<?php
ob_start();
include("config.php");
	if(! check_login()){
	header("Location: login.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>

<?php

	if(isset($_GET['x'])){

	$dbres	=	mysql_query("SELECT `info`,`sex`,`rank`,`respect`,`login`,`level`,`huwelijk`,`partners`,`cash`,`online`,`avater`,UNIX_TIMESTAMP(`online`) AS `online`,0 FROM `gebruiker` WHERE `login`='{$_GET['x']}'");

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

			if($user->info == ""){
			$hompage	=	"<center>Moet homepage nog instellen!</center>";
			} else {
			$hompage	=	ubb($user->info);
			}

			if($user->avater != ""){
			echo "<div align=\"center\"><img src=\"{$user->avater}\"></div><br />";
			}

			if($user->online + 300 > time()){
			$status		=	"online";
			} else {				
			$status		=	"offline";
			}

			if($user->cash < 50001){
			$geldstatus	=	"Zwerver";
			} else if($user->cash > 49999 && $user->cash < 100001){
			$geldstatus	=	"Sloeber";
			} else if($user->cash > 99999 && $user->cash < 500001){
			$geldstatus	=	"Arm";
			} else if($user->cash > 499999 && $user->cash < 1000001){
			$geldstatus	=	"Modaal";
			} else if($user->cash > 999999 && $user->cash < 25000001){
			$geldstatus	=	"Miljonair";
			} else if($user->cash > 24999999 && $user->cash < 100000001){
			$geldstatus	=	"Multi-miljonair";
			} else if($user->cash > 99999999 && $user->cash < 500000001){
			$geldstatus	=	"Halve miljardair";
			} else if($user->cash > 499999999 && $user->cash < 5000000001){
			$geldstatus	=	"Miljardair";
			} else if($user->cash > 5000000000){
			$geldstatus	=	"Rijksten der aarde!";
			}

			if($user->level == 2){
			$elite		=	"<span class=\"tekstheader\">VIP</span>";
			} else if($user->level == 3){
			$dbres	=	mysql_query("SELECT `level` FROM `admin` WHERE `login`='{$user->login}'");
			$admin	=	mysql_fetch_object($dbres);
				if($admin->level == 3){
				$elite		=	"<span class=\"tekstheader\">Webmaster</span>";
				} else if($admin->level == 2){
				$elite		=	"<span class=\"tekstheader\">Game Master</span>";
				} else if($admin->level == 1){
				$elite		=	"<span class=\"tekstheader\">Moderator</span>";
				}
			} else {
			$elite		=	"Geen elite functie";
			}

			if($user->partners == 0){
			$partners	=	 "Geen partners";
			} else {
			$partners	=	 "{$user->partners} partner(s)";
			}

			if($user->rank == "Junkie" || $user->rank == "Straatrat" || $user->rank == "Dief" || $user->rank == "Wietkweker" || $user->rank == "Drugsdealer" || $user->rank == "Gangster" || $user->rank == "Handelaar"){
			$huwelijk	=	"Minderjarig";
			} else if($user->huwelijk != ""){
			$huwelijk	=	"Getrouwd:<br> $user->login en $user->huwelijk";
			} else {
			$huwelijk	=	"Vrijgezel";
			}

?>

<table align="center" width="600">
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>
	<tr>
		<td width="600" class="mainTxt" align="center"><strong><font size="6" color="#FFFFFF"><?php echo $user->login; ?><?php if($user->level == -2){ echo " - R.I.P."; } else if($user->level == -1){ echo " - Verbannen"; } ?></font></strong></td>
	</tr>
	<tr>
		<td align="center" class="maintxts">
		<table align="center" width="406">
			<tr> 
				<td width="190" align="center"><table align="left" width="160">
					<tr>
						<td width="18"><img src="layout/images/icons/light_vriend.jpg" height="16" width="16" alt="Partner" /></td>
						<td width="142"><a href="speler-partners.php?add=<?php echo $user->login; ?>" target="content">Verzoek als partner</a></td>
					</tr>
				</table></td>
				<td width="200" align="right"><table align="right" width="160">
					<tr>
						<td width="18"><img src="layout/images/icons/light_email.jpg" height="16" width="16" alt="Email" /></td>
						<td width="142"><a href="internet-email.php?p=new&to=<?php echo $user->login; ?>" target="content">Stuur een email</a></td>
					</tr>
				</table></td>
			</tr>
		</table></td>
	</tr>
	<tr>
		<td class="subtitle">&nbsp;</td>
	</tr>
	<tr>
		<td width="600" class="mainTxts"><table width="580">
			<tr>
				<td><table width="580">
					<tr>
						<td><table width="180" align="center">
							<tr>
								<td width="16" align="center"><img src="layout/images/icons/light_kroon.jpg" height="16" width="16" alt="Rang" /></td>
								<td> <a href="algemeen-help.php?item=faq&word=ranks" target="content"><?php echo $user->rank; ?></a></td>
							</tr>
							<tr>
								<td width="16" align="center"><img src="layout/images/icons/light_money.jpg" height="16" width="16" alt="Welvaart" /></td>
								<td> <a href="algemeen-help.php?item=faq&word=wealth" target="content"><?php echo $geldstatus; ?></a></td>
							</tr>
						</table></td>
						<td><table width="140" align="center">
							<tr>
								<td width="16" align="center"><img src="layout/images/icons/light_respect.jpg" height="16" width="16" alt="Respect" /></td>
								<td> <a href="algemeen-help.php?item=faq&word=respect" target="content"><?php echo geld($user->respect); ?> respect</a></td>
							</tr>
							<tr>
								<td width="16" align="center"><img src="layout/images/icons/light_vriend.jpg" height="16" width="16" alt="Partners" /></td>
								<td><?php echo $partners; ?></td>
							</tr>
						</table></td>
						<td><table width="148" align="center">
							<tr>
								<td align="right"><?php echo $huwelijk; ?></td>
								<td width="16" align="center"><img src="layout/images/icons/light_map.jpg" height="16" width="16" alt="Kavel" /></td>
							</tr>
							<tr>
								<td align="right"><?php echo $elite; ?></td>
								<td width="16" align="center"><img src="layout/images/icons/light_world.jpg" height="16" width="16" alt="Elite" /></td>
							</tr>
						</table></td>
						<td><table width="92" align="center">
							<tr>
								<td align="right"><?php echo $user->sex; ?></td>
								<td width="16" align="center"><img src="layout/images/icons/light_zodiac_<?php echo $user->sex; ?>.jpg" height="16" width="16" alt="Geslacht" /></td>
							</tr>
							<tr>
								<td align="right"><?php echo $status; ?></td>
								<td width="16" align="center"><img src="layout/images/icons/light_<?php echo $status; ?>.jpg" height="16" width="16" alt="<?php echo $status; ?>" /></td>
							</tr>
						</table></td>
					</tr>
				</table></td>
				<td>&nbsp;</td>
			</tr>
		</table></td>
	</tr>
	<tr>
		<td class="subtitle">&nbsp;</td>
	</tr>
</table>

<?php

			if($user->level == 2){

?>

<table align="center" width="600">	
	<tr>
		<td align="center"><a href="algemeen-vip.php" target="content"><img src="layout/images/profiel-vip-crimineel.jpg" border="0" alt="Deze persoon geniet van VIP Status in Ultimatecrime!"></a></td>
	</tr>
</table>

<?php

			}

?>

<br>
<table align="center" width="600">
	<tr>
		<td class="subTitle"><b>Homepage</b></td>
	</tr>
	<tr>
		<td class="mainTxt"><?php echo $hompage; ?></td>
	</tr>
</table>

<?php

		} else {
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Profile</b></td></tr><tr><td class=\"mainTxt\" colspan=\"3\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_comment.jpg\" height=\"16\" width=\"16\" alt=\"Opmerking\" /></td><td>Deze gebruiker bestaat niet.</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
		}

	}

?>

</body>
</html>