Файл: task/cancel.php
Строк: 13
<?
require_once'../core/system.php';
echo only_reg();
echo ban();
echo blok();
$header='Задания';
require_once'../core/head.php';
if(isset($_GET['id'])){
$lot = intval($_GET['id']);
$req = mysql_query("SELECT id FROM `task` WHERE `usr` = '".$user['id']."' and `id` = '".$lot."' and `status`='2' LIMIT 1");
$avto = mysql_num_rows($req);
if($avto==0){
$_SESSION['err'] = "Ошибка";
header('Location: /');
}
mysql_query("UPDATE `task` set `status`='0' WHERE `usr` = '".$user['id']."' and `id` = '".$lot."' LIMIT 1");
$_SESSION['message'] = " Задание отменено";
header('Location: /');
exit;
}
require_once'../core/foot.php';
?>