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


?>

<html>
<head>
<title>Ultimatecrime - Instellingen!</title>
<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">
<link rel="stylesheet" type="text/css" href="style_general.css">
</head>
<body background="layout/images/layout_12.gif" bgproperties="fixed">
<br>
<br>
<br>
<form method="post" name="setting" action="speler-instellingen.php" target="content" onsubmit="return submitForm(this.submit_vip);">
<table align="center" width="600">
	<tr>
		<td class="subTitle">Ultimatecrime - <?php echo $data->login; ?> - Account instellingen</td>
	</tr>
	<tr>
		<td class="maintxt"><table width="580" border="0" align="center" cellpadding="0" cellspacing="0">
			<tr>
				<td width="290" valign="middle"><table width="290" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="35"><div align="center"><img src="layout/images/icons/light_settings.jpg" width="16" height="16"></div></td>
						<td valign="middle"><a href="speler-instellingen.php?show=algemeen" target="content"><strong>Algemene instellingen </strong></a></td>
						<td valign="middle">&nbsp;</td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td colspan="2" valign="middle" class="forum_subtitle">Backfire, testament, ect!</td>
					</tr>
				</table></td>
				<td width="290" valign="middle"><table width="290" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="35"><div align="center"><img src="layout/images/icons/light_tekstparagraaf.jpg" width="16" height="16"></div></td>
						<td valign="middle"><a href="speler-instellingen.php?show=homepage" target="content"><strong>Homepage instellingen </strong></a></td>
						<td valign="middle">&nbsp;</td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td colspan="2" valign="middle"><span class="forum_subtitle">Maak hier je eigen homepage! </span></td>
					</tr>
				</table></td>
			</tr>
		</table></td>
	</tr>
	<tr>
		<td class="subtitle">&nbsp;</td>
	</tr>
</table>

