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

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

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

?>

<html>
<head>
<title>Ultimatecrime</title>
<link rel="stylesheet" type="text/css" href="style_general.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Ultimatecrime is een gratis online multiplayer spel! Ontwikkel je eigen crimineel door verschillende criminele activiteiten te doen! Speel met duizenden andere criminelen en wordt nummer 1!">
<meta name="keywords" content="world, gangster, criminal, mafia, games, game, multiplayer, rpg, mmorpg, online game, online multiplayer">
<meta name="Robots" CONTENT="follow">
<meta name="REVISIT-AFTER" CONTENT="7 days">
</head>
<body background="layout/images/layout_12.gif" bgproperties="fixed">
<br>
<br>
<br>
<table align="center" width="600">
	<tr>
		<td class="subTitle"><b>Laatste 10 van jou</b></td>
	</tr>
 	<tr>
		<td><table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td class="subTitle" style="letter-spacing: normal;" align="center" width="25%"><b>Datum</b></td>
				<td class="subTitle" style="letter-spacing: normal;" align="center" width="20%"><b>Naar</b></a></td>
				<td class="subTitle" style="letter-spacing: normal;" align="center" width="15%"><b>Aantal</td>
				<td class="subTitle" style="letter-spacing: normal;" align="center" width="40%"><b>Bericht</b></td>
			</tr>
		</table></td>
	</tr>

<?php

$dbres				= mysql_query("SELECT `naar`,`aantal`,`bericht`,DATE_FORMAT(`tijd`,'%d-%m-%Y %H:%i') AS `tijd` FROM `eerpunten` WHERE `van`='{$data->login}' ORDER BY `tijd` DESC LIMIT 0,10");

	while($info = mysql_fetch_object($dbres)){
		if($info->bericht == ""){
		$bericht	=	"&nbsp;";
		} else {
		$bericht	=	$info->bericht;
		}
?>

	<tr>
		<td><table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td class="maintxt" style="letter-spacing: normal;" align="center" width="25%"><b><?php echo $info->tijd; ?></b></td>
				<td class="maintxt" style="letter-spacing: normal;" align="center" width="20%"><b><a href="speler-profiel.php?x=<?php echo $info->naar; ?>"><?php echo $info->naar; ?></a></b></a></td>
				<td class="maintxt" style="letter-spacing: normal;" align="center" width="15%"><b><?php echo $info->aantal; ?></td>
				<td class="maintxt" style="letter-spacing: normal;" align="center" width="40%"><b><?php echo $bericht; ?></b></td>
			</tr>
		</table></td>
	</tr>

<?php

	}

?>

	<tr>
		<td><br></td>
	</tr>
	<tr>
		<td><br></td>
	</tr>
	<tr>
		<td class="subTitle"><b>Laatste 10 voor jou</b></td>
	</tr>
 	<tr>
		<td><table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td class="subTitle" style="letter-spacing: normal;" align="center" width="25%"><b>Datum</b></td>
				<td class="subTitle" style="letter-spacing: normal;" align="center" width="20%"><b>Van</b></a></td>
				<td class="subTitle" style="letter-spacing: normal;" align="center" width="15%"><b>Aantal</td>
				<td class="subTitle" style="letter-spacing: normal;" align="center" width="40%"><b>Bericht</b></td>
			</tr>
		</table></td>
	</tr>

<?php

$dbres				= mysql_query("SELECT `van`,`aantal`,`bericht`,DATE_FORMAT(`tijd`,'%d-%m-%Y %H:%i') AS `tijd` FROM `eerpunten` WHERE `naar`='{$data->login}' ORDER BY `tijd` DESC LIMIT 0,10");

	while($info = mysql_fetch_object($dbres)){
		if($info->bericht == ""){
		$bericht	=	"&nbsp;";
		} else {
		$bericht	=	$info->bericht;
		}
?>

	<tr>
		<td><table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td class="maintxt" style="letter-spacing: normal;" align="center" width="25%"><b><?php echo $info->tijd; ?></b></td>
				<td class="maintxt" style="letter-spacing: normal;" align="center" width="20%"><b><a href="speler-profiel.php?x=<?php echo $info->van; ?>"><?php echo $info->van; ?></a></b></a></td>
				<td class="maintxt" style="letter-spacing: normal;" align="center" width="15%"><b><?php echo $info->aantal; ?></td>
				<td class="maintxt" style="letter-spacing: normal;" align="center" width="40%"><b><?php echo $bericht; ?></b></td>
			</tr>
		</table></td>
	</tr>

<?php

	}

?>

</table>
</body>
</html>