<?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 - Grand Theft Auto</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 *,UNIX_TIMESTAMP(`wachttijd_autostelen`) AS `wachttijd_autostelen`,0 FROM `gebruiker` WHERE `login`='{$data->login}'");
$data             = mysql_fetch_object($dbres);

	if($data->wachttijd_autostelen + 240 > time()){

	$totaal		=	$data->wachttijd_autostelen + 240 - time() - 3600;
	$tijd		=	date("i:s", "$totaal");

	echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Grand Theft Auto</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_comment.jpg\"></td><td><span class=\"header_rood\">Je moet nog wachten...</span><br>De Grote Raad is nog bezig met het regelen van nieuwe identiteitpapieren en afhandelen van vorige zaken.<br />Als je slim bent ga je ondertussen wat anders nuttigs doen!<br /><br /><i>Over $tijd seconden hebben we weer iets voor je!</i></td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

	} else if(isset($_POST['submit'])){

		if($data->rank == "Junkie"){  
		$rankvordering	=	500;
		$gevangenis	=	20;
		$pr2a		=	rand(5,15);
		} else if($data->rank == "Straatrat"){ 
 		$rankvordering	=	400;
		$gevangenis	=	40;
		$pr2a		=	rand(5,15);
		} else if($data->rank == "Dief"){ 
		$rankvordering	=	300;
		$gevangenis	=	60;
		$pr2a		=	rand(10,15);
		} else if($data->rank == "Wietkweker"){
		$rankvordering	=	200;
		$gevangenis	=	70;
		$pr2a		=	rand(10,15);
		} else if($data->rank == "Drugsdealer"){ 
		$rankvordering	=	100;
		$gevangenis	=	80;
		$pr2a		=	rand(10,20);
		} else if($data->rank == "Gangster") { 
		$rankvordering	=	75;
		$gevangenis	=	100;
		$pr2a		=	rand(10,20);
		} else if($data->rank == "Handelaar"){ 
		$rankvordering	=	50;
		$gevangenis	=	120;
		$pr2a		=	rand(10,25);
		} else if($data->rank == "Arbeider"){ 
		$rankvordering	=	40;
		$gevangenis	=	140;
		$pr2a		=	rand(10,25);
		} else if($data->rank == "Manager"){ 
		$rankvordering	=	30;
		$gevangenis	=	160;
		$pr2a		=	rand(15,25);
		} else if($data->rank == "Baas Stadsnetwerk"){  
 		$rankvordering	=	20;
		$gevangenis	=	180;
		$pr2a		=	rand(15,25);
		} else if($data->rank == "Huurmoordenaar"){ 
		$rankvordering	=	15;
		$gevangenis	=	200;
		$pr2a		=	rand(20,30);
		} else if($data->rank == "Nationaal crimineel"){  
		$rankvordering	=	10;
		$gevangenis	=	250;
		$pr2a		=	rand(20,30);
		} else if($data->rank == "Internationaal Crimineel"){ 
 		$rankvordering	=	5;
		$gevangenis	=	300;
		$pr2a		=	rand(20,35);
		} else if($data->rank == "Lid Grote Raad"){  
		$rankvordering	=	0;
		$gevangenis	=	350;
		$pr2a		=	rand(20,35);
		}

	$pr1a	=	rand(-1,3);

	$pr1b	=	$data->autostelen_kans1+$pr1a;
	$pr2b	=	$pr2a;

		if($pr1b > 100){
		$pra	=	100;
		} else if($pr1b < 1){
		$pra	=	0;
		} else {
		$pra	=	$pr1b;
		}

		if($pr2b > 100){
		$prb	=	100;
		} else if($pr2b < 1){
		$prb	=	0;
		} else {
		$prb	=	$pr2b;
		}

	mysql_query("UPDATE `gebruiker` SET `autostelen_kans1`='$pra',`autostelen_kans2`='$prb',`autostelen`=`autostelen`+'1' WHERE `login`='{$data->login}'");

		if($_POST['auto'] == 1){
		$getal1		=	rand(1,1000);
		$getal2		=	((100-$data->autostelen_kans1)/6)*10;
		$getal3		=	$data->autostelen_kans1*10;
		$getal4		=	round($getal3+$getal2);
		$getal5		=	round($getal4+$getal2);
		$getal6		=	round($getal5+$getal2);
		$getal7		=	round($getal6+$getal2);
		$getal8		=	round($getal7+$getal2);
		$getal9		=	round($getal8+$getal2);

			if($data->rank == "Junkie" || $data->rank == "Straatrat" || $data->rank == "Dief"){
			$getal		=	mt_rand(1,160);
			} else if($data->rank == "Wietkweker" || $data->rank == "Drugsdealer"){
			$getal		=	mt_rand(1,199);
			} else {
			$getal		=	mt_rand(1,200);
			}
		

			if($getal < 161){
			$dbres		=	mysql_query("SELECT * FROM `auto_soorten1`"); 
			$rand		=	mysql_num_rows($dbres); 
			$getal		=	rand(1,$rand); 
			$dbres		=	mysql_query("SELECT * FROM `auto_soorten1` WHERE `id`='$getal'"); 
			$auto		=	mysql_fetch_object($dbres);
			} else if($getal > 160 && $getal < 200){
			$dbres		=	mysql_query("SELECT * FROM `auto_soorten2`"); 
			$rand		=	mysql_num_rows($dbres); 
			$getal		=	rand(1,$rand); 
			$dbres		=	mysql_query("SELECT * FROM `auto_soorten2` WHERE `id`='$getal'"); 
			$auto		=	mysql_fetch_object($dbres);
			} else if($getal == 200){
			$getal		=	rand(1,10);

				if($getal < 7){
				$dbres		=	mysql_query("SELECT * FROM `auto_soorten3` WHERE `id`='1'"); 
				$auto		=	mysql_fetch_object($dbres);
				} else if($getal > 6 && $getal < 10){
				$dbres		=	mysql_query("SELECT * FROM `auto_soorten3` WHERE `id`='2'"); 
				$auto		=	mysql_fetch_object($dbres);
				} else if($getal == 10){
				$dbres		=	mysql_query("SELECT * FROM `auto_soorten3` WHERE `id`='3'"); 
				$auto		=	mysql_fetch_object($dbres);
				}
			}

		$schade		=	rand(1,100);
		$waarde		=	($auto->waarde/100)*(100-$schade);

			if($auto->waarde < 500){
			$waarde		=	500;
			} else {
			$waarde		=	$waarde;
			}


			if($getal1 > 0 && $getal1 <= $getal3){
			$g		=	2;

?>

<table align="center" width="600">
	<tr>
		<td class="subTitle" colspan="2">
		<b>Ultimatecrime - Grand Theft Auto</b>
		</td>
	</tr>
	<tr>
		<td align="center" colspan="2">
		<img src="images/autos/1_<?php echo $auto->naam; ?>.jpg" border="0">
		</td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>
	<tr>
		<td class="maintxt" colspan="2" width="600">
		<span class="tekstheader">Je hebt met succes een auto gejat!</span>
		</td>
	</tr>
	<tr>
		<td width=300 class="mainTxts">Model</td>
		<td class="mainTxts" width="300"><?php echo $auto->naam; ?></td>
	</tr>
	<tr>
		<td width=300 class="mainTxts">Topsnelheid</td>
		<td class="mainTxts" width="300"><?php echo $auto->snelheid; ?> km/h</td>
	</tr>
	<tr>
		<td width=300 class="mainTxts">Huidige waarde</td>
		<td class="mainTxts" width="300">&euro;<?php echo geld($waarde); ?></td>
	</tr>
	<tr>
		<td width=300 class="mainTxts">Schade</td>
		<td class="mainTxts" width="300"><?php echo $schade; ?>%</td>
	</tr>
	<tr>
		<td width=300 class="mainTxts">PK's</td>
		<td class="mainTxts" width="300"><?php echo $auto->pk; ?></td>
	</tr>
	<tr>
		<td width=300 class="mainTxts">Massa in KG's</td>
		<td class="mainTxts" width="300"><?php echo $auto->massa; ?></td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>
</table>

<?php
			} else if($getal1 > $getal3 && $getal1 <= $getal4){
			$g		=	1;
			$bericht1	=	"<span class=\"header_rood\">Het ging niet goed!</span>";
			$bericht2	=	"De smeris heeft je gespot";
			echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Misdaden</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>$bericht1<br>$bericht2</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
			} else if($getal1 > $getal4 && $getal1 <= $getal5){
			$g		=	0;
			$bericht1	=	"<span class=\"header_rood\">Poging mislukt!</span>";
			$bericht2	=	"Toen je de ruit had open geslagen zag je een vrijend kopeltje op de achterbank, Gelukkig achtervolgden ze je niet";
			echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Misdaden</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>$bericht1<br>$bericht2</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
			} else if($getal1 > $getal5 && $getal1 <= $getal6){
			$g		=	0;
			$bericht1	=	"<span class=\"header_rood\">Poging mislukt!</span>";
			$bericht2	=	"Je kreeg het slot niet open";
			echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Misdaden</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>$bericht1<br>$bericht2</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
			} else if($getal1 > $getal6 && $getal1 <= $getal7){
			$g		=	0;
			$bericht1	=	"<span class=\"header_rood\">Poging mislukt!</span>";
			$bericht2	=	"Er werd alarm geslagen je kon nog net optijd wegkomen, Helaas moest je de auto wel achterlaten";
			echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Misdaden</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>$bericht1<br>$bericht2</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
			} else if($getal1 > $getal7 && $getal1 <= $getal8){
			$g		=	0;
			$bericht1	=	"<span class=\"header_rood\">Poging mislukt!</span>";
			$bericht2	=	"Er waren teveel mensen op plaats delict";
			echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Misdaden</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>$bericht1<br>$bericht2</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
			} else if($getal1 > $getal8 && $getal1 <= $getal9){
			$g		=	0;
			$bericht1	=	"<span class=\"header_rood\">Poging mislukt!</span>";
			$bericht2	=	"Probeer voortaan niet tegen een paaltje aan te rijden!";
			echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Misdaden</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>$bericht1<br>$bericht2</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
			}

			if($g == 0){
			mysql_query("UPDATE `gebruiker` SET `rankvordering`=`rankvordering`+'$rankvordering',`wachttijd_autostelen`=NOW() WHERE `login`='{$data->login}'");
			} else if($g == 1){
			mysql_query("UPDATE `gebruiker` SET `gevangenistijd`='$gevangenis',`gevangenis`=NOW(),`wachttijd_autostelen`=NOW() WHERE `login`='{$data->login}'");
			} else if($g == 2){
			mysql_query("INSERT INTO `autos`(`owner`,`schade`,`naam`,`snelheid`,`waarde`,`pk`,`massa`,`land`) VALUES('{$data->login}','$schade','{$auto->naam}','{$auto->snelheid}','$waarde','{$auto->pk}','{$auto->massa}','{$data->land}')");
			mysql_query("UPDATE `gebruiker` SET `rankvordering`=`rankvordering`+'$rankvordering',`wachttijd_autostelen`=NOW() WHERE `login`='{$data->login}'");
			}


		} else if($_POST['auto'] == 2){

			$getal1		=	mt_rand(1,1000);
			$getal2		=	((100-$data->autostelen_kans2)/6)*10;
			$getal3		=	$data->autostelen_kans2*10;
			$getal4		=	round($getal3+$getal2);
			$getal5		=	round($getal4+$getal2);
			$getal6		=	round($getal5+$getal2);
			$getal7		=	round($getal6+$getal2);
			$getal8		=	round($getal7+$getal2);
			$getal9		=	round($getal8+$getal2);
			$dbres		=	mysql_query("SELECT * FROM `autos`") or die(mysql_error());
			$aantal		=	mysql_num_rows($dbres);
			$rij		=	mt_rand(1,$aantal);
			$dbres		=	mysql_query("SELECT * FROM `autos` LIMIT $rij,1") or die(mysql_error());
			$def		=	mysql_fetch_object($dbres);

				if($def->owner == $data->login || $def->alarm == 1){

				$rij	=	mt_rand(1,$aantal);
				$dbres	=	mysql_query("SELECT * FROM `autos` LIMIT $rij,1") or die(mysql_error());
				$def	=	mysql_fetch_object($dbres);

					if($def->owner == $data->login || $def->alarm == 1){

					$rij	=	mt_rand(1,$aantal);
					$dbres	=	mysql_query("SELECT * FROM `autos` LIMIT $rij,1") or die(mysql_error());
					$def	=	mysql_fetch_object($dbres);

						if($def->owner == $data->login || $def->alarm == 1){

						$rij	=	mt_rand(1,$aantal);
						$dbres	=	mysql_query("SELECT * FROM `autos` LIMIT $rij,1") or die(mysql_error());
						$def	=	mysql_fetch_object($dbres);

							if($def->owner == $data->login || $def->alarm == 1){

							$rij	=	mt_rand(1,$aantal);
							$dbres	=	mysql_query("SELECT * FROM `autos` LIMIT $rij,1") or die(mysql_error());
							$def	=	mysql_fetch_object($dbres);

								if($def->owner == $data->login || $def->alarm == 1){
	
								$rij	=	mt_rand(1,$aantal);
								$dbres	=	mysql_query("SELECT * FROM `autos` LIMIT $rij,1") or die(mysql_error());
								$def	=	mysql_fetch_object($dbres);

									if($def->owner == $data->login || $def->alarm == 1){

									$rij	=	mt_rand(1,$aantal);
									$dbres	=	mysql_query("SELECT * FROM `autos` LIMIT $rij,1") or die(mysql_error());
									$def	=	mysql_fetch_object($dbres);

									}
								}
							}
						}

					}

				}


		$waarde		=	geld($def->waarde);

			if($getal1 > 0 && $getal1 <= $getal3){
			$g		=	2;
?>

<table align="center" width="600">
	<tr>
		<td class="subTitle" colspan="2">
		<b>Ultimatecrime - Grand Theft Auto</b>
		</td>
	</tr>
	<tr>
		<td align="center" colspan="2">
		<img src="images/autos/1_<?php echo $def->naam; ?>.jpg" border="0">
		</td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>
	<tr>
		<td class="maintxt" colspan="2" width="600">
		<span class="tekstheader">Je hebt met succes een auto gejat van <a href="speler-profiel.php?x=<?php echo $def->owner;?>"><?php echo $def->owner;?></a>!</span>
		</td>
	</tr>
	<tr>
		<td width=300 class="mainTxts">Model</td>
		<td class="mainTxts" width="300"><?php echo $def->naam; ?></td>
	</tr>
	<tr>
		<td width=300 class="mainTxts">Topsnelheid</td>
		<td class="mainTxts" width="300"><?php echo $def->snelheid; ?> km/h</td>
	</tr>
	<tr>
		<td width=300 class="mainTxts">Huidige waarde</td>
		<td class="mainTxts" width="300">&euro;<?php echo $waarde; ?></td>
	</tr>
	<tr>
		<td width=300 class="mainTxts">Schade</td>
		<td class="mainTxts" width="300"><?php echo $def->schade; ?>%</td>
	</tr>
	<tr>
		<td width=300 class="mainTxts">PK's</td>
		<td class="mainTxts" width="300"><?php echo $def->pk; ?></td>
	</tr>
	<tr>
		<td width=300 class="mainTxts">Massa in KG's</td>
		<td class="mainTxts" width="300"><?php echo $def->massa; ?></td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>
</table>

<?php
			} else if($getal1 > $getal3 && $getal1 <= $getal4){
			$g		=	1;
			$bericht1	=	"<span class=\"header_rood\">Het ging niet goed!</span>";
			$bericht2	=	"De smeris heeft je gespot";
			echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Misdaden</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>$bericht1<br>$bericht2</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
			} else if($getal1 > $getal4 && $getal1 <= $getal5){
			$g		=	0;
			$bericht1	=	"<span class=\"header_rood\">Het ging niet goed!</span>";
			$bericht2	=	"Toen je de ruit had open geslagen zag je een vrijend kopeltje op de achterbank, Gelukkig achtervolgden ze je niet";
			echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Misdaden</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>$bericht1<br>$bericht2</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
			} else if($getal1 > $getal5 && $getal1 <= $getal6){
			$g		=	0;
			$bericht1	=	"<span class=\"header_rood\">Het ging niet goed!</span>";
			$bericht2	=	"Je kreeg het slot niet open";
			echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Misdaden</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>$bericht1<br>$bericht2</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
			} else if($getal1 > $getal6 && $getal1 <= $getal7){
			$g		=	0;
			$bericht1	=	"<span class=\"header_rood\">Het ging niet goed!</span>";
			$bericht2	=	"Er werd alarm geslagen je kon nog net optijd wegkomen, Helaas moest je de auto wel achterlaten";
			echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Misdaden</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>$bericht1<br>$bericht2</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
			} else if($getal1 > $getal7 && $getal1 <= $getal8){
			$g		=	0;
			$bericht1	=	"<span class=\"header_rood\">Het ging niet goed!</span>";
			$bericht2	=	"Er waren teveel mensen op plaats delict";
			echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Misdaden</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>$bericht1<br>$bericht2</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
			} else if($getal1 > $getal8 && $getal1 <= $getal9){
			$g		=	0;
			$bericht1	=	"<span class=\"header_rood\">Het ging niet goed!</span>";
			$bericht2	=	"Probeer voortaan niet tegen een paaltje aan te rijden!";
			echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\" colspan=\"3\"><b>Ultimatecrime - Misdaden</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>$bericht1<br>$bericht2</td></tr></td></tr></table></td></tr><tr><td class=\"subtitle\" colspan=\"3\">&nbsp;</td></tr></table>";
			}

			if($g == 0){
			mysql_query("UPDATE `gebruiker` SET `rankvordering`=`rankvordering`+'$rankvordering',`wachttijd_autostelen`=NOW() WHERE `login`='{$data->login}'");
			} else if($g == 1){
			mysql_query("UPDATE `gebruiker` SET `gevangenistijd`='$gevangenis',`gevangenis`=NOW(),`wachttijd_autostelen`=NOW() WHERE `login`='{$data->login}'");
			} else if($g == 2){
			mysql_query("INSERT INTO `autos`(`owner`,`schade`,`naam`,`snelheid`,`waarde`,`pk`,`massa`,`land`) VALUES('{$data->login}','{$def->schade}','{$def->naam}','{$def->snelheid}','{$def->waarde}','{$def->pk}','{$def->massa}','{$def->land}')");
			mysql_query("UPDATE `gebruiker` SET `rankvordering`=`rankvordering`+'$rankvordering',`wachttijd_autostelen`=NOW() WHERE `login`='{$data->login}'");
			mysql_query("INSERT INTO `berichten`(`tijd`,`ip`,`van`,`naar`,`titel`,`bericht`) VALUES(NOW(),'{$_SERVER['REMOTE_ADDR']}','Ultimatecrime','{$def->owner}','Autodiefstal','{$data->login} heeft een {$def->naam} van jou gestolen.')");
			}
		}

	} else {

?>

<form method="post" onsubmit="return submitForm(this.submit);">
<table align="center" width="600">
	<tr>
		<td class="subTitle" colspan="2">
		<b>Ultimatecrime - Grand Theft Auto</b>
		</td>
	</tr>
	<tr>
		<td align="center" colspan="2">
		<a href="auto-showroom.php"><img src="images/ingame/gta_banner.jpg" border="0" alt="Klik hier om alle 'beschikbare' auto's in Ultimatecrime  te bekijken!"></a></td></tr><tr><td class="subTitle" colspan="2">&nbsp;
		</td>
	</tr>
	<tr>
		<td class="mainTxt" width="600" colspan="2">
		<span class="tekstheader">Grand Theft Auto</span><br>Het jatten en vervolgens verkopen van auto's levert veel geld op. Bovendien kan je met de auto's opdrachten doen en tegen andere criminelen racen.<br>
		</td>
	</tr>
	<tr>
		<td class="mainTxt" width="300">Jat auto van de straat</td>
		<td class="mainTxt" width="300"><input type="radio" value="1" class="form_radio" name="auto"> <?php echo $data->autostelen_kans1;?>% kans op succes</td>
	</tr>
	<tr>
		<td class="mainTxt" width="300">Jat auto van een andere crimineel</td>
		<td class="mainTxt" width="300"><input type="radio" class="form_radio" value="2" name="auto"> <?php echo $data->autostelen_kans2;?>% kans op succes</td>
	</tr>
	<tr>
		<td class="mainTxt" width="300">Auto gevonden</td>
		<td class="mainTxt" width="300"><input type="submit" name="submit" value="Jat hem!" style="width: 100;"></td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>
</table>
</form>

<?php

	}

?>

</body>
</html>
	