Файл: taverna.php
Строк: 76
<?
define('PROTECTOR', 1);
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$textl='Таверна';
include($path.'files/core.php');
include('tav_s_complete.php');
include($path.'files/head.php');
include($path.'files/zag.php');
echo '<table width=100%>
<tr>
<td width=35%>
<a href=game.php><div style="background: #882222; border-radius: 7px 0 0 7px" class="m p bts bbs brs bls" align=center>Главная</div></a>
</td><td>';
echo '<a href=?><div class="line bts brs bls bbs p m" style="border-radius: 0 7px 7px 0">
<font color=#ffffff>Таверна</font>
</div></a></td></tr></table>';
echo '<div class="bat bts brs bls bbs p">';
include('tav2.php');
if(isset($_GET['kv']))
{
$kvest=mysql_query("SELECT * FROM `kvest_d` WHERE `id`='".mysql_real_escape_string($_GET['kv'])."'");
$num=mysql_num_rows($kvest);
if($num!=0){
$kv=mysql_fetch_array($kvest);
echo '<div style="margin:3px;padding:2px;border:1px solid #090;background:#222" align=center>';
echo $kv['opis'];
echo '</div>';
echo '<div style="margin:3px;padding:2px;border:1px solid #090;background:#222">';
echo '<font color=#f90>Награда</font>: '.$kv['nagr'];
echo '</div>';
if($udata['kv_d']==0)
{
echo '<center><a href=?prin_d='.$kv['id'].'><div style="width: 75%; padding: 4px; margin: 6px; background: #cc2222; border-radius:7px" align=center class="bts bbs bls brs"><font color=#0099ff><b>Принять</b></font></div>
</a><center>';
}
else
{
if($udata['kv_d']==$kv['id']){
echo '<div style="margin:3px;padding:2px;border:1px solid #090;background:#222">';
echo '<font color=#f90>Статус</font>: '.$udata['kv_d_n'].' из '.$kv['kol'];
echo '</div>';
if($udata['kv_d_n']<$kv['kol'])
{
echo '<center><a href=?otkaz_d='.$kv['id'].'><div style="width: 75%; padding: 4px; margin: 6px; background: #cc2222; border-radius:7px" align=center class="bts bbs bls brs"><font color=#0099ff><b>Отказаться</b></font></div>
</a><center>';
}
else
{
echo '<center><a href=?sd_d='.$kv['id'].'><div style="width: 75%; padding: 4px; margin: 6px; background: #cc2222; border-radius:7px" align=center class="bts bbs bls brs"><font color=#0099ff><b>Получить награду</b></font></div>
</a><center>';
}
}
}
}
}
else
{
$kvest=mysql_query("SELECT * FROM `kvest_d` ORDER BY `id` ASC");
while($kv=mysql_fetch_array($kvest))
{
$kv_d=mysql_num_rows(mysql_query("SELECT * FROM `kvest_usr` WHERE `kv`='".$kv['id']."' and `usr`='".$udata['id']."'"));
if($kv_d==0){
$c='#ff2';
if($udata['kv_d']==$kv['id']){$c='#f22';}
echo '<img src=img/main/e28.png> <a href=?kv='.$kv['id'].'><font color='.$c.'>'.$kv['name'].'</font></a><br>';
}
}
}
echo '</div>';
include('files/down.php');
?>