fatal_error(1, get_vocab('failed_to_acquire')); } $date_now = time(); $error_booking_in_past = 'no'; $error_booking_room_out = 'no'; $error_duree_max_resa_area = 'no'; $error_delais_max_resa_room = 'no'; $error_delais_min_resa_room = 'no'; $error_date_option_reservation = 'no'; $error_chevaussement = 'no'; $error_qui_peut_reserver_pour = 'no'; $error_heure_debut_fin = 'no'; foreach ($_GET['rooms'] as $room_id) { if ($rep_type != 0 && !empty($reps)) { $diff = $endtime - $starttime; if (!grrCheckOverlap($reps, $diff)) { $error_chevaussement = 'yes'; } $i = 0; while ($i < count($reps) && $error_booking_in_past == 'no' && $error_duree_max_resa_area == 'no' && $error_delais_max_resa_room == 'no' && $error_delais_min_resa_room == 'no' && $error_date_option_reservation == 'no' && $error_qui_peut_reserver_pour == 'no' && $error_heure_debut_fin == 'no') { if (authGetUserLevel(getUserName(), -1) < 2 && auth_visiteur(getUserName(), $room_id) == 0) { $error_booking_room_out = 'yes'; } if (!verif_booking_date(getUserName(), -1, $room_id, $reps[$i], $date_now, $enable_periods)) { $error_booking_in_past = 'yes'; } if (!verif_duree_max_resa_area(getUserName(), $room_id, $starttime, $endtime)) { $error_duree_max_resa_aera = 'yes'; } if (!verif_delais_max_resa_room(getUserName(), $room_id, $reps[$i])) { $error_delais_max_resa_room = 'yes';
$error_booking_in_past = 'no'; $error_booking_room_out = 'no'; $error_duree_max_resa_area = 'no'; $error_delais_max_resa_room = 'no'; $error_delais_min_resa_room = 'no'; $error_date_option_reservation = 'no'; $error_chevaussement = 'no'; $error_qui_peut_reserver_pour = 'no'; $error_heure_debut_fin = 'no'; foreach ( $_GET['rooms'] as $room_id ) { # On verifie qu'aucune réservation ne se situe dans la passé if ($rep_type != 0 && !empty($reps)) { $diff = $endtime - $starttime; // Dans le cas d'une réservation avec périodicité, on vérifie que les différents créneaux ne se chevaussent pas. if (!grrCheckOverlap($reps, $diff)) $error_chevaussement = 'yes'; $i = 0; while (($i < count($reps)) and ($error_booking_in_past == 'no') and ($error_duree_max_resa_area == 'no') and ($error_delais_max_resa_room == 'no') and ($error_delais_min_resa_room == 'no') and ($error_date_option_reservation=='no') and ($error_qui_peut_reserver_pour=='no') and ($error_heure_debut_fin=='no')) { if ((authGetUserLevel(getUserName(),-1) < 2) and (auth_visiteur(getUserName(),$room_id) == 0)) $error_booking_room_out = 'yes'; if (!(verif_booking_date(getUserName(), -1, $room_id, $reps[$i], $date_now, $enable_periods))) $error_booking_in_past = 'yes'; if (!(verif_duree_max_resa_area(getUserName(), $room_id, $starttime, $endtime))) $error_duree_max_resa_aera = 'yes'; if (!(verif_delais_max_resa_room(getUserName(), $room_id, $reps[$i]))) $error_delais_max_resa_room = 'yes'; if (!(verif_delais_min_resa_room(getUserName(), $room_id, $reps[$i]))) $error_delais_min_resa_room = 'yes'; if (!(verif_date_option_reservation($option_reservation, $reps[$i]))) $error_date_option_reservation = 'yes'; if (!(verif_qui_peut_reserver_pour($room_id, getUserName(), $beneficiaire))) $error_qui_peut_reserver_pour = 'yes'; if (!(verif_heure_debut_fin($reps[$i], $reps[$i]+$diff, $area))) $error_heure_debut_fin = 'yes'; $i++; } } else { if ((authGetUserLevel(getUserName(),-1) < 2) and (auth_visiteur(getUserName(),$room_id) == 0)) $error_booking_room_out = 'yes'; if (isset($id) and ($id!=0)) {