clanlevel == 9) {
if(isset($_POST['change_owner']) && $_POST['owner'] != $data->login) {
$dbres = mysql_query("SELECT `login`,`level`,`clan` FROM `[users]` WHERE `login`='{$_POST['owner']}'");
if(($owner = mysql_fetch_object($dbres)) && $owner->clan == $data->clan && $owner->level & 0x01) {
mysql_query("UPDATE `[users]` SET `clanlevel`=1 WHERE `login`='{$data->login}'");
mysql_query("UPDATE `[users]` SET `clanlevel`=9 WHERE `login`='{$owner->login}'");
mysql_query("UPDATE `[clans]` SET `owner`='{$owner->login}' WHERE `name`='{$data->clan}'");
header("Location: /criminals/clan.php?x={$data->clan}\n");
}
}
}
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
include("_include-gevangenis.php");
/* ------------------------- */ ?>
\n";
print " Clan | Owner | Power | \n";
$dbres = mysql_query("SELECT `name`,`owner`,`type`,`def_lvl1`,`homes` FROM `[clans]` ORDER BY `type`");
while($clan = mysql_fetch_object($dbres)) {
$power = 0;
$dbres2 = mysql_query("SELECT `attack`,`defence`,`clicks` 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*3000)/2;
$power += ($clan->homes*1250)/2;
$clanpower[$clan->type][$clan->name] = $power;
}
$lasttype = 1;
foreach($clanpower as $type => $info) {
if($type != $lasttype)
print "
| \n";
arsort($info);
foreach($info as $name => $power) {
$dbres = mysql_query("SELECT `name`,`owner` FROM `[clans]` WHERE `name`='$name'");
$clan = mysql_fetch_object($dbres);
print " name}\">{$clan->name} | owner}\">{$clan->owner} | $power | ";
if($data->clanlevel >= 7)
print " Attack | \n";
else
print "\n";
$lasttype = $type;
}
}
print " | \n";
/* ------------------------- */ ?>