max_cb; } elseif ($pmb_num_carte_auto_array[0] == "2" ) { $long_prefixe = $pmb_num_carte_auto_array[1]; $nb_chiffres = $pmb_num_carte_auto_array[2]; $prefix = $pmb_num_carte_auto_array[3]; $rqt = "SELECT CAST(SUBSTRING(empr_cb,".($long_prefixe+1).") AS UNSIGNED) AS max_cb, SUBSTRING(empr_cb,1,".($long_prefixe*1).") AS prefixdb FROM empr ORDER BY max_cb DESC limit 0,1" ; // modif f cerovetti pour sortir dernier code barre tri par ASCII $res = mysql_query($rqt, $dbh); $cb_initial = mysql_fetch_object($res); $cb_a_creer = ($cb_initial->max_cb*1)+1; if (!$nb_chiffres) $nb_chiffres=strlen($cb_a_creer); if (!$prefix) $prefix = $cb_initial->prefixdb; $cb_a_creer = $prefix.substr((string)str_pad($cb_a_creer, $nb_chiffres, "0", STR_PAD_LEFT),-$nb_chiffres); } elseif ($pmb_num_carte_auto_array[0] == '3' ) { $num_carte_auto_filename = $base_path.'/circ/empr/'.trim($pmb_num_carte_auto_array[1]).'.inc.php'; $num_carte_auto_fctname = trim($pmb_num_carte_auto_array[1]); if (file_exists($num_carte_auto_filename)){ require_once($num_carte_auto_filename); if(function_exists($num_carte_auto_fctname)) { $cb_a_creer = $num_carte_auto_fctname(); } } } get_cb($msg[42], "", $msg[43], './circ.php?categ=empr_saisie', 1, (string)$cb_a_creer, 1);