proces_anunt(); elseif(isset($_POST['admin'])) $this->proces_admin(); elseif(isset($_POST['anunt_admin'])) $this->proces_adauga_anunt(); elseif(isset($_POST['sterge_anunt_admin'])) $this->proces_sterge_anunt_admin(); elseif(isset($_POST['cauta_anunt_admin'])) $this->proces_cauta_anunt_admin(); elseif(isset($_POST['modifica_anunt_admin'])) $this->proces_modifica_anunt_admin(); elseif(isset($_POST['add_user'])) $this->proces_add_user(); elseif(isset($_POST['sterge_user'])) $this->proces_sterge_user(); elseif(isset($_POST['schimba_pass'])) $this->proces_schimba_pass(); elseif(isset($_POST['opinia_ta'])) $this->proces_opinia_ta(); elseif($sesiune->conectat) $this->proces_deconectare(); else header("Location: index.php"); } function proces_admin() { global $sesiune, $formular; $retval = $sesiune->conectare_admin($_POST['user'], $_POST['pass']); if($retval) header("Location: admin/admin.php"); else { $_SESSION['tablou_valori'] = $_POST; $_SESSION['tablou_erori'] = $formular->returneaza_tablou_erori(); header("Location: admin/index.php"); } } function proces_deconectare() { global $sesiune; $retval = $sesiune->deconectare(); header("Location: admin/index.php"); } function proces_adauga_anunt() { global $sesiune, $formular; $retval = $sesiune->adauga_anunt($_POST['imobil'], $_POST['tranzactie'], $_POST['anuntul'], $_POST['pretul'], $_POST['zona'], $_FILES['poza1'], $_FILES['poza2'], $_FILES['poza3'], $_FILES['poza4'], $_FILES['poza5'], $_FILES['poza6']); if($retval == 1) { $_SESSION['adaugat_anunt_succes'] = true; header("Location: admin/admin.php"); } else { $_SESSION['adaugat_anunt_insucces'] = true; $_SESSION['tablou_valori'] = $_POST; $_SESSION['tablou_erori'] = $formular->returneaza_tablou_erori(); header("Location: admin/admin.php"); } } function proces_anunt() { global $sesiune, $formular; $retval = $sesiune->anunt($_POST['nume'], $_POST['localitatea'], $_POST['telefoane'], $_POST['email_client'], $_POST['text_anunt']); if($retval == 0) { $_SESSION['nume_inregistrat'] = $_POST['nume']; $_SESSION['inregistrat_succes'] = true; header("Location: adauga.php"); } else if($retval != 0) $_SESSION['tablou_valori'] = $_POST; $_SESSION['tablou_erori'] = $formular->returneaza_tablou_erori(); header("Location: adauga.php"); } function proces_sterge_anunt_admin() { global $sesiune, $formular; $retval = $sesiune->sterge_anunt_admin($_POST['ID_anunt_sters']); if($retval == 0) { $_SESSION['anunt_sters'] = true; header("Location: admin/admin.php#stergere_anunt"); } else { $_SESSION['sterge_anunt_insucces'] = true; $_SESSION['tablou_valori'] = $_POST; $_SESSION['tablou_erori'] = $formular->returneaza_tablou_erori(); header("Location: admin/admin.php#stergere_anunt"); } } function proces_cauta_anunt_admin() { global $sesiune, $formular; $retval = $sesiune->cauta_anunt_admin($_POST['ID_anunt_cautat']); if($retval == 0) { $_SESSION['anunt_admin_gasit'] = true; header("Location: admin/admin.php#modificare_anunt"); } else { $_SESSION['anunt_admin_negasit'] = true; $_SESSION['tablou_valori'] = $_POST; $_SESSION['tablou_erori'] = $formular->returneaza_tablou_erori(); header("Location: admin/admin.php#modificare_anunt"); } } function proces_modifica_anunt_admin() { global $sesiune, $formular; $retval = $sesiune->modifica_anunt_admin($_POST['modifica_anunt_imobil'], $_POST['modifica_anunt_tranzactie'], $_POST['modifica_anunt_anuntul'], $_POST['modifica_anunt_pretul'], $_POST['modifica_anunt_zona']); if($retval == 1) { $_SESSION['anunt_admin_modificat'] = true; header("Location: admin/admin.php#modificare_anunt"); } else { $_SESSION['anunt_admin_nemodificat'] = true; $_SESSION['tablou_valori'] = $_POST; $_SESSION['tablou_erori'] = $formular->returneaza_tablou_erori(); header("Location: admin/admin.php#modificare_anunt"); } } function proces_add_user() { global $sesiune, $formular; $retval = $sesiune->add_user($_POST['ad_user'], $_POST['ad_pass']); if($retval == 0) { $_SESSION['add_user_succes'] = true; header("Location: admin/admin.php"); } else { $_SESSION['add_user_insucces'] = true; $_SESSION['tablou_valori'] = $_POST; $_SESSION['tablou_erori'] = $formular->returneaza_tablou_erori(); header("Location: admin/admin.php"); } } function proces_sterge_user() { global $sesiune, $formular; $retval = $sesiune->sterge_user($_POST['user_de_sters']); if($retval == 0) { $_SESSION['sterge_user_succes'] = true; header("Location: admin/admin.php"); } else { $_SESSION['sterge_user_insucces'] = true; $_SESSION['tablou_valori'] = $_POST; $_SESSION['tablou_erori'] = $formular->returneaza_tablou_erori(); header("Location: admin/admin.php"); } } function proces_schimba_pass() { global $sesiune, $formular; $retval = $sesiune->schimba_pass($_POST['schimba_pass_nou']); if($retval == 0) { $_SESSION['schimba_pass_succes'] = true; header("Location: admin/admin.php"); } else { $_SESSION['schimba_pass_insucces'] = true; $_SESSION['tablou_valori'] = $_POST; $_SESSION['tablou_erori'] = $formular->returneaza_tablou_erori(); header("Location: admin/admin.php"); } } function proces_opinia_ta() { global $sesiune, $formular; $retval = $sesiune->opinia($_POST['opinia_nume'], $_POST['opinia_email'], $_POST['opinia_anunt']); if($retval == 0) { $_SESSION['opinia_nume'] = $_POST['opinia_nume']; $_SESSION['opinia_succes'] = true; header("Location: opinia-ta.php"); } else if($retval != 0) $_SESSION['tablou_valori'] = $_POST; $_SESSION['tablou_erori'] = $formular->returneaza_tablou_erori(); header("Location: opinia-ta.php"); } }; $proces = new Proces; ?>