24 lines
1018 B
PHP
24 lines
1018 B
PHP
<?
|
|
include "config.php";
|
|
include "functions.php";
|
|
$id = mysql_query("SELECT * FROM `clans`");
|
|
$clans = mysql_num_rows($id);
|
|
$check = 0;
|
|
while($check++ < $clans) {
|
|
$shor = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '{$check}' LIMIT 1"));
|
|
$short = $shor['short'];
|
|
$exp = mysql_fetch_row(mysql_query("SELECT `exp`, COUNT(*) FROM `users` WHERE `klan` = '{$short}'"));
|
|
$id = mysql_query("SELECT `id` FROM `users` WHERE `klan` = '{$short}'");
|
|
$kolvo_us = mysql_num_rows($id);
|
|
echo "$exp[0];||$kolvo_us Q";
|
|
$site_r_clan = 0; // рейтинг клан сайта
|
|
$fight_r_clan = 0; // боевой рейтинг клана
|
|
$grash_point = 0; // очки гражданства
|
|
$Clan_ration = (($exp/$kolvo_us)+($site_r_clan*100000))+$fight_r_clan+$grash_point;
|
|
$l_p = mysql_query("UPDATE `clans` SET `rating` = 'Clan_ration' WHERE `id` = '{$check}'");
|
|
if($l_p) {
|
|
echo "Клановый рейтинг для клана '$short' удачно обновлен";
|
|
}
|
|
}
|
|
|
|
?>
|