<?php
if (!isset($_SESSION['ID'])) {
} else {
	if (in_array("Alle_Objekte", $_SESSION['Rechte'])) {
		$abfrage = "";
	} elseif (in_array("Eigene_Objekte", $_SESSION['Rechte'])) {
		$abfrage = " AND TID = \"".$_SESSION['TID']."\" ";
	} else {
		die("Keine Zugriffsrechte");
	}
	$sql1 = 'SELECT ID, O_TYP, V_TYP, Kurz FROM objekte WHERE VVID = "'.$_POST['ID'].'" '.$abfrage.' ORDER BY O_TYP DESC, V_TYP DESC; ';
	$result1 = $db->query($sql1);
	echo "<fieldset>\n";
	echo "	<legend>Objekte des Vermieters / Verkäufers</legend>\n";
	while ($nt1 = $result1->fetch_assoc()) {
		echo "	<label style=\"margin-top: 0px;\">".$nt1['O_TYP']." - ".$nt1['V_TYP']."</label>\n";
		echo "	<span style=\"color: #000000;\">".$nt1['ID']." ".$nt1['Kurz']."</span>\n";
		echo "	<br />\n";
	}
	echo "</fieldset>\n";
}
?>
