<?php
if ($_POST['fotos'])
{
	echo "Foto-Beschreibungen speichern!";
}
$sql = "SELECT *, MONTH(HU) AS HU_Monat, YEAR(HU) AS HU_Jahr, MONTH(AU) AS AU_Monat, YEAR(AU) AS AU_Jahr, DATE_FORMAT(Erstzulassung, '%d.%m.%Y') AS Erstzulassung FROM " . PREFIX . "_KfZ WHERE ID = \"" . $_POST['ID'] . "\";";
$result = $db->query($sql);
$nt = $result->fetch_assoc();
$sqlk = "SELECT * FROM " . PREFIX . "_Kontakte WHERE ID =\"" . $nt['Kontakt_ID'] . "\";";
$resultk = $db->query($sqlk);
$ntk = $resultk->fetch_assoc();

echo "<fieldset>\n";
echo "	<legend>" . $nt['Marke'] . " " . $nt['Modellvariante'] . ", Baujahr " . $nt['Baujahr'] . " --- " . $nt['Preis'] . " €</legend>\n";
echo "	<fieldset>\n";
echo "		<legend class=\"sub\">Fahrzeughalter</legend>\n";
echo "		<label>Name</label>\n";
echo "		<label class=\"data\">" . $ntk['Vorname'] . " " . $ntk['Nachname'] . "</label>\n";
echo "		<label>Firma</label>\n";
echo "		<label class=\"data\">" . $ntk['Firma'] . "</label>\n";
echo "		<br />\n";
echo "		<label>Anschrift</label>\n";
echo "		<label class=\"data\">" . $ntk['Strasse'] . " " . $ntk['Nummer'] . "</label>\n";
echo "		<label>PLZ / Ort</label>\n";
echo "		<label class=\"data\">" . $ntk['PLZ'] . " " . $ntk['Ort'] . " (" . $ntk['Land'] . ")</label>\n";
echo "		<br />\n";
echo "		<label>Telefon</label>\n";
echo "		<label class=\"data\">" . $ntk['Telefon'] . "</label>\n";
echo "		<label>Telefax</label>\n";
echo "		<label class=\"data\">" . $ntk['Fax'] . "</label>\n";
echo "		<br />\n";
echo "		<label>Mobil</label>\n";
echo "		<label class=\"data\">" . $ntk['Mobil'] . "</label>\n";
echo "		<label>Email</label>\n";
echo "		<label class=\"data\"><a href=\"mailto:" . $ntk['Email'] . "\">" . $ntk['Email'] . "</a></label>\n";
echo "		<br />\n";
echo "	</fieldset>\n";
echo "	<fieldset>\n";
echo "		<legend class=\"sub\">Allgemeine Daten</legend>\n";
echo "		<label>Fzg-Identifikationsnr.</label>\n";
echo "		<label class=\"data\">" . $nt['Fzg_Ident_Nr'] . "</label>\n";
echo "		<label>Kategorie</label>\n";
echo "		<label class=\"data\">" . $nt['Kategorie'] . "</label>\n";
echo "		<br />\n";
echo "		<label>HSN</label>\n";
echo "		<label class=\"data\">" . $nt['HSN'] . "</label>\n";
echo "		<label>TSN</label>\n";
echo "		<label class=\"data\">" . $nt['TSN'] . "</label>\n";
echo "		<br />\n";
echo "		<label>Fahrzeugart</label>\n";
echo "		<label class=\"data\">" . $nt['Fahrzeugart'] . "</label>\n";
echo "		<label>Kilometerlaufleistung</label>\n";
echo "		<label class=\"data\">" . $nt['Kilometerlaufleistung'] . " km</label>\n";
echo "		<br />\n";
echo "		<label>Baujahr</label>\n";
echo "		<label class=\"data\">" . $nt['Baujahr'] . "</label>\n";
echo "		<label>Erstzulassung</label>\n";
echo "		<label class=\"data\">" . $nt['Erstzulassung'] . "</label>\n";
echo "		<br />\n";
echo "		<label>nächste HU</label>\n";
echo "		<label class=\"data\">" . $nt['HU_Monat'] . " / " . $nt['HU_Jahr'] . "</label>\n";
echo "		<label>nächste AU</label>\n";
echo "		<label class=\"data\">" . $nt['AU_Monat'] . " / " . $nt['AU_Jahr'] . "</label>\n";
echo "		<br />\n";
echo "		<label>Anzahl der Fahrzeughalter</label>\n";
echo "		<label class=\"data\">" . $nt['Fahrzeughalter'] . "</label>\n";
echo "		<label>Unfallfahrzeug</label>\n";
if ($nt['Unfallfahrzeug'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "		<label>MwSt. ausweisbar</label>\n";
if ($nt['MwSt'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<label>Für Gewerbe</label>\n";
if ($nt['Gewerbe'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />&nbsp;<br />\n";
echo "		<fieldset style=\"border: none;\">\n";
echo "			<p>" . nl2br($nt['Beschreibung']) . "</p>\n";
echo "		</fieldset>\n";
echo "	</fieldset>\n";
echo "	<fieldset>\n";
echo "		<legend class=\"sub\">Technische Daten</legend>\n";
echo "		<label>Leistung in kW</label>\n";
echo "		<label class=\"data\">" . $nt['Leistung'] . "</label>\n";
echo "		<label>Getriebe</label>\n";
echo "		<label class=\"data\">" . $nt['Getriebe'] . "</label>\n";
echo "		<br />\n";
echo "		<label>Kraftstoffart</label>\n";
echo "		<label class=\"data\">" . $nt['Kraftstoffart'] . "</label>\n";
if ("Diesel" == $nt['Krafstoffart'])
{
	echo "		<label>Biodiesel geeignet</label>\n";
	if ($nt['Biodiesel'])
	{
		echo "		<label class=\"data\">ja</label>\n";
	}
	else
	{
		echo "		<label class=\"data\">nein</label>\n";
	}
	echo "		<br />\n";
	echo "		<label>&nbsp;</label><label class=\"data\">&nbsp;</label>\n";
	echo "		<label>Pflanzenöl geeignet</label>\n";
	if ($nt['Pflanzenoel'])
	{
		echo "		<label class=\"data\">ja</label>\n";
	}
	else
	{
		echo "		<label class=\"data\">nein</label>\n";
	}
}
elseif (("Benzin" == $nt['Kraftstoffart']) OR ("Hybrid" == $nt['Kraftstoffart']))
{
	echo "		<label>E10 geeignet</label>\n";
	if ($nt['E10'])
	{
		echo "		<label class=\"data\">ja</label>\n";
	}
	else
	{
		echo "		<label class=\"data\">nein</label>\n";
	}
}
echo "		<br />\n";
echo "		<label>Hubraum in ccm</label>\n";
echo "		<label class=\"data\">" . $nt['Hubraum'] . "</label>\n";
echo "		<label>Farbe</label>\n";
echo "		<label class=\"data\">" . $nt['Farbe'] . "</label>\n";
echo "		<br />\n";
echo "		<label>Herstellerfarbbezeichnung</label>\n";
echo "		<label class=\"data\">" . $nt['Herstellerfarbbezeichnung'] . "</label>\n";
echo "		<label>Metallic</label>\n";
if ($nt['Metallic'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "	</fieldset>\n";
echo "	<fieldset>\n";
echo "		<legend class=\"sub\">Komfort / Innenausstattung</legend>\n";
echo "		<label>Klimatisierung</label>\n";
echo "		<label class=\"data\">" . $nt['Klimatisierung'] . "</label>\n";
echo "		<label>Anzahl der Sitzplätze</label>\n";
echo "		<label class=\"data\">" . $nt['Sitzplaetze'] . "</label>\n";
echo "		<br />\n";
echo "		<label>Türen</label>\n";
echo "		<label class=\"data\">" . $nt['Tueren'] . "</label>\n";
echo "		<label>Innenausstattung</label>\n";
echo "		<label class=\"data\">" . $nt['Innenausstattung'] . "</label>\n";
echo "		<br />\n";
echo "		<label>Farbe der Innenausstattung</label>\n";
echo "		<label class=\"data\">" . $nt['Innen_farbe'] . "</label>\n";
echo "		<label>Einparkhilfe</label>\n";
if ($nt['Einparkhilfe'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "		<label>Navigationssystem</label>\n";
if ($nt['Navigationssystem'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<label>Sitzheizung</label>\n";
if ($nt['Sitzheizung'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "		<label>Tempomat</label>\n";
if ($nt['Tempomat'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<label>Servolenkung</label>\n";
if ($nt['Servolenkung'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "		<label>Elektrische Fensterheber</label>\n";
if ($nt['El_Fensterheber'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<label>Schiebedach</label>\n";
if ($nt['Schiebedach'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "		<label>Standheizung</label>\n";
if ($nt['Standheizung'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<label>Zentralverriegelung</label>\n";
if ($nt['Zentralverriegelung'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "	</fieldset>\n";
echo "	<fieldset>\n";
echo "		<legend class=\"sub\">Aussenausstattung</legend>\n";
echo "		<label>Bereifung</label>\n";
echo "		<fieldset style=\"border: none;\">\n";
echo "			<p>" . nl2br($nt['Bereifung']) . "</p>\n";
echo "		</fieldset>\n";
echo "		<label>Anhängerkupplung</label>\n";
if ($nt['Anhaengerkupplung'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<label>Leichtmetallfelgen</label>\n";
if ($nt['Leichtmetallfelgen'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "	</fieldset>\n";
echo "	<fieldset>\n";
echo "		<legend class=\"sub\">Sicherheit & Umwelt</legend>\n";
echo "		<label>Schadstoffklasse</label>\n";
echo "		<label class=\"data\">" . $nt['Schadstoffklasse'] . "</label>\n";
echo "		<label>Umweltplakette</label>\n";
echo "		<label class=\"data\">" . $nt['Umweltplakette'] . "</label>\n";
echo "		<br />\n";
echo "		<label>CO2-Emission in g/km</label>\n";
echo "		<label class=\"data\">" . $nt['CO2'] . "</label>\n";
echo "		<label>Verbrauch kombiniert</label>\n";
echo "		<label class=\"data\">" . $nt['Verbrauch_kombi'] . "</label>\n";
echo "		<br />\n";
echo "		<label>Verbrauch innerorts</label>\n";
echo "		<label class=\"data\">" . $nt['Verbrauch_innen'] . "</label>\n";
echo "		<label>Verbrauch ausserorts</label>\n";
echo "		<label class=\"data\">" . $nt['Verbrauch_aussen'] . "</label>\n";
echo "		<br />\n";
echo "		<label>Airbags</label>\n";
echo "		<label class=\"data\">" . $nt['Airbags'] . "</label>\n";
echo "		<br />\n";
echo "		<label>ABS</label>\n";
if ($nt['AntiBS'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<label>Wegfahrsperre</label>\n";
if ($nt['Wegfahrsperre'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "		<label>ESP</label>\n";
if ($nt['ESP'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<label>Allradantrieb</label>\n";
if ($nt['Allradantrieb'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "		<label>Partikelfilter</label>\n";
if ($nt['Partikelfilter'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<label>Xenon-Licht</label>\n";
if ($nt['Xenon'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "	</fieldset>\n";
echo "	<fieldset>\n";
echo "		<legend class=\"sub\">Extras</legend>\n";
echo "		<label>Behindertengerecht</label>\n";
if ($nt['Behindertengerecht'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<label>Scheckheftgepflegt</label>\n";
if ($nt['Scheckheftgepflegt'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "		<label>Garantie</label>\n";
if ($nt['Garantie'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<label>Taxi</label>\n";
if ($nt['Taxi'])
{
	echo "		<label class=\"data\">ja</label>\n";
}
else
{
	echo "		<label class=\"data\">nein</label>\n";
}
echo "		<br />\n";
echo "	</fieldset>\n";
echo "	<fieldset>\n";
echo "		<legend class=\"sub\">Sonstiges</legend>\n";
echo "		<fieldset style=\"border: none;\">\n";
echo "			<p>" . nl2br($nt['Sonstiges']) . "</p>\n";
echo "		</fieldset>\n";
echo "	</fieldset>\n";
echo "</fieldset>\n";