Файл: smotrahiy.php
Строк: 93
<?php
include 'inc/mysql.php';
include 'inc/check.php';
include ("inc/gzip.php");
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
include 'inc/shapka.php';
switch($_GET[mod]){
default:
$req = mysql_query("SELECT * FROM `pahan` ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
$w=explode("*",$mag[boss1]);
$req = mysql_query("SELECT `status`,`sex`,`login`,`id` FROM `account` WHERE `id` = '$mag[account]'");
$pic = mysql_fetch_array($req);
if($pic['status']=="gm"){
$nik = gradient(''.$pic[login].'','00FF00', '00CC00');
echo '<us><img src="pic/main/'.$pic[sex].'.png" alt="*"/><a href="infa.php?id='.$pic['id'].'"> '.$nik.'</us></a><br><img src="pic/avatar/'.$pic[sex].'.png" alt="*"/> <br> ';
}else{
if($pic['status']=="moder"){
$nik = gradient(''.$pic[login].'','0066CC', 'AB82FF');
echo '<us><img src="pic/main/'.$pic[sex].'.png" alt="*"/><a href="infa.php?id='.$pic['id'].'"> '.$nik.'</us></a><br><img src="pic/avatar/'.$pic[sex].'.png" alt="*"/> <br> ';
}else{
if($pic['status']=="bot"){
$nik = gradient(''.$pic[login].'','FFCC00', 'FF9933');
echo '<img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="infa.php?id='.$pic['id'].'"> '.$nik.'</us></a><br><img src="pic/avatar/'.$pic[sex].'.png" alt="*"/> <br> ';
}else{
echo '<img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="infa.php?id='.$pic['id'].'">'.htmlspecialchars(stripslashes($pic['login'])).'</a><br><img src="pic/avatar/'.$pic[sex].'.png" alt="*"/><br> ';
}}}
echo'<hr><img src="/pic/main/yes2.png" alt="*"/> <a href="smotrahiy.php?mod=pahan">Сместить смотрящего</a> <img src="pic/main/zoloto.gif" alt="*"/> '.$mag[sdvig].' золота<hr>';
$d = time()-$mag['time'];
echo'<img src="pic/main/timereg.png" alt="*"/> У власти: '.sec2day($d).'<br>';
echo"<img src='pic/main/baks.png' alt='*'/> Забрал с общака: ".number_format($mag[money])." <img src='pic/main/money.gif' alt='*'/>, ".number_format($mag[fermany])." <img src='pic/main/fermany.png' alt='*'/>";
}}else{
echo"<img src='pic/main/!.png' alt='*'/> Нет смотрящего.";
}
break;
case 'pahan':
$req = mysql_query("SELECT * FROM `pahan` ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
if($mag[account]==$account[id]){
echo"<img src='pic/main/nou.png' alt='*'/> Себя смещать нельзя!";
include 'inc/nogi.php';
exit;
}
if($account[zoloto]<$mag[sdvig]){
echo"<img src='pic/main/nou.png' alt='*'/> Маловато золота!";
include 'inc/nogi.php';
exit;
}
mysql_query("UPDATE `pahan` SET `money`='0', `fermany`='0', `time`= '$time', `account`='$account[id]', `sdvig`=`sdvig`+ '5' WHERE `id`='1'");
mysql_query("UPDATE `account` SET `zoloto`=`zoloto` - '$mag[sdvig]' WHERE `id`='$account[id]'");
header ("Location: smotrahiy.php");
}
}
}
}else{
header ("Location: index.php"); exit;
}
include 'inc/nogi.php';
?>