ТОП 25 лучших игроков Бойцовского Клуба
Место |
Логин |
Опыт |
$tech=array("1241","1242","1243","1244","1990","1253","1254","1255","1256","1257");
$data = mysql_query("SELECT * FROM `users` WHERE `block`='0' AND `align`<>'4' ORDER by `exp` DESC;");
while($row = mysql_fetch_array($data)) {
if(!in_array($row['id'],$tech) && $user['align']!=4 && $user['block']!=1)
{
$n+=1;
echo "( ".$n." ) | ",$row['login'],"[".$row['level']."] | [",$row['exp'],"] | ";
echo " | ";
if ($n==25) break;
}
}
//рейтинг рефералов
?>
ТОП 10 рефералов за неделю
Место |
Логин |
Прибыль |
$ref_out=array();
$var_w=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE var='ref_week' LIMIT 1;"));
$var_m=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE var='ref_month' LIMIT 1;"));
$var_w_id=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE var='ref_w_id' LIMIT 1;"));
$var_m_id=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE var='ref_m_id' LIMIT 1;"));
$tech=array("1241","1242","1243","1244","1990","1253","1254","1255","1256","1257");
$n=0;
$tm=time();
$data = mysql_query("SELECT id,login FROM `users` WHERE align<>'4' AND block=0;");
$date_lim=$var_w['value'];
while($row = mysql_fetch_array($data))
{
$ref_money=mysql_fetch_array(mysql_query("SELECT SUM(money) FROM `referal` WHERE master_id='{$row['id']}' AND date>'{$date_lim}' LIMIT 1;"));
if(!in_array($row['id'],$tech) && $ref_money[0])
{
$ref_w_out[$row['login']]=$ref_money[0];
}
}
arsort($ref_w_out);
//рефералы недели
foreach($ref_w_out as $log=>$mon)
{
$n+=1;
$wr=mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE login='{$log}' LIMIT 1;"));
if($var_w_id['value']==0 && $n==1)
{
if($var_w_id['value']==0 && date("N",$tm)=="6")
{
mysql_query("UPDATE variables SET value='{$wr['id']}' WHERE var='ref_w_id';");
$dress=mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE id='273' LIMIT 1;"));
mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`,
`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,
`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,
`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,
`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,
`nlight`,`ngray`,`ndark`,`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,
`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,
`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,
`artefact`,`duration`)
VALUES
('{$dress['id']}','{$mr_id['id']}','{$dress['name']}','{$dress['type']}',
{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},
{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}',
'{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}',
'{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}',
'{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}',
'{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}',
'{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}',
'{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}',
'{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}',
'{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}','{$dress['mfkrit']}',
'{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}',
'{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}',
'{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}',
'{$dress['nalign']}','".(3*24*60*60+time())."','3','{$dress['razdel']}',
'{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','{$dur}');");
addchp ('Как реферал недели, Вы получили '.$dress['name'].'!','{[]}'.nick7 ($v).'{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$user['id']}','\"".$log['login']."\" получил как реферал недели ".$dress['name']."',1,'".time()."');");
}
}
echo "( ".$n." ) | ",$log," | ",$mon;
echo " | ";
if ($n==10) break;
}
$n=0;
?>
ТОП 10 рефералов за месяц
Место |
Логин |
Прибыль |
'4' AND block=0;");
while($row = mysql_fetch_array($data))
{
$ref_money=mysql_fetch_array(mysql_query("SELECT SUM(money) FROM `referal` WHERE master_id='{$row['id']}' AND date>'{$date_lim}' LIMIT 1;"));
if(!in_array($row['id'],$tech) && $ref_money[0])
{
$ref_m_out[$row['login']]=$ref_money[0];
}
}
arsort($ref_m_out);
foreach($ref_m_out as $log=>$mon)
{
$n+=1;
$mr=mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE login='{$log}' LIMIT 1;"));
if($var_m_id['value']==0 && $n==1)
{
if($var_m_id['value']==0 && date("t",$tm)==date("d",$tm))
{
mysql_query("UPDATE variables SET value='{$mr['id']}' WHERE var='ref_m_id';");
$dress=mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE id='273' LIMIT 1;"));
mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`,
`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,
`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,
`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,
`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,
`nlight`,`ngray`,`ndark`,`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,
`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,
`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,
`artefact`,`duration`)
VALUES
('{$dress['id']}','{$mr_id['id']}','{$dress['name']}','{$dress['type']}',
{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},
{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}',
'{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}',
'{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}',
'{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}',
'{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}',
'{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}',
'{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}',
'{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}',
'{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}','{$dress['mfkrit']}',
'{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}',
'{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}',
'{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}',
'{$dress['nalign']}','".(3*24*60*60+time())."','3','{$dress['razdel']}',
'{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','{$dur}');");
addchp ('Как реферал месяца, Вы получили '.$dress['name'].'!','{[]}'.nick7 ($v).'{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$user['id']}','\"".$log['login']."\" получил как реферал месяца ".$dress['name']."',1,'".time()."');");
$_POST['digger']=0;
}
}
echo "( ".$n." ) | ",$log," | ",$mon;
echo " | ";
if ($n==10) break;
}
$n=0;
?>
ТОП 10 рефералов Бойцовского Квартала
Место |
Логин |
Прибыль |
'4' AND block=0;");
while($row = mysql_fetch_array($data))
{
$ref_money=mysql_fetch_array(mysql_query("SELECT SUM(money) FROM `referal` WHERE master_id='{$row['id']}' LIMIT 1;"));
if(!in_array($row['id'],$tech) && $ref_money[0])
{
$ref_out[$row['login']]=$ref_money[0];
}
}
arsort($ref_out);
foreach($ref_out as $log=>$mon)
{
$n+=1;
$mr_id=mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE login='{$log}' LIMIT 1;"));
echo "( ".$n." ) | ",$log," | ",$mon;
echo " | ";
if ($n==10) break;
}
//}
?>
$num = mysql_num_rows(mysql_query("SELECT `id` FROM `users` WHERE `block`='0' AND `align`<>'4';"));
echo"Всего жителей: ".$num."";
?>
|
|
|
|