\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;
$type = Array("","$clan->centrale","$clan->centrale","$clan->centrale");
$type = $type[$clan->type];
$geld2 = Array("","300","300","300");
$geld2 = $geld2[$clan->type];
$geld = $type*$geld2;
print " Power: | $power | \n";
print " Land: | {$clan->land}m2 | \n";
print " Contant: | {$clan->cash} | \n";
print " Bank: | {$clan->bank} | \n";
print " Clicks: | {$clan->clicks} | \n";
print " Clicks vandaag: | {$clan->clickstoday} | \n";
print " Opgericht: | {$clan->started} | \n";
print " Clan verdiensten: | $geld | \n";
print " Clickssite: | name\" class=\"menu\">$sitelink/clanklik.php?x={$clan->name} | \n";
print " Energie centrale
| $clan->centrale |
| \n";
print " \n";
$dbres = mysql_query("SELECT `name`,`url` FROM `[weapons]` WHERE `area`=8 OR `area`=8+{$clan->type} ORDER BY `area`,`costs`");
while($weapon = mysql_fetch_object($dbres)) {
$name = $weapon->name;
$type = Array("Huis" => "homes",
"Muur" => "def_lvl1",
"bunker" => "def_lvl4",
"Coffeeshop" => "money_lvl1",
"Chemie Lab" => "money_lvl1",
"booreiland" => "money_lvl4",
"Aandeel" => "money_lvl1");
$type = $type[$weapon->name];
print " {$weapon->name} url}.gif\" height=75 width=100> | ". ($clan->{"$type"}) ." |
| \n";
$lastarea = $weapon->area;
}
print " | \n
| \n\n";
print <<
# |
Nick |
Rank |
Geld |
Power |
ENDHTML;
$begin = ($_GET['p'] >= 0) ? $_GET['p']*30 : 0;
if($_GET['s'] == "login")
$dbres = mysql_query("SELECT `login`,`attack`,`defence`,`clicks`,`bank`,`cash`,`clanlevel`,`type` FROM `[users]` WHERE `clan`='{$clan->name}' AND `activated`=1 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "money")
$dbres = mysql_query("SELECT `login`,`attack`,`defence`,`clicks`,`bank`,`cash`,`clanlevel`,`type` FROM `[users]` WHERE `clan`='{$clan->name}' AND `activated`=1 ORDER BY `cash`+`bank` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "power")
$dbres = mysql_query("SELECT `login`,`attack`,`defence`,`clicks`,`bank`,`cash`,`clanlevel`,`type` FROM `[users]` WHERE `clan`='{$clan->name}' AND `activated`=1 ORDER BY (`attack`+`defence`)/2+`clicks`*5 DESC,`login` ASC LIMIT $begin,30");
else
$dbres = mysql_query("SELECT `login`,`attack`,`defence`,`clicks`,`bank`,`cash`,`clanlevel`,`type` FROM `[users]` WHERE `clan`='{$clan->name}' AND `activated`=1 ORDER BY `clanlevel` DESC,`login` ASC LIMIT $begin,30");
for($j=$begin+1; $member = mysql_fetch_object($dbres); $j++) {
$rank = Array("","Member","Recruiter","","","","Manager","Generaal","Leader","Owner");
$rank = $rank[$member->clanlevel];
$power = round(($member->attack+$member->defence)/2+$member->clicks*5);
$money = $member->cash+$member->bank;
print <<$j |
{$member->login} |
$rank |
\$$money |
$power |
ENDHTML;
}
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `clan`='{$clan->name}' AND `activated`=1");
print " \n\n\n ";
if(mysql_num_rows($dbres) <= 30)
print "< 1 > | \n";
else {
if($begin/30 == 0)
print "<< ";
else
print "name}&s={$_GET['s']}&p=". ($begin/30-1) ."\"><< ";
for($i=0; $iname}&s={$_GET['s']}&p=$i\">". ($i+1) ." ";
}
if($begin+30 >= mysql_num_rows($dbres))
print ">> ";
else
print "name}&s={$_GET['s']}&p=". ($begin/30+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) {
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);
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `clan`='$name'");
$nummembers = mysql_num_rows($dbres);
print " $name | owner}\">{$clan->owner} | $nummembers | $power | ";
if($data->clanlevel >= 7)
print " Attack | \n";
else
print "\n";
$lasttype = $type;
}
}
print " | \n";
}
else if($_GET['p'] == "join") {
if($data->clanlevel == 0) {
print " Join clan | \n";
if(isset($_POST['clan'])) {
$clan = substr($_POST['clan'],0,32);
$dbres = mysql_query("SELECT `name`,`owner`,`type` FROM `[clans]` WHERE `name`='{$_POST['clan']}'");
if($clan = mysql_fetch_object($dbres)) {
if($clan->type == $data->type) {
$data->clan = "{$clan->name}-[recruit]";
mysql_query("UPDATE `[users]` SET `clan`='{$clan->name}-[recruit]' WHERE `login`='{$data->login}'");
print " Je hebt je aangemeld bij {$clan->name} | \n";
}
else {
$type = Array("","drugsdealers","wetenschappers","agenten","Terroristen","Gangsters");
$type = $type[$clan->type];
print " Alleen $type kunnen zich aanmelden bij {$clan->name} | \n";
}
}
else
print " Die clan bestaat niet | \n";
}
print " | \n";
}
else
print " Je zit al in een clan | \n";
}
else if($_GET['p'] == "new" && $data->clanlevel == 0) {
print " Nieuwe clan | \n";
$rank1 = array("","Empty-Suit","Deliveryboy","Picciotto","Shoplifter","Pickpocket","Thief","Associate","Mobster","Soldier","Swindler","Assassin","Local Chief","Chief","Bruglione","Godfather","Legendary Godfather");
$rank = $rank1[$data->rank];
if($data->rank <= 3){
print " Je moet Shoplifter zijn. Je bent nu $rank . | \n";
exit;
}
if(isset($_POST['name'])) {
$_POST['name'] = substr($_POST['name'],0,16);
if(preg_match('/^[A-Za-z0-9_\-]+$/',$_POST['name'])) {
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
if($_POST['name'] == ' ')
{
$_POST['name'] = str_replace(" ","*",$_POST['name']);
}
else
{
}
$dbres = mysql_query("SELECT `name` FROM `[clans]` WHERE `name`='{$_POST['name']}'");
if(mysql_num_rows($dbres) == 0) {
$dbres = mysql_query("SELECT `land` FROM `[clans]`");
$land = 0;
while($clan = mysql_fetch_object($dbres))
$land += $clan->land;
if(100000000000000000 - $land >= 300) {
$data->clan = $_POST['name'];
$data->clanlevel = 9;
mysql_query("UPDATE `[users]` SET `clan`='{$_POST['name']}',`clanlevel`=9 WHERE `login`='{$data->login}'");
mysql_query("INSERT INTO `[clans]`(`name`,`owner`,`started`,`type`) values('{$_POST['name']}','{$data->login}',NOW(),$data->type)");
print " De clan is aangemaakt | \n\n";
}
else
print " Er is niet genoeg grond om een clan te stichten | \n";
}
else
print " Er is al een clan met die naam | \n";
}
else
print " Er mogen alleen letters, nummers, _ - in de clan-name zitten | \n";
}
print "
| \n";
}
else if($_GET['p'] == "quit" && $data->clanlevel > 0 && $data->clanlevel < 9) {
print " Stap uit de clan | \n";
if(isset($_POST['quit'])) {
$data->clan = "";
$data->clanlevel = 0;
mysql_query("UPDATE `[users]` SET `clan`='',`clanlevel`=0 WHERE `login`='{$data->login}'");
print <<Je bent uit de clan gestapt |
ENDHTML;
}
else if(isset($_POST['cancel'])) {
print <<
document.location = "hq.php";
ENDHTML;
}
else {
print << |
ENDHTML;
}
}
else if($_GET['p'] == "delete" && $data->clanlevel == 9) {
print " Delete clan | \n";
if(isset($_POST['delete'])) {
$dbres = mysql_query("SELECT `login` FROM `[users]` WHERE `clan`='{$data->clan}' OR `clan`='{$data->clan}-[recruit]'");
while($member = mysql_fetch_object($dbres))
mysql_query("UPDATE `[users]` SET `clan`='',`clanlevel`=0 WHERE `clan`='{$data->clan}' OR `clan`='{$data->clan}-[recruit]'");
mysql_query("DELETE FROM `[clans]` WHERE `name`='{$data->clan}'");
$data->clan = "";
$data->clanlevel = 0;
print <<De clan is opgeheven |
ENDHTML;
}
else if(isset($_POST['cancel'])) {
print <<
document.location = "hq.php";
ENDHTML;
}
else {
print << |
ENDHTML;
}
}
/* ------------------------- */ ?>
|