2020-08-30 04:09:52 +03:00
< ? php
2021-02-01 18:42:52 +02:00
use Battles\Template ;
2022-01-27 01:15:33 +02:00
use Battles\User ;
2021-02-01 18:42:52 +02:00
2020-08-30 04:09:52 +03:00
require_once 'functions.php' ;
2020-09-30 22:12:34 +03:00
require_once 'classes/quests_class.php' ;
2018-01-28 18:40:49 +02:00
2022-08-09 22:57:43 +03:00
if ( ! empty ( $_GET [ 'end_qst_now' ])) {
2020-08-30 04:09:52 +03:00
$q -> endq (( int ) $_GET [ 'end_qst_now' ], 'end' , $user );
}
2018-03-23 23:34:06 +02:00
2022-08-09 22:57:43 +03:00
if ( ! empty ( $_GET [ 'end_qst' ])) {
2020-08-30 04:09:52 +03:00
$q -> winqst (( int ) $_GET [ 'end_qst' ], $user );
}
2018-01-28 18:40:49 +02:00
2022-08-09 22:57:43 +03:00
$qsee = null ;
2018-03-23 23:34:06 +02:00
$error = '' ;
2022-08-09 22:57:43 +03:00
$q = new Quests ();
2018-01-28 18:40:49 +02:00
2021-02-01 18:42:52 +02:00
Template :: header ( 'module_quest' );
2018-01-28 18:40:49 +02:00
?>
2020-09-30 22:12:34 +03:00
<link rel="stylesheet" href="css/hostel.css"/>
2018-01-28 18:40:49 +02:00
<?php
2022-08-09 22:57:43 +03:00
//$sp = \Battles\Database\Db::getInstance()->fetchall('select vars from actions where vars like ? and vals = ? and uid = ? limit 100', ['%start_quest%', 'go', User::getInstance()->getId()]);
//foreach ($sp as $row) {
// $questId = str_replace('start_quest', '', $pl['vars']);
// $pq = \Battles\Database\Db::getInstance()->fetch('select id, name, info from quests where is = ?', $questId);
// $qsee .= sprintf('<a href="?end_qst_now=%s"><img src="/i/clear.gif" title="Отказаться от задания"></a> <b>%s</b><span style="float: right;"><a href="?end_qst=%s">Выполнить</a></span><div style="padding-left: 15px; padding-bottom: 5px; border-bottom: 1px solid grey;"><small>%s<br>$s</small></div><br>', $pq['id'], $pq['name'], $pq['id'], $pq['info'], $q->info($pq, User::getInstance()->getId()));
//}
2018-01-28 18:40:49 +02:00
2020-08-30 04:09:52 +03:00
if (!$qsee) {
$qsee = 'У вас нет заданий.';
}
if ($q->error) {
$error = $q->error;
}
2018-01-28 18:40:49 +02:00
?>
<div class="contentContainer">
2022-08-09 22:57:43 +03:00
<div style="text-align: center; padding-top: 3px;">
<span class="hs">Состояние персонажа, <?= User::getInstance()->getLogin() ?></span>
</div>
2018-03-23 23:30:05 +02:00
<div class="buttonContainer">
<input type="button" class="btns button-route" value="Вернуться" onclick="location.href='main.php';"/>
<input type="button" class="btns button-route" value="Обновить" onclick="location.href='module_quest.php';"/>
</div>
2020-09-30 22:12:34 +03:00
<?php if ($error) {
err($error);
} ?>
2018-03-23 23:30:05 +02:00
<div class="quest_target_container" style="padding-top: 15px;">
2020-08-30 04:09:52 +03:00
<?= $qsee ?>
2018-03-23 23:30:05 +02:00
</div>
2020-09-30 22:12:34 +03:00
</div>