<?php

	if($_GET['show'] == "algemeen" || $_POST['show'] == "algemeen"){

		if($_POST['pass_old'] != "" && $_POST['pass_nieuw'] != "" && $_POST['pass_confirm'] != ""){
		$dbres		=	mysql_query("SELECT `id` FROM `gebruiker` WHERE `login`='{$data->login}' AND `pass`=MD5('{$_POST['pass_old']}')");
		$controlle	=	mysql_num_rows($dbres);
			if($controlle == 0){

?>

<table align="center" width="600">
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2"><?php echo $data->login; ?> - Algemene Account Instellingen</td>
	</tr>
	<tr>
		<td width="600" class="mainTxt" colspan="2" align="center"><span class="header_rood">Je oude wachtwoord klopt niet!</span></td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>
</table>

<?php

			} else if($_POST['pass_nieuw'] != $_POST['pass_confirm']){

?>

<table align="center" width="600">
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2"><?php echo $data->login; ?> - Algemene Account Instellingen</td>
	</tr>
	<tr>
		<td width="600" class="mainTxt" colspan="2" align="center"><span class="header_rood">De nieuwe wachtwoorden komen niet overeen!</span></td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>
</table>

<?php

			} else {
			$pass	=	md5($_POST['pass_nieuw']);
			mysql_query("UPDATE `gebruiker` SET `pass`='$pass' WHERE `login`='{$data->login}'");

?>

<table align="center" width="600">
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2"><?php echo $data->login; ?> - Algemene Account Instellingen</td>
	</tr>
	<tr>
		<td width="600" class="mainTxt" colspan="2" align="center"><span class="tekstheader">Wachtwoord aangepast!</span></td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>
</table>

<?php

			}
		} else {
			if($_POST['backfire'] == "1" && $_POST['bfmanual_aantal'] != "" && $_POST['bfmanual_aantal'] > 0){
			$_POST['bfmanual_aantal']	=	$_POST['bfmanual_aantal'];
			mysql_query("UPDATE `gebruiker` SET `backfire`='Handmatig' WHERE `login`='{$data->login}'");
			mysql_query("UPDATE `gebruiker` SET `bfpreset`='{$_POST['bfmanual_aantal']}' WHERE `login`='{$data->login}'");
			} else if($_POST['backfire'] == "2" && ($_POST['bfpreset'] == "50%" || $_POST['bfpreset'] == "100%" || $_POST['bfpreset'] == "200%")){
			$_POST['bfpreset']	=	$_POST['bfpreset'];
			mysql_query("UPDATE `gebruiker` SET `bfpreset`='{$_POST['bfpreset']}' WHERE `login`='{$data->login}'");
			mysql_query("UPDATE `gebruiker` SET `backfire`='Preset' WHERE `login`='{$data->login}'");
			}

			if($_POST['testament'] == 1 && $_POST['testa_persoon'] != ""){
			$dbres		=	mysql_query("SELECT * FROM `gebruiker` WHERE `login`='{$_POST['testa_persoon']}' AND `level`!='-1' AND `login`!='{$data->login}' AND `level`!='-2'");
			$testa_persoon	=	mysql_num_rows($dbres);
				if($testa_persoon != 0){
				mysql_query("UPDATE `gebruiker` SET `erfgenaam`='{$_POST['testa_persoon']}' WHERE `login`='{$data->login}'");
				}
			} else if($_POST['testament'] == 0 && isset($_POST['submit_algemeen'])){
			mysql_query("UPDATE `gebruiker` SET `erfgenaam`='' WHERE `login`='{$data->login}'");
			}


?>

<table align="center" width="600">
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2"><?php echo $data->login; ?> - Algemene Account Instellingen</td>
	</tr>
	<tr>
		<td width="600" class="mainTxtS" colspan="2"><table width="550">
			<tr>
				<td width="20"><input type="radio" name="backfire" class="form_radio" value="1" <?php if(($data->backfire == "Handmatig" && $_POST['backfire'] != "2") || $_POST['backfire'] == "1"){ echo "checked"; } ?>></td>
				<td><span class="tekstheader">Backfire - Handmatig</span></td>
			</tr>
			<tr>
				<td width="20">&nbsp;</td>
				<td>Vink aan en vul het aantal ammo clips in dat je wilt terugschieten als iemand je aanvalt! Als je meer invult dan het aantal ammo clips dat je bezit, worden al je clips afgeschoten.<br /><br />Aantal ammo clips: <input type="text" name="bfmanual_aantal" style="width:100;" value="<?php if($_POST['backfire'] == "1" && $_POST['bfmanual_aantal'] != "" && $_POST['bfmanual_aantal'] > 0){ echo $_POST['bfmanual_aantal']; } else { echo $data->bfpreset; } ?>"></td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
		</table>
		<table width="550">
			<tr>
				<td width="20"><input type="radio" name="backfire" class="form_radio" value="2" <?php if(($data->backfire == "Preset" && $_POST['backfire'] != "1") || $_POST['backfire'] == "2"){ echo "checked"; } ?>></td>
				<td><span class="tekstheader">Backfire - Preset</span></td>
			</tr>
			<tr>
				<td width="20">&nbsp;</td>
				<td>Vink aan en selecteer welke preset je wilt. Je schiet dan het percentage van het aantal ammo clips dat op jou geschoten wordt terug!<br /><br />Preset: &nbsp;&nbsp;&nbsp;<input type="radio" name="bfpreset" value="50%" class="form_radio" <?php if($data->bfpreset == "50%" || $_POST['bfpreset'] == "50%"){ echo "checked"; } ?>> 50% &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="bfpreset" value="100%" class="form_radio" <?php if($data->bfpreset == "100%" || $_POST['bfpreset'] == "100%"){ echo "checked"; } ?>> 100% &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="bfpreset" value="200%" class="form_radio" <?php if($data->bfpreset == "200%" || $_POST['bfpreset'] == "200%"){ echo "checked"; } ?>> 200%</td>
			</tr>
		</table></td>
	</tr>	
	<tr>
		<td width="600" class="mainTxtS" colspan="2"><table width="550">
			<tr>
				<td width="20"><input type="checkbox" name="testament" class="form_radio" value="1" <?php if(($_POST['testament'] == 1 && $testa_persoon != 0) || $data->erfgenaam != "" && !($_POST['testament'] == 0 && isset($_POST['submit_algemeen']))){ echo "checked"; } ?>></td>
				<td><span class="tekstheader">Persoon in je testament</span></td>
			</tr>
			<tr>
				<td width="20">&nbsp;</td>
				<td>Zet iemand in je testament zodat je nog wat terug ziet van je hardverdiende centen als je dood gaat! Deze persoon krijgt 25% - 50% van het geld op je bankrekening (afhankelijk van de fraude die de notaris pleegt) en de autos waarin die persoon mag rijden!<br /><br />Crimineel in testament: <input type="text" name="testa_persoon" style="width:150;" value="<?php if($testa_persoon != 0 && $_POST['testament'] == 1 && !($_POST['testament'] == 0 && isset($_POST['submit_algemeen']))){ echo $_POST['testa_persoon']; } else if(!($_POST['testament'] == 0 && isset($_POST['submit_algemeen']))){ echo $data->erfgenaam; } ?>">&nbsp;&nbsp;<i>Vergeet het vinkje niet!</i></td>
			</tr>
		</table></td>
	</tr>
	<tr>
		<td width="600" class="mainTxtS" colspan="2"><table width="550" align="center">
			<tr>
				<td width="550">
				<span class="tekstheader">Wachtwoord instellen</span><br />Het is belangrijk een veilig en moeilijk te raden wachtwoord te hebben!<br />We raden je aan voor Ultimatecrime een apart wachtwoord te hebben!<br /><br /><a href="algemeen-help.php?item=faq&word=hacken" target="content"><strong>Lees hier belangrijke info ter voorkoming van fraude/hacken!</span></a><br /><br />
				<table>
					<tr>
						<td width="250">Huidige wachtwoord</td>
						<td width="300"><input type="password" name="pass_old" maxlength="16"  style="width:150;"></td>
					</tr>
					<tr>
						<td width="250">Nieuwe wachtwoord</td>
						<td width="300"><input type="password" name="pass_nieuw" maxlength="16"  style="width:150;"></td>
					</tr>
					<tr>
						<td width="250">Nogmaals nieuwe wachtwoord &nbsp;&nbsp;&nbsp;&nbsp;</td>
						<td width="300"><input type="password" name="pass_confirm" maxlength="16" style="width:150;"></td>
					</tr>
				</table>
				</td>
			</tr>
		</table></td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>    
	<tr>
		<td width="600" class="mainTxt" colspan="2"><table width="550">
			<tr>
				<td width="25"><img src="layout/images/vink.jpg"></td>
				<td width="525">&nbsp;<input type="hidden" name="show" value="algemeen"><input type="submit" name="submit_algemeen" value="&nbsp;&nbsp;&nbsp;Algemene instellingen opslaan&nbsp;&nbsp;&nbsp;"></td>
			</tr>
		</table></td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>
</table>

<?php

		}
	}

	if($_GET['show'] == "homepage" || $_POST['show'] == "homepage"){
	$url			=	$data->avater;
	$homepage		=	$data->info;

		if(isset($_POST['submit_homepage'])){
		$_POST['homepage_img']		=	$_POST['homepage_img'];
		$_POST['homepage_text']		=	$_POST['homepage_text'];
		$url				=	$_POST['homepage_img'];
		$homepage			=	$_POST['homepage_text'];
		mysql_query("UPDATE `gebruiker` SET `info`='{$_POST['homepage_text']}',`avater`='{$_POST['homepage_img']}' WHERE `login`='{$data->login}'");
		}
?>


<table align="center" width="600">
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">
		<?php echo $data->login; ?> - Homepage Instellingen
		</td>
	</tr>
	<tr>
		<td width="600" class="mainTxt" colspan="2">
		<span class="tekstheader">Jouw homepage</span><br />Je homepage is het visitekaartje voor andere criminelen. Op <a href="speler-profiel.php?x=<?php echo $data->login; ?>" target="content">jouw profiel</a>, onder de algemene informatie die Ultimatecrime over jouw weet, zoals je rang, netwerk etc, kan jij je eigen homepage maken! Hou het wel netjes!<br /><br /><a href="algemeen-help.php?item=faq&word=ubb" target="content"><strong>Lees hier hoe je je homepage mooi kunt maken!</strong>
		</td>
	</tr>
	<tr>
		<td width="600" class="mainTxt" colspan="2">
		<span class="tekstheader">Persoonlijke afbeelding</span><br />
		Webadres afbeelding&nbsp;&nbsp;<input type="text" name="homepage_img" style="width:400;" value="<?php echo $url; ?>">
		</td>
	</tr>
	<tr>
		<td width="600" class="mainTxt" colspan="2">
		<span class="tekstheader">Persoonlijke tekst (homepage)</span><br />
		<textarea name="homepage_text" cols="77" rows="15"><?php echo $homepage; ?></textarea>
		<table width="500">
			<tr>
				<td align="center">
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':grin:'"><img src=images/smiles/icon_biggrin.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':S'"><img src=images/smiles/icon_confused.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += '8)'"><img src=images/smiles/icon_cool.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':.('"><img src=images/smiles/icon_cry.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':eek:'"><img src=images/smiles/icon_eek.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':evil:'"><img src=images/smiles/icon_evil.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':lol:'"><img src=images/smiles/icon_lol.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':@'"><img src=images/smiles/icon_mad.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':D'"><img src=images/smiles/icon_mrgreen.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':|'"><img src=images/smiles/icon_neutral.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':P'"><img src=images/smiles/icon_razz.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':$'"><img src=images/smiles/icon_redface.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':roll:'"><img src=images/smiles/icon_rolleyes.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':('"><img src=images/smiles/icon_sad.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':)'"><img src=images/smiles/icon_smile.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':o'"><img src=images/smiles/icon_surprised.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':twisted:'"><img src=images/smiles/icon_twisted.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ';)'"><img src=images/smiles/icon_wink.gif border=0></a><br />
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':{'"><img src=images/smiles/icon_dracula.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':sick:'"><img src=images/smiles/icon_sick.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':uhm:'"><img src=images/smiles/icon_uhm.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':clap:'"><img src=images/smiles/icon_clap.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':dance:'"><img src=images/smiles/icon_dance.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':stop:'"><img src=images/smiles/icon_stop.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':doh:'"><img src=images/smiles/icon_doh.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':nono:'"><img src=images/smiles/icon_nono.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':think:'"><img src=images/smiles/icon_think.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':ssht:'"><img src=images/smiles/icon_ssht.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':nope:'"><img src=images/smiles/icon_nope.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':salut:'"><img src=images/smiles/icon_salut.gif border=0></a>
				<a href="javascript://" onClick="document.setting.homepage_text.value += ':wall:'"><img src=images/smiles/icon_wall.gif border=0></a>
				</td>
			</tr>
		</table></td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>    
	<tr>
		<td width="600" class="mainTxt" colspan="2"><table width="550">
			<tr>
				<td width="25"><img src="layout/images/vink.jpg"></td>
				<td width="525">&nbsp;<input type="hidden" name="show" value="homepage"><input type="submit" name="submit_homepage" value="&nbsp;&nbsp;&nbsp;Homepage instellingen opslaan&nbsp;&nbsp;&nbsp;"></td>
			</tr>
		</table></td>
	</tr>
	<tr>
		<td class="subTitle" colspan="2">&nbsp;</td>
	</tr>
</table>

<?php

	}

?>

</form>
</body>
</html>