<?php
ob_start();
include("config.php");

?>

<html>
<head>
<title>Ultimatecrime</title>
<link rel="stylesheet" type="text/css" href="style_general.css">
</head>
<body background="layout/images/layout_12.gif" bgproperties="fixed">
<br>
<br>
<br>

<?php

$dbres 		=	mysql_query("SELECT * FROM `familie` WHERE `naam`='{$data->familie}'");
$netwerk 	=	mysql_fetch_object($dbres);
$dbres 		=	mysql_query("SELECT * FROM `gebruiker` WHERE `familie`='{$netwerk->naam}'");
$members 	=	mysql_num_rows($dbres);
$dbres 		=	mysql_query("SELECT * FROM `gebruiker` WHERE `familie`='{$netwerk->naam}' AND `level`!='1'");
$donateurs 	=	mysql_num_rows($dbres);

$maxmembers	=	$netwerk->huizen*5;

$crush 		=	$netwerk->crush;
$crush		=	preg_replace('/0/',"(Geen crush)",$crush);
$crush		=	preg_replace('/2/',"Medium crush",$crush);
$crush		=	preg_replace('/3/',"Large crush",$crush);
$crush		=	preg_replace('/4/',"Extreme crush",$crush);
$crush		=	preg_replace('/1/',"Small crush",$crush);

$geld		=	$netwerk->promootgeld;
$rank1		=	$geld;
$rank2		=	round(($geld/100)*115);
$rank3		=	round(($geld/100)*130);
$rank4		=	round(($geld/100)*145);
$rank5		=	round(($geld/100)*160);
$rank6		=	round(($geld/100)*175); 
$rank7		=	round(($geld/100)*200);
$rank8		=	round(($geld/100)*230);
$rank9		=	round(($geld/100)*260); 
$rank10		=	round(($geld/100)*290); 
$rank11		=	round(($geld/100)*300);
$rank12		=	round(($geld/100)*315); 

?>

<table align="center" width="600">
	<tr>
		<td class="subTitle">
		<b>Netwerk - <?php echo $netwerk->naam; ?></b>
		</td>
	</tr>
	<tr>
		<td class="mainTxt" align="center">
		<table width="600">
			<tr>
				<td width="300">
				<table width="300">
					<tr>
						<td width="150"><div align="left">Netwerk naam:</div></td>
						<td width="150"><?php echo $netwerk->naam; ?></td>
					</tr>
					<tr>
						<td width="150"><div align="left">Verlaat kosten:</div></td>
						<td width="150">€<?php echo geld($netwerk->leavecost); ?></td>
					</tr>
					<tr>
						<td width="150"><div align="left">Leader:</div></td>
						<td width="150"><b><a href="speler-profiel.php?x=<?php echo $netwerk->leader; ?>" target="content"><font color="gold"><?php echo $netwerk->leader; ?></font></a></b></td>
					</tr>
					<tr>
						<td width="150"><div align="left">Consiglieri:</div></td>
						<td width="150"><b><a href="speler-profiel.php?x=<?php echo $netwerk->consig; ?>" target="content"><font color="gold"><?php echo $netwerk->consig; ?></font></a></b></td>
					</tr>
					<tr>
						<td width="150"><div align="left">Sottocapo:</div></td>
						<td width="150"><b><a href="speler-profiel.php?x=<?php echo $netwerk->sotto; ?>" target="content"><font color="gold"><?php echo $netwerk->sotto; ?></font></a></b></td>
					</tr>
					<tr>
						<td width="150"><div align="left">Netwerk bank:</div></td>
						<td width="150">€<?php echo geld($netwerk->bank); ?></td>
					</tr>
					<tr>
						<td width="150"><div align="left">Crusher:</div></td>
						<td width="150">Type: <?php echo $crush; ?><br>Max. Autos: <?php echo $netwerk->maxautos; ?><br>Autos Nu: <?php echo $netwerk->autos; ?><br>Kogels per Auto: <?php echo $netwerk->kogels; ?></td>
					</tr>
					<tr>
						<td width="150"><div align="left">Land:</div></td>
						<td width="150"><?php echo $netwerk->land; ?></td>
					</tr>
					<tr>
						<td width="150"><div align="left">Maximale leden:</div></td>
						<td width="150"><?php echo $maxmembers; ?></td>
					</tr>
					<tr>
						<td width="150"><div align="left">Leden:</div></td>
						<td width="150"><?php echo $members; ?></td>
					</tr>
					<tr>
						<td width="150"><div align="left">Donerende members:</div></td>
						<td width="150"><?php echo $donateurs; ?>/<?php echo $members; ?></td>
					</tr>
				</table>
				</td>
				<td><img src="<?php echo  $netwerk->image; ?>"></td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td>
		<br>
		</td>
	</tr>
	<tr>
		<td class="subTitle">
		<b>Rank beloningen</b>
		</td>
	</tr>
	<tr>
		<td class="mainTxt">
		<table width="100%">
			<tr>
				<td width="15%">Straatrat:<br>Dief:<br>Wietkweker:<br>Gangster:</td>
				<td width="10%">€<?php echo geld($rank1); ?><br>€<?php echo geld($rank2); ?><br>€<?php echo geld($rank3); ?><br>€<?php echo geld($rank4); ?></td>
				<td width="20%">Handelaar:<br>Arbeider:<br>Manager:<br>Baas Stadsnetwerk:</td>
				<td width="11%">€<?php echo geld($rank5); ?><br>€<?php echo geld($rank6); ?><br>€<?php echo geld($rank7); ?><br>€<?php echo geld($rank8); ?></td>
				<td width="23%">Huurmoordenaar:<br>Nationaal crimineel:<br>Internationaal Crimineel:<br>Lid Grote Raad:</td>
				<td width="11%">€<?php echo geld($rank9); ?><br>€<?php echo geld($rank10); ?><br>€<?php echo geld($rank11); ?><br>€<?php echo geld($rank12); ?></td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td>
		<br>
		</td>
	</tr>

