Файл: adm_panel_teeda_zv.php
Строк: 856
<?
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($udata['admin']<4)
{
header('location: game.php');exit;
}
if(isset($_GET['123']))
{
$user=mysql_query("SELECT * FROM `users` WHERE `hp1`>'100'");
while($us=mysql_fetch_array($user))
{
if($us['klass']==1)
{
$hp=$us['lvl']*2;
$sila=$us['lvl']*3;
$arm=$us['lvl']*1;
}
elseif($us['klass']==2)
{
$hp=$us['lvl']*3;
$sila=$us['lvl']*1;
$arm=$us['lvl']*2;
}
elseif($us['klass']==3)
{
$hp=$us['lvl']*1;
$sila=$us['lvl']*2;
$arm=$us['lvl']*3;
}
mysql_query("UPDATE `users` SET `hp1`='".$hp."', `arm1`='".$arm."', `sila1`='".$sila."' WHERE `id`='".$us['id']."'");
}
}
if(isset($_GET['avan']))
{
$av=mysql_query("SELECT * FROM `avan` WHERE `id`='".$_GET['id']."'");
$avan=mysql_fetch_array($av);
if($avan['status']==0)
{
$t=time()+20;
mysql_query("UPDATE `avan` SET `status`='1', `time`='".$t."' WHERE `id`='".$avan['id']."'");
header('location: ?ad=av');exit;
}
}
if(isset($_GET['edd_usr']))
{
if($_GET['tip']=='pass')
{
if($_POST['pass']!='')
{
$pass=md5($_POST['pass']);
mysql_query("UPDATE `users` SET `pass`='".$pass."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
}
if($_GET['tip']=='admin')
{
mysql_query("UPDATE `users` SET `admin`='".mysql_real_escape_string($_POST['admin'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if($_GET['tip']=='rasa')
{
mysql_query("UPDATE `users` SET `rasa`='".mysql_real_escape_string($_POST['rasa'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if($_GET['tip']=='klass')
{
mysql_query("UPDATE `users` SET `klass`='".mysql_real_escape_string($_POST['klass'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if($_GET['tip']=='exp')
{
mysql_query("UPDATE `users` SET `exp`='".mysql_real_escape_string($_POST['exp'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if($_GET['tip']=='expr')
{
mysql_query("UPDATE `users` SET `exp_rang`='".mysql_real_escape_string($_POST['expr'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if($_GET['tip']=='mon')
{
mysql_query("UPDATE `users` SET `money`='".mysql_real_escape_string($_POST['mon'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if($_GET['tip']=='jem')
{
mysql_query("UPDATE `users` SET `jem`='".mysql_real_escape_string($_POST['jem'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if($_GET['tip']=='kd')
{
mysql_query("UPDATE `users` SET `kd`='".mysql_real_escape_string($_POST['kd'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if($_GET['tip']=='kl')
{
mysql_query("UPDATE `users` SET `kl`='".mysql_real_escape_string($_POST['kl'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if($_GET['tip']=='fm')
{
mysql_query("UPDATE `users` SET `fm`='".mysql_real_escape_string($_POST['fm'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if($_GET['tip']=='iss')
{
mysql_query("UPDATE `users` SET `iss`='".mysql_real_escape_string($_POST['iss'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if($_GET['tip']=='lazyr')
{
mysql_query("UPDATE `users` SET `lazyr`='".mysql_real_escape_string($_POST['lazyr'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if($_GET['tip']=='bagr')
{
mysql_query("UPDATE `users` SET `bagr`='".mysql_real_escape_string($_POST['bagr'])."' WHERE `id`='".$_GET['id']."'");
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
}
if(isset($_GET['gfn']))
{
$lv=time()-2678400;
$users=mysql_query("SELECT * FROM `users` WHERE `lv`>'".$lv."' and `lvl`>'15'");
while($us=mysql_fetch_array($users))
{
$jem=$us['jem']+25;
mysql_query("UPDATE `users` SET `jem`='".$jem."' WHERE `id`='".$us['id']."'");
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$us['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$us['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$us['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$us['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$us['id']."'"));
$text='<font color=#cccccc><b>Подарок</b></font><br>
<font color=#ff9900>Вот и новый год стучится в двери. И нас подками не обделили. Вам начислено 25<img src=img/main/p13.png>. С новым Годом.</font>
';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$us['id']."'
");
}
header('location: '.$_SERVER['HTTP_REFERER'].'');exit;
}
if(isset($_GET['forum_sms']))
{
$lv=time()-604800;
$i=0;
$user=mysql_query("SELECT * FROM `users` WHERE `lv`>'".$lv."' and `lvl`>='20'");
while($us=mysql_fetch_array($user))
{
$log='Ваш уровень выше либо равен 20, так же вы были замечены в игре в течение последнее недели. Поэтому приглашаем вас на форум в раздел "Предложения по игре", в тему "Гильдии. Ваши комментарии"';
$rows21_ok=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$us['id']."' and `usr2`='0'"));
if($rows21_ok==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$us['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2_ok=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$us['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$us['id']."'");
}
$rows2_oks=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$us['id']."'"));
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2_oks['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$log."',
`usr`='".$us['id']."'
");
$i++;
}
header('location: ?i='.$i.'');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">';
switch($_GET['ad'])
{
default:
if($udata['admin']>3 and $udata['admin']<6)
{
echo '
<img src=img/main/e55.png> <a href=?ad=bazar>Рыночные операции</a><br>
<img src=img/main/e55.png> <a href=?ad=arena>Дуэли</a><br>
<img src=img/main/e55.png> <a href=?ad=bz>Боевая Зона</a><br>
<img src=img/main/e55.png> <a href=?ad=podzem>Подземелья</a><br>
<img src=img/main/e55.png> <a href=?ad=str>Штурм</a><br>
<img src=img/main/e55.png> <a href=?ad=terr>Территоррии</a><br>
';
}
elseif($udata['admin']>5)
{
echo '
<img src=img/main/e55.png> <a href=?ad=bazar>Рыночные операции</a><br>
<img src=img/main/e55.png> <a href=?ad=torg>Торговые операции</a><br>
<img src=img/main/e55.png> <a href=?ad=arena>Дуэли</a><br>
<img src=img/main/e55.png> <a href=?ad=bz>Боевая Зона</a><br>
<img src=img/main/e55.png> <a href=?ad=podzem>Подземелья</a><br>
<img src=img/main/e55.png> <a href=?ad=str>Штурм</a><br>
<img src=img/main/e55.png> <a href=?ad=terr>Территоррии</a><br>
<img src=img/main/e55.png> <a href=?ad=kvest>Квесты</a><br>
<img src=img/main/e55.png> <a href=?ad=kraft>Крафт</a><br>
<img src=img/main/e55.png> <a href=?ad=vip>VIP</a><br>
<img src=img/main/e55.png> <a href=?ad=shaman>Шаман</a><br>
<img src=img/main/e55.png> <a href=?ad=user>Игроки</a><br>
<img src=img/main/e55.png> <a href=?ad=av>Аваны</a><br>
<img src=img/main/e55.png> <a href=?ad=bye>Платежи</a><br>';
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc=='0404')
{
echo '<br><img src=img/main/e55.png> <a href=?forum_sms>Смс ФОРУМА</a><br>';
}
if($dd=='01' or $dd=='1')
{
echo '<img src=img/main/e55.png> <a href=?ad=zp>зарплата</a><br>';
}
}
break;
case 'tyrn':
$user=mysql_query("SELECT * FROM `users` WHERE `gaika`>='10'");
while($us=mysql_fetch_array($user))
{
if($us['gaika']>=10000)
{
$jem=30;
$tank=500;
$soul_res=2500;
}
elseif($us['gaika']<10000 and $us['gaika']>=6000)
{
$jem=20;
$tank=350;
$soul_res=1800;
}
elseif($us['gaika']<6000 and $us['gaika']>=3000)
{
$jem=14;
$tank=200;
$soul_res=1200;
}
elseif($us['gaika']<3000 and $us['gaika']>=500)
{
$jem=8;
$tank=100;
$soul_res=700;
}
elseif($us['gaika']<500 and $us['gaika']>=10)
{
$jem=3;
$tank=50;
$soul_res=200;
}
$u_j=$us['jem']+$jem;
$u_t=$us['tank']+$tank;
$u_s=$us['soul_res']+$soul_res;
mysql_query("UPDATE `users` SET `jem`='".$u_j."', `soul_res`='".$u_s."', `tank`='".$u_t."' WHERE `id`='".$us['id']."'");
$log='За ваши достижение в турнире прибрежья, вы получаете: <img src=img/main/23f.png>'.$tank.' <img src=img/main/p13.png>'.$jem.' <img src=img/main/i27.png>'.$soul_res.'';
if($us['id']==648)
{
$name='Медаль Мороза X';
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='".$us['id']."',
`name`='<font color=#00ffff>".$name."</font>',
`img`='1',
`lvl`='1',
`sila`='20',
`hp`='20',
`arm`='20',
`tip`='medal',
`item`='1',
`status`='off'
");
$log=$log.'<br>А так же за 10 место по активности, вы получаете медаль: <font color=#00ffff>'.$name.'</font>';
}
elseif($us['id']==2657)
{
$name='Медаль Мороза IX';
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='".$us['id']."',
`name`='<font color=#00ffff>".$name."</font>',
`img`='1',
`lvl`='1',
`sila`='24',
`hp`='24',
`arm`='24',
`tip`='medal',
`item`='1',
`status`='off'
");
$log=$log.'<br>А так же за 9 место по активности, вы получаете медаль: <font color=#00ffff>'.$name.'</font>';
}
elseif($us['id']==5515)
{
$name='Медаль Мороза VIII';
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='".$us['id']."',
`name`='<font color=#00ffff>".$name."</font>',
`img`='1',
`lvl`='1',
`sila`='28',
`hp`='28',
`arm`='28',
`tip`='medal',
`item`='1',
`status`='off'
");
$log=$log.'<br>А так же за 8 место по активности, вы получаете медаль: <font color=#00ffff>'.$name.'</font>';
}
elseif($us['id']==3244)
{
$name='Медаль Мороза VII';
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='".$us['id']."',
`name`='<font color=#00ffff>".$name."</font>',
`img`='1',
`lvl`='1',
`sila`='32',
`hp`='32',
`arm`='32',
`tip`='medal',
`item`='1',
`status`='off'
");
$log=$log.'<br>А так же за 7 место по активности, вы получаете медаль: <font color=#00ffff>'.$name.'</font>';
}
elseif($us['id']==229)
{
$name='Медаль Мороза VI';
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='".$us['id']."',
`name`='<font color=#00ffff>".$name."</font>',
`img`='1',
`lvl`='1',
`sila`='36',
`hp`='36',
`arm`='36',
`tip`='medal',
`item`='1',
`status`='off'
");
$log=$log.'<br>А так же за 6 место по активности, вы получаете медаль: <font color=#00ffff>'.$name.'</font>';
}
elseif($us['id']==5522)
{
$name='Медаль Мороза V';
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='".$us['id']."',
`name`='<font color=#00ffff>".$name."</font>',
`img`='1',
`lvl`='1',
`sila`='40',
`hp`='40',
`arm`='40',
`tip`='medal',
`item`='1',
`status`='off'
");
$log=$log.'<br>А так же за 5 место по активности, вы получаете медаль: <font color=#00ffff>'.$name.'</font>';
}
elseif($us['id']==74)
{
$name='Медаль Мороза IV';
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='".$us['id']."',
`name`='<font color=#00ffff>".$name."</font>',
`img`='1',
`lvl`='1',
`sila`='44',
`hp`='44',
`arm`='44',
`tip`='medal',
`item`='1',
`status`='off'
");
$log=$log.'<br>А так же за 4 место по активности, вы получаете медаль: <font color=#00ffff>'.$name.'</font>';
}
elseif($us['id']==2401)
{
$name='Медаль Мороза III';
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='".$us['id']."',
`name`='<font color=#00ffff>".$name."</font>',
`img`='1',
`lvl`='1',
`sila`='50',
`hp`='50',
`arm`='50',
`krit`='1',
`blok`='1',
`tip`='medal',
`item`='1',
`status`='off'
");
$log=$log.'<br>А так же за 3 место по активности, вы получаете медаль: <font color=#00ffff>'.$name.'</font>';
}
elseif($us['id']==92)
{
$name='Медаль Мороза II';
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='".$us['id']."',
`name`='<font color=#00ffff>".$name."</font>',
`img`='1',
`lvl`='1',
`sila`='55',
`hp`='55',
`arm`='55',
`krit`='2',
`blok`='2',
`tip`='medal',
`item`='1',
`status`='off'
");
$log=$log.'<br>А так же за 2 место по активности, вы получаете медаль: <font color=#00ffff>'.$name.'</font>';
}
elseif($us['id']==662)
{
$name='Медаль Мороза I';
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='".$us['id']."',
`name`='<font color=#00ffff>".$name."</font>',
`img`='1',
`lvl`='1',
`sila`='60',
`hp`='60',
`arm`='60',
`krit`='3',
`blok`='3',
`tip`='medal',
`item`='1',
`status`='off'
");
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='2',
`name`='<font color=#00ffff>".$name."</font>',
`img`='1',
`lvl`='1',
`sila`='60',
`hp`='60',
`arm`='60',
`krit`='3',
`blok`='3',
`tip`='medal',
`item`='1',
`status`='off'
");
$log=$log.'<br>А так же за 1 место по активности, вы получаете медаль: <font color=#00ffff>'.$name.'</font>';
}
$rows21_ok=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$us['id']."' and `usr2`='0'"));
if($rows21_ok==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$us['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2_ok=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$us['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$us['id']."'");
}
$rows2_oks=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$us['id']."'"));
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2_oks['id']."',
`vhod`='1',
`time`='".time()."',
`text`='<font color=#ff9900>".$log."</font>',
`usr`='".$us['id']."'
");
}
mysql_query("UPDATE `users` SET `gaika`='0'");
echo 'Готово';
break;
case 'ct':
$lv=time()-604800;
$user=mysql_query("SELECT * FROM `users` WHERE `lv`>'".$lv."' and `rang`>='10'");
while($us=mysql_fetch_array($user))
{
if($us['rang']>=10 and $us['rang']<=15){$mon=500;$alm=25;}
elseif($us['rang']>=16 and $us['rang']<=20){$mon=700;$alm=35;}
elseif($us['rang']>=21 and $us['rang']<=27){$mon=1000;$alm=50;}
elseif($us['rang']>=28 and $us['rang']<=34){$mon=1400;$alm=70;}
elseif($us['rang']>=35 and $us['rang']<=40){$mon=2000;$alm=100;}
$m=$us['money']+$mon;
$a=$us['tank']+$alm;
mysql_query("UPDATE `users` SET `money`='".$m."', `tank`='".$a."' WHERE `id`='".$us['id']."'");
$rows21_ok=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$us['id']."' and `usr2`='0'"));
if($rows21_ok==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$us['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2_ok=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$us['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$us['id']."'");
}
$rows2_oks=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$us['id']."'"));
$text_ok='<font color=#00ff99>Дар великих Мудрецов за ранг.<br>Вы достигли '.$us['rang'].' ранга.<br>Ваша награда: <img src=img/main/p10.png>'.$mon.' <img src=img/main/23f.png>'.$alm.'</font>';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2_oks['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text_ok."',
`usr`='".$us['id']."'
");
}
break;
case 'tv':
$user=mysql_query("SELECT * FROM `users` WHERE `rt_reit`>'0'");
while($us=mysql_fetch_array($user))
{
if($us['rt_reit']>=2000){$alm=floor($us['rt_reit']/100);$jem=floor($us['rt_reit']/2000);$mon=0;$t='<img src=img/main/23f.png>'.$alm.' <img src=img/main/p13.png>'.$jem.'';}
elseif($us['rt_reit']<2000 and $us['rt_reit']>30){$mon=floor($us['rt_reit']/3);$jem=0;$alm=0;$t='<img src=img/main/p5.png>'.$mon.'';}
$a=$udata['tank']+$alm;
$j=$udata['jem']+$jem;
$m=$udata['money']+$mon;
mysql_query("UPDATE `users` SET `money`='".$m."', `jem`='".$j."', `tank`='".$a."' WHERE `id`='".$us['id']."'");
$rows21_ok=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$us['id']."' and `usr2`='0'"));
if($rows21_ok==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$us['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2_ok=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$us['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$us['id']."'");
}
$rows2_oks=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$us['id']."'"));
$text_ok='<font color=#00ff99>Наконец то Мудрецам удалось отыскать древние свитки о былых войнах сражавшихся за мир в Райской Твердыне. И вы оказались одним из тех войнов.<br>Ваша награда: '.$t.'</font>';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2_oks['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text_ok."',
`usr`='".$us['id']."'
");
}
mysql_query("UPDATE `users` SET `rt_reit`='0'");
echo 'Готово';
break;
case 'terr':
if(isset($_GET['arr']))
{
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
echo '<table width=100% border=1px>';
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='terrs' and `usr`='".mysql_real_escape_string($_GET['arr'])."' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo '<tr><td colspan=2>';
echo $ch['text'].'</td>
<td colspan=1><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font></td>";
}
echo '</tr>';
}
echo '</table>
';
if ($_GET['page'] > 0)
{
echo "<a href="?ad=podzem&arr=".mysql_real_escape_string($_GET['arr'])."&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=podzem&arr=".mysql_real_escape_string($_GET['arr'])."&page=$next">Далее</a>";}
else
{echo "Далее";}
}
else
{
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
echo '<table width=100% border=1px>';
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='terr' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo '<tr><td class="p"><font color=#ff9900>'.$ch['text'].'</font><a href=?ad=terr&arr='.$ch['usr'].'> [<font color=#ffff00>просмотр</font>]</a></td>';
echo '</tr>';
}
echo '</table>
';
if ($_GET['page'] > 0)
{
echo "<a href="?ad=terr&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=terr&page=$next">Далее</a>";}
else
{echo "Далее";}
}
break;
break;
case 'str':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
echo '<table width=100% border=1px>';
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='str' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo '<tr><td colspan=2>';
echo $ch['text'].'</td>
<td colspan=1><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font></td>";
}
echo '</tr>';
}
echo '</table>
';
if ($_GET['page'] > 0)
{
echo "<a href="?ad=str&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=str&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'podzem':
if(isset($_GET['arr']))
{
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
echo '<table width=100% border=1px>';
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='podzem' and `usr`='".mysql_real_escape_string($_GET['arr'])."' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo '<tr><td colspan=2>';
echo $ch['text'].'</td>
<td colspan=1><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font></td>";
}
echo '</tr>';
}
echo '</table>
';
if ($_GET['page'] > 0)
{
echo "<a href="?ad=podzem&arr=".mysql_real_escape_string($_GET['arr'])."&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=podzem&arr=".mysql_real_escape_string($_GET['arr'])."&page=$next">Далее</a>";}
else
{echo "Далее";}
}
else
{
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
echo '<table width=100% border=1px>';
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='podzem' group by `usr` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo '<tr><td class="p"><a href=?ad=podzem&arr='.$ch['usr'].'><font color=#ff9900>Подземелье</font> #';
echo $ch['usr'].'</a></td>';
echo '</tr>';
}
echo '</table>
';
if ($_GET['page'] > 0)
{
echo "<a href="?ad=podzem&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=podzem&page=$next">Далее</a>";}
else
{echo "Далее";}
}
break;
case 'bz':
if(isset($_GET['arr']))
{
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
echo '<table width=100% border=1px>';
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='bz' and `usr`='".mysql_real_escape_string($_GET['arr'])."' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo '<tr><td colspan=2>';
echo $ch['text'].'</td>
<td colspan=1><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font></td>";
}
echo '</tr>';
}
echo '</table>
';
if ($_GET['page'] > 0)
{
echo "<a href="?ad=bz&arr=".mysql_real_escape_string($_GET['arr'])."&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=bz&arr=".mysql_real_escape_string($_GET['arr'])."&page=$next">Далее</a>";}
else
{echo "Далее";}
}
else
{
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
echo '<table width=100% border=1px>';
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='bz' group by `usr` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo '<tr><td class="p"><a href=?ad=bz&arr='.$ch['usr'].'><font color=#ff9900>Боевая Зона</font> #';
echo $ch['usr'].'</a></td>';
echo '</tr>';
}
echo '</table>
';
if ($_GET['page'] > 0)
{
echo "<a href="?ad=bz&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=bz&page=$next">Далее</a>";}
else
{echo "Далее";}
}
break;
case 'arena':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
echo '<table width=100% border=1px>';
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='arena' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo '<tr><td colspan=2>';
echo $ch['text'].'</td>
<td colspan=1><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font></td>";
}
echo '</tr>';
}
echo '</table>
';
if ($_GET['page'] > 0)
{
echo "<a href="?ad=arena&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=arena&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'zp':
$user=mysql_query("SELECT * FROM `users` WHERE `admin`>'0'");
while($us=mysql_fetch_array($user))
{
if($us['admin']<=3)
{
$j=15;
}
elseif($us['admin']==4)
{
$j=25;
}
elseif($us['admin']==5)
{
$j=40;
}
$jem=$us['jem']+$j;
mysql_query("UPDATE `users` SET `jem`='".$jem."' WHERE `id`='".$us['id']."'");
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$us['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$us['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$us['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$us['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$us['id']."'"));
$text='Вы славно служите на благо игры. Ваша зарплата: <img src=img/main/p13.png>'.$j.'';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$us['id']."'
");
}
echo 'Готово';
break;
case 'god':
$user=mysql_query("SELECT * FROM `users` WHERE `stats`='0'");
while($us=mysql_fetch_array($user))
{
$us['hp']=$us['hp1']+$us['hp2'];
$us['sila']=$us['sila1']+$us['sila2'];
$us['arm']=$us['arm1']+$us['arm2'];
$ss=$us['hp']+$us['sila']+$us['arm'];
mysql_query("UPDATE `users` SET `stats`='".$ss."' WHERE `id`='".$us['id']."'");
}
echo 'Готово';
break;
case 'torg_ob':
$mobss=mysql_query("SELECT * FROM `bazar`");
while($asa=mysql_fetch_array($mobss))
{
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='".$asa['usr']."',
`name`='".$asa['name']."',
`cena`='".$asa['cena']."',
`lvl`='".$asa['lvl']."',
`img`='".$asa['img']."',
`hp`='".$asa['hp']."',
`arm`='".$asa['arm']."',
`sila`='".$asa['sila']."',
`tip`='".$asa['tip']."',
`lic`='1',
`pr`='".$asa['pr']."',
`komp`='".$asa['komp']."',
`krit`='".$asa['krit']."',
`blok`='".$asa['blok']."',
`status`='off',
`mist`='".$asa['mist']."'
");
mysql_query("DELETE FROM `bazar` WHERE `id`='".$asa['id']."'");
}
$rest=mysql_query("SELECT * FROM `bazar_res`");
while($res=mysql_fetch_array($rest))
{
$us=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$res['usr']."'"));
$kol=$us[''.$res['res'].'']+$res['kol'];
mysql_query("UPDATE `users` SET `".$res['res']."`='".$kol."' WHERE `id`='".$us['id']."'");
mysql_query("DELETE FROM `bazar_res` WHERE `id`='".$res['id']."'");
}
break;
case 'ip':
echo htmlspecialchars($_GET['ips']);
echo'<iframe src="https://geoiptool.com/" width="100%" height="500">
</iframe>';
break;
case 'mart':
$uyt=mysql_query("SELECT * FROM `users` WHERE `pol`!='1' and `lvl`>'9'");
while($f8f=mysql_fetch_array($uyt))
{
$j=$f8f['jem']+$f8f['lvl'];
mysql_query("UPDATE `users` SET `jem`='".$j."' WHERE `id`='".$f8f['id']."'");
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$f8f['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$f8f['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$f8f['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$f8f['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$f8f['id']."'"));
$text='Ваши Красные Розы были конвертированы в <img src=img/main/p13.png> '.$f8f['lvl'].'';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$f8f['id']."'
");
}
echo'готово';
break;
case'bye':
echo'<table width=100% border=1px style="font-size:12px">';
$tr=mysql_query("SELECT * FROM `payments` ORDER BY `id` DESC LIMIT 20");
while($t=mysql_fetch_array($tr))
{
$usersza=mysql_query("SELECT * FROM `users` WHERE `id`='".$t['usr']."'");
$us=mysql_fetch_array($usersza);
echo'
<tr>
<td width=5%>'.$t['id'].'</td>
<td width=50%>';
if($us['admin']>0 and $us['admin']<6)
{
echo '<img src=img/main/md.png> ';
}
elseif($us['admin']>5)
{
echo '<img src=img/main/admin.png> ';
}
echo '<img src=img/main/c'.$us['klass'].'.png> <img src=img/main/r'.$us['rasa'].'.png>
<a href=info.php?id='.$us['id'].'>'.$us['usr'].'</a>';
echo'</td>
<td width=15% align=center><img src=img/main/13.png>'.$t['sum'].'</td>
<td width=30% align=center>';
if($t['status']==0){echo 'не оплачено';}
elseif($t['status']==1){echo 'в процессе';}
elseif($t['status']==10){echo 'начислено';}
echo'</td>
</tr>
';
}
echo'</table>';
break;
case 'av':
$av=mysql_query("SELECT * FROM `avan`");
while($avan=mysql_fetch_array($av))
{
echo '<div class="tav p">
<img src=img/main/p21.png> <font color=#ff9900>'.$avan['name'].'</font> ('.$avan['gorod'].' город)';
if($avan['stat']>0)
{
echo ' <img src=img/main/p7.png>'.$avan['stat'].'';
}
echo '<br>';
if($avan['status']==0)
{
echo '<img src=img/main/e55.png> <font color=#00ff00>Спокойствие</font>';
echo '<br><img src=img/main/e55.png> <a href=?avan&id='.$avan['id'].'>Открыть</a>';
}
else
{
if($avan['time']<time())
{
echo '<img src=img/main/e55.png> <font color=#ff0000>Ведется бой</font>';
}
else
{
echo '<img src=img/main/e55.png> <font color=#ff0000>До битвы:</font> <font color=#00cad4>';
$avan['time']=$avan['time']-time();
if($avan['time']<60){
echo $avan['time']." с.</font>";
}elseif($avan['time']>60 and $avan['time']<3600){
$avan['time']=round($avan['time']/60);
echo $avan['time']." м.</font>";
}else{
$avan['time']=round($avan['time']/3600);
echo $avan['time']." ч.</font>";
}
echo '<br><img src=img/main/p21.png> <a href=avan.php?vst&id='.$avan['id'].'>Вступить в бой</a>';
}
}
echo '</div>';
}
break;
case 'bazar':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='bazar' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo $ch['text'].'<br>
<font color=#ff9900>'.$ch['data'].'</font><br><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font>";
}
echo '<hr>
';
}
if ($_GET['page'] > 0)
{
echo "<a href="?ad=bazar&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=bazar&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'torg':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='torg' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo $ch['text'].'<br>
<font color=#ff9900>'.$ch['data'].'</font><br><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font>";
}
echo '<hr>
';
}
if ($_GET['page'] > 0)
{
echo "<a href="?ad=torg&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=torg&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'ohota':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='ohota' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo $ch['text'].'<br>
<font color=#ff9900>'.$ch['data'].'</font><br><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font>";
}
echo '<hr>
';
}
if ($_GET['page'] > 0)
{
echo "<a href="?ad=ohota&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=ohota&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'okrest':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='okrest' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo $ch['text'].'<br>
<font color=#ff9900>'.$ch['data'].'</font><br><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font>";
}
echo '<hr>
';
}
if ($_GET['page'] > 0)
{
echo "<a href="?ad=okrest&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=okrest&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'sht':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='sht' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo $ch['text'].'<br>
<font color=#ff9900>'.$ch['data'].'</font><br><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font>";
}
echo '<hr>
';
}
if ($_GET['page'] > 0)
{
echo "<a href="?ad=sht&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=sht&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'avan':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='avan' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo $ch['text'].'<br>
<font color=#ff9900>'.$ch['data'].'</font><br><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font>";
}
echo '<hr>
';
}
if ($_GET['page'] > 0)
{
echo "<a href="?ad=avan&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=avan&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'kvest':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='kvest' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo $ch['text'].'<br>
<font color=#ff9900>'.$ch['data'].'</font><br><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font>";
}
echo '<hr>
';
}
if ($_GET['page'] > 0)
{
echo "<a href="?ad=kvest&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=kvest&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'kraft':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='kraft' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo $ch['text'].'<br>
<font color=#ff9900>'.$ch['data'].'</font><br><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font>";
}
echo '<hr>
';
}
if ($_GET['page'] > 0)
{
echo "<a href="?ad=kraft&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=kraft&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'vip':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='vip' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo $ch['text'].'<br>
<font color=#ff9900>'.$ch['data'].'</font><br><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font>";
}
echo '<hr>
';
}
if ($_GET['page'] > 0)
{
echo "<a href="?ad=vip&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=vip&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'shaman':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='shaman' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo $ch['text'].'<br>
<font color=#ff9900>'.$ch['data'].'</font><br><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font>";
}
echo '<hr>
';
}
if ($_GET['page'] > 0)
{
echo "<a href="?ad=shaman&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=shaman&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'arena':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `tip`='arena' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo $ch['text'].'<br>
<font color=#ff9900>'.$ch['data'].'</font><br><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font>";
}
echo '<hr>
';
}
if ($_GET['page'] > 0)
{
echo "<a href="?ad=arena&page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?ad=arena&page=$next">Далее</a>";}
else
{echo "Далее";}
break;
case 'user':
echo '<form action=?ad=user&ut method=POST>
<input type=text name=usr><br>
<input type=submit value=поиск class=line>
</form>';
if(isset($_GET['ut']))
{
$us=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `usr`='".mysql_real_escape_string($_POST['usr'])."'"));
echo '<img src=img/main/e55.png> <a href=?ad=users&id='.$us['id'].'>Просмотр действий игрока
<img src=img/main/c'.$us['klass'].'.png>
<img src=img/main/r'.$us['rasa'].'.png>
'.$us['usr'].'</a><br>';
echo '<img src=img/main/e55.png> <a href=?ad=users_r&id='.$us['id'].'>редактирование игрока
<img src=img/main/c'.$us['klass'].'.png>
<img src=img/main/r'.$us['rasa'].'.png>
'.$us['usr'].'</a>';
}
break;
case 'users_r':
$us=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$_GET['id']."'"));
echo '<table width=100% border=1px>';
echo '<tr>';
echo '<td width=25%><b>Ник</b></td>';
echo '<td>
<form action=?edd_usr&tip=nick&id='.$us['id'].' method=POST>
<input type=text name=nick value="'.$us['usr'].'"><br></form>
</td>';
echo '</tr>';
echo '<tr>';
echo '<td><b>Пароль</b></td>';
echo '<td>
'.$us['pass'].'<br>
<form action=?edd_usr&tip=pass&id='.$us['id'].' method=POST>
<input type=text name=pass><br><input type=submit value=задать class=line></form>
</td>';
echo '</tr>';
echo '<tr>';
echo '<td><b>Права</b></td>';
echo '<td>';
if($us['admin']==0)
{
echo 'Игрок';
}
elseif($us['admin']==1)
{
echo 'Стажер';
}
elseif($us['admin']==2)
{
echo 'Мд чата';
}
elseif($us['admin']==3)
{
echo 'Мд форума';
}
elseif($us['admin']==4)
{
echo 'Старший мд';
}
elseif($us['admin']==5)
{
echo 'Верховный мд';
}
elseif($us['admin']==6)
{
echo 'Системный администратор';
}
echo '<form action=?edd_usr&tip=admin&id='.$us['id'].' method=POST>
<select name=admin>
<option value=0>Игрок</option>
<option value=1>Стажер</option>
<option value=2>Мд чата</option>
<option value=3>Мд форума</option>
<option value=4>Старший мд</option>
<option value=5>Верховный мд</option>
<option value=6>Системный администратор</option>
</select><br><input type=submit value=задать class=line></form>
</td>';
echo '</tr>';
echo '<tr>';
echo '<td><b>Сторона</b></td>';
echo '<td>';
if($us['rasa']==1)
{
echo 'Атлант';
}
else
{
echo 'Тектон';
}
echo '<form action=?edd_usr&tip=rasa&id='.$us['id'].' method=POST>
<select name=rasa>
<option value=1>Атлант</option>
<option value=2>Тектон</option>
</select><br><input type=submit value=задать class=line></form>
</td>';
echo '</tr>';
echo '<tr>';
echo '<td><b>Класс</b></td>';
echo '<td>';
if($us['klass']==1)
{
echo 'Воин';
}
elseif($us['klass']==2)
{
echo 'Маг';
}
elseif($us['klass']==3)
{
echo 'Разбойник';
}
echo '<form action=?edd_usr&tip=klass&id='.$us['id'].' method=POST>
<select name=klass>
<option value=1>Воин</option>
<option value=2>Маг</option>
<option value=3>Разбойник</option>
</select><br><input type=submit value=задать class=line></form>
</td>';
echo '</tr>';
echo '<tr>';
echo '<td><b>Уровень</b></td>';
echo '<td>
'.$us['lvl'].'<br>
</td>';
echo '</tr>';
echo '<tr>';
echo '<td><b>Опыт</b></td>';
echo '<td>
'.$us['exp'].'<br>
<form action=?edd_usr&tip=exp&id='.$us['id'].' method=POST>
<input type=text name=exp><br><input type=submit value=задать class=line></form>
</td>';
echo '</tr>';
echo '<tr>';
echo '<td><b>Уровень ранга</b></td>';
echo '<td>
'.$us['rang'].'<br>
</td>';
echo '</tr>';
echo '<tr>';
echo '<td><b>Опыт ранга</b></td>';
echo '<td>
'.$us['exp_rang'].'<br>
<form action=?edd_usr&tip=expr&id='.$us['id'].' method=POST>
<input type=text name=expr><br><input type=submit value=задать class=line></form>
</td>';
echo '<tr>';
echo '<td><b>Золото</b></td>';
echo '<td>
'.$us['money'].'<br>
<form action=?edd_usr&tip=mon&id='.$us['id'].' method=POST>
<input type=text name=mon><br><input type=submit value=задать class=line></form>
</td>';
echo '</tr>';
echo '<tr>';
echo '<td><b>Жемчуг</b></td>';
echo '<td>
'.$us['jem'].'<br>
<form action=?edd_usr&tip=jem&id='.$us['id'].' method=POST>
<input type=text name=jem><br><input type=submit value=задать class=line></form>
</td>';
echo '<tr>';
echo '<td><b>Камни душ</b></td>';
echo '<td>
'.$us['kd'].'<br>
<form action=?edd_usr&tip=kd&id='.$us['id'].' method=POST>
<input type=text name=kd><br><input type=submit value=задать class=line></form>
</td>';
echo '<tr>';
echo '<td><b>Клыки</b></td>';
echo '<td>
'.$us['kl'].'<br>
<form action=?edd_usr&tip=kl&id='.$us['id'].' method=POST>
<input type=text name=kl><br><input type=submit value=задать class=line></form>
</td>';
echo '<tr>';
echo '<td><b>Фимиам</b></td>';
echo '<td>
'.$us['fm'].'<br>
<form action=?edd_usr&tip=fm&id='.$us['id'].' method=POST>
<input type=text name=fm><br><input type=submit value=задать class=line></form>
</td>';
echo '<tr>';
echo '<td><b>Иссинит</b></td>';
echo '<td>
'.$us['iss'].'<br>
<form action=?edd_usr&tip=iss&id='.$us['id'].' method=POST>
<input type=text name=iss><br><input type=submit value=задать class=line></form>
</td>';
echo '<tr>';
echo '<td><b>Лазурит</b></td>';
echo '<td>
'.$us['lazyr'].'<br>
<form action=?edd_usr&tip=lazyr&id='.$us['id'].' method=POST>
<input type=text name=lazyr><br><input type=submit value=задать class=line></form>
</td>';
echo '<tr>';
echo '<td><b>Багрянит</b></td>';
echo '<td>
'.$us['bagr'].'<br>
<form action=?edd_usr&tip=bagr&id='.$us['id'].' method=POST>
<input type=text name=bagr><br><input type=submit value=задать class=line></form>
</td>';
echo '</tr>';
echo '</table>';
break;
case 'users':
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM adm_res"));
$puslap = floor($viso/10);
$chat=mysql_query("SELECT * FROM `adm_res` WHERE `usr`='".$_GET['id']."' ORDER BY `id` DESC LIMIT $num,10");
while($ch=mysql_fetch_array($chat))
{
echo $ch['text'].'<br>
<font color=#ff9900>'.$ch['data'].'</font><br><font color=#1faee9>';
$ch['time']=time()-$ch['time'];
if($ch['time']<60){
echo $ch['time']." с. назад</font>";
}elseif($ch['time']>60 and $ch['time']<3600){
$ch['time']=round($ch['time']/60);
echo $ch['time']." м. назад</font>";
}else{
$ch['time']=round($ch['time']/3600);
echo $ch['time']." ч. назад</font>";
}
echo '<hr>
';
}
if ($_GET['page'] > 0)
{
echo "<a href="?ad=users&page=$back&id=".$_GET['id']."">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href=?ad=users&page=$next&id=".$_GET['id'].">Далее</a>";}
else
{echo "Далее";}
break;
}
echo '</div>';
include('files/down.php');
?>