예제 #1
0
        $add->req_add();
        $add_ok = true;
    } else {
        $error = true;
    }
} elseif (isset($_POST['up'])) {
    if (!empty($_POST['log']) and !empty($_POST['id']) and is_numeric($_POST['id'])) {
        include_once 'class/update_log.php';
        $up = new update_log($_POST['id'], htmlspecialchars($_POST['log']));
        $up->req_update();
        $up_ok = true;
        if (!empty($_GET['site']) and is_numeric($_GET['site']) and isset($_POST['nb_log']) and is_numeric($_POST['nb_log']) and isset($_POST['entree']) and isset($_POST['piece']) and is_numeric($_POST['piece']) and isset($_POST['lit']) and is_numeric($_POST['lit']) and isset($_POST['wc']) and isset($_POST['balcon']) and isset($_POST['cloison']) and isset($_POST['douche']) and isset($_POST['prix']) and is_numeric($_POST['prix'])) {
            $info = new info_sl($_GET['site'], $_POST['id']);
            $info->req_exist();
            // Ajouter un site logement s'il n'existe pas encore
            if ($info->get_result() != 1) {
                include_once 'class/add_sl.php';
                $add = new add_sl($_GET['site'], $_GET['num']);
                $add->req_add();
            }
            include_once 'class/update_sl.php';
            $up = new update_sl($_GET['site'], $_GET['num'], $_POST['nb_log'], $_POST['entree'], $_POST['piece'], $_POST['lit'], $_POST['wc'], $_POST['balcon'], $_POST['cloison'], $_POST['douche'], $_POST['prix']);
            $up->req_update();
        } else {
            $error_infos = true;
        }
    } else {
        $error = true;
    }
} elseif (isset($_POST['del'])) {
    if (!empty($_POST['id']) and is_numeric($_POST['id'])) {