2018-01-28 18:40:49 +02:00
< ?
session_start ();
2018-07-02 16:30:18 +03:00
if ( ! isset ( $_SESSION [ 'uid' ])) {
header ( 'Location: /index.php' );
}
2018-01-28 18:40:49 +02:00
include ( 'config.php' );
include ( 'functions.php' );
include ( 'classes/quests_class.php' );
2018-07-02 16:30:18 +03:00
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' ]);
}
2018-01-28 18:40:49 +02:00
}
$qsee = '' ;
$sp = mysql_query ( 'SELECT * FROM `quests` WHERE `delete` = 0 ORDER BY `id` DESC' );
2018-07-02 16:30:18 +03:00
while ( $pl = mysql_fetch_array ( $sp )) {
$qsee .= $q -> list_quest ( $pl , $user [ 'id' ]);
2018-01-28 18:40:49 +02:00
}
2018-07-02 16:30:18 +03:00
if ( $qsee == '' ) {
$qsee = '<center>К сожалению заданий сейчас нету ...</center>' ;
2018-01-28 18:40:49 +02:00
}
2018-07-02 16:30:18 +03:00
if ( $_GET [ 'go_to' ]) {
mysql_query ( 'UPDATE `users`,`online` SET `users`.`room` = 20, `online`.`room` = 20 WHERE `users`.`id` = "' . $user [ 'id' ] . '" AND `online`.`id` = "' . $user [ 'id' ] . '"' );
header ( 'Location: city.php' );
2018-01-28 18:40:49 +02:00
}
2018-07-02 16:30:18 +03:00
function info_quest ( $id )
{
$sp = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `quests` WHERE `id` = "' . $id . '" LIMIT 1' ));
if ( isset ( $sp [ 'id' ])) {
return $sp ;
} else {
return null ;
}
2018-01-28 18:40:49 +02:00
}
2018-07-02 16:30:18 +03:00
if ( $_GET [ 'hps' ]) {
2018-01-28 18:40:49 +02:00
$user [ 'hp' ] = $user [ 'maxhp' ];
2018-07-02 16:30:18 +03:00
mysql_query ( 'UPDATE `users` SET `hp` = "' . $user [ 'hp' ] . '" WHERE `id` = "' . $user [ 'id' ] . '" LIMIT 1' );
2018-01-28 18:40:49 +02:00
$err = 'Ваше здоровье восстановлено ...' ;
}
2018-07-02 16:30:18 +03:00
//if ($_GET['quids']) {
// #$err = add_quest($user['id'], (int)$_GET['quid']);
//}
if ( $q -> error != '' ) {
$err = $q -> error ;
2018-01-28 18:40:49 +02:00
}
?>
<html>
<head>
2018-07-02 16:30:18 +03:00
<title>404</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/hostel.css"/>
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
2018-01-28 18:40:49 +02:00
</head>
<style>
2018-07-02 16:30:18 +03:00
div.ctContainerA {
position: relative;
margin-bottom: 5px;
padding: 5px;
border-radius: 5px;
}
div.ctContainerA {
border: 2px groove threedface;
}
div.ctTitle {
margin-bottom: 3px;
border-bottom: 2px groove threedface;
font-weight: bold;
color: #bf0000;
}
div.ctContent {
overflow: hidden;
position: relative;
width: 100%;
}
div.quest_target_item div.ctTitle {
float: right;
}
div.quest_target_item[forever='1'] div.ctContent {
color: #800;
}
div.quest_target_item[forever='0'][available='0'] div.ctContent {
color: blue;
}
div.quest_target_item div.ctContent {
width: 60px;
height: 60px;
float: left;
margin: 2px;
}
2018-01-28 18:40:49 +02:00
</style>
<body>
2018-07-02 16:30:18 +03:00
<div class="contentContainer">
2018-01-28 18:40:49 +02:00
<h1>Памятник Архангелу</h1>
<div class="buttonContainer">
2018-07-02 16:30:18 +03:00
<input type="button" class="btns button-route" value="Вернуться" onclick="location.href='?go_to=1';"/>
<input type="button" class="btns" value="Обновить" onclick="location.href='quest_room.php';"/>
<? if (($user['level'] <= 5 OR $user['admin'] == 1) AND $user['hp'] == $user['maxhp']): ?>
<input type="button" class="btns" value="Восстановить здоровье"
onclick="location.href='quest_room.php?hps=1';"/>
<? endif ?>
2018-01-28 18:40:49 +02:00
</div>
<div style="float: left; width: 247px;">
2018-07-02 16:30:18 +03:00
<img src="i/pamyatnik.jpg" style="border-radius: 3px; margin-bottom: 5px;"/>
2018-01-28 18:40:49 +02:00
</div>
<div style="margin-left: 250px;">
2018-07-02 16:30:18 +03:00
<div class="ctContainerA">
<div class="ctTitle">
<span>Приветствую тебя, воин!</span>
</div>
<div class="ctContent">
На памятнике выгравированы опасные задания, за выполнение которых Вы получаете достойную
награду!<br/><br/>
P.S. Для каждого задания отводится определенный промежуток времени, если задание не сдано вовремя, то
Архангел не выдаст Вам награду и придется начать все сначала! Да, тут Вам не ясли, все серьезно!
</div>
2018-01-28 18:40:49 +02:00
</div>
2018-07-02 16:30:18 +03:00
<div id="error">
<? if (!empty($err)) err($err); ?>
2018-01-28 18:40:49 +02:00
</div>
2018-07-02 16:30:18 +03:00
<div style="clear: both;"></div>
2018-01-28 18:40:49 +02:00
</div>
<div class="quest_target_container">
2018-07-02 16:30:18 +03:00
<?= $qsee ?>
2018-01-28 18:40:49 +02:00
</div>
2018-07-02 16:30:18 +03:00
</div>
2018-01-28 18:40:49 +02:00
</body>
</html>