<?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>

<?php

$dbres		=	mysql_query("SELECT *,UNIX_TIMESTAMP(`wachttijd_heist`) AS `wachttijd_heist`,0 FROM `gebruiker` WHERE `login`='{$data->login}'");
$data		=	mysql_fetch_object($dbres);  
	
	if(isset($_POST['annuleren1'])){

	$dbres		=	mysql_query("SELECT * FROM `heist` WHERE `login1`='{$data->login}'");
	$heist		=	mysql_fetch_object($dbres);
 	$dbres		=	mysql_query("SELECT * FROM `bezittingen` WHERE `naam`='Ammo clips' AND `owner`='{$data->login}'");
	$controlle	=	mysql_num_rows($dbres);
		if($controlle == 0){
		mysql_query("INSERT INTO `bezittingen`(`owner`,`type`,`aantal`,`naam`,`link`) VALUES('{$data->login}','Wapen','{$heist->clips}','Ammo clips','internet-cbay.php')");
		} else {
		mysql_query("UPDATE `bezittingen` SET `aantal`=`aantal`+'{$heist->clips}' WHERE `naam`='Ammo clips' AND `owner`='{$data->login}'");
		}
	mysql_query("UPDATE `gebruiker` SET `bezet2`='0',`kogels`=`kogels`+'{$heist->clips}' WHERE `login`='{$data->login}'");
	mysql_query("UPDATE `gebruiker` SET `bezet2`='0' WHERE `login`='{$heist->login2}'");
	mysql_query("INSERT INTO `berichten`(`tijd`,`ip`,`van`,`naar`,`titel`,`bericht`) VALUES(NOW(),'{$_SERVER['REMOTE_ADDR']}','Ultimatecrime','{$heist->login2}','Route 66','{$data->login} heeft de route 66 overval geanuleert.')");
	mysql_query("DELETE FROM `heist` WHERE `login1`='{$data->login}'") or die(mysql_error());
	echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Je hebt de heist geanuleert.</span></td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";
	exit;
	}


	if(isset($_POST['annuleren2'])){

	$dbres		=	mysql_query("SELECT * FROM `heist` WHERE `login2`='{$data->login}'");
	$heist		=	mysql_fetch_object($dbres);  
 	$dbres		=	mysql_query("SELECT * FROM `bezittingen` WHERE `naam`='Ammo clips' AND `owner`='{$heist->login1}'");
	$controlle	=	mysql_num_rows($dbres);
		if($controlle == 0){
		mysql_query("INSERT INTO `bezittingen`(`owner`,`type`,`aantal`,`naam`,`link`) VALUES('{$heist->login1}','Wapen','{$heist->clips}','Ammo clips','internet-cbay.php')");
		} else {
		mysql_query("UPDATE `bezittingen` SET `aantal`=`aantal`+'{$heist->clips}' WHERE `naam`='Ammo clips' AND `owner`='{$heist->login1}'");
		}
	mysql_query("UPDATE `gebruiker` SET `bezet2`='0' WHERE `login`='{$data->login}'");
	mysql_query("UPDATE `gebruiker` SET `bezet2`='0',`kogels`=`kogels`+'{$heist->kogels}' WHERE `login`='{$heist->login1}'");
	mysql_query("INSERT INTO `berichten`(`tijd`,`ip`,`van`,`naar`,`titel`,`bericht`) VALUES(NOW(),'{$_SERVER['REMOTE_ADDR']}','Ultimatecrime','{$heist->login1}','Route 66','{$data->login} heeft de route 66 overval geanuleert, je hebt al jou ingezette kogels terug gekregen.')");
	mysql_query("DELETE FROM `heist` WHERE `login2`='{$data->login}'");
	echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Je hebt de heist geanuleert.</span></td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";
	exit;
	}

	if(isset($_POST['submit1'])){

	$naam		=	$data->login; 
	$medespeler	=	$_POST['bestuurder']; 
	$kogels		=	$_POST['kogels'];

	$dbres		=	mysql_query("SELECT *,UNIX_TIMESTAMP(`wachttijd_heist`) AS `wachttijd_heist`,0 FROM `gebruiker` WHERE `login`='$medespeler' AND `level`!='-1' AND `level`!='0'") or die(mysql_error());
	$man		=	mysql_fetch_object($dbres);  
	$controle	=	mysql_num_rows($dbres); 


		if($controle == 0){

		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Jou partner bestaat niet, is verbannen of is dood.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else if($man->login == $data->login){
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Je kunt jezelf niet opgeven als heist partner.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else if($man->wachttijd_heist + 10800 > time()){
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Jou partner is nog aan het rusten.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else if($man->land != $data->land){
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Je zit niet in het zelfde land als de bestuurder.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else if($man->bezet2 > 0){
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Jou partner doet al een heist.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else if($data->kogels < $kogels){
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Zoveel kogels heb je niet.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else if($kogels > 100){
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Je kunt niet meer als 50 kogels inzetten.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else if($kogels < 1){
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Vul een geldig aantal kogels in.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else if($man->rank == "Junkie" || $man->rank == "Straatrat" || $man->rank == "Dief" || $man->rank == "Wietkweker" || $man->rank == "Drugsdealer"){
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Jou partner heeft een nog niet hoog genoege rank.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else {
 
			if($data->rank == "Gangster"){

			$procent	=	20;

			} else if($data->rank == "Handelaar"){

			$procent	=	30;

			} else if($data->rank == "Arbeider"){

			$procent	=	40;

			} else if($data->rank == "Manager"){

			$procent	=	50;

			} else if($data->rank == "Baas Stadsnetwerk"){

			$procent	=	60;

			} else if($data->rank == "Huurmoordenaar"){

			$procent	=	70;

			} else if($data->rank == "Nationaal crimineel"){

			$procent	=	80;

			} else if($data->rank == "Internationaal Crimineel"){

			$procent	=	90;

			} else if($data->rank == "Lid Grote Raad"){

			$procent	=	100;

			}

		$total		=	$kogels+$procent;
		mysql_query("INSERT INTO `heist`(`login1`,`login2`,`clips`,`procent`,`land`) values('$naam','$medespeler','$kogels','$total','{$data->land}')");
		mysql_query("UPDATE `gebruiker` SET `kogels`=`kogels`-'$kogels',`bezet2`='1' WHERE `login`='{$data->login}'");
		mysql_query("UPDATE `gebruiker` SET `bezet2`='2' WHERE `login`='$medespeler'");
		mysql_query("INSERT INTO `berichten`(`tijd`,`ip`,`van`,`naar`,`titel`,`bericht`) VALUES(NOW(),'{$_SERVER['REMOTE_ADDR']}','Ultimatecrime','$medespeler','Route 66','Je bent uitgenodigt door {$data->login} voor een route 66 overval in {$data->land} als bestuurder.\n Ga naar route 66 overval om de overval te accepteren of te weigeren.')");
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_comment.jpg\"></td><td>Je hebt '$medespeler' uitgenodigt voor een route 66 overval.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";
		}
	exit;

	} 


	if(isset($_POST['submit2'])){

	$naam		=	$data->login; 
	$id		=	$_POST['kogels']; 
 
	$dbres		=	mysql_query("SELECT * FROM `heist` WHERE `login2`='{$data->login}'"); 
	$heist		=	mysql_fetch_object($dbres);

	$dbres		=	mysql_query("SELECT * FROM `autos` WHERE `id`='$id' AND `owner`='{$data->login}'");  
	$auto		=	mysql_fetch_object($dbres); 
	$controle	=	mysql_num_rows($dbres);

	$dbres		=	mysql_query("SELECT * FROM `gebruiker` WHERE `login`='{$heist->login1}'");
	$partner	=	mysql_fetch_object($dbres);  

		if($controle < 1){
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Deze auto is niet van jou.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else if($auto->status == 2){
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Deze auto staat op marktplaats.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else if($auto->land != $heist->land){
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Deze auto staat is niet in het juiste land en dat is : {$heist->land}.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else if($auto->status == 1){
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_error.jpg\"></td><td><span class=\"header_rood\">Error</span><br>Deze auto is al bezig met een race.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		} else {

			if($auto->snelheid >= 0 && $auto->snelheid <= 120){

			$race	=	10;

			} else if($auto->snelheid >= 121 && $auto->snelheid <= 160){

			$race	=	20;

			} else if($auto->snelheid >= 161 && $auto->snelheid <= 190){

			$race	=	30;

			} else if($auto->snelheid >= 191 && $auto->snelheid <= 220){

			$race	=	40;

			} else if($auto->snelheid >= 221 && $auto->snelheid <= 250){

			$race	=	60;

			} else if($auto->snelheid >= 251 && $auto->snelheid <= 270){

			$race	=	70;

			} else if($auto->snelheid >= 271 && $auto->snelheid <= 310){

			$race	=	80;

			} else if($auto->snelheid >= 311){

			$race	=	100;

			}

		$totaal		=	round($race/100)*(100-$auto->schade);
		$totala		=	$totaal+$heist->procent;
		$total		=	round($totala/25*10);
		$moord		=	0;
    
			if($total == 100){

			$raak		=	1;

			} else if($total >= 99 && $total <= 80){

			$raak		=	mt_rand(1,3);

			} else if($total >= 79 && $total <= 60){

			$raak		=	mt_rand(1,4);

			} else if($total >= 59 && $total <= 40){

			$raak		=	mt_rand(1,5);

			} else if($total >= 39 && $total <= 20){

			$raak		=	mt_rand(1,6);

			} else {

			$raak		=	mt_rand(1,7);

			}


			if($raak == 2){

			$health		=	0;
			$gevangenis	=	0;
			$geld		=	mt_rand(50000, 1000000);
			$geld1 		=	geld($geld);
			$bericht	=	"Jullie stopten een gepanserde geldwagen van de bank, Er zat €$geld1 in!, Haleluja!\n Door jullie snelle auto konden jullie optijd wegkomen.\n Het geld is naar de leider gegaan.";

			} else if($raak == 3){  

			$health		=	0;
			$gevangenis	=	0;
			$geld		=	0;
			$geld1a 	=	mt_rand(50000, 1000000);
			$geld1b		=	geld($geld1a);
			$bericht	=	"Jullie stopten een gepanserde geldwagen van de casino, Er zat €$geld1b in!, Haleluja!\n Maar jullie kregen auto pech.\n Er kwam al snel een auto van de casino aan.\n Er kwamen uitsmijters met tommyguns uit de auto.\n jullie moesten het geld wel terug geven.";

			} else if($raak == 4){  

			$health		=	mt_rand(3,10);
			$gevangenis	=	300;
			$geld		=	0;
			$bericht	=	"Jullie stopten een gepanserde geldwagen, Er sprongen ME luitjes uit de auto.\n Er werd heftig geschoten.\n Jullie raakten gewond.";

			} else if($raak == 5){  

			$health		=	mt_rand(3,10);
			$gevangenis	=	0;
			$geld		=	0;
			$bericht	=	"Jullie stopten een vrachwagen, Je vroegen de bestuurder om de sleutel.\n De bestuurder grinikte, jullie opende de vrachtwagen en er kwam een wilde chimpansee uit.\n Hij sloeg jullie neer.\n Jullie raakten gewond.";

			} else if($raak == 6){  

			$health		=	0;
			$gevangenis	=	0;
			$geld		=	mt_rand(10000, 50000);
			$geld1 		=	geld($geld);
			$bericht	=	"Jullie stopten een vrachwagen, Je vroegen de bestuurder om de sleutel.\n De bestuurder had een raar accent.\n Jullie openden de vrachtwagen en de vrachtwagen bleek vol te zitten met aardappelen.\n Jullie konden de vrachtwagen plus inhoud verkopen voor €$geld1 Het geld is naar de leider gegaan.";


			} else if($raak == 7){  

			$health		=	0;
			$gevangenis	=	0;
			$geld		=	0;
			$geld1 		=	geld($geld);
			$bericht	=	"Jullie kwamen na lang wachten een vrachtwagen tegen, toen jullie de vrachtwagen aan de kant hielden vroegen jullie om de sleutel met een geweer op zijn neus!\n De eigenaar van de vrachtwagen waarschuwde nog maar jullie wouden niet luisteren.\n toen jullie de klep achter openden kwamen er dolle zwijnen uit rennen!\n de chaufeur riep: \"Jullie zijn diep in de strond gezakt!\", en reed weg.";

			} else if($raak == 1){  

			$health		=	0;
			$gevangenis	=	0;
			$geld		=	mt_rand(50000, 1000000);
			$geld1 		=	geld($geld);
			$moord		=	rand(1,8);
			$bericht	=	"Jullie stopten een gepanserde geldwagen van de bank, Jullie zagen dat er iets gaande was.\n Er waren al 2 overvallers.\n Maar jullie dachten geen nood julie pakten jullie geweren en schoten de overvallers neer.\n Er zat €$geld1 in de geldwagen!, Haleluja!\n Door jullie snelle auto konden jullie makkelijk wegkomen.\n Het geld is naar de leider gegaan en jullie kregen ieder 0,$moord% schiet ervaring erbij.";
			}


			if($gevangenis > 0){

			mysql_query("UPDATE `gebruiker` SET `gevangenis`=NOW(),`gevangenistijd`='$gevangenis' WHERE `login`='{$data->login}'");
			mysql_query("UPDATE `gebruiker` SET `gevangenis`=NOW(),`gevangenistijd`='$gevangenis' WHERE `login`='{$partner->login}'");

			}


			if($health > 0){

			mysql_query("UPDATE `gebruiker` SET `health`=`health`-'$health' WHERE `login`='{$data->login}'");
			mysql_query("UPDATE `gebruiker` SET `health`=`health`-'$health' WHERE `login`='{$partner->login}'");

			}


			if($moord > 0){

			mysql_query("UPDATE `gebruiker` SET `schiet_ervaring`=`schiet_ervaring`+'$moord' WHERE `login`='{$data->login}'");
			mysql_query("UPDATE `gebruiker` SET `schiet_ervaring`=`schiet_ervaring`+'$moord' WHERE `login`='{$partner->login}'");

			}


			if($geld > 0){

			mysql_query("UPDATE `gebruiker` SET `cash`=`cash`+'$geld' WHERE `login`='{$partner->login}'") or die(mysql_error());

			}


			if($data->rank == "Gangster"){

			$rank	=	500;

			} else if($data->rank == "Handelaar"){

			$rank	=	200;

			} else if($data->rank == "Arbeider"){

			$rank	=	150;

			} else if($data->rank == "Manager"){

			$rank	=	100;

			} else if($data->rank == "Baas Stadsnetwerk"){

			$rank	=	80;

			} else if($data->rank == "Huurmoordenaar"){

			$rank	=	60;

			} else if($data->rank == "Nationaal crimineel"){

			$rank	=	40;

			} else if($data->rank == "Internationaal Crimineel"){

			$rank	=	30;

			} else if($data->rank == "Lid Grote Raad"){

			$rank	=	0;

			}


			if($partner->rank == "Gangster"){

			$ranka	=	500;

			} else if($partner->rank == "Handelaar"){

			$ranka	=	200;

			} else if($partner->rank == "Arbeider"){

			$ranka	=	150;

			} else if($partner->rank == "Manager"){

			$ranka	=	100;

			} else if($partner->rank == "Baas Stadsnetwerk"){

			$ranka	=	80;

			} else if($partner->rank == "Huurmoordenaar"){

			$ranka	=	60;

			} else if($partner->rank == "Nationaal crimineel"){

			$ranka	=	40;

			} else if($partner->rank == "Internationaal Crimineel"){

			$ranka	=	30;

			} else if($partner->rank == "Lid Grote Raad"){

			$ranka	=	0;

			}


		mysql_query("UPDATE `gebruiker` SET `rankvordering`=`rankvordering`+'$rank',`wachttijd_heist`=NOW(),`bezet2`='0',`heist`=`heist`+'1' WHERE `login`='{$data->login}'");
		mysql_query("UPDATE `gebruiker` SET `rankvordering`=`rankvordering`+'$ranka',`wachttijd_heist`=NOW(),`bezet2`='0',`heist`=`heist`+'1' WHERE `login`='{$partner->login}'");
		mysql_query("INSERT INTO `berichten`(`tijd`,`ip`,`van`,`naar`,`titel`,`bericht`) VALUES(NOW(),'{$_SERVER['REMOTE_ADDR']}','Ultimatecrime','{$partner->login}','Route 66','$bericht')");
		mysql_query("DELETE FROM `autos` WHERE `id`='{$auto->id}'");
		mysql_query("DELETE FROM `heist` WHERE `id`='{$heist->id}'");
		echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</b></td></tr><tr><td class=\"mainTxt\"><table><tr><td width=\"20\" valign=\"top\"><img src=\"layout/images/icons/light_comment.jpg\"></td><td>$bericht</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

		}

	exit;

	}

$dbres			=	mysql_query("SELECT * FROM `heist` WHERE `login1`='{$data->login}' OR `login2`='{$data->login}'");
$heist			=	mysql_fetch_object($dbres);

	if($data->rank == "Junkie" || $data->rank == "Straatrat" || $data->rank == "Dief" || $data->rank == "Wietkweker" || $data->rank == "Drugsdealer"){

	echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</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\">Een nog niet geschikte klus voor jou!</span><br>De Grote Raad heeft besloten dat je nog maar even wat verder moet ranken voor deze klus.<br />Als je Gangster bent mag je hier aan mee doen.</td></tr></table></td></tr><tr><td class=\"subTitle\">&nbsp;</td></tr></table>";

	} else if($data->wachttijd_heist+10800>time()){

	$totaal	=	$data->wachttijd_heist + 10800 - time() - 3600;
	$tijd	=	date("H:i:s", "$totaal");
	echo "<table align=\"center\" width=\"600\"><tr><td class=\"subTitle\"><b>Ultimatecrime - Assasin - Route 66 Overval</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($data->bezet2 == 1){

?>

<form method="post">
<table align="center" width="600">
	<tr>
		<td class="subTitle" colspan="4">
		<b>Ultimatecrime - Assasin - Route 66 Overval</b>
		</td>
	</tr>
	<tr>
		<td width="174" rowspan="4" align="center"><img src="images/misdaad/sniperviewd.jpg"></td>
		<td class="mainTxts" width="226">&nbsp;&nbsp;Type Misdaad</td>
		<td class="mainTxts" width="200" align="center">Assassin - Route 66 Overval</td>
	</tr>
	<tr>
		<td class="mainTxts" width="226">&nbsp;&nbsp;Bestuurder</td>
		<td class="mainTxts" width="200" align="center"><strong><?php echo $heist->login2; ?></td>
	</tr>
	<tr>
		<td class="mainTxts" width="226">&nbsp;&nbsp;Aantal ammo clips </td>
		<td class="mainTxts" width="200" align="center"><?php echo $heist->clips; ?></td>
	</tr>
	<tr>
		<td class="mainTxts" width="400" colspan="2" align="center"><input type="submit" name="annuleren1" value="Annuleren"  style="width: 300;"></td>
	<tr>
	<tr>
		<td class="subTitle" colspan="3">&nbsp;</td>
	</tr>
</table>
</form>

<?php

	} else if($data->bezet2 == 2){

?>

<form method="post">
<table align="center" width="600">
	<tr>
		<td class="subTitle" colspan="4">
		<b>Ultimatecrime - Assasin - Route 66 Overval</b>
		</td>
	</tr>
	<tr>
		<td width="174" rowspan="4" align="center"><img src="images/misdaad/sniperviewd.jpg"></td>
		<td class="mainTxts" width="226">&nbsp;&nbsp;Type Misdaad</td>
		<td class="mainTxts" width="200" align="center">Assassin - Route 66 Overval</td>
	</tr>
	<tr>
		<td class="mainTxts" width="226">&nbsp;&nbsp;Leader</td>
		<td class="mainTxts" width="200" align="center"><strong><?php echo $heist->login1; ?></td>
	</tr>
	<tr>
		<td class="mainTxts" width="226">&nbsp;&nbsp;Auto-id</td>
		<td class="mainTxts" width="200" align="center"><input type="text" name="kogels" maxlength=6></td>
	</tr>
	<tr>
		<td class="mainTxts" width="400" colspan="2" align="center"><input type="submit" name="submit2" value="Submit" style="width: 100;">&nbsp;&nbsp;<input type="submit" name="annuleren2" value="Annuleren"  style="width: 100;"></td>
	</tr>
	<tr>
		<td class="subTitle" colspan="3">&nbsp;</td>
	</tr>
</table>
</form>

<?php

	} else {

?>

<form method="post">
<table align="center" width="600">
	<tr>
		<td class="subTitle" colspan="4">
		<b>Ultimatecrime - Assasin - Route 66 Overval</b>
		</td>
	</tr>
	<tr>
		<td width="174" rowspan="4" align="center"><img src="images/misdaad/sniperviewd.jpg"></td>
		<td class="mainTxts" width="226">&nbsp;&nbsp;Type Misdaad</td>
		<td class="mainTxts" width="200" align="center">Assassin - Route 66 Overval</td>
	</tr>
	<tr>
		<td class="mainTxts" width="226">&nbsp;&nbsp;Bestuurder</td>
		<td class="mainTxts" width="200" align="center"><input type="text" name="bestuurder" maxlength=16></td>
	</tr>
	<tr>
		<td class="mainTxts" width="226">&nbsp;&nbsp;Aantal ammo clips [1-100]</td>
		<td class="mainTxts" width="200" align="center"><input type="text" name="kogels" maxlength=3></td>
	</tr>
	<tr>
		<td class="mainTxts" width="400" colspan="2" align="center"><input type="submit" name="submit1" value="Stuur een uitnodiging naar bestuurder"  style="width: 300;">
	</tr>
	<tr>
		<td class="subTitle" colspan="3">&nbsp;</td>
	</tr>
</table>
</form>

<?php

	}

?>

</body>
</html>