check_submited_fields(); if ($nberrors) { error_message_history($msg["notice_champs_perso"],$p_perso->error_message,1); exit(); } switch($sub) { case 'create': $requete = "SELECT count(1) FROM exemplaires WHERE expl_cb='$f_ex_cb' "; $res = pmb_mysql_query($requete); $nbr_lignes = pmb_mysql_result($res, 0, 0); $nbr_lignes ? $valid_requete = FALSE : $valid_requete = TRUE; $libelle = $msg[4007]; break; case 'update': // ceci teste si l'exemplaire cible existe bien $requete = "SELECT expl_id FROM exemplaires WHERE expl_cb='$org_cb' "; $res = pmb_mysql_query($requete); $nbr_lignes = pmb_mysql_num_rows($res); $nbr_lignes ? $valid_requete = TRUE : $valid_requete = FALSE; if ($nbr_lignes) $expl_id = pmb_mysql_result($res,0,0); // remplacement code-barre : test sur le nouveau numéro if($org_cb != $f_ex_cb) { $requete = "SELECT count(1) FROM exemplaires WHERE expl_cb='$f_ex_cb' "; $res = pmb_mysql_query($requete); $nbr_lignes = pmb_mysql_result($res, 0, 0); $nbr_lignes ? $valid_requete = FALSE : $valid_requete = TRUE; } $libelle = $msg[4007]; break; } print pmb_bidi("