<?php

	if($netwerk->info != ""){

?>

	<tr>
		<td class="subTitle"><b>Netwerk informatie</b></td>
	</tr>
	<tr>
		<td class="mainTxt"><?php echo ubb($netwerk->info); ?></td>
	</tr>

<?php

	} else {

?>

	<tr>
		<td class="subTitle"><b>Netwerk informatie</b></td>
	</tr>
	<tr>
		<td class="mainTxt" align="center">Moet homepage nog instellen!</td>
	</tr>

<?php

	}

?>

	<tr>
		<td>
		<br>
		</td>
	</tr>
	<tr>
		<td class="subTitle">
		<b>Leden van netwerk <?php echo $netwerk->naam; ?></b>
		</td>
	</tr>
	<tr>
		<td class="mainTxt">

<?php

$dbres	=	mysql_query("SELECT `login`,`famleader`,`famsotto`,`famconsig`,UNIX_TIMESTAMP(`online`) AS `online`,0 FROM `gebruiker` WHERE `familie`='{$netwerk->naam}'");

	while($user = mysql_fetch_object($dbres)){

		if($user->famleader == 1){
			if($user->online + 300 > time()){
			echo "<a href=\"speler-profiel.php?x={$user->login}\" target=\"content\"><font color=\"#000000\"><b>{$user->login}</b></font></a> | ";
			} else {
			echo "<a href=\"speler-profiel.php?x={$user->login}\" target=\"content\"><font color=\"#000000\">{$user->login}</font></a> | ";
			}

		} else if($user->famsotto == 1){
			if($user->online + 300 > time()){
			echo "<a href=\"speler-profiel.php?x={$user->login}\" target=\"content\"><font color=\"#00005F\"><b>{$user->login}</b></font></a> | ";
			} else {
			echo "<a href=\"speler-profiel.php?x={$user->login}\" target=\"content\"><font color=\"#00005F\">{$user->login}</font></a> | ";
			}

		} else if($user->famconsig == 1){
			if($user->online + 300 > time()){
			echo "<a href=\"speler-profiel.php?x={$user->login}\" target=\"content\"><font color=\"#00199F\"><b>{$user->login}</b></font></a> | ";
			} else {
			echo "<a href=\"speler-profiel.php?x={$user->login}\" target=\"content\"><font color=\"#00199F\">{$user->login}</font></a> | ";
			}

		} else if($user->online + 300 > time()){
		echo "<a href=\"speler-profiel.php?x={$user->login}\" target=\"content\"><b>{$user->login}</b></a> | ";
		} else {
		echo "<a href=\"speler-profiel.php?x={$user->login}\" target=\"content\">{$user->login}</a> | ";
		}

	}

?>

		</td>
	</tr>
</table>
</body>
</html>