} else { $error = true; } } elseif (isset($_POST['del'])) { if (!empty($_POST['id']) and is_numeric($_POST['id'])) { include_once 'class/delete_log.php'; $del = new delete_log($_POST['id']); $del->req_delete(); $del_ok = true; } else { $error = true; } } // Infos sur un logement en fonction d'un site if (!empty($_GET['num']) and is_numeric($_GET['num']) and !empty($_GET['site']) and is_numeric($_GET['site'])) { $info = new info_sl($_GET['site'], $_GET['num']); $info->req_data(); $sl = $info->get_data(); } // Obtenir les infos d'un logement en fonction de son id if (!empty($_GET['num']) and is_numeric($_GET['num'])) { include_once 'class/info_logement.php'; $info = new info_logement($_GET['num']); $info->req_data(); $log = $info->get_data(); } // Liste de tous les logements include_once 'class/liste_log.php'; $liste = new liste_log(); $liste->req_data(); $logs = $liste->get_data();
<?php include 'class/requiert.php'; $authentification = new requiert(); $authentification->acces(); if (isset($_POST['submit'])) { if (!empty($_GET['site']) and is_numeric($_GET['site']) and !empty($_POST['log']) and is_numeric($_POST['log']) and !empty($_POST['date'])) { include_once 'class/info_site.php'; $info = new info_site($_GET['site']); $info->req_exist(); if ($info->get_result() == 1) { include_once 'class/info_sl.php'; $nb_sl = new info_sl($_GET['site'], $_POST['log']); $nb_sl->req_nb(); $max = $nb_sl->get_data(); include_once 'class/nb_reserv.php'; $reserv = new nb_reserv($_POST['date'], $_GET['site'], $_POST['log']); $reserv->req_data(); if ($reserv->get_data() < $max['nb_log_sl']) { include_once 'class/info_logement.php'; $info = new info_logement($_POST['log']); $info->req_exist(); if ($info->get_result() == 1) { // Insérer dans la base de données include_once 'class/add_reservation.php'; if (!empty($_POST['pension'])) { $pension = 1; } else { $pension = 0; } if (!empty($_POST['menage'])) {