<?php //Suppression ligne if (tg('del') != 0) { $sqladdby = "Select addby from noteservice where noteservice.id=" . tg('del'); $userss = $_SESSION['userid']; $useradd = $db->QuerySingleValue0($sqladdby); if ($userss != $useradd) { // Autorisation test exit("2"); } model::load('note', 'note'); if (!delet(tg('del'))) { //Function error exit("1"); } // Succes function exit("0"); } if (tg('srch') == 0) { view::load('note', 'note'); } else { view::load('note', 'notesrch'); }
<?php global $db; if (tp('del') == 1) { $id_villa = tp('lin'); //Check if have contrat $nbr_contrat = $db->QuerySingleValue0("select count(id) from contrat_location_villa where idvilla= {$id_villa} "); if ($nbr_contrat > 0) { exit("2#{$nbr_contrat}"); } model::load('gestionvilla', 'gestionvilla'); //Execute Model if (!delet($id_villa)) { exit("3"); //Error opération } else { exit("1"); //Success Opération } } $nextid = getnextidtable('contrat_location_villa'); $session = new session(); $session->set('nextid', $nextid); view::load('gestionvilla', 'gestionvilla');