<?php
if (!isset($_SESSION['ID'])) {
} else {
	if ('POST' == $_SERVER['REQUEST_METHOD']) {
		if (!isset($_POST['formaction'])) {
			echo "Benutzen sie nur Formulare von der Homepage.";
		}
		elseif ('Anzeigen' == ($_POST['formaction'])) {
			$sqlob =	'SELECT * FROM objekte WHERE ID = "'.$_POST['ID'].'" ';
			$resultob = $db->query($sqlob);
			$ntob = 	$resultob->fetch_assoc();
			
			$sql1 =		'SELECT DATE_FORMAT(Datum, "%d.%m.%Y") AS Datum, DATE_FORMAT(Akt_Datum, "%d.%m.%Y") AS Akt_Datum FROM objekte WHERE ID = "'.$_POST['ID'].'" ';
			$result1 =	$db->query($sql1);
			$nt1 =		$result1->fetch_assoc();
			
			$sql3 =		"SELECT Wert FROM US WHERE ID = \"9\";";
			$result3 =	$db->query($sql3);
			$nt3 =		$result3->fetch_assoc();

/*			$sql4 = 'SELECT
						 *
					 FROM vv
					 WHERE ID = "'.$ntob['VVID'].'" ';
			$result4 = $db->query($sql4);
			$nt4 = $result4->fetch_assoc();
*/			
			echo "<h1>".$ntob['ID']." - ".$ntob['Kurz']."</h1>\n";
			echo "<p style=\"margin-left: 13px;\">\n";
			echo "	<label>Aufgenommen:</label>\n";
			echo "	<label class=\"links\">".fnc_getUsernameById ( $ntob['TID'], 'logfiles' ).", ".$nt1['Datum']."</label>\n";
			echo "	<label>Zuletzt bearbeitet:</label>\n";
			echo "	<label class=\"rechts\">".$nt1['Akt_Datum']."</label>\n";
			if ("Tags" == $nt3['Wert']) {
				echo "	<label>SEO-Schlagworte</label>\n";
				echo "	<br />\n";
				echo "<span style=\"color: #000000;\">";
				echo $ntob['Tags'];
				echo "</span>\n";
			}
			echo "</p>\n";
			echo "<br style=\"clear: both;\" />\n";
/*			echo "<fieldset>\n";
			echo "	<legend>Kontaktdaten</legend>\n";
			echo "	<label>Anrede</label>\n";
			echo "	<label class=\"links\">".$nt4['Anrede']."</label>\n";
			echo "	<label>Telefon</label>\n";
			echo "	<label class=\"rechts\">".$nt4['Telefon']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Vorname</label>\n";
			echo "	<label class=\"links\">".$nt4['Vorname']."</label>\n";
			echo "	<label>Fax</label>\n";
			echo "	<label class=\"rechts\">".$nt4['Fax']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Nachname</label>\n";
			echo "	<label class=\"links\">".$nt4['Nachname']."</label>\n";
			echo "	<label>Mobil</label>\n";
			echo "	<label class=\"rechts\">".$nt4['Mobil']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Adresse</label>\n";
			echo "	<label class=\"links\">".$nt4['Adresse']."</label>\n";
			echo "	<label>Firma</label>\n";
			echo "	<label class=\"rechts\">".$nt4['Firma']."</label>\n";
			echo "	<br />\n";
			echo "	<label>PLZ / Ort</label>\n";
			echo "	<label class=\"links\">".$nt4['PLZ']." ".$nt4['Ort']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Email</label>\n";
			echo "	<label class=\"links\">".$nt4['Email']."</label>\n";
			echo "</fieldset>\n";
			echo "<br />\n";
*/			echo "<fieldset>\n";
			echo "	<legend>Eigenschaften</legend>\n";
			echo "	<label>Neu eingetroffen</label>\n";
			echo "	<label class=\"links\"><img src=\"../img/".$ntob['Neu'].".png\" /></label>\n";
			echo "	<label>Foto auf Startseite</label>\n";
			echo "	<label class=\"rechts\"><img src=\"../img/".$ntob['FotoStart'].".png\" /></label>\n";
			echo "	<br />\n";
			echo "	<label>Zimmer</label>\n";
			echo "	<label class=\"links\">".$ntob['Zimmer']."</label>\n";
			echo "	<label>Art</label>\n";
			echo "	<label class=\"rechts\">".$ntob['Art']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Zustand</label>\n";
			echo "	<label class=\"links\">".$ntob['Zustand']."</label>\n";
			echo "	<label>Qualität-Ausstattung</label>\n";
			echo "	<label class=\"rechts\">".$ntob['Quali']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Baujahr</label>\n";
			echo "	<label class=\"links\">".$ntob['Baujahr']."</label>\n";
			echo "	<label>letzte Modernisierung</label>\n";
			echo "	<label class=\"rechts\">".$ntob['Modern']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Etage</label>\n";
			echo "	<label class=\"links\">".$ntob['Etage']."</label>\n";
			echo "	<label>Etagen</label>\n";
			echo "	<label class=\"rechts\">".$ntob['Etagen']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Wohnfläche</label>\n";
			echo "	<label class=\"links\">".$ntob['WohnF']."</label>\n";
			echo "	<label>Grundfläche</label>\n";
			echo "	<label class=\"rechts\">".$ntob['GrundF']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Heizart</label>\n";
			echo "	<label class=\"links\">".$ntob['Heizart']."</label>\n";
			echo "	<label>Befeuerungsart</label>\n";
			echo "	<label class=\"rechts\">".$ntob['Befeuerung']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Waschmaschine im</label>\n";
			echo "	<label class=\"links\">".$ntob['WaschOrt']."</label>\n";
			echo "	<label>TV-Anschluss</label>\n";
			echo "	<label class=\"rechts\">".$ntob['TV']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Bezug</label>\n";
			echo "	<label class=\"links\">".$ntob['Bezug']."</label>\n";
			echo "	<br />\n";
			echo "</fieldset>\n";
			echo "<br />\n";
			echo "<fieldset>\n";
			echo "	<legend>Lage</legend>\n";
			echo "	<label>Adresse</label>\n";
			echo "	<label class=\"links\">".$ntob['Strasse']." ".$ntob['StraNr']."</label>\n";
			echo "	<label>Ort</label>\n";
			echo "	<label class=\"rechts\">".$ntob['PLZ']." ".$ntob['Ort']."</label>\n";
			echo "	<br />\n";
			echo "<p>".nl2br($ntob['Lage'])."</p>\n";
			echo "</fieldset>\n";
			echo "<br />\n";
			echo "<fieldset>\n";
			echo "	<legend>Kosten</legend>\n";
			echo "	<label>Miete kalt</label>\n";
			echo "	<label class=\"links\">".$ntob['Mkalt']."</label>\n";
			echo "	<label>Kaution</label>\n";
			echo "	<label class=\"rechts\">".$ntob['Kaution']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Miete warm</label>\n";
			echo "	<label class=\"links\">".$ntob['Mwarm']."</label>\n";
			echo "	<label>zzgl. Garage</label>\n";
			echo "	<label class=\"rechts\">".$ntob['GaraK']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Nebenkosten</label>\n";
			echo "	<label class=\"links\">".$ntob['NebenK']."</label>\n";
			echo "	<label>zzgl. Stellplatz</label>\n";
			echo "	<label class=\"rechts\">".$ntob['StellK']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Heizkosten</label>\n";
			echo "	<label class=\"links\">".$ntob['HeizK']."</label>\n";
			echo "	<label>Ablöse Einbauküche</label>\n";
			echo "	<label class=\"rechts\">".$ntob['EBKK']."</label>\n";
			echo "	<br />\n";
			echo "	<label>HeizK in NK enthalten</label>\n";
			echo "	<label class=\"links\"><img src=\"../img/".$ntob['HKent'].".png\" /></label>\n";
			echo "	<label>sonstige Kosten</label>\n";
			echo "	<label class=\"rechts\">".$ntob['SonK']."</label>\n";
			echo "	<br />\n";
			echo "</fieldset>\n";
			echo "<br />\n";
			echo "<fieldset>\n";
			echo "	<legend>Auflagen</legend>\n";
			echo "	<label>Erwachsene</label>\n";
			echo "	<label class=\"links\">".$ntob['EZahl']."</label>\n";
			echo "	<label>Kinder</label>\n";
			echo "	<label class=\"rechts\">".$ntob['KZahl']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Raucher</label>\n";
			echo "	<label class=\"links\"><img src=\"../img/".$ntob['Raucher'].".png\" /></label>\n";
			echo "	<label>Ausländer</label>\n";
			echo "	<label class=\"rechts\"><img src=\"../img/".$ntob['Ausl'].".png\" /></label>\n";
			echo "	<br />\n";
			echo "	<label>Tiere</label>\n";
			echo "	<label class=\"links\">".$ntob['Tiere']."</label>\n";
			echo "	<label>Renovierung bei</label>\n";
			echo "	<label class=\"rechts\">".$ntob['Renovierung']."</label>\n";
			echo "	<br />\n";
			echo "</fieldset>\n";
			echo "<br />\n";
			echo "<fieldset>\n";
			echo "	<legend>Ausstattung</legend>\n";
			echo "<fieldset>\n";
			echo "	<legend>innen</legend>\n";
			echo "	<label>Abstellraum</label>\n";
			echo "	<label class=\"links\"><img src=\"../img/".$ntob['Abstell'].".png\" /></label>\n";
			echo "	<label>Dachboden</label>\n";
			echo "	<label class=\"rechts\"><img src=\"../img/".$ntob['DachB'].".png\" /></label>\n";
			echo "	<br />\n";
			echo "	<label>Keller</label>\n";
			echo "	<label class=\"links\"><img src=\"../img/".$ntob['Keller'].".png\" /></label>\n";
			echo "	<label>Aufzug</label>\n";
			echo "	<label class=\"rechts\"><img src=\"../img/".$ntob['Aufzug'].".png\" /></label>\n";
			echo "	<br />\n";
			echo "	<label>Betreutes Wohnen</label>\n";
			echo "	<label class=\"links\"><img src=\"../img/".$ntob['Betreut'].".png\" /></label>\n";
			echo "	<label>Barrierefrei</label>\n";
			echo "	<label class=\"rechts\"><img src=\"../img/".$ntob['Barrierefrei'].".png\" /></label>\n";
			echo "	<br />\n";
			echo "</fieldset>\n";
			echo "<br />\n";
			echo "<fieldset>\n";
			echo "	<legend>Küche</legend>\n";
			echo "	<label>Einbauküche</label>\n";
			echo "	<label class=\"links\"><img src=\"../img/".$ntob['EinbauK'].".png\" /></label>\n";
			echo "	<label>Speisekammer</label>\n";
			echo "	<label class=\"rechts\"><img src=\"../img/".$ntob['Speise'].".png\" /></label>\n";
			echo "	<br />\n";
			echo "</fieldset>\n";
			echo "<br />\n";
			echo "<fieldset>\n";
			echo "	<legend>Badezimmer</legend>\n";
			echo "	<label>Anzahl Badezimmer</label>\n";
			echo "	<label class=\"links\">".$ntob['AnzBad']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Badewanne</label>\n";
			echo "	<label class=\"links\"><img src=\"../img/".$ntob['BadeW'].".png\" /></label>\n";
			echo "	<label>Duschkabine</label>\n";
			echo "	<label class=\"rechts\"><img src=\"../img/".$ntob['DuschK'].".png\" /></label>\n";
			echo "	<br />\n";
			echo "	<label>WC im Bad</label>\n";
			echo "	<label class=\"links\"><img src=\"../img/".$ntob['WCbad'].".png\" /></label>\n";
			echo "	<label>Gäste-WC</label>\n";
			echo "	<label class=\"rechts\"><img src=\"../img/".$ntob['WCsep'].".png\" /></label>\n";
			echo "	<br />\n";
			echo "</fieldset>\n";
			echo "<br />\n";
			echo "<fieldset>\n";
			echo "	<legend>aussen</legend>\n";
			echo "	<label>Anzahl Garage/Stellpl.</label>\n";
			echo "	<label class=\"links\">".$ntob['AnzGarStell']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Garage</label>\n";
			echo "	<label class=\"links\"><img src=\"../img/".$ntob['Garage'].".png\" /></label>\n";
			echo "	<label>Stellplatz</label>\n";
			echo "	<label class=\"rechts\"><img src=\"../img/".$ntob['StellPl'].".png\" /></label>\n";
			echo "	<br />\n";
			echo "	<label>Terrasse</label>\n";
			echo "	<label class=\"links\"><img src=\"../img/".$ntob['Terrasse'].".png\" /></label>\n";
			echo "	<label>Balkon</label>\n";
			echo "	<label class=\"rechts\"><img src=\"../img/".$ntob['Balkon'].".png\" /></label>\n";
			echo "	<br />\n";
			echo "	<label>Gartenbenutzung</label>\n";
			echo "	<label class=\"links\"><img src=\"../img/".$ntob['Garten'].".png\" /></label>\n";
			echo "	<br />\n";
			echo "</fieldset>\n";
			echo "<br />\n";
			echo "<fieldset>\n";
			echo "	<legend>Energieausweis</legend>\n";
			echo "	<label>Energieausweistyp</label>\n";
			echo "	<label class=\"links\">".$ntob['EnerTyp']."</label>\n";
			echo "	<br />\n";
			echo "	<label>Verbrauchskennwert</label>\n";
			echo "	<label class=\"links\">".$ntob['EnerVKW']."</label>\n";
			echo "	<label>Warmwasser enthalten</label>\n";
			echo "	<label class=\"rechts\"><img src=\"../img/".$ntob['EnerWWEnt'].".png\" /></label>\n";
			echo "	<br />\n";
			echo "</fieldset>\n";
			echo "<br />\n";
			echo "	<p>".nl2br($ntob['Ausstatt'])."</p>\n";
			echo "</fieldset>\n";
			echo "<br />\n";
			echo "<fieldset>\n";
			echo "	<legend>Sonstiges</legend>\n";
			echo "	<p>".nl2br($ntob['Sonstiges'])."</p>\n";
			echo "</fieldset>\n";
			echo "<br />\n";
			echo "<fieldset>\n";
			echo "	<legend>Interne Infos</legend>\n";
			echo "	<p>".nl2br($ntob['Intern'])."</p>\n";
			echo "</fieldset>\n";
			echo "<br />\n";
			echo "<fieldset>\n";
			echo "	<legend>Fotos</legend>\n";
			echo "	<table style=\"background:none;\">\n";
			echo "		<colgroup>\n";
			echo "			<col span=\"4\" width=\"180px\" />\n";
			echo "		</colgroup>\n";
			echo "		<tr>\n";
			$j = 0;
			for ($i=1; $i<8; $i++) {
				$pic = "../img/objekte/".$_POST['ID']."_".$i.".jpg";
				if (file_exists($pic)) {
					echo "			<td style=\"text-align:center;\" >\n";
					echo "				<img src=\"".$pic."\" title=\"".$ntob['Foto'.$i]."\" width=\"100px\" height=\"100px\"/> \n";
					echo "				<br />\n";
					echo $ntob['Foto'.$i];
					echo "			</td>\n";
					$j++;
				}
				if ("4" == $j) {
					echo "		</tr>\n";
					echo "		<tr>\n";
				}
			}
			echo "		</tr>\n";
			echo "	</table>\n";
			echo "</fieldset>\n";
			echo "<br />\n";
		}	
	}
}

?>
