Файл: poas.php
Строк: 79
<?
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');
if(isset($_GET['od']))
{
$sf=mysql_query("SELECT * FROM `elic` WHERE `usr`='".$udata['id']."' and `status`='off' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($sf);
if($num==0)
{
header('location: ?');exit;
}
else
{
$sfs=mysql_query("SELECT * FROM `elic` WHERE `usr`='".$udata['id']."' and `status`='on'");
$nums=mysql_num_rows($sfs);
if($nums==3)
{
header('location: ?');exit;
}
else
{
$sfer=mysql_fetch_array($sf);
mysql_query("UPDATE `elic` SET `status`='on' WHERE `id`='".$sfer['id']."'");
header('location: ?');exit;
}
}
}
if(isset($_GET['sn']))
{
$sf=mysql_query("SELECT * FROM `elic` WHERE `usr`='".$udata['id']."' and `status`='on' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($sf);
if($num==0)
{
header('location: ?');exit;
}
else
{
$sfer=mysql_fetch_array($sf);
mysql_query("UPDATE `elic` SET `status`='off' WHERE `id`='".$sfer['id']."'");
header('location: ?');exit;
}
}
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">';
$sf=mysql_query("SELECT * FROM `elic` WHERE `usr`='".$udata['id']."' and `status`='on'");
while($sfer=mysql_fetch_array($sf))
{
$n=''.$sfer['tip'].''.$sfer['ef'].'';
if($n=='hp100')
{
$name='исцелитель';
}
elseif($n=='hp500')
{
$name='оживитель';
}
elseif($n=='hp1000')
{
$name='воскреситель';
}
elseif($n=='hp5000')
{
$name='восстановитель';
}
elseif($n=='hp20000')
{
$name='возродитель';
}
echo '<img src=img/elic/'.$sfer['tip'].''.$sfer['ef'].'.png> '. htmlspecialchars($name).' [<font color=#999999>'.$sfer['kol'].'</font>] <a href=?sn&id='.$sfer['id'].'><font color=#ff0000>снять</font></a><br>';
}
echo '</div></div><div class="v8">
<div class="line bbs m bts brs bls b p v12">Пояс</div>
<div class="bat bts brs bls bbs p t1">';
$sf=mysql_query("SELECT * FROM `elic` WHERE `usr`='".$udata['id']."' and `status`='off'");
while($sfer=mysql_fetch_array($sf))
{
$n=''.$sfer['tip'].''.$sfer['ef'].'';
if($n=='hp100')
{
$name='исцелитель';
}
elseif($n=='hp500')
{
$name='оживитель';
}
elseif($n=='hp1000')
{
$name='воскреситель';
}
elseif($n=='hp5000')
{
$name='восстановитель';
}
elseif($n=='hp20000')
{
$name='возродитель';
}
echo '<img src=img/elic/'.$sfer['tip'].''.$sfer['ef'].'.png> '. htmlspecialchars($name).' [<font color=#999999>'.$sfer['kol'].'</font>] <a href=?od&id='.$sfer['id'].'><font color=#ff0000>одеть</font></a><br>';
}
echo '</div></div>';
include('files/down.php');
?>