if (!empty($oferte)) {
    foreach ($oferte as $oferta) {
        echo $oferta->id;
        $apartament = Apartament::find_by_id($oferta->idApartament);
        $client = Client::find_by_id($apartament->idClient);
        $agent = User::find_by_id($client->idUtilizator);
        $subzona = Subzona::find_by_id($apartament->idSubzona);
        $sql = "SELECT * FROM Foto WHERE idApartament={$apartament->id} ORDER BY Ordin";
        $fotografii = Foto::find_by_sql($sql);
        $ok = 0;
        $idImobiliare = "";
        if ($oferta->Vanzare == 1) {
            posteazaAnunt(0);
        }
        if ($oferta->Inchiriere == 1) {
            posteazaAnunt(1);
        }
        $oferta->ExportImobiliare = $oferta->ExportImobiliare == 3 ? 0 : 4;
        if ($oferta->Stare != 'de actualitate') {
            $oferta->ExportImobiliare = 0;
        }
        if ($ok == 1) {
            $oferta->LinkImobiliare = "http://www.imobiliare.ro/anunt/" . $idImobiliare;
        } else {
            $oferta->LinkImobiliare = "";
        }
        $oferta->save();
    }
}
// logout
try {
Example #2
0
        $client = Client::find_by_id($apartament->idClient);
        $agent = User::find_by_id($client->idUtilizator);
        $subzona = Subzona::find_by_id($apartament->idSubzona);
        $strada = Strada::find_by_id($apartament->idStrada);
        $sql = "SELECT * FROM Foto WHERE idApartament={$apartament->id} ORDER BY Ordin";
        $fotografii = Foto::find_by_sql($sql);
        //posteazaAnunt(1);
        if ($oferta->ExportMC < 3 && $oferta->Stare == "de actualitate") {
            $succes = true;
            if ($oferta->Vanzare == 1) {
                if (!posteazaAnunt(0)) {
                    $succes = false;
                }
            }
            if ($oferta->Inchiriere == 1) {
                if (!posteazaAnunt(1)) {
                    $succes = false;
                }
            }
            if ($succes) {
                $oferta->ExportMC = 4;
            }
        }
        if ($oferta->ExportMC == 3 || $oferta->Stare != "de actualitate") {
            stergeAnunt();
            $oferta->ExportMC = 0;
            $oferta->idMC = "";
        }
        $oferta->save();
    }
} else {
Example #3
0
    foreach ($oferte as $oferta) {
        echo $oferta->id;
        $apartament = Apartament::find_by_id($oferta->idApartament);
        $client = Client::find_by_id($apartament->idClient);
        $agent = User::find_by_id($client->idUtilizator);
        $subzona = Subzona::find_by_id($apartament->idSubzona);
        $sql = "SELECT * FROM Foto WHERE idApartament={$apartament->id} ORDER BY Ordin";
        $fotografii = Foto::find_by_sql($sql);
        $ok = 0;
        $idImobiliare = "";
        $sinc = false;
        if ($oferta->Vanzare == 1) {
            $sinc = posteazaAnunt(0);
        }
        if ($oferta->Inchiriere == 1) {
            $sinc = posteazaAnunt(1);
        }
        if ($sinc) {
            $oferta->ExportImobiliare = $oferta->ExportImobiliare == 3 ? 0 : 4;
            if ($oferta->Stare != 'de actualitate') {
                $oferta->ExportImobiliare = 0;
            }
        }
        if ($ok == 1) {
            $oferta->LinkImobiliare = "http://www.imobiliare.ro/anunt/" . $idImobiliare;
        } else {
            $oferta->LinkImobiliare = "";
        }
        $oferta->save();
    }
}
Example #4
0
     }
     $extra = explode('#', $result->extra);
     // id-ul de sesiune va fi folosit ulterior la orice request
     $session_id = $extra[1];
     //echo "<pre> LOGIN: "******"SELECT * FROM Foto WHERE idApartament={$apartament->id} ORDER BY Ordin";
     $fotografii = Foto::find_by_sql($sql);
     $ok = 0;
     $idImobiliare = "";
     $sinc = false;
     if ($oferta->Vanzare == 1) {
         $sinc = posteazaAnunt(0, 0);
     }
     if ($oferta->Inchiriere == 1) {
         $sinc = posteazaAnunt(1, 0);
     }
     if ($sinc) {
         $oferta->ExportImobiliare = $oferta->ExportImobiliare == 3 ? 0 : 4;
         if ($oferta->Stare != 'de actualitate') {
             $oferta->ExportImobiliare = 0;
         }
     }
     if ($ok == 1) {
         $oferta->LinkImobiliare = "http://www.imobiliare.ro/anunt/" . $idImobiliare;
     } else {
         $oferta->LinkImobiliare = "";
     }
 }
 // sincronizare imopedia
 if ($oferta->ExportImopedia > 0 && SyncSite::modalitate("Imopedia") == "automat") {