Файл: book/reit.php
Строк: 15
<?php
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
if ($aut) {
if ((int)$id) {
$type = $db -> query("SELECT * FROM `reit` WHERE `komy` = '".$id."' and `where`='book'");
if ($type -> num_rows > 0) $the = $type -> fetch_assoc(); else $the = false;
} else $the = false;
$te = $db -> query("SELECT * FROM `reit` WHERE `where`='book' and `komy` = '".$id."' and `kto` = '".$ya['id']."' LIMIT 1");
if ($te -> num_rows > 0) {
$db -> query("DELETE FROM `reit` WHERE `komy` = '".$id."' and `where` = 'book' and `kto` = '".$ya['id']."' LIMIT 1");
header('location: book'.$id.'');
}else{
$db -> multi_query("INSERT INTO `reit` SET `where`='book', `kto` = '".$ya['id']."', `komy` = '".$id."',`rei` = '1',`text` = '".$text."',`time` = '".time()."'");
header('location: book'.$id.'');
}
} else header('location: aut.php');
?>