while ($n <= $end_bookings) { $daysInMonth = getDaysInMonth($month, $year); $day = 1; while ($day <= $daysInMonth) { $n = mktime(0, 0, 0, $month, $day, $year); if (isset($_POST[$n])) { // Le jour a été selectionné dans le calendrier $starttime = mktime($morningstarts, 0, 0, $month, $day, $year); $endtime = mktime($eveningends, 0, $resolution, $month, $day, $year); // Pour toutes les dates bon précédement enregistrées, on efface toutes les résa en conflit if (!in_array($n, $day_old)) { $sql = "select id from " . TABLE_PREFIX . "_room"; $res = grr_sql_query($sql); if ($res) { for ($i = 0; $row = grr_sql_row($res, $i); $i++) { $result += grrDelEntryInConflict($row[0], $starttime, $endtime, 0, 0, 1); } } } // On enregistre la valeur dans ".TABLE_PREFIX."_calendar $sql = "INSERT INTO " . TABLE_PREFIX . "_calendar set DAY='" . $n . "'"; if (grr_sql_command($sql) < 0) { fatal_error(0, "<p>" . grr_sql_error()); } } $day++; } $month++; if ($month == 13) { $year++; $month = 1;
if ($i == count($reps) - 1) { $tmp = mrbsCheckFree($room_id, $reps[$i], $reps[$i] + $diff, $ignore_id, $repeat_id); } else { $tmp = mrbsCheckFree($room_id, $reps[$i], $reps[$i] + $diff, $ignore_id, $repeat_id); } if (!empty($tmp)) { $err = $err . $tmp; } } } else { $err .= get_vocab('too_may_entrys') . '<p>'; $hide_title = 1; } } else { if (isset($_GET['del_entry_in_conflict']) && $_GET['del_entry_in_conflict'] == 'yes') { grrDelEntryInConflict($room_id, $starttime, $endtime - 1, $ignore_id, $repeat_id, 0); } $err .= mrbsCheckFree($room_id, $starttime, $endtime - 1, $ignore_id, $repeat_id); } } } if (empty($err) && $error_booking_in_past == 'no' && $error_duree_max_resa_area == 'no' && $error_delais_max_resa_room == 'no' && $error_delais_min_resa_room == 'no' && $error_booking_room_out == 'no' && $error_date_option_reservation == 'no' && $error_chevaussement == 'no' && $error_qui_peut_reserver_pour == 'no' && $error_heure_debut_fin == 'no') { $compt_room = 0; foreach ($_GET['rooms'] as $room_id) { $area = mrbsGetRoomArea($room_id); if (isset($id) && $id != 0) { if (!getWritable($beneficiaire, getUserName(), $id)) { showAccessDenied($back); exit; } }