Файл: cron/reita.php
Строк: 505
<?
define('PROTECTOR', 1);
$db_host = "localhost";
$db_user = "aweik_sidonias";
$db_table = "aweik_sidonias";
$db_pass = "08091993Lex";
$connect = @ mysql_pconnect($db_host, $db_user, $db_pass) or die('cannot connect to server');
@ mysql_select_db($db_table) or die('cannot connect to db');
@ mysql_query("SET NAMES 'utf8'", $connect);
$dsa=date('d');
$dbz=mysql_query("SELECT * FROM `aaa` WHERE `id`='2'");
$dbzv=mysql_fetch_array($dbz);
if($dsa!=$dbzv['day'])
{
$tus1=mysql_query("SELECT * FROM `users` WHERE `reit_nai`!='0' ORDER BY `reit_nai` DESC LIMIT 0,1");
$n1=mysql_num_rows($tus1);
if($n1!=0)
{
$usrz=mysql_fetch_array($tus1);
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$usrz['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$usrz['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$usrz['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz['id']."'"));
$text='Вы заняли первое место в рейтинге Убийца! За это вы получаете <img src=img/main/p5.png>100.';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$usrz['id']."'
");
$zzet=$usrz['money']+100;
mysql_query("UPDATE `users` SET `money`='".$zzet."' WHERE `id`='".$usrz['id']."'");
if($usrz['admin']>0 and $usrz['admin']<6)
{
$ng='<img src=img/main/md.png> ';
}
if($usrz['admin']>5)
{
$ng='<img src=img/main/admin.png> ';
}
$t='1. '.$ng.' <img src=img/main/c'.$usrz['klass'].'.png> <img src=img/main/r'.$usrz['rasa'].'.png>
<a href=info.php?id='.$usrz['id'].'>'.$usrz['usr'].'</a> <img src=img/main/p10.png>'.$usrz['lvl'].' +<img src=img/main/p5.png>100';
}
else
{
$t='1. <font color=#ff0000>Пусто</font>';
}
$tus2=mysql_query("SELECT * FROM `users` WHERE `reit_nai`!='0' ORDER BY `reit_nai` DESC LIMIT 1,1");
$n2=mysql_num_rows($tus2);
if($n2!=0)
{
$usrz2=mysql_fetch_array($tus2);
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$usrz2['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$usrz2['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz2['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$usrz2['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz2['id']."'"));
$text='Вы заняли второе место в рейтинге Убийца! За это вы получаете <img src=img/main/p5.png>50.';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$usrz2['id']."'
");
$zzet2=$usrz2['money']+50;
mysql_query("UPDATE `users` SET `money`='".$zzet2."' WHERE `id`='".$usrz2['id']."'");
if($usrz2['admin']>0 and $usrz2['admin']<6)
{
$ng='<img src=img/main/md.png> ';
}
if($usrz2['admin']>5)
{
$ng='<img src=img/main/admin.png> ';
}
$t2='2. '.$ng.' <img src=img/main/c'.$usrz2['klass'].'.png> <img src=img/main/r'.$usrz2['rasa'].'.png>
<a href=info.php?id='.$usrz2['id'].'>'.$usrz2['usr'].'</a> <img src=img/main/p10.png>'.$usrz2['lvl'].' +<img src=img/main/p5.png>50';
}
else
{
$t2='2. <font color=#ff0000>Пусто</font>';
}
$tus3=mysql_query("SELECT * FROM `users` WHERE `reit_nai`!='0' ORDER BY `reit_nai` DESC LIMIT 2,1");
$n3=mysql_num_rows($tus3);
if($n3!=0)
{
$usrz3=mysql_fetch_array($tus3);
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$usrz3['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$usrz3['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz3['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$usrz3['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz3['id']."'"));
$text='Вы заняли третье место в рейтинге Убийца! За это вы получаете <img src=img/main/p5.png>25.';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$usrz3['id']."'
");
$zzet3=$usrz3['money']+25;
mysql_query("UPDATE `users` SET `money`='".$zzet3."' WHERE `id`='".$usrz3['id']."'");
if($usrz3['admin']>0 and $usrz3['admin']<6)
{
$ng='<img src=img/main/md.png> ';
}
if($usrz3['admin']>5)
{
$ng='<img src=img/main/admin.png> ';
}
$t3='3. '.$ng.' <img src=img/main/c'.$usrz3['klass'].'.png> <img src=img/main/r'.$usrz3['rasa'].'.png>
<a href=info.php?id='.$usrz3['id'].'>'.$usrz3['usr'].'</a> <img src=img/main/p10.png>'.$usrz3['lvl'].' +<img src=img/main/p5.png>25';
}
else
{
$t3='3. <font color=#ff0000>Пусто</font>';
}
$text=$t.'<br>'.$t2.'<br>'.$t3;
mysql_query("UPDATE `users` SET `reit_nai`='0'");
mysql_query("UPDATE `aaa` SET `day`='".$dsa."', `text`='".$text."' WHERE `id`='2'");
mysql_query("UPDATE `clan_users` SET `kv_s`='0', `kv_s_n`='0'");
mysql_query("UPDATE `users` SET `pay_b`='0'");
}
$dbz=mysql_query("SELECT * FROM `aaa` WHERE `id`='1'");
$dbzv=mysql_fetch_array($dbz);
if($dsa!=$dbzv['day'])
{
$tus1=mysql_query("SELECT * FROM `users` WHERE `reit_sh`!='0' ORDER BY `reit_sh` DESC LIMIT 0,1");
$n1=mysql_num_rows($tus1);
if($n1!=0)
{
$usrz=mysql_fetch_array($tus1);
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$usrz['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$usrz['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$usrz['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz['id']."'"));
$text='Вы заняли первое место в рейтинге Страж! За это вы получаете <img src=img/main/p5.png>100.';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$usrz['id']."'
");
$zzet=$usrz['money']+100;
mysql_query("UPDATE `users` SET `money`='".$zzet."' WHERE `id`='".$usrz['id']."'");
if($usrz['admin']>0 and $usrz['admin']<6)
{
$ng='<img src=img/main/md.png> ';
}
if($usrz['admin']>5)
{
$ng='<img src=img/main/admin.png> ';
}
$t='1. '.$ng.' <img src=img/main/c'.$usrz['klass'].'.png> <img src=img/main/r'.$usrz['rasa'].'.png>
<a href=info.php?id='.$usrz['id'].'>'.$usrz['usr'].'</a> <img src=img/main/p10.png>'.$usrz['lvl'].' +<img src=img/main/p5.png>100';
}
else
{
$t='1. <font color=#ff0000>Пусто</font>';
}
$tus2=mysql_query("SELECT * FROM `users` WHERE `reit_sh`!='0' ORDER BY `reit_sh` DESC LIMIT 1,1");
$n2=mysql_num_rows($tus2);
if($n2!=0)
{
$usrz2=mysql_fetch_array($tus2);
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$usrz2['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$usrz2['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz2['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$usrz2['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz2['id']."'"));
$text='Вы заняли второе место в рейтинге Страж! За это вы получаете <img src=img/main/p5.png>50.';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$usrz2['id']."'
");
$zzet2=$usrz2['money']+50;
mysql_query("UPDATE `users` SET `money`='".$zzet2."' WHERE `id`='".$usrz2['id']."'");
if($usrz2['admin']>0 and $usrz2['admin']<6)
{
$ng='<img src=img/main/md.png> ';
}
if($usrz2['admin']>5)
{
$ng='<img src=img/main/admin.png> ';
}
$t2='2. '.$ng.' <img src=img/main/c'.$usrz2['klass'].'.png> <img src=img/main/r'.$usrz2['rasa'].'.png>
<a href=info.php?id='.$usrz2['id'].'>'.$usrz2['usr'].'</a> <img src=img/main/p10.png>'.$usrz2['lvl'].' +<img src=img/main/p5.png>50';
}
else
{
$t2='2. <font color=#ff0000>Пусто</font>';
}
$tus3=mysql_query("SELECT * FROM `users` WHERE `reit_sh`!='0' ORDER BY `reit_sh` DESC LIMIT 2,1");
$n3=mysql_num_rows($tus3);
if($n3!=0)
{
$usrz3=mysql_fetch_array($tus3);
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$usrz3['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$usrz3['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz3['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$usrz3['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz3['id']."'"));
$text='Вы заняли третье место в рейтинге Страж! За это вы получаете <img src=img/main/p5.png>25.';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$usrz3['id']."'
");
$zzet3=$usrz3['money']+25;
mysql_query("UPDATE `users` SET `money`='".$zzet3."' WHERE `id`='".$usrz3['id']."'");
if($usrz3['admin']>0 and $usrz3['admin']<6)
{
$ng='<img src=img/main/md.png> ';
}
if($usrz3['admin']>5)
{
$ng='<img src=img/main/admin.png> ';
}
$t3='3. '.$ng.' <img src=img/main/c'.$usrz3['klass'].'.png> <img src=img/main/r'.$usrz3['rasa'].'.png>
<a href=info.php?id='.$usrz3['id'].'>'.$usrz3['usr'].'</a> <img src=img/main/p10.png>'.$usrz3['lvl'].' +<img src=img/main/p5.png>25';
}
else
{
$t3='3. <font color=#ff0000>Пусто</font>';
}
$text=$t.'<br>'.$t2.'<br>'.$t3;
mysql_query("UPDATE `users` SET `reit_sh`='0'");
mysql_query("UPDATE `aaa` SET `day`='".$dsa."', `text`='".$text."' WHERE `id`='1'");
}
$dbz=mysql_query("SELECT * FROM `aaa` WHERE `id`='3'");
$dbzv=mysql_fetch_array($dbz);
if($dsa!=$dbzv['day'])
{
$tus1=mysql_query("SELECT * FROM `users` WHERE `reit_oh`!='0' ORDER BY `reit_oh` DESC LIMIT 0,1");
$n1=mysql_num_rows($tus1);
if($n1!=0)
{
$usrz=mysql_fetch_array($tus1);
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$usrz['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$usrz['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$usrz['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz['id']."'"));
$text='Вы заняли первое место в рейтинге Охотник! За это вы получаете <img src=img/main/p5.png>100.';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$usrz['id']."'
");
$zzet=$usrz['money']+100;
mysql_query("UPDATE `users` SET `money`='".$zzet."' WHERE `id`='".$usrz['id']."'");
if($usrz['admin']>0 and $usrz['admin']<6)
{
$ng='<img src=img/main/md.png> ';
}
if($usrz['admin']>5)
{
$ng='<img src=img/main/admin.png> ';
}
$t='1. '.$ng.' <img src=img/main/c'.$usrz['klass'].'.png> <img src=img/main/r'.$usrz['rasa'].'.png>
<a href=info.php?id='.$usrz['id'].'>'.$usrz['usr'].'</a> <img src=img/main/p10.png>'.$usrz['lvl'].' +<img src=img/main/p5.png>100';
}
else
{
$t='1. <font color=#ff0000>Пусто</font>';
}
$tus2=mysql_query("SELECT * FROM `users` WHERE `reit_oh`!='0' ORDER BY `reit_oh` DESC LIMIT 1,1");
$n2=mysql_num_rows($tus2);
if($n2!=0)
{
$usrz2=mysql_fetch_array($tus2);
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$usrz2['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$usrz2['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz2['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$usrz2['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz2['id']."'"));
$text='Вы заняли второе место в рейтинге Охотник! За это вы получаете <img src=img/main/p5.png>50.';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$usrz2['id']."'
");
$zzet2=$usrz2['money']+50;
mysql_query("UPDATE `users` SET `money`='".$zzet2."' WHERE `id`='".$usrz2['id']."'");
if($usrz2['admin']>0 and $usrz2['admin']<6)
{
$ng='<img src=img/main/md.png> ';
}
if($usrz2['admin']>5)
{
$ng='<img src=img/main/admin.png> ';
}
$t2='2. '.$ng.' <img src=img/main/c'.$usrz2['klass'].'.png> <img src=img/main/r'.$usrz2['rasa'].'.png>
<a href=info.php?id='.$usrz2['id'].'>'.$usrz2['usr'].'</a> <img src=img/main/p10.png>'.$usrz2['lvl'].' +<img src=img/main/p5.png>50';
}
else
{
$t2='2. <font color=#ff0000>Пусто</font>';
}
$tus3=mysql_query("SELECT * FROM `users` WHERE `reit_oh`!='0' ORDER BY `reit_oh` DESC LIMIT 2,1");
$n3=mysql_num_rows($tus3);
if($n3!=0)
{
$usrz3=mysql_fetch_array($tus3);
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$usrz3['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$usrz3['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz3['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$usrz3['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz3['id']."'"));
$text='Вы заняли третье место в рейтинге Охотник! За это вы получаете <img src=img/main/p5.png>25.';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$usrz3['id']."'
");
$zzet3=$usrz3['money']+25;
mysql_query("UPDATE `users` SET `money`='".$zzet3."' WHERE `id`='".$usrz3['id']."'");
if($usrz3['admin']>0 and $usrz3['admin']<6)
{
$ng='<img src=img/main/md.png> ';
}
if($usrz3['admin']>5)
{
$ng='<img src=img/main/admin.png> ';
}
$t3='3. '.$ng.' <img src=img/main/c'.$usrz3['klass'].'.png> <img src=img/main/r'.$usrz3['rasa'].'.png>
<a href=info.php?id='.$usrz3['id'].'>'.$usrz3['usr'].'</a> <img src=img/main/p10.png>'.$usrz3['lvl'].' +<img src=img/main/p5.png>25';
}
else
{
$t3='3. <font color=#ff0000>Пусто</font>';
}
$text=$t.'<br>'.$t2.'<br>'.$t3;
mysql_query("UPDATE `users` SET `reit_oh`='0'");
mysql_query("UPDATE `aaa` SET `day`='".$dsa."', `text`='".$text."' WHERE `id`='3'");
}
$dbz=mysql_query("SELECT * FROM `aaa` WHERE `id`='7'");
$dbzv=mysql_fetch_array($dbz);
if($dsa!=$dbzv['day'])
{
$tus1=mysql_query("SELECT * FROM `users` WHERE `reit_kv`!='0' ORDER BY `reit_kv` DESC LIMIT 0,1");
$n1=mysql_num_rows($tus1);
if($n1!=0)
{
$usrz=mysql_fetch_array($tus1);
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$usrz['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$usrz['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$usrz['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz['id']."'"));
$text='Вы заняли первое место в рейтинге Квестовик! За это вы получаете <img src=img/main/p13.png>1.';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$usrz['id']."'
");
$zzet=$usrz['jem']+1;
mysql_query("UPDATE `users` SET `jem`='".$zzet."' WHERE `id`='".$usrz['id']."'");
if($usrz['admin']>0 and $usrz['admin']<6)
{
$ng='<img src=img/main/md.png> ';
}
if($usrz['admin']>5)
{
$ng='<img src=img/main/admin.png> ';
}
$t='1. '.$ng.' <img src=img/main/c'.$usrz['klass'].'.png> <img src=img/main/r'.$usrz['rasa'].'.png>
<a href=info.php?id='.$usrz['id'].'>'.$usrz['usr'].'</a> <img src=img/main/p10.png>'.$usrz['lvl'].' +<img src=img/main/p13.png>1';
}
else
{
$t='1. <font color=#ff0000>Пусто</font>';
}
$tus2=mysql_query("SELECT * FROM `users` WHERE `reit_kv`!='0' ORDER BY `reit_kv` DESC LIMIT 1,1");
$n2=mysql_num_rows($tus2);
if($n2!=0)
{
$usrz2=mysql_fetch_array($tus2);
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$usrz2['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$usrz2['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz2['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$usrz2['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz2['id']."'"));
$text='Вы заняли второе место в рейтинге Квестовик! За это вы получаете <img src=img/main/p5.png>100.';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$usrz2['id']."'
");
$zzet2=$usrz2['money']+100;
mysql_query("UPDATE `users` SET `money`='".$zzet2."' WHERE `id`='".$usrz2['id']."'");
if($usrz2['admin']>0 and $usrz2['admin']<6)
{
$ng='<img src=img/main/md.png> ';
}
if($usrz2['admin']>5)
{
$ng='<img src=img/main/admin.png> ';
}
$t2='2. '.$ng.' <img src=img/main/c'.$usrz2['klass'].'.png> <img src=img/main/r'.$usrz2['rasa'].'.png>
<a href=info.php?id='.$usrz2['id'].'>'.$usrz2['usr'].'</a> <img src=img/main/p10.png>'.$usrz2['lvl'].' +<img src=img/main/p5.png>100';
}
else
{
$t2='2. <font color=#ff0000>Пусто</font>';
}
$tus3=mysql_query("SELECT * FROM `users` WHERE `reit_kv`!='0' ORDER BY `reit_kv` DESC LIMIT 2,1");
$n3=mysql_num_rows($tus3);
if($n3!=0)
{
$usrz3=mysql_fetch_array($tus3);
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$usrz3['id']."' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$usrz3['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz3['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$usrz3['id']."'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$usrz3['id']."'"));
$text='Вы заняли третье место в рейтинге Квестовик! За это вы получаете <img src=img/main/p5.png>50.';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$usrz3['id']."'
");
$zzet3=$usrz3['money']+50;
mysql_query("UPDATE `users` SET `money`='".$zzet3."' WHERE `id`='".$usrz3['id']."'");
if($usrz3['admin']>0 and $usrz3['admin']<6)
{
$ng='<img src=img/main/md.png> ';
}
if($usrz3['admin']>5)
{
$ng='<img src=img/main/admin.png> ';
}
$t3='3. '.$ng.' <img src=img/main/c'.$usrz3['klass'].'.png> <img src=img/main/r'.$usrz3['rasa'].'.png>
<a href=info.php?id='.$usrz3['id'].'>'.$usrz3['usr'].'</a> <img src=img/main/p10.png>'.$usrz3['lvl'].' +<img src=img/main/p5.png>50';
}
else
{
$t3='3. <font color=#ff0000>Пусто</font>';
}
$text=$t.'<br>'.$t2.'<br>'.$t3;
mysql_query("UPDATE `users` SET `reit_kv`='0'");
mysql_query("UPDATE `aaa` SET `day`='".$dsa."', `text`='".$text."' WHERE `id`='7'");
}
mysql_query("DELETE FROM `kvest_usr` WHERE `status`!='".$dsa."'");
?>