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

$procent1a	=	round($data->health, 1);
$procent1b	=	round(100-$data->health, 1);
$procent2a	=	round($data->rankvordering/100);
$procent2b	=	round(100-$data->rankvordering/100);
$procent3a	=	round($data->schiet_ervaring/10);
$procent3b	=	round(100-$data->schiet_ervaring/10);
$procent4a	=	$data->uitbrakenkans;
$procent4b	=	100-$data->uitbrakenkans;


	if($data->level == 1){
	$titel =	"Normaal Crimineel";
	} else if($data->level == 2){
	$titel =	"VIP Crimineel";
	} else if($data->level == 3){
	$dbres	=	mysql_query("SELECT `level` FROM `admin` WHERE `login`='{$data->login}'");
	$admin	=	mysql_fetch_object($dbres);
		if($admin->level == 3){
		$titel		=	"Webmaster";
		} else if($admin->level == 2){
		$titel		=	"Game Master";
		} else if($admin->level == 1){
		$titel		=	"Moderator";
		}
	}

	if($data->erfgenaam != ""){
	$erfgenaam	=	"<a href=\"speler-profiel.php?x={$data->erfgenaam}\" target=\"content\"><b>{$data->erfgenaam}</b></a>";
	} else {
	$erfgenaam	=	"<a href=\"speler-instellingen.php\" target=\"content\"><font color=\"red\"><b>Geen testament!</b></font></a>";
	}

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

	if($member->memberdays+60*60*24*$member->dagen > time()){
	$tijd		=	$member->memberdays+(60*60*24*$member->dagen)-time()-3600;
	$totaal		=	date("z", "$tijd");
	$mdagen		=	$totaal;
	} else {
	$mdagen		=	0;
	}

$dbres			=	mysql_query("SELECT `id` FROM `berichten` WHERE `naar`='{$data->login}' AND `delete1`!='1'");
$inbox1			=	mysql_num_rows($dbres);
$dbres			=	mysql_query("SELECT `id` FROM `berichten` WHERE `naar`='{$data->login}' AND `read`='0' AND `delete1`!='1'");
$inbox2			=	mysql_num_rows($dbres);

	if($data->blood == 1){
	$bloed	=	"A";	
	} else if($data->blood == 2){
	$bloed	=	"B";
	} else if($data->blood == 3){
	$bloed	=	"AB";
	} else if($data->blood == 4){
	$bloed	=	"O";
	}

	if($data->rank == "Junkie" || $data->rank == "Straatrat" || $data->rank == "Dief" || $data->rank == "Wietkweker" || $data->rank == "Drugsdealer" || $data->rank == "Gangster" || $data->rank == "Handelaar"){
	$huwelijk	=	"Minderjarig";
	} else if($data->huwelijk != ""){
	$huwelijk	=	"Getrouwd met $data->huwelijk";
	} else {
	$huwelijk	=	"Vrijgezel";
	}

?>

<html>
<head>
<title>Ultimatecrime - Statistieken</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" colspan="2"><b>Statistieken van <?php echo $data->login; ?></b></td>
	</tr>
	<tr>
		<td width="300" align="center" class="mainTxt"><a href="speler-status-bezittingen.php" target="content"><strong>Bezittingen</strong></a></td>
		<td width="300" align="center" class="mainTxt"><a href="speler-status-wachttijden.php" target="content"><strong>Wachttijden</strong></a></td>
	</tr>
