${msg[313]}
";
//Récupération de l'ID de l'exemplaire
if (!$expl_id || !$cb) {
$requete = "select expl_id, expl_cb from exemplaires where expl_cb='$cb' or expl_id='$expl_id'";
$result=@mysql_query($requete);
if (mysql_num_rows($result)) {
$expl_id=mysql_result($result,0,0);
$cb=mysql_result($result,0,1);
}
}
$requete = "select 1 from pret where pret_idexpl='$expl_id' ";
$result=@mysql_query($requete);
if (mysql_num_rows($result)) {
// gestion erreur prêt en cours
error_message($msg[416], $msg[impossible_expl_del_pret], 1, "./catalog.php?categ=isbd&id=$id");
} else {
//archivage
if ($pmb_archive_warehouse) {
exemplaire::save_to_agnostic_warehouse(array(0=>$expl_id),$pmb_archive_warehouse);
}
// nettoyage doc. à ranger
$requete_suppr = "delete from resa_ranger where resa_cb in (select expl_cb from exemplaires where expl_id='".$expl_id."') ";
$result_suppr = mysql_query ($requete_suppr, $dbh);
$requete = "DELETE FROM exemplaires WHERE expl_cb='$cb' or expl_id='$expl_id'";
$result = @mysql_query($requete, $dbh);
audit::delete_audit (AUDIT_EXPL, $expl_id) ;
$query_caddie = "select caddie_id from caddie_content, caddie where type='EXPL' and object_id ='$expl_id' and caddie_id=idcaddie ";
$result_caddie = @mysql_query($query_caddie, $dbh);
while($cad = mysql_fetch_object($result_caddie)) {
$req_suppr_caddie="delete from caddie_content where caddie_id = '$cad->caddie_id' and object_id ='$expl_id' " ;
@mysql_query($req_suppr_caddie, $dbh);
}
//Supression des champs perso
if ($expl_id) {
$p_perso=new parametres_perso("expl");
$p_perso->delete_values($expl_id);
}
// nettoyage transfert
$requete_suppr = "delete from transferts_demande where num_expl='$expl_id'";
$result_suppr = mysql_query($requete_suppr);
print "";
$id_form = md5(microtime());
$retour = "./catalog.php?categ=isbd&id=$id";
print "
";
}
?>