Example #1
0
 static function delete($id_exercice = 0)
 {
     global $dbh;
     if (!$id_exercice) {
         return;
     }
     //Suppression des actes
     //TODO Voir suppression du lien entre actes et exercices
     $res_actes = actes::listByExercice($id_exercice);
     while ($row = mysql_fetch_object($res_actes)) {
         actes::delete($row->id_acte);
     }
     //Suppression des budgets
     $res_budgets = budgets::listByExercice($id_exercice);
     while ($row = mysql_fetch_object($res_budgets)) {
         budgets::delete($row->id_budget);
     }
     //Suppression de l'exercice
     $q = "delete from exercices where id_exercice = '" . $id_exercice . "' ";
     mysql_query($q, $dbh);
 }