</table>
<br>
<table align="center" width="600">
	<tr>
		<td class="subTitle" colspan="4"><b>Ultimatecrime - Statistieken van <?php echo $data->login; ?></b></td>
	</tr>
	<tr>
		<td class="subTitle" width="300" colspan="2"><b>Vorderingen in je loopbaan</b></td>
		<td colspan="2" align="center" width="300" class="subTitle"><b>Werkervaring</b></td>
	</tr>
	<tr>
		<td class="mainTxtS" width="175">Rangvordering</td>
		<td class="mainTxtS" width="125" align="center"><table border=1 borderColor="black" height="10" cellSpacing="0" cellPadding="0" rules="cols" width="100" border="1"><tr><td align="middle" width="<?php echo $procent2a; ?>" bgColor="orange" height="15"><?php if($data->rankvordering > 5000){ echo "<font color=\"black\">" . round($data->rankvordering/100, 2) . "%</font>"; } ?></td><td align="middle" width="<?php echo $procent2b; ?>" bgColor="red"><?php if($data->rankvordering <= 5000){ echo "<font color=\"black\">" . round($data->rankvordering/100, 2) . "%</font>"; } ?></td></tr></table></td>
		<td align="left" width="200" class="mainTxtS">Jail uitbraken</td>
		<td align="center" width="100" class="mainTxtS"><?php echo $data->uitbraken; ?></td>
	</tr>
	<tr>
		<td class="mainTxtS" width="175">Gezondheid</td>
		<td class="mainTxtS" width="125" align="center"><table border=1 borderColor="black" height="10" cellSpacing="0" cellPadding="0" rules="cols" width="100" border="1"><tr><td align="middle" width="<?php echo $procent1a; ?>" bgColor="green" height="15"><?php if($data->health > 50){ echo "<font color=\"black\">{$data->health}%</font>"; } ?></td><td align="middle" width="<?php echo $procent1b; ?>" bgColor="red"><?php if($data->health <= 50){ echo "<font color=\"black\">{$data->health}%</font>"; } ?></td></tr></table></td>
		<td align="left" width="200" class="mainTxtS">Misdaden</td>
		<td align="center" width="100" class="mainTxtS"><?php echo $data->misdaden; ?></td>
	</tr>
	<tr>
		<td class="mainTxtS" width="175">Schiet experience</td>
		<td class="mainTxtS" width="125" align="center"><table border=1 borderColor="black" height="10" cellSpacing="0" cellPadding="0" rules="cols" width="100" border="1"><tr><td align="middle" width="<?php echo $procent3a; ?>" bgColor="white" height="15"><?php if($data->schiet_ervaring > 500){ echo "<font color=\"black\">" . round($data->schiet_ervaring/10, 1) . "%</font>"; } ?></td><td align="middle" width="<?php echo $procent3b; ?>" bgColor="red"><?php if($data->schiet_ervaring <= 500){ echo "<font color=\"black\">" . round($data->schiet_ervaring/10, 1) . "%</font>"; } ?></td></tr></table></td>
		<td align="left" width="200" class="mainTxtS">Autojat pogingen</td>
		<td align="center" width="100" class="mainTxtS"><?php echo $data->autostelen; ?></td>
	</tr>
	<tr>
		<td class="mainTxtS" width="175">Uitbraak kans</td>
		<td class="mainTxtS" width="125" align="center"><table border=1 borderColor="black" height="10" cellSpacing="0" cellPadding="0" rules="cols" width="100" border="1"><tr><td align="middle" width="<?php echo $procent4a; ?>" bgColor="white" height="15"><?php if($data->uitbrakenkans > 50){ echo "<font color=\"black\">{$data->uitbrakenkans}%</font>"; } ?></td><td align="middle" width="<?php echo $procent4b; ?>" bgColor="red"><?php if($data->uitbrakenkans <= 50){ echo "<font color=\"black\">{$data->uitbrakenkans}%</font>"; } ?></td></tr></table></td>
		<td align="left" width="200" class="mainTxtS">Route 66 overvallen</td>
		<td align="center" width="100" class="mainTxtS"><?php echo $data->heist; ?></td>
	</tr>
	<tr>
		<td class="mainTxtS" width="175">Gekillde criminelen</td>
		<td class="mainTxtS" width="125" align="center"><?php echo $data->gekilled; ?></td>
		<td align="left" width="200" class="mainTxtS">Georganiseerde misdaden</td>
		<td align="center" width="100" class="mainTxtS"><?php echo $data->gmisdaad; ?></td>
	</tr>
	<tr>
		<td class="mainTxtS" width="175">Huwelijk</td>
		<td class="mainTxtS" width="125" align="center"><?php echo $huwelijk; ?></td>
		<td align="left" width="200" class="mainTxtS">Bloedgroep</td>
		<td align="center" width="100" class="mainTxtS"><?php echo $bloed; ?></td>
	</tr>
	<tr>
		<td class="mainTxtS" width="175">Ammo Clips</td>
		<td class="mainTxtS" width="125" align="center"><?php echo $data->kogels; ?></td>
		<td align="left" width="200" class="mainTxtS">Forum posts</td>
		<td align="center" width="100" class="mainTxtS"><?php echo $data->posts; ?></td>
	</tr>
	<tr>
		<td colspan="4" class="subtitle">&nbsp;</td>
	</tr>
</table>
<br />
<table align="center" width="600">
	<tr>
		<td class="subTitle" colspan="4"><b>Persoonsgegevens</b></td>
	</tr>

	<tr>
		<td align="left" class="mainTxtS" width="100">Rang</td>
		<td align="left" class="mainTxtS" width="200"><?php echo $data->rank;?></td>
		<td align="left" class="mainTxtS" width="00">Geslacht</td>
		<td align="left" class="mainTxtS" width="200"><?php echo $data->sex;?></td>
	</tr>
	<tr>
		<td align="left" class="mainTxtS" width="100">Respect</td>
		<td align="left" class="mainTxtS" width="200"><?php echo $data->respect;?></td>
		<td align="left" class="mainTxtS" width="100">Startdatum</td>
		<td align="left" class="mainTxtS" width="200"><?php echo $data->signup;?></td>
	</tr>
	<tr>
		<td align="left" class="mainTxtS" width="100">Titel</td>
		<td align="left" class="mainTxtS" width="200"><?php echo $titel;?></td>
		<td align="left" class="mainTxtS" width="100">Sofinummer</td>
		<td align="left" class="mainTxtS" width="200"><?php echo $data->id;?></td>
	</tr>
	<tr>
		<td align="left" class="mainTxtS" width="100">Woonplaats</td>
		<td align="left" class="mainTxtS" width="200"><?php echo $data->land;?></td>
		<td align="left" class="mainTxtS" width="100">Erfgenaam</td>
		<td align="left" class="mainTxtS" width="200"><?php echo $erfgenaam;?></td>
	</tr>
	<tr>
		<td align="left" class="mainTxtS" width="100">Email</td>
		<td align="left" class="mainTxtS" width="200"><?php echo $data->email;?></td>
		<td align="left" class="mainTxtS" width="100">IP-adres</td>
		<td align="left" class="mainTxtS" width="200"><?php echo $data->ip;?></td>
	</tr>
	<tr>
		<td align="left" class="mainTxtS" width="100">VIP dagen</td>
		<td align="left" class="mainTxtS" width="200"><?php echo $mdagen;?></td>
		<td align="left" class="mainTxtS" width="100">Berichten</td>
		<td align="left" class="mainTxtS" width="200"><?php echo $inbox2;?>/<?php echo $inbox1;?></td>
	</tr>
	<tr>
		<td colspan="4" class="subtitle">&nbsp;</td>
	</tr>
</table>
</body>
</html>