function sup_liv($id_liv, $id_cde) { $cde = new actes($id_cde); $cde->statut = $cde->statut & ~STA_ACT_REC | STA_ACT_ENC; //Statut commande = soldé->en cours $cde->update_statut(); actes::delete($id_liv); liens_actes::delete($id_liv); }
function delete_dev_list() { global $chk; if (is_array($chk)) { foreach ($chk as $id_dev) { $dev = new actes($id_dev); if ($dev->type_acte == TYP_ACT_DEV) { $dev->delete(); } } } }
function sup_fac($id_fac, $id_cde) { $cde = new actes($id_cde); $cde->statut = $cde->statut & ~STA_ACT_FAC; //Statut commande = facturé->non facturé $cde->statut = $cde->statut & ~STA_ACT_PAY; //Statut commande = payé->non payé $cde->update_statut(); actes::delete($id_fac); liens_actes::delete($id_fac); }
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); }
function delete_cde_list() { global $chk; if (is_array($chk)) { foreach ($chk as $id_cde) { $cde = new actes($id_cde); if ($cde->type_acte == TYP_ACT_CDE && $cde->statut == STA_ACT_AVA) { $cde->delete(); } } } }
function undo() { global $id_lig, $previous; $error = false; if (!$id_lig) { return $error; } if (!$previous) { return $error; } $tp = unserialize(rawurldecode(stripslashes($previous))); if (!is_array($tp) || !count($tp)) { $previous = 0; return $error; } $id_liv = array_pop($tp); if (count($tp)) { $previous = addslashes(rawurlencode(serialize($tp))); } else { $previous = 0; } $lg_liv = new lignes_actes($id_liv); if (!$lg_liv->id_ligne) { return $error; } $liv = new actes($lg_liv->num_acte); if (!$liv->id_acte) { return $error; } $id_cde = liens_actes::getOrder($id_liv); $lg_liv->delete(); $r = actes::getLignes($lg_liv->num_acte); if (mysql_num_rows($r) == 0) { $liv->delete(); } $cde = new actes($id_cde); $cde->statut = $cde->statut & !STA_ACT_AVA & !STA_ACT_REC & !STA_ACT_ARC | STA_ACT_ENC; $cde->update_statut(); return !$error; }