313 lines
10 KiB
PHP
313 lines
10 KiB
PHP
<?php
|
|
|
|
$sql2 = 'SELECT * FROM objekte WHERE ID = "'.$_POST['ID'].'";';
|
|
$result2 = $db->query($sql2);
|
|
$nt2 = $result2->fetch_assoc();
|
|
$user = fnc_getUsernameById ( $nt2['TID'], 'portal' );
|
|
|
|
$Importmodus = $_POST['ImmoScout'];
|
|
$stellplkosten = 0;
|
|
$picpath = '';
|
|
$Baujahr = '';
|
|
$Gesamtflaeche = '';
|
|
$Garten = '';
|
|
$HausT = '';
|
|
$Heizungsart = '';
|
|
$KategorieTyp = '';
|
|
$Nebenkosten = '';
|
|
$PreisParkflaeche = '';
|
|
$PreisProParkflaeche = '';
|
|
$Einbaukueche = '';
|
|
$Keller = '';
|
|
$Befeuerungsart = '';
|
|
$Vermarktung = '';
|
|
$Waehrung = ' Waehrung="EUR"'."\n";
|
|
$Modernisierung = '';
|
|
$Energieausweis = '';
|
|
$Provision = '';
|
|
$Wege = '';
|
|
$OBeschreib = '';
|
|
if ( !empty ( $nt2['Provision'] ) )
|
|
{
|
|
$Provision = ' Provision="' . $nt2['Provision'] . "\"\n";
|
|
}
|
|
if ( '1' == $nt2['ProvisionsPflichtig'] )
|
|
{
|
|
$Provision .= ' Provisionspflichtig="true"'."\n";
|
|
}
|
|
if ( !empty ( $nt2['ProvisionsHinweis'] ) )
|
|
{
|
|
$Provision .= ' Provisionshinweis="' . $nt2['ProvisionsHinweis'] . "\"\n";
|
|
}
|
|
|
|
if ( '0' != $nt2['FusswegOeNV'] )
|
|
{
|
|
$Wege .= ' FusswegOeNV="' . $nt2['FusswegOeNV'] . '"'."\n";
|
|
}
|
|
if ( '0' != $nt2['FahrBHF'] )
|
|
{
|
|
$Wege .= ' FahrzeitBHf="' . $nt2['FahrBHF'] . '"'."\n";
|
|
}
|
|
if ( '0' != $nt2['FahrBAB'] )
|
|
{
|
|
$Wege .= ' FahrzeitBAB="' . $nt2['FahrBAB'] . '"'."\n";
|
|
}
|
|
if ( '0' != $nt2['Fahrflug'] )
|
|
{
|
|
$Wege .= ' FahrzeitFlughafen="' . $nt2['Fahrflug'] . '"'."\n";
|
|
}
|
|
|
|
$Adresse = ' <Adresse '."\n";
|
|
if ( !empty ( $nt2['Strasse'] ) )
|
|
{
|
|
$Adresse .= ' Strasse="'.$nt2['Strasse'].'" '."\n";
|
|
}
|
|
if ( !empty ( $nt2['StraNr'] ) )
|
|
{
|
|
$Adresse .= ' Hausnummer="'.$nt2['StraNr'].'" '."\n";
|
|
}
|
|
$Adresse .= ' Ort="'.$nt2['Ort'].'" '."\n";
|
|
$Adresse .= ' Postleitzahl="'.$nt2['PLZ'].'" '."\n";
|
|
$Adresse .= ' Laenderkennzeichen="DEU"'."\n";
|
|
$Adresse .= ' />'."\n";
|
|
|
|
$Kontaktperson = " <Kontaktperson \n";
|
|
$Kontaktperson .= " Anrede=\"". $user[0] ."\" \n";
|
|
$Kontaktperson .= " Vorname=\"".$user[1]."\" \n";
|
|
$Kontaktperson .= " Nachname=\"".$user[2]."\" \n";
|
|
$Kontaktperson .= " Telefon=\"".KONT_TEL."\" \n";
|
|
$Kontaktperson .= " Homepage=\"".KONT_HOME."\" \n";
|
|
$Kontaktperson .= " EMail=\"".KONT_MAIL."\" \n";
|
|
$Kontaktperson .= " />\n";
|
|
|
|
if ( 'keine Angabe' != $nt2['EnerTyp'] )
|
|
{
|
|
$Energieausweis = ' <Energieausweis '."\n";
|
|
$Energieausweis .= ' Energieausweistyp="'.$nt2['EnerTyp'].'" '."\n";
|
|
$Energieausweis .= ' Energieverbrauchskennwert="'.$nt2['EnerVKW'].'" '."\n";
|
|
if ( $nt2['EnerWWEnt'] )
|
|
{
|
|
$Energieausweis .= ' WarmwasserEnthalten="true"'."\n";
|
|
}
|
|
$Energieausweis .= ' />'."\n";
|
|
}
|
|
|
|
if (0 != (int)$nt2['Baujahr']) {
|
|
$Baujahr = ' Baujahr="'.$nt2['Baujahr'].'"'."\n";
|
|
}
|
|
|
|
if ('' != $nt2['OBeschreibung']) {
|
|
$OBeschreib = ' <Objektbeschreibung>'."\n";
|
|
$OBeschreib .= ' '.substr($nt2['OBeschreibung'],0,2000)."\n";
|
|
$OBeschreib .= ' </Objektbeschreibung>'."\n";
|
|
}
|
|
|
|
if ('' != $nt2['Ausstatt']) {
|
|
$Ausstattung = ' <Ausstattung>'."\n";
|
|
$Ausstattung .= ' '.substr($nt2['Ausstatt'],0,2000)."\n";
|
|
$Ausstattung .= ' </Ausstattung>'."\n";
|
|
}
|
|
|
|
if ('' != $nt2['Sonstiges']) {
|
|
$Sonst = ' <SonstigeAngaben>'."\n";
|
|
$Sonst .= ' '.substr($nt2['Sonstiges'],0,2000)."\n";
|
|
$Sonst .= ' </SonstigeAngaben>'."\n";
|
|
}
|
|
|
|
if (('Büro' == $nt2['O_TYP']) OR ('Praxis' == $nt2['O_TYP'])) {
|
|
$Objekt = "BueroPraxis";
|
|
$Flaeche = ' BueroPraxisFlaeche="'.$nt2['WohnF'].'"'."\n";
|
|
} elseif ('Einzelhandel' == $nt2['O_TYP']) {
|
|
$Objekt = "Einzelhandel";
|
|
$Flaeche = ' Verkaufsflaeche="'.$nt2['WohnF'].'"'."\n";
|
|
} elseif (('Lagerhalle' == $nt2['O_TYP']) OR ('Produktionshalle' == $nt2['O_TYP'])) {
|
|
$Objekt = "HalleProduktion";
|
|
$Flaeche = ' LagerProduktionsFlaeche="'.$nt2['WohnF'].'"'."\n";
|
|
} elseif ('Gastronomie' == $nt2['O_TYP']) {
|
|
$Objekt = "Gastronomie";
|
|
if ( $nt2['WohnF'] != 0 )
|
|
{
|
|
$Flaeche = ' GastraumFlaeche="'.$nt2['WohnF'].'"'."\n";
|
|
}
|
|
else
|
|
{
|
|
$Flaeche = ' GastraumFlaeche="'.$nt2['GrundF'].'"'."\n";
|
|
}
|
|
$KategorieTyp = " Objektkategorie2=\"";
|
|
if (eregi('Hotel', $nt2['Beschreibung'])) {
|
|
$KategorieTyp .= "Hotel";
|
|
} elseif (eregi('Bar', $nt2['Beschreibung'])) {
|
|
$KategorieTyp .= "Barbetrieb";
|
|
} elseif (eregi('Gast', $nt2['Beschreibung'])) {
|
|
$KategorieTyp .= "Gaststaette";
|
|
} elseif (eregi('Pension', $nt2['Beschreibung'])) {
|
|
$KategorieTyp .= "Pension";
|
|
} elseif (eregi('Restau', $nt2['Beschreibung'])) {
|
|
$KategorieTyp .= "Restaurant";
|
|
} elseif (eregi('Disko', $nt2['Beschreibung'])) {
|
|
$KategorieTyp .= "Diskothek";
|
|
} else {
|
|
$KategorieTyp .= "Caffee";
|
|
}
|
|
$KategorieTyp .= "\"\n";
|
|
} else {
|
|
$Objekt = "SonstigeGewerbe";
|
|
$Flaeche = ' Hauptflaeche="'.$nt2['WohnF'].'"'."\n";
|
|
$KategorieTyp = " Objektkategorie2=\"";
|
|
$KategorieTyp .= "Gewerbeflaeche";
|
|
$KategorieTyp .= "\"\n";
|
|
}
|
|
|
|
if (0 != (int)$nt2['GrundF']) {
|
|
$Gesamtflaeche = ' Gesamtflaeche="'.$nt2['GrundF'].'"'."\n";
|
|
}
|
|
|
|
// Berechnung PreisParkflaeche
|
|
if (0 != (int)$nt2['GaraK']) {
|
|
$stellplkosten = (int)$nt2['GaraK'];
|
|
}
|
|
if (0 != (int)$nt2['GaraK']) {
|
|
$stellplkosten = $stellplkosten + (int)$nt2['StellK'];
|
|
}
|
|
if (0 != $stellplkosten) {
|
|
$PreisParkflaeche = ' PreisParkflaeche="'.$stellplkosten.'" ';
|
|
}
|
|
if (0 != (int)$nt2['NebenK']) {
|
|
$Nebenkosten = ' Nebenkosten="'.$nt2['NebenK'].'" ';
|
|
}
|
|
if ( ( $nt2['O_TYP'] == 'Gastronomie' OR $nt2['O_TYP'] == 'SonstigeGewerbe' ) AND 0 != $stellplkosten )
|
|
{
|
|
$PreisProParkflaeche = ' PreisProParkflaeche="' . (int)( $stellplkosten / $nt2['AnzGarStell'] ) . '" ';
|
|
}
|
|
|
|
$Vermarktung = ' <Vermarktung';
|
|
if ( $nt2['O_TYP'] != 'Gastronomie' AND $nt2['O_TYP'] != 'SonstigeGewerbe' )
|
|
{
|
|
$Vermarktung .= $PreisParkflaeche;
|
|
}
|
|
$Vermarktung .= $Nebenkosten;
|
|
if ( $nt2['O_TYP'] == 'Gastronomie' OR $nt2['O_TYP'] == 'SonstigeGewerbe' )
|
|
{
|
|
$Vermarktung .= $PreisProParkflaeche;
|
|
$Vermarktung .= ' Preis="' . $nt2['Mkalt'] . '" ';
|
|
}
|
|
if ('Miete' == $nt2['V_TYP']) {
|
|
$Vermarktung .= ">\n";
|
|
$Vermarktung .= " <Miete";
|
|
if ( $nt2['O_TYP'] != 'Gastronomie' AND $nt2['O_TYP'] != 'SonstigeGewerbe' )
|
|
{
|
|
$Vermarktung .= ' Kaltmiete="' . $nt2['Mkalt'] . '"';
|
|
}
|
|
if (0 != (int)$nt2['Kaution']) {
|
|
$Vermarktung .= ' Kaution="'.$nt2['Kaution'].'"';
|
|
}
|
|
$Vermarktung .= '/>'."\n";
|
|
|
|
$picpath = "../img/objekte/";
|
|
}
|
|
|
|
if ( !empty ( $nt2['Modern'] ) AND '0' != $nt2['Modern'] )
|
|
{
|
|
$Modernisierung = ' JahrLetzteModernisierung="' . $nt2['Modern'] . '"'."\n";
|
|
}
|
|
|
|
if ('Kauf' == $nt2['V_TYP']) {
|
|
$Vermarktung .= ">\n";
|
|
$Vermarktung .= " <Kauf";
|
|
if ( $nt2['O_TYP'] != 'Gastronomie' AND $nt2['O_TYP'] != 'SonstigeGewerbe' )
|
|
{
|
|
$Vermarktung .= ' Preis="'.$nt2['Mkalt'].'"';
|
|
}
|
|
$Vermarktung .= '/>'."\n";
|
|
|
|
$picpath = "../img/objekte/";
|
|
}
|
|
|
|
$Vermarktung .= ' </Vermarktung>'."\n";
|
|
|
|
$Heizungsart = ' Heizungsart="' . str_replace ( ' ', '', $nt2['Heizart'] ) . '"'."\n";
|
|
|
|
$BefeuerungsArt = " <BefeuerungsArt>\n";
|
|
$BefeuerungsArt .= ' <' . str_replace ( ' ', '', str_replace ( 'ä', 'ae', str_replace ( 'Ö', 'Oe', $nt2['befeuerung'] ) ) ) . '/>' . "\n";
|
|
$BefeuerungsArt .= " </BefeuerungsArt>\n";
|
|
|
|
$MmATitel = 'Burkhardt Immobilien';
|
|
$MultimediaAnhang = ' <MultimediaAnhang '."\n";
|
|
$MultimediaAnhang .= ' AnhangArt="bild" '."\n";
|
|
$MultimediaAnhang .= ' Titel="'.$MmATitel.'" '."\n";
|
|
$MultimediaAnhang .= ' Dateityp=".JPG"'."\n";
|
|
$MultimediaAnhang .= ' Dateiname="'.$nt2['ID'].'_0.jpg" '."\n";
|
|
$MultimediaAnhang .= ' />'."\n";
|
|
$source = $picpath."0_0.jpg";
|
|
$dest = "temp/".$nt2['ID']."_0.jpg";
|
|
copy($source, $dest);
|
|
for ($i=1; $i<10; $i++) {
|
|
if ((file_exists($picpath.$nt2['ID']."_".$i.".jpg"))){
|
|
if ('' == $nt2['Foto'.$i.'']) {
|
|
$MmATitel = 'Foto'.$i;
|
|
} else {
|
|
$MmATitel = $nt2['Foto'.$i.''];
|
|
}
|
|
$MultimediaAnhang .= ' <MultimediaAnhang '."\n";
|
|
$MultimediaAnhang .= ' AnhangArt="bild" '."\n";
|
|
$MultimediaAnhang .= ' Titel="'.$MmATitel.'" '."\n";
|
|
$MultimediaAnhang .= ' Dateityp=".JPG"'."\n";
|
|
$MultimediaAnhang .= ' Dateiname="'.$nt2['ID']."_".$i.'.jpg" '."\n";
|
|
$MultimediaAnhang .= ' />'."\n";
|
|
$source = $picpath.$nt2['ID']."_".$i.".jpg";
|
|
$dest = "temp/".$nt2['ID']."_".$i.".jpg";
|
|
copy($source, $dest);
|
|
}
|
|
}
|
|
$path = "temp/".$nt2['ID']."_st_Z9B_imt.xml";
|
|
$datei = fopen($path, "a+");
|
|
|
|
$text = '<?xml version="1.0" encoding="UTF-8"?>'."\n";
|
|
$text .= '<IS24ImmobilienTransfer'."\n";
|
|
$text .= ' xmlns="http://www.immobilienscout24.de/immobilientransfer"'."\n";
|
|
$text .= ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'."\n";
|
|
$text .= ' xsi:schemaLocation="http://www.immobilienscout24.de/immobilientransfer is24immotransfer.xsd"'."\n";
|
|
$text .= ' ErstellerSoftware="R!ST"'."\n";
|
|
$text .= ' ErstellerSoftwareVersion="'.SW_VERSION.'"'."\n";
|
|
$text .= ' EmailBeiFehler="'.MAIL_ERROR.'"'."\n";
|
|
$text .= '>'."\n";
|
|
$text .= ' <Anbieter ScoutKundenID="'.IMMOW_KD.'">'."\n";
|
|
$text .= ' <'.$Objekt."\n";
|
|
$text .= ' AnbieterObjektID="'.$nt2['ID'].'"'."\n";
|
|
$text .= ' StatusVBM="aktiv"'."\n";
|
|
$text .= ' StatusIS24="aktiv"'."\n";
|
|
$text .= ' StatusHP="aktiv"'."\n";
|
|
$text .= ' Ueberschrift="'.$nt2['Kurz'].'"'."\n";
|
|
$text .= ' Importmodus="'.$Importmodus.'"'."\n";
|
|
$text .= $Gesamtflaeche;
|
|
$text .= $Flaeche;
|
|
$text .= $KategorieTyp;
|
|
|
|
|
|
$text .= ' Adressdruck="false"'."\n";
|
|
$text .= $Baujahr;
|
|
$text .= $Einbaukueche;
|
|
$text .= $Heizungsart;
|
|
$text .= $Keller;
|
|
$text .= $Provision;
|
|
$text .= $Wege;
|
|
$text .= $Waehrung;
|
|
$text .= ' >'."\n";
|
|
$text .= $Adresse;
|
|
$text .= $Kontaktperson;
|
|
$text .= $OBeschreib;
|
|
$text .= $Ausstattung;
|
|
$text .= $Sonst;
|
|
$text .= $MultimediaAnhang;
|
|
$text .= $BefeuerungsArt;
|
|
$text .= $Energieausweis;
|
|
$text .= $Vermarktung;
|
|
$text .= ' </'.$Objekt.'>'."\n";
|
|
$text .= ' </Anbieter>'."\n";
|
|
$text .= '</IS24ImmobilienTransfer>';
|
|
|
|
$text = utf8_encode($text);
|
|
fwrite($datei, $text);
|
|
fclose($datei);
|
|
?>
|