\n";
print <<
ENDHTML;
print " Owner: | owner}\">{$clan->owner} | \n";
$dbres = mysql_query("SELECT `attack`,`defence`,`clicks`,`type` FROM `[users]` WHERE `clan`='{$clan->name}'");
print " Members: | ". (mysql_num_rows($dbres)) ." | \n";
while($member = mysql_fetch_object($dbres))
$power += round(($member->attack+$member->defence)/2+$member->clicks*5);
$power += ($clan->def_lvl1*1500)/2;
$power += ($clan->def_lvl4*20000)/2;
print " Power: | ".number_format($power,0,',','.')." | \n";
print " Land: | ".number_format($clan->land,0,',','.')."m2 | \n";
print " Contant: | €".number_format($clan->cash,0,',','.')." | \n";
print " Bank: | €".number_format($clan->bank,0,',','.')." | \n";
print " Clicks: | ".number_format($clan->clicks,0,',','.')." | \n";
print " Clicks vandaag: | {$clan->clickstoday} | \n";
print " Opgericht: | {$clan->started} | \n";
print " \n";
print " | \n
| \n\n";
print <<
# |
Nick |
Rank |
Geld |
Power |
ENDHTML;
$begin = ($_GET['p'] >= 0) ? $_GET['p']*15 : 0;
if($_GET['s'] == "login")
$dbres = mysql_query("SELECT `login`,`attack`,`defence`,`clicks`,`bank`,`cash`,`clanlevel`,`type` FROM `[users]` WHERE `clan`='{$clan->name}' ORDER BY `login` LIMIT $begin,15");
else if($_GET['s'] == "money")
$dbres = mysql_query("SELECT `login`,`attack`,`defence`,`clicks`,`bank`,`cash`,`clanlevel`,`type` FROM `[users]` WHERE `clan`='{$clan->name}' ORDER BY `cash`+`bank` DESC,`login` ASC LIMIT $begin,15");
else if($_GET['s'] == "power")
$dbres = mysql_query("SELECT `login`,`attack`,`defence`,`clicks`,`bank`,`cash`,`clanlevel`,`type` FROM `[users]` WHERE `clan`='{$clan->name}' ORDER BY (`attack`+`defence`)/2+`clicks`*5 DESC,`login` ASC LIMIT $begin,15");
else
$dbres = mysql_query("SELECT `login`,`attack`,`defence`,`clicks`,`bank`,`cash`,`clanlevel`,`type` FROM `[users]` WHERE `clan`='{$clan->name}' ORDER BY `clanlevel` DESC,`login` ASC LIMIT $begin,15");
for($j=$begin+1; $member = mysql_fetch_object($dbres); $j++) {
$rank = Array("","Member","Recruiter","","","","Manager","Generaal","Leader","Owner");
$rank = $rank[$member->clanlevel];
$power = number_format(round(($member->attack+$member->defence)/2+$member->clicks*5),0,',','.');
$money = number_format($member->cash+$member->bank,0,',','.');
print <<$j |
{$member->login} |
$rank |
€$money |
$power |
ENDHTML;
}
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `clan`='{$clan->name}'");
print " \n\n\n ";
if(mysql_num_rows($dbres) <= 15)
print "| 1 | | \n";
else {
if($begin/15 == 0)
print "<< ";
else
print "name}&s={$_GET['s']}&p=". ($begin/15-1) ."\"><< ";
for($i=0; $iname}&s={$_GET['s']}&p=$i\">". ($i+1) ." ";
}
if($begin+15 >= mysql_num_rows($dbres))
print ">> ";
else
print "name}&s={$_GET['s']}&p=". ($begin/15+1) ."\">>>";
print " | |
\n";
}
}
}
else if($_GET['p'] == "list") {
print " \n";
print " Clan | Owner | Members | Power | \n";
$dbres = mysql_query("SELECT `name`,`owner`,`type`,`def_lvl1` FROM `[clans]` ORDER BY `type`");
while($clan = mysql_fetch_object($dbres)) {
$power = 0;
$dbres2 = mysql_query("SELECT `attack`,`defence`,`clicks`,`type` FROM `[users]` WHERE `clan`='{$clan->name}'");
while($member = mysql_fetch_object($dbres2))
$power += round(($member->attack+$member->defence)/2+$member->clicks*5);
$power += ($clan->def_lvl1*1500)/2;
$clanpower[$clan->type][$clan->name] = $power;
}
$lasttype = 1;
foreach($clanpower as $type => $info) {
arsort($info);
foreach($info as $name => $power) {
$dbres = mysql_query("SELECT `name`,`owner`,`type` FROM `[clans]` WHERE `name`='$name'");
$clan = mysql_fetch_object($dbres);
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `clan`='$name'");
$nummembers = mysql_num_rows($dbres);
$type2 = Array("","Drugsdealers","Wetenschappers","Politie");
$type2 = $type2[$clan->type];
print " $name | owner}\">{$clan->owner} | $nummembers | $power | ";
if($data->clanlevel >= 7)
print " attack | \n";
else
print "\n";
$lasttype = $type;
}
}
print " |
\n";
$db = mysql_query("SELECT `name` FROM `[clans]`");
$num = mysql_num_rows($db);
echo "