$sql .= "AND ((C.Nume LIKE '%{$ClientNume}%') OR (C.Prenume LIKE '%{$ClientNume}%')) "; } if ($ClientCod != "") { $sql .= "AND C.id='{$ClientCod}' "; } if ($Agent != "") { $sql .= "AND U.id='{$Agent}' "; } if ($Stare != "") { $sql .= "AND X.Stare='{$Stare}' "; } if (isset($subZonaChecked)) { $sql = $sql . "AND (" . build_query_zone($subZonaChecked, "Zona") . ") "; } $sql .= "ORDER BY X.DataCreare DESC "; $cerereList = Cerere::find_by_sql($sql); if (!empty($cerereList)) { ?> <div id="oferte" class="view"> <h3>Cereri gasite</h3> <table width="100%"> <tr > <td class="header" width="5%">Cod</td> <td class="header" width="15%">Client</td> <td class="header" width="10%">Telefon</td> <td class="header" width="5%">Tip proprietate</td> <td class="header" width="5%">Camere</td> <td class="header" width="10%">Tip ap.</td> <td class="header" width="5%">Etaje</td> <td class="header" width="30%">Zone</td> <td class="header" width="10%">Buget</td>
$Cumparare = $cerere->Cumparare; $Inchiriere = $cerere->Inchiriere; $Buget = $cerere->Buget; $Moneda = $cerere->Moneda; $Credit = $cerere->Credit; $Detalii = $cerere->Detalii; $Stare = $cerere->Stare; } if (isset($_POST['submit'])) { $postlist = array_keys($_POST); foreach ($postlist as $variable) { if ($variable != "submit") { ${$variable} = $_POST[$variable]; } } $cerere = new Cerere(); $client = Client::find_by_id($ClientId); $cerere->id = $idCerere; $cerereStatic = Cerere::find_by_id($idCerere); $cerere->idClient = $ClientId; if (isset($subZonaChecked)) { $cerere->Zona = build_list($subZonaChecked); } if (isset($TipProprietate)) { $cerere->TipProprietate = build_list($TipProprietate); } if (isset($NumarCamere)) { $cerere->NumarCamere = build_list($NumarCamere); } if (isset($Confort)) { $cerere->Confort = build_list($Confort);
if (!$session->is_logged_in()) { redirect_to("login.php"); } //include_layout_template('header.php'); if (isset($_GET['id'])) { $idCerere = $_GET['id']; } if (isset($_POST['submit'])) { $postlist = array_keys($_POST); foreach ($postlist as $variable) { if ($variable != "submit") { ${$variable} = $_POST[$variable]; } } } $cerere = Cerere::find_by_id($idCerere); $cerere->NumarCamere = substr($cerere->NumarCamere, 1, -1); $cerere->TipProprietate = substr($cerere->TipProprietate, 1, -1); $cerere->Zona = substr($cerere->Zona, 1, -1); $cerere->TipApartament = substr($cerere->TipApartament, 1, -1); $cerere->Confort = substr($cerere->Confort, 1, -1); $client = Client::find_by_id($cerere->idClient); $agent = User::find_by_id($client->idUtilizator); if (!isset($_POST['submit'])) { $TipProprietate[1] = 1; $NumarCamere[$apartament->NumarCamere] = 1; //$zoneSelectate= $subZonaChecked[$subzona->id] = 1; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">