<?php
if (!isset($_SESSION))
{
	session_start();
}
require_once ('header.php');
if ($aangemeld == "ja")
{
	if ($member_status == "manager")
	{
		if (ISSET($_GET['naam']))
		{
			if (ISSET($_GET['change']))
			{
				mysql_query("UPDATE members SET wachtwoord='".$_GET['wachtwoord']."', functie='".$_GET['functie']."', ip='".$_GET['ip']."', actie='".$_GET['actie']."', ban='".$_GET['ban']."', money='".$_GET['money']."', console='".$_GET['console']."' WHERE naam='".$_GET['naam']."';");
			}
			echo "<h1>Leden instellen (".$_GET['naam'].")</h1>";
			echo "<center>";
			echo "<form action='?' method='get'>";
			echo "Naam: <input type='text' length='20' maxlength='20' name='naam'>";
			echo "<input type='submit' value='Ga'>";
			echo "</form>";
			echo "</center>";
			error_reporting(0);
	   		$bestaat_mss_al = halen("SELECT * FROM members WHERE naam='".$_GET['naam']."';");
		   	error_reporting(E_ALL);
			if($bestaat_mss_al != "")
			{
				$gegevens = halen_array("SELECT * FROM members WHERE naam='".$_GET['naam']."';");
				echo "<center>";
				echo "<form name='change_form' method='get' action='?'>";
				echo "<input type='hidden' name='change' value='change'>";
				echo "<input type='hidden' name='naam' value='".$gegevens['naam']."'>";
				echo "<table border='1' class='tabel'>";
				echo "<tr>";
	    		echo "<td>ID: </td>";
	    		echo "<td>".$gegevens['id']."</td>";
	    		echo "</tr>";
				echo "<tr>";
	    		echo "<td>Naam: </td>";
	    		echo "<td>".$gegevens['naam']."</td>";
	    		echo "</tr>";
	    		echo "<tr>";
	    		echo "<td>Wachtwoord: </td>";
	    		echo "<td><input type='text' size='50' name='wachtwoord' value='".$gegevens['wachtwoord']."' maxlength='30'></td>";
	    		echo "</tr>";
				echo "<tr>";
	    		echo "<td>Functie: </td>";
	    		echo "<td><input type='text' size='50' name='functie' value='".$gegevens['functie']."' maxlength='20'></td>";
	    		echo "</tr>";
	    		echo "<tr>";
	    		echo "<td>IP: </td>";
	    		echo "<td><input type='text' size='50' name='ip' value='".$gegevens['ip']."' maxlength='50'></td>";
	    		echo "</tr>";
	    		echo "<tr>";
	    		echo "<td>Last_online: </td>";
	    		echo "<td>".$gegevens['last_online']."</td>";
	    		echo "</tr>";
	    		echo "<tr>";
	    		echo "<td>Last_online2: </td>";
	    		echo "<td>".$gegevens['last_online2']."</td>";
	    		echo "</tr>";
	    		echo "<tr>";
	    		echo "<td>Last_online3: </td>";
	    		echo "<td>".$gegevens['last_online3']."</td>";
	    		echo "</tr>";
	    		echo "<tr>";
	    		echo "<td>Actie: </td>";
	    		echo "<td><input type='text' size='50' name='actie' value='".$gegevens['actie']."' maxlength='50'></td>";
	    		echo "</tr>";
	    		echo "<tr>";
	    		echo "<td>Warning: </td>";
	    		echo "<td>".$gegevens['warning']."</td>";
	    		echo "</tr>";
				echo "<tr>";
	    		echo "<td>Ban: </td>";
	    		echo "<td><input type='text' size='50' name='ban' value='".$gegevens['ban']."' maxlength='5'></td>";
	    		echo "</tr>";
				echo "<tr>";
	    		echo "<td>Money: </td>";
	    		echo "<td><input type='text' size='50' name='money' value='".$gegevens['money']."' maxlength='50'></td>";
	    		echo "</tr>";
				echo "<tr>";
	    		echo "<td>Console: </td>";
	    		echo "<td><input type='text' size='50' name='console' value='".$gegevens['console']."' maxlength='50'></td>";
	    		echo "</tr>";
				echo "</table>";
				echo "<br><input type='submit' value='Wijzig'>";
				echo "</form>";
				echo "</center>";
				action("bekijkt instellingen van ".$_GET['naam']);
			}
			else
			{
				echo "Dit account bestaat niet.</center>";
			}
		}
		else
		{
			echo "<h1>Leden instellen</h1>";
			echo "<center>";
			echo "<form action='?' method='get'>";
			echo "Naam: <input type='text' length='20' maxlength='20' name='naam'>";
			echo "<input type='submit' value='Ga'>";
			echo "</form>";
			echo "</center><br>";
		}
	}
}
else
{
	echo "Oeps! Hiervoor moet je aangemeld zijn!";
}
require_once('footer.php');
?>