setDomain(1); $acces_j = $dom_1->getJoin($PMBuserid,8,'bulletin_notice'); $q = "select count(1) from bulletins $acces_j where bulletin_id=".$expl_bulletin; $r = mysql_query($q, $dbh); if(mysql_result($r,0,0)==0) { $acces_m=0; } } if ($acces_m==0) { if (!$expl_id) { error_message('', htmlentities($dom_1->getComment('mod_bull_error'), ENT_QUOTES, $charset), 1, ''); } else { error_message('', htmlentities($dom_1->getComment('mod_expl_error'), ENT_QUOTES, $charset), 1, ''); } } else { // le form d'exemplaire renvoit : // Je nettoie ce qui me parait devoir etre nettoye // $bul_id // $id_form // $org_cb // $expl_id // $expl_bulletin // $expl_typdoc $expl_cote = clean_string($expl_cote); // $expl_section // $expl_statut // $expl_location // $expl_codestat $expl_note = clean_string($expl_note); $expl_comment = clean_string($f_ex_comment); $expl_prix = clean_string($expl_prix); // $expl_owner //Verification des champs personalises $p_perso=new parametres_perso("expl"); $nberrors=$p_perso->check_submited_fields(); if ($nberrors) { error_message_history($msg["notice_champs_perso"],$p_perso->error_message,1); exit(); } // controle sur le nouveau code barre si applicable : if($org_cb != $f_ex_cb) { // si le nouveau code-barre est deja utilise, on reste sur l'ancien $requete = "SELECT expl_id FROM exemplaires WHERE expl_cb='$f_ex_cb'"; $myQuery = mysql_query($requete, $dbh); if(!($result=mysql_result($myQuery, 0, 0))) { $expl_cb = $f_ex_cb; } else { // Verif si expl_id est celui poste if($expl_id == $result[0]) { $expl_cb = $org_cb; } else { //Erreur: code barre deja existant error_message_history($msg[301],$msg[303],1); exit(); } } } else { $expl_cb = $f_ex_cb; } // on prepare la date de creation ou modification $expl_date = today(); // on recupere les valeurs $formlocid="f_ex_section".$expl_location ; $expl_section=$$formlocid ; // preparation de la requete if($expl_id) { // update de l'exemplaire // on prepare la requete $values = "expl_cb='$expl_cb'"; $values .= ", expl_typdoc='$expl_typdoc'"; $values .= ", expl_cote='$expl_cote'"; $values .= ", expl_section='$expl_section'"; $values .= ", expl_statut='$expl_statut'"; $values .= ", expl_location='$expl_location'"; $values .= ", expl_codestat='$expl_codestat'"; $values .= ", expl_note='$expl_note'"; $values .= ", expl_comment='$expl_comment'"; $values .= ", expl_prix='$expl_prix'"; $values .= ", expl_owner='$expl_owner'"; $values .= ", type_antivol='$type_antivol'"; $values .= ", expl_nbparts='$f_ex_nbparts'"; $requete = "UPDATE exemplaires SET $values WHERE expl_id=$expl_id AND expl_notice=0 LIMIT 1"; $myQuery = mysql_query($requete, $dbh); audit::insert_modif (AUDIT_EXPL, $expl_id) ; } else { // insertion d'un nouvel exemplaire $values = "expl_cb='$expl_cb'"; $values .= ", expl_notice='0'"; $values .= ", expl_bulletin='$expl_bulletin'"; $values .= ", expl_typdoc='$expl_typdoc'"; $values .= ", expl_cote='$expl_cote'"; $values .= ", expl_section='$expl_section'"; $values .= ", expl_statut='$expl_statut'"; $values .= ", expl_location='$expl_location'"; $values .= ", expl_codestat='$expl_codestat'"; $values .= ", expl_note='$expl_note'"; $values .= ", expl_comment='$expl_comment'"; $values .= ", expl_prix='$expl_prix'"; $values .= ", expl_owner='$expl_owner'"; $values .= ", type_antivol='$type_antivol'"; $values .= ", expl_nbparts='$f_ex_nbparts'"; $requete = "INSERT INTO exemplaires set $values , create_date=sysdate() "; $myQuery = mysql_query($requete, $dbh); $expl_id=mysql_insert_id(); audit::insert_creation (AUDIT_EXPL, $expl_id) ; } //Insertion des champs personalises $p_perso->rec_fields_perso($expl_id); $id_form = md5(microtime()); print "
".$msg[maj_encours]."
"; $retour = "./catalog.php?categ=serials&sub=view&sub=bulletinage&action=view&bul_id=$expl_bulletin"; if ($pointage) { $templates=" "; } else { print "
"; } } ?>