session_start(); if (!isset($_SESSION['uid'])) { header('Location: /index.php'); } include('config.php'); include('functions.php'); include('classes/quests_class.php'); if (isset($_GET['quid'])) { $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= "' . $user['level'] . '" AND `max_lvl` >= "' . $user['level'] . '" AND `id` = "' . mysql_real_escape_string($_GET['quid']) . '" LIMIT 1')); if (isset($pl['id']) && $q->testGood($pl, $user['id']) == 1) { echo $q->startq($pl['id'], null, $user['id']); } elseif ($q->testGood($pl, $user['id']) == 2) { $err = 'У вас уже есть такое задание ...'; } elseif ($q->testGood($pl, $user['id']) == 3) { $err = 'Необходимо завершить квесты ...'; } elseif ($q->testGood($pl, $user['id']) == 4) { $err = 'Задержка на выполнение задания ...'; } elseif ($q->testGood($pl, $user['id']) == 5) { $err = 'Достигнут лимит выполнения заданий ...'; } else { $err = $q->testGood($pl, $user['id']); } } $qsee = ''; $sp = mysql_query('SELECT * FROM `quests` WHERE `delete` = 0 ORDER BY `id` DESC'); while ($pl = mysql_fetch_array($sp)) { $qsee .= $q->list_quest($pl, $user['id']); } if ($qsee == '') { $qsee = '