Files
wachter/inhalte/sonstige/anlage.php

321 lines
8.6 KiB
PHP

<?php
$a = true;
$b = true;
$sql1="SELECT * FROM objekte WHERE ID = '" . $_GET['obj'] . "' ";
$result1 = $db->query($sql1);
$nt1 = $result1->fetch_assoc();
$sql2="SELECT Firma AS Vorname, Telefon, EMail FROM Firma WHERE ID = 2 ";
$result2 = $db->query($sql2);
$nt2 = $result2->fetch_assoc();
echo "<h2>" . $nt1['Kurz'] . "<br />Objekt-Nr: " . $nt1['ID'] . "</h2>\n";
echo "<h2 style=\"float:left;\">" . $nt1['O_TYP'] . "</h2>";
echo "<span style=\"float: right;\">\n";
echo " <a style=\"height: 24px; line-height: 24px; float:right;\" href=\"index.php?section=anlage&topic=rkauf&obj=".$_GET['obj']."&pdf=create\" target=\"_blank\"><img style=\"float:right;margin-right:10px;\" src=\"img/small_pdf.png\" alt=\"Expose zum Objekt als PDF anzeigen\" title=\"Expose zum Objekt als PDF anzeigen\" /></a>\n";
echo " <a style=\"height: 24px; line-height: 24px;float:right;\" href=\"index.php?section=anlage&topic=rkauf&obj=".$_GET['obj']."&pdf=create\" target=\"_blank\">PDF-Expose --></a>\n";
echo "</span><br style=\"clear:both;\" />\n";
if (isset($_GET['f'])) {
$pic = "img/objekte/".$_GET['obj']."_".$_GET['f'].".jpg";
}
else
{
$pic = '';
}
?>
<table class="uebersicht">
<colgroup>
<col width="130" />
<col width="110" />
<col width="120" />
<col width="130" />
<col width="130" />
<col width="70" />
</colgroup>
<tr>
<td colspan="6"><hr style="margin-top: 0px; margin-left: -5px; margin-right: -5px;"/></td>
</tr>
<tr>
<th colspan="4">Übersicht</th>
<th colspan="2">Kontakt</th>
</tr>
<tr>
<td>Gesamtfläche:</td><td colspan="3"><?php echo $nt1['WohnF']; ?> m&sup2;</td>
<td colspan="2"><?php echo fnc_getUsernameById ( $nt1['TID'], 'welcome' ); ?></td><td rowspan="3">
</tr>
<tr>
<td>Gewerbefläche:</td><td colspan="3"><?php echo $nt1['GrundF']; ?> m&sup2;</td>
<td colspan="2"><?php echo $nt2['Telefon']; ?></td>
</tr>
<tr>
<td>Wohnfläche:</td><td colspan="3"><?php echo $nt1['AnzGarStell']; ?> m&sup2;</td>
<td colspan="2"><?php echo $nt2['EMail']; ?></td>
</tr>
<tr>
<td>Kaufpreis:</td><td colspan="3"><?php echo number_format ( $nt1['Mkalt'], 0, ',', '.' ); ?> &euro;</td>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="6"><hr style="margin-bottom: 0px; margin-left: -5px; margin-right: -5px;"/></td>
</tr>
</table><br />
<table class="foto">
<colgroup>
<col width="480px" />
<col span="2" width="110px" />
</colgroup>
<tr>
<?php
$count = 0;
for ( $i = 1; $i < 11; $i++ )
{
$file = "img/objekte/".$_GET['obj']."_".$i.".jpg";
if ( ( "1" == $i ) AND ( isset ( $_GET['f'] ) ) )
{
echo "<td rowspan=\"5\"><img id=\"showImg\" src=\"" . $pic . "?ts=" . date ( 'YmdHis' ) . "\" title=\"" .$nt1['Foto' . $i ] . "\" alt=\"" . $nt1[ 'Foto' . $i ] . "\" /></td>\n";
}
if ( file_exists ( $file ) )
{
if ( "" == $pic )
{
$pic = $file;
echo "<td rowspan=\"5\"><img id=\"showImg\" src=\"" . $file . "?ts=" . date ( 'YmdHis' ) . "\" title=\"" . $nt1['Foto' . $i ] . "\" alt=\"" . $nt1['Foto' . $i ] . "\" /></td>\n";
}
echo "<td style=\"text-align:right;\"><img style=\"cursor:pointer;\" onclick=\"document.getElementById('showImg').setAttribute('src' , this.getAttribute('src'));document.getElementById('showImg').setAttribute('title' , this.getAttribute('title'));\" src=\"" . $file . "?ts=" . date ( 'YmdHis' ) . "\" title=\"" . $nt1['Foto' . $i ] . "\" alt=\"" . $nt1['Foto' . $i ] . "\" width=\"100px\" height=\"75px\" /></td>\n";
if ( !$a )
{
echo "</tr>\n<tr>\n";
}
$a = ( $a xor $b );
$count++;
}
}
for ( $count; $count < 11; $count++ )
{
echo "<td>&nbsp</td>\n";
if ( !$a )
{
echo "</tr>\n<tr>\n";
}
$a = ( $a xor $b );
}
?>
</tr>
</table><br />
<table class="expose">
<colgroup>
<col width="200" />
<col width="150" />
<col width="200" />
<col width="150" />
</colgroup>
<tr>
<th colspan="4">Beschreibung</th>
</tr>
<tr>
<td colspan="4"><?php echo nl2br($nt1['OBeschreibung']); ?><br />&nbsp;<br /></td>
</tr>
<tr>
<?php
if ( 'keineAngabe' == $nt1['Zustand'] )
{
echo "<td colspan=\"2\"></td>";
}
else
{
echo "<td>Zustand:</td><td>" . $nt1['Zustand'] . "</td>";
}
if ( 'keineAngabe' == $nt1['Quali'] )
{
echo "<td colspan=\"2\"></td>";
}
else
{
echo "<td>Qualität der Ausstattung:</td><td>" . $nt1['Quali'] . "</td>";
}
?>
</tr>
<tr>
<td>Baujahr:</td><td><?php echo $nt1['Baujahr']; ?></td><td>Modernisiert:</td><td><?php echo $nt1['Modern']; ?></td>
</tr>
<tr>
<td colspan="4"><hr /></td>
</tr>
<tr>
<th colspan="4">Kosten</th>
</tr>
<?php
if ( '1' == $nt['ProvisionsPflichtig'] )
{
?>
<tr>
<td>Provision:</td>
<td colspan="3"><?php echo $nt1['Provision']; ?></td>
</tr>
<tr>
<td>Provisionshinweis:</td>
<td colspan="3"><?php echo $nt1['ProvisionsHinweis']; ?></td>
</tr>
<?php
}
?>
<tr>
<td>Kaufpreis:</td>
<td><?php echo number_format ( $nt1['Mkalt'], 0, ',', '.' ); ?> &euro;</td>
<td>zzgl. Stellplatz:</td>
<td><?php echo number_format ( $nt1['StellK'], 0, ',', '.') ; ?> &euro;</td>
</tr>
<tr>
<td colspan="4"><hr /></td>
</tr>
<tr>
<th colspan="4">Rendite</th>
</tr>
<tr>
<td>Vermietbare Fläche:</td>
<td><?php echo $nt1['VermietbareFlaeche']; ?> &euro;</td>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td>Mieteinnahme pa IST:</td>
<td><?php echo number_format ( $nt1['MietEinnahmePaIst'], 0, ',', '.' ); ?> &euro;</td>
<td>Mieteinnahme pa SOLL:</td>
<td><?php echo number_format ( $nt1['MietEinnahmePaSoll'], 0, ',', '.' ); ?> &euro;</td>
</tr>
<tr>
<td colspan="4"><hr /></td>
</tr>
<tr>
<th colspan="4">Lage</th>
</tr>
<tr>
<td>Fussweg öff. Verkehrsmitteln</td>
<td><?php echo $nt1['FusswegOeNV']; ?> Min.</td>
<td>Fahrzeit HBF</td>
<td><?php echo $nt1['FahrBHF']; ?> Min.</td>
</tr>
<tr>
<td>Fahrzeit BAB</td>
<td><?php echo $nt1['FahrBAB']; ?> Min.</td>
<td>Fahrzeit Flughafen</td>
<td><?php echo $nt1['Fahrflug']; ?> Min.<br />&nbsp;<br /></td>
</tr>
<tr>
<td colspan="4"> <?php echo nl2br( $nt1['Lage'] ); ?></td>
</tr>
<tr>
<td colspan="4"><hr /></td>
</tr>
<tr>
<th colspan="4">Ausstattung innen</th>
</tr>
<tr>
<?php
$a = true;
if ('1' == $nt1['EinbauK']) {
echo "<td>Einbauküche:</td><td><img src=\"img/1.png\" alt=\"ja\" /></td> \n";
$a = ($a xor $b);
if ($a) {
echo "</tr>\n<tr>\n";
}
}
if ('1' == $nt1['Speise']) {
echo "<td>Speisekammer:</td><td><img src=\"img/1.png\" alt=\"ja\" /></td> \n";
$a = ($a xor $b);
if ($a) {
echo "</tr>\n<tr>\n";
}
}
if ('1' == $nt1['BadeW']) {
echo "<td>Badewanne:</td><td><img src=\"img/1.png\" alt=\"ja\" /></td> \n";
$a = ($a xor $b);
if ($a) {
echo "</tr>\n<tr>\n";
}
}
if ('1' == $nt1['DuschK']) {
echo "<td>Duschkabine:</td><td><img src=\"img/1.png\" alt=\"ja\" /></td> \n";
$a = ($a xor $b);
if ($a) {
echo "</tr>\n<tr>\n";
}
}
if ('1' == $nt1['WCsep']) {
echo "<td>WC separat:</td><td><img src=\"img/1.png\" alt=\"ja\" /></td> \n";
$a = ($a xor $b);
if ($a) {
echo "</tr>\n<tr>\n";
}
}
if ('1' == $nt1['WCbad']) {
echo "<td>WC im Bad:</td><td><img src=\"img/1.png\" alt=\"ja\" /></td> \n";
$a = ($a xor $b);
if ($a) {
echo "</tr>\n<tr>\n";
}
}
if ('1' == $nt1['Abstell']) {
echo "<td>Abstellraum:</td><td><img src=\"img/1.png\" alt=\"ja\" /></td> \n";
$a = ($a xor $b);
if ($a) {
echo "</tr>\n<tr>\n";
}
}
if ('1' == $nt1['DachB']) {
echo "<td>Dachboden:</td><td><img src=\"img/1.png\" alt=\"ja\" /></td> \n";
$a = ($a xor $b);
if ($a) {
echo "</tr>\n<tr>\n";
}
}
if ('1' == $nt1['Keller']) {
echo "<td>Keller:</td><td><img src=\"img/1.png\" alt=\"ja\" /></td> \n";
$a = ($a xor $b);
}
?>
</tr>
<tr>
<td>Heizart:</td><td colspan="3"><?php echo $nt1['Heizart']; ?></td>
</tr>
<?php
if ( 'keineAngabe' != $nt1['EnerTyp'] )
{
?>
<tr>
<td>Energieausweistyp:</td><td colspan="3"><?php echo $nt1['EnerTyp']; ?></td>
</tr>
<tr>
<td>Verbrauchskennwert:</td><td colspan="3"><?php echo $nt1['EnerVKW']; ?></td>
</tr>
<tr>
<td>Warmwasser enthalten:</td><td colspan="3"><?php echo ( '1' == $nt1['EnerWWEnt'] ) ? "<img src=\"img/1.png\" alt=\"ja\" />" : "<img src=\"img/0.png\" alt=\"nein\" />"; ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<tr>
<th colspan="4">Ausstattung</th>
</tr>
<tr>
<td colspan="4"><?php echo nl2br($nt1['Ausstatt']); ?></td>
</tr>
<tr>
<td colspan="4"><hr /></td>
</tr>
<tr>
<th colspan="4">Sonstiges</th>
</tr>
<tr>
<td colspan="4"><?php echo nl2br($nt1['Sonstiges']); ?></td>
</tr>
</table><br />