<?php
if (!isset($_SESSION['ID'])) {
} else {
	$sql = 'SELECT * FROM vv WHERE ID = "'.$_POST['ID'].'";';
	$result = $db->query($sql);
	$nt = $result->fetch_assoc();
	$sql2 = 'SELECT Vorname, Nachname FROM Team WHERE ID = "'.$nt['TID'].'";';
	$result2 = $db->query($sql2);
	$nt2 = $result2->fetch_assoc();
	$sql3 =		'SELECT DATE_FORMAT(Datum, "%d.%m.%Y") AS Datum, DATE_FORMAT(Akt_Datum, "%d.%m.%Y") AS Akt_Datum FROM vv WHERE ID = "'.$_POST['ID'].'" ';
	$result3 =	$db->query($sql3);
	$nt3 =		$result3->fetch_assoc();
	echo "<h1>".$nt['ID']." - ".$nt['Anrede']." ".$nt['Vorname']." ".$nt['Nachname']."</h1>\n";
	echo "<p style=\"margin-left: 13px;\">\n";
	echo "	<label>Aufgenommen:</label>\n";
	echo "	<label class=\"links\">".$nt2['Vorname']." ".$nt2['Nachname'].", ".$nt3['Datum']."</label>\n";
	echo "	<label>Zuletzt bearbeitet:</label>\n";
	echo "	<label class=\"rechts\">".$nt3['Akt_Datum']."</label>\n";
	echo "</p>\n";
	echo "<fieldset>\n";
	echo "	<legend>Kontaktdaten</legend>\n";
	echo "	<label>Anrede</label>\n";
	echo "	<label class=\"links\">".$nt['Anrede']."</label>\n";
	echo "	<label>Telefon</label>\n";
	echo "	<label class=\"rechts\">".$nt['Telefon']."</label>\n";
	echo "	<br />\n";
	echo "	<label>Vorname</label>\n";
	echo "	<label class=\"links\">".$nt['Vorname']."</label>\n";
	echo "	<label>Fax</label>\n";
	echo "	<label class=\"rechts\">".$nt['Fax']."</label>\n";
	echo "	<br />\n";
	echo "	<label>Nachname</label>\n";
	echo "	<label class=\"links\">".$nt['Nachname']."</label>\n";
	echo "	<label>Mobil</label>\n";
	echo "	<label class=\"rechts\">".$nt['Mobil']."</label>\n";
	echo "	<br />\n";
	echo "	<label>Adresse</label>\n";
	echo "	<label class=\"links\">".$nt['Adresse']."</label>\n";
	echo "	<label>Firma</label>\n";
	echo "	<label class=\"rechts\">".$nt['Firma']."</label>\n";
	echo "	<br />\n";
	echo "	<label>PLZ / Ort</label>\n";
	echo "	<label class=\"links\">".$nt['PLZ']." ".$nt['Ort']."</label>\n";
	echo "	<br />\n";
	echo "	<label>Email</label>\n";
	echo "	<label class=\"links\">".$nt['Email']."</label>\n";
	echo "</fieldset>\n";
	echo "<fieldset>\n";
	echo "	<legend>Sonstiges</legend>\n";
	echo "	<p>".nl2br($nt['Sonstiges'])."</p>\n";
	echo "</fieldset>\n";
	echo "<fieldset>\n";
	echo "	<legend>Interne Infos</legend>\n";
	echo "	<p>".nl2br($nt['Intern'])."</p>\n";
	echo "</fieldset>\n";

	include "inhalte/personen/vv_obj.php";
}
?>