Commit 503c053b authored by Estéban Ristich's avatar Estéban Ristich
Browse files

Fix Issue #69 feature work but no stable due to past change

parent bf45643e
......@@ -43,6 +43,18 @@ if ($_SERVER["REQUEST_METHOD"] === 'POST') {
if($date_retour < $date_emprunt)
$erreur = 'L\'intervalle des dates ne correspond pas. Merci de les vérifier';
$pdo = connect_db_or_alert();
if ($param_mode == "loan" || $param_mode == "booking") {
$day_diff = $date_out_rtn - $date_out_ymd;
$day_diff = intval(date('d', $day_diff));
$equipment_max_day = get_equipment_all_by_id($pdo, $equipment_id)["max_loan_day"];
if ($equipment_max_day != 0) {
if ($day_diff > $equipment_max_day)
$erreur = 'L\'équipement ne peut pas être enprunter sur une durée de plus de '.$equipment_max_day.' jours';
}
}
/* $flag_new = true;
if ($loan_id > 0)
$flag_new = false; */
......@@ -59,8 +71,6 @@ if (!empty($erreur)) {
exit();
}
$pdo = connect_db_or_alert();
if ($param_mode == "booking") {
// CHECK FUTUR
if ($date_out_ymd >= $date_tomorrow) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment