game/modules_data/_quests.php

88 lines
3.2 KiB
PHP
Raw Normal View History

2023-03-31 18:42:06 +00:00
<?php
2022-06-06 21:30:34 +00:00
if(!defined('GAME'))
{
die();
}
if(isset($_GET['start']))
{
$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE (`city` = "" OR `city` = "'.$u->info['city'].'") AND `delete` = "0" AND `min_lvl` <= '.$u->info['level'].' AND `max_lvl` >= '.$u->info['level'].' AND (`align` = "0" OR `align` = "'.floor($u->info['align']).'") AND `id` = "'.mysql_real_escape_string($_GET['start']).'" LIMIT 1'));
if(isset($pl['id']) && $q->testGood($pl)==1)
{
$q->startq($pl['id']);
}
}elseif(isset($_GET['end']))
{
$q->endq((int)$_GET['end'],'end');
}
if($u->error!='')
{
echo '<font color="red"><b>'.$u->error.'</b></font><br>';
}
?>
<table width="100%">
<tr>
2023-01-10 16:29:32 +00:00
<td align="center"><h3>Доступные задания, <?=$u->info['city']?></h3></td>
<td width="150" align="right"><input type="button" value="обновить" onclick="location='main.php?quests=1';" /> <input type="button" value="Вернуться" onclick="location='main.php';" /></td>
2022-06-06 21:30:34 +00:00
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td><a href="main.php?skills=1&rz=6">Активные квесты</a></td>
2022-06-06 21:30:34 +00:00
<td>&nbsp;</td>
</tr>
<tr>
<td>
2023-03-31 18:42:06 +00:00
<?php
2022-06-06 21:30:34 +00:00
$qsee = ''; $j = 0;
$sp = mysql_query('SELECT * FROM `quests` WHERE (`city` = "" OR `city` = "'.$u->info['city'].'") AND `delete` = "0" AND `min_lvl` <= '.$u->info['level'].' AND `max_lvl` >= '.$u->info['level'].' AND (`align` = "0" OR `align` = "'.floor($u->info['align']).'")');
while($pl = mysql_fetch_array($sp))
{
if($j<20)
{
if($q->testGood($pl)==1)
{
2023-01-10 16:29:32 +00:00
$urq = '<a href="main.php?quests&minfo='.$pl['id'].'">Подробнее</a>';
2022-06-06 21:30:34 +00:00
if(isset($_GET['minfo']) && $_GET['minfo']==$pl['id'])
{
2023-01-10 16:29:32 +00:00
$urq = '<a href="main.php?quests=1">Скрыть</a>';
2022-06-06 21:30:34 +00:00
}
$qsee .= '<tr>
<td style="border-bottom:1px solid #CCCCCC;" width="300"><div align="left" style="margin-left:11px;">'.$pl['name'].'</div></td>
<td width="75" bgcolor="#DADADA" style="border-bottom:1px solid #CCCCCC;"><div align="center"><small>'.$urq.'</small></div></td>
2023-01-10 16:29:32 +00:00
<td style="border-bottom:1px solid #CCCCCC;"><small><b>Описание:</b> '.$pl['info'].'</small></td>
2022-06-06 21:30:34 +00:00
</tr>';
unset($urq);
if(isset($_GET['minfo']) && $_GET['minfo']==$pl['id'])
{
if($pl['city']!='')
{
$gc = '<small>Город квеста: <img src="//img.new-combats.tech/i/city_ico/'.$pl['city'].'.gif" width="17" height="15"> '.$u->city_name[$pl['city']].'</small>';
2022-06-06 21:30:34 +00:00
}else{
$gc = '&nbsp;';
}
$di = $q->info($pl);
2023-01-10 16:29:32 +00:00
$di .= '<a href="main.php?quests&start='.$pl['id'].'">Принять задание</a><br><br>';
2022-06-06 21:30:34 +00:00
$qsee .= '<tr>
<td style="border-bottom:1px solid #CCCCCC;" width="300">'.$gc.'</td>
<td width="75" style="border-bottom:1px solid #CCCCCC;">&nbsp;</td>
<td style="border-bottom:1px solid #CCCCCC;">'.$di.'</td>
</tr>';
unset($gc,$di,$w);
}
$j++;
}
}
}
if($qsee == '')
{
2023-01-10 16:29:32 +00:00
$qsee = '<tr><td align="center" bgcolor="#EAEAEA">Для вас нет доступных заданий, приходите позже</td></tr>';
2022-06-06 21:30:34 +00:00
}
?>
<table width="100%" border="0" cellpadding="5" cellspacing="0" bgcolor="#E1E1E1">
<!-- -->
<?=$qsee?>
<!-- -->
</table>
</td>
</tr>
</table>