<?php
ob_start();
include("config.php");
	if(! check_login()) { 
	exit;
	}

$dbres	=	mysql_query("SELECT *,UNIX_TIMESTAMP(`gevangenis`) AS `gevangenis`,0 FROM `gebruiker` WHERE `login`='{$data->login}'");
$data	=	mysql_fetch_object($dbres);

	if($data->gevangenis + $data->gevangenistijd > time()){
	header("Location: netwerken-gevangenis.php"); 
	exit;
	}

?>

<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>
<table align="center" width="600">
	<tr> 
		<td align="center" class="subTitle" colspan="5"><b>Netwerk lijst</b></td>
	</tr>
	<tr>
		<td align="center" class="subTitle"><b>Naam:</b></td>
		<td align="center" class="subTitle"><b>Leader:</b></td>
		<td align="center" class="subTitle"><b>Land:</b></td>
		<td align="center" class="subTitle"><b>Grond:</b></td>
		<td align="center" class="subTitle"><b>Leden:</b></td>
	</tr>

<?php

$dbres = mysql_query("SELECT * FROM `familie` ORDER BY `oppervlakte` DESC");
	while($select = mysql_fetch_object($dbres)){
	$dbres2		=	mysql_query("SELECT * FROM `gebruiker` WHERE `familie`='{$select->naam}'");
	$members	=	mysql_num_rows($dbres2);

?>

	<tr>
		<td class="mainTxt" align="center"><a href="famprofiel.php?x=<?php echo $select->naam; ?>"><?php echo $select->naam; ?></a></td>
		<td class="mainTxt" align="center"><a href="speler-profiel.php?x=<?php echo $select->leader; ?>" target="content"><?php echo $select->leader; ?></a></td>
		<td class="mainTxt" align="center"><?php echo $select->land; ?></td>
		<td class="mainTxt" align="center"><?php echo $select->oppervlakte; ?> mē</td>
		<td class="mainTxt" align="center"><?php echo $members; ?></td>
	</tr>

<?php

	}

?>

	<tr>
		<td class="subtitle" colspan="5">&nbsp;</td>
	</tr>
</table>
</body>
</html>