<?php if (tp('verif') == 1) { global $db; //Check if id corespond nom $datedebut = new DateTime(tp('date_debut')); $datefin = new DateTime(tp('date_fin')); if ($datedebut >= $datefin) { exit("0"); } model::load('recette', 'editlocation'); if (!editlocation(tp('id'), tp('nom'), tp('adresse'), tp('pjid'), tp('tel'), tp('email'), tp('villa'), tp('date_debut'), tp('date_fin'), tp('type_paiement'), tp('montant_location'), tp('agarantie_location'))) { exit("1"); } else { exit("2"); } } else { view::load('recette', 'editlocation'); }
if ($rest_devision != 0) { exit("4"); } else { if ($rest2 != 0 or $devis == 0) { exit("5"); } else { if ($depot_garantie > $diff_month + 1) { exit("5"); } else { if ($dat1 != $dat11) { exit("6"); } else { if ($dat2 != $dat22) { exit("7"); } else { if (!editlocation(tp('id'), tp('nom'), tp('responsable'), tp('adresse'), tp('pjid'), tp('tel'), tp('email'), tp('date_debut'), tp('date_fin'), $cycle_name, tp('montant'), tp('depot'))) { exit("2"); } else { exit("1"); } } } } } } } else { exit("3"); } } else { view::load('gestionvilla', 'editcontravila'); }