function show_lgstat_list() { global $dbh; global $msg; global $charset; print "<table>\n\t<tr>\n\t\t<th>" . htmlentities($msg[103], ENT_QUOTES, $charset) . "</th>\n\t\t<th>" . htmlentities($msg['acquisition_lgstat_arelancer'], ENT_QUOTES, $charset) . "</th>\n\t</tr>"; $tab_lgstat = lgstat::getList(); $parity = 1; foreach ($tab_lgstat as $id_statut => $lgstat) { if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $parity += 1; $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./admin.php?categ=acquisition&sub=lgstat&action=modif&id={$id_statut}';\" "; print "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'>"; if ($id_statut == 1) { print "<td><i><strong>" . htmlentities($lgstat[0], ENT_QUOTES, $charset) . "</strong></i></td>"; } else { print "<td><i>" . htmlentities($lgstat[0], ENT_QUOTES, $charset) . "</i></td>"; } $arelancer = $msg[39]; if ($lgstat[1] == '1') { $arelancer = $msg[40]; } print "<td><i>" . htmlentities($arelancer, ENT_QUOTES, $charset) . "</i></td>"; print "</tr>"; } print "</table>\n\t\t<input class='bouton' type='button' value='" . htmlentities($msg['acquisition_lgstat_add'], ENT_QUOTES, $charset) . "' onClick=\"document.location='./admin.php?categ=acquisition&sub=lgstat&action=add'\" />"; }
case "deflt3cde_statut": $t = actes::getStatelist(TYP_ACT_CDE); break; case "deflt3liv_statut": $t = actes::getStatelist(TYP_ACT_LIV); break; case "deflt3fac_statut": $t = actes::getStatelist(TYP_ACT_FAC); break; case "deflt3sug_statut": $m = new suggestions_map(); $t = $m->getStateList(); break; case 'deflt3lgstatcde': case 'deflt3lgstatdev': $q = lgstat::getList('QUERY'); break; case 'deflt3receptsugstat': $m = new suggestions_map(); $t = $m->getStateList('ORDERED', TRUE); break; } if ($q) { $r = mysql_query($q, $dbh) or die("<br />" . mysql_error() . "<br />" . $q . "<br />"); $nb = mysql_num_rows($r); while ($row = mysql_fetch_row($r)) { $t[$row[0]] = $row[1]; } } if (count($t)) { $deflt3user .= "<div class='row'><div class='colonne60'>" . $msg[$field] . " : </div>\n";
switch ($acquisition_gestion_tva) { case '1': $modif_cde_form .= "\n\t\t\t\t\t\t<th width='6%'>" . htmlentities($msg['acquisition_act_tab_priht'], ENT_QUOTES, $charset) . " " . $msg['acquisition_act_tab_pri_exposant'] . "<br />" . htmlentities($msg['acquisition_act_tab_prittc'], ENT_QUOTES, $charset) . " " . $msg['acquisition_act_tab_pri_exposant'] . "</th>\n\t\t\t\t\t\t<th width='20%'>" . htmlentities($msg['acquisition_act_tab_typ'], ENT_QUOTES, $charset) . "<br />" . htmlentities($msg['acquisition_tva'], ENT_QUOTES, $charset) . " / " . htmlentities($msg['acquisition_remise'], ENT_QUOTES, $charset) . "</th>"; break; case '2': $modif_cde_form .= "\n\t\t\t\t\t\t<th width='6%'>" . htmlentities($msg['acquisition_act_tab_prittc'], ENT_QUOTES, $charset) . " " . $msg['acquisition_act_tab_pri_exposant'] . "<br />" . htmlentities($msg['acquisition_act_tab_priht'], ENT_QUOTES, $charset) . " " . $msg['acquisition_act_tab_pri_exposant'] . "</th>\n\t\t\t\t\t\t<th width='20%'>" . htmlentities($msg['acquisition_act_tab_typ'], ENT_QUOTES, $charset) . "<br />" . htmlentities($msg['acquisition_tva'], ENT_QUOTES, $charset) . " / " . htmlentities($msg['acquisition_remise'], ENT_QUOTES, $charset) . "</th>"; break; default: $modif_cde_form .= "\n\t\t\t\t\t\t<th width='6%'>" . htmlentities($msg['acquisition_act_tab_prittc'], ENT_QUOTES, $charset) . " " . $msg['acquisition_act_tab_pri_exposant'] . "</th>\n\t\t\t\t\t\t<th width='20%'>" . htmlentities($msg['acquisition_act_tab_typ'], ENT_QUOTES, $charset) . "<br />" . htmlentities($msg['acquisition_remise'], ENT_QUOTES, $charset) . "</th>"; break; } $modif_cde_form .= "\t\t<th width='20%'>" . htmlentities($msg['acquisition_act_tab_bud'], ENT_QUOTES, $charset) . "</th>\n\t\t\t\t\t\t<th width='10%'>" . htmlentities($msg['acquisition_lgstat'], ENT_QUOTES, $charset) . "</th>\n\t\t\t\t\t\t<th width='0px' ></th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<!-- lignes -->\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\n\t\t<div class='row'>\n\t\t\t<div class='left' >\n\t\t\t\t<input type='button' id='bt_add_line' tabindex='1' class='bouton_small' value='" . $msg['acquisition_act_add_lig'] . "' onclick=\"act_addLine();\" />\n\t\t\t</div>\n\t\t\t<div class='right'>\n\t\t\t\t<input type='button' tabindex='1' class='bouton_small' value='" . $msg['acquisition_del_chk_lig'] . "' onclick=\"act_delLines();\" />\n\t\t\t\t<input type='button' class='bouton_small' style='width:20px;' tabindex='1' value='+' onclick='act_switchCheck();' />\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t<div class='row'></div>\n\t\t<hr />\n\t\t\n\t\t<div class='row'>\n\t\t\t<div class='left'>\n\t\t\t\t<input type='button' tabindex='1' class='bouton_small' value='" . $msg['acquisition_calc'] . "' onclick=\"act_calc();\" />"; if ($acquisition_gestion_tva) { $modif_cde_form .= "\n\t\t\t\t<label class='etiquette'>" . htmlentities($msg['acquisition_total_ht'], ENT_QUOTES, $charset) . "</label>\n\t\t\t\t<input type='text' id='tot_ht' name='tot_ht' class='saisie-10emd' style='text-align:right;' readonly='readonly' value='0.00' />\n\t\t\t\t<label class='etiquette'>" . htmlentities($msg['acquisition_tva'], ENT_QUOTES, $charset) . "</label>\n\t\t\t\t<input type='text' id='tot_tva' name='tot_tva' class='saisie-10emd' style='text-align:right;' readonly='readonly' value='0.00' />"; } $modif_cde_form .= "\t\n\t\t\t\t<label class='etiquette'>" . htmlentities($msg['acquisition_total_ttc'], ENT_QUOTES, $charset) . "</label>\n\t\t\t\t<input type='text' id='tot_ttc' name='tot_ttc' class='saisie-10emd' style='text-align:right;' readonly='readonly' value='0.00' />\n\t\t\t\t<label class='etiquette'>" . htmlentities($msg['acquisition_devise'], ENT_QUOTES, $charset) . "</label>\n\t\t\t\t<input type='text' id='devise' name='devise' class='saisie-5em' style='text-align:right;' value='!!devise!!' />\n\t\t\t</div>\n\t\t\t<div class='right'>\n\t\t\t\t<label class='etiquette'>" . htmlentities($msg['acquisition_tot_expl'], ENT_QUOTES, $charset) . "</label>\n\t\t\t\t<input type='text' id='tot_expl' name='tot_expl' class='saisie-5emd' style='text-align:right;' readonly='readonly' value='0' />\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t<div class='row'></div>\n\t\t\n\t</div>\n\t\n\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg['acquisition_act_tab_pri_exposant_label'] . "</label>\n\t</div>\t\t\t\t\t\n\t<div class='row'>\n\t\t<div class='left'>\n\t\t\t<input type='button' class='bouton' value='" . $msg['76'] . "' onclick=\"document.location='./acquisition.php?categ=ach&sub=cmde&action=list&id_bibli=!!id_bibli!!' \" />\n\t\t\t<!-- bouton_enr -->\n\t\t\t<!-- bouton_val -->\n\t\t\t<!-- bouton_dup -->\n\t\t\t<!-- bouton_imp -->\n\t\t\t<!-- bouton_audit -->\n\t\t</div>\n\t\t<div class='right'>\n\t\t\t<!-- bouton_sup -->\n\t\t</div>\n\t</div>\n\t\n\t<div class='row'></div>\n\n</form>\n<br /><br />\n<script type='text/javascript' src='./javascript/tablist.js'></script>\n<script type='text/javascript' src='./javascript/ajax.js'></script>\n<script type='text/javascript'>\n\tvar acquisition_gestion_tva=" . $acquisition_gestion_tva . ";\n</script>\n<script type='text/javascript' src='./javascript/actes.js'></script>\n<script type='text/javascript'>\t\n\t\n\tdocument.getElementById('statut').value='!!statut!!';\n\t\n\tvar msg_parcourir='" . addslashes($msg['parcourir']) . "'; \n\tvar msg_raz='" . addslashes($msg['raz']) . "'; \n\tvar msg_no_fou = '" . addslashes($msg['acquisition_cde_fou_err']) . "';\n\tvar msg_act_vide='" . addslashes($msg['acquisition_cde_vid']) . "';\n\tvar acquisition_budget = '" . $acquisition_budget . "';\n\tvar msg_no_bud = '" . addslashes($msg['acquisition_act_bud_err']) . "';\n\tvar msg_acquisition_comment_lg='" . htmlentities($msg['acquisition_comment_lg'], ENT_QUOTES, $charset) . "';\n\tvar msg_acquisition_comment_lo='" . htmlentities($msg['acquisition_comment_lo'], ENT_QUOTES, $charset) . "';\n\t\n\tvar lgstat_sel=\"" . lgstat::getHtmlSelect(array(0 => $deflt3lgstatcde), FALSE, array('id' => 'lg_statut[!!lig!!]', 'name' => 'lg_statut[!!lig!!]')) . "\";\n\t\n\tvar act_nblines='!!act_nblines!!';\n\tvar act_curline='!!act_nblines!!';\n\tif(act_nblines>0) {\n\t\tact_calc();\n\t} else {\n\t\tact_addLine(!!id_cde!!);\n\t}\n\t\n</script>\n<!-- jscript -->"; // ------------------------------------------------------------------------------ // template de création/modification pour les lignes de commande // ------------------------------------------------------------------------------ $modif_cde_row_form = "\n<tr id='R_!!no!!'>\n\t<td width='0px' style='overflow:visible;'>\n\t\t<img onclick=\"javascript:expandRow('C_!!no!!_', true);\" src='./images/plus.gif' name='C_!!no!!_Img' id='C_!!no!!_Img' class='act_cell_img_plus' />\n\t</td>\n\t<td>\n\t\t<input type='text' id='code[!!no!!]' name='code[!!no!!]' tabindex='1' class='in_cell' value='!!code!!' />\n\t\t<input type='button' tabindex='1' class='bouton_small' style='width:20px;' value='" . $msg['parcourir'] . "' onclick=\"act_getCode(this);\" />\n\t\t<input type='button' tabindex='1' class='bouton_small' style='width:20px;' value='" . $msg['raz'] . "' onclick=\"act_delCode(this);\" />\n\t</td>\n\t<td>\n\t\t<textarea id='lib[!!no!!]' name='lib[!!no!!]' tabindex='1' class='in_cell' rows='3' wrap='virtual'>!!lib!!</textarea>\n\t</td>\n\t<td>\n\t\t<input type='text' id='qte[!!no!!]' name='qte[!!no!!]' tabindex='1' class='in_cell_nb' value='!!qte!!' />\n\t</td>\n\t<td>\n\t\t<input type='text' id='prix[!!no!!]' name='prix[!!no!!]' tabindex='1' class='in_cell_nb' value='!!prix!!' !!convert_prix!!/>\n\t\t!!convert_ht_ttc!! \n\t</td>\n\t<td>\n\t\t<input type='hidden' id='typ[!!no!!]' name='typ[!!no!!]' value='!!typ!!' />\n\t\t<input type='text' id='lib_typ[!!no!!]' name='lib_typ[!!no!!]' tabindex='1' completion='types_produits' linkfield='id_fou' autfield='typ[!!no!!]' autocomplete='off' callback='callBackTypeProduit' class='in_cell_ro' value='!!lib_typ!!' /><input type='button' tabindex='1' class='bouton_small' style='width:20px' value='" . $msg['parcourir'] . "' onclick=\"act_getType(this);\" /><input type='button' tabindex='1' class='bouton_small' style='width:20px;' value='" . $msg['raz'] . "' onclick=\"act_delType(this);\" />"; if ($acquisition_gestion_tva) { $modif_cde_row_form .= " <input type='text' id='tva[!!no!!]' name='tva[!!no!!]' tabindex='1' class='in_cell_nb' style='width:20%;' value='!!tva!!' !!onchange_tva!! /> %"; } $modif_cde_row_form .= " <input type='text' id='rem[!!no!!]' name='rem[!!no!!]' tabindex='1' class='in_cell_nb' style='width:20%;' value='!!rem!!' /> %\t\t\n\t</td>\n\t<td>\n\t\t<input type='hidden' id='rub[!!no!!]' name='rub[!!no!!]' value='!!rub!!' />\n\t\t<input type='text' id='lib_rub[!!no!!]' name='lib_rub[!!no!!]' tabindex='1' completion='rubriques' param1='!!id_bibli!!' param2='!!id_exer!!' autfield='rub[!!no!!]' autocomplete='off' class='in_cell_ro' value='!!lib_rub!!' /><input type='button' tabindex='1' class='bouton_small' style='width:20px;' value='" . $msg['parcourir'] . "' onclick=\"act_getRubrique(this);\" /><input type='button' tabindex='1' class='bouton_small' style='width:20px;' value='" . $msg['raz'] . "' onclick=\"act_delRubrique(this);\" />\n\t\t!!force_ht_ttc!!\n\t</td>\t\n\t<td>\n\t\t!!lgstat!!\n\t</td>\t\n\t<td width='0px' style='overflow:visible;' >\n\t\t<input type='checkbox' id='chk[!!no!!]' name='chk[!!no!!]' tabindex='1' value='1' class='act_cell_chkbox2' />\n\t\t<input type='hidden' id='id_sug[!!no!!]' name='id_sug[!!no!!]' value='!!id_sug!!' /> \n\t\t<input type='hidden' id='id_lig[!!no!!]' name='id_lig[!!no!!]' value='!!id_lig!!' /> \n\t\t<input type='hidden' id='typ_lig[!!no!!]' name='typ_lig[!!no!!]' value='!!typ_lig!!' /> \t\n\t\t<input type='hidden' id='id_prod[!!no!!]' name='id_prod[!!no!!]' value='!!id_prod!!' />\n\t</td>\n</tr>\n<tr id='C_!!no!!_Child' class='act_cell_comments' style='display:none;'>\n\t<td colspan='9'>\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td width='10%' >" . htmlentities($msg['acquisition_comment_lg'], ENT_QUOTES, $charset) . "</th>\n\t\t\t\t<td width='40%'>\n\t\t\t\t\t<textarea id='comment_lg[!!no!!]' name='comment_lg[!!no!!]' tabindex='1' class='in_cell' rows='1' wrap='virtual'>!!comment_lg!!</textarea>\n\t\t\t\t</td>\n\t\t\t\t<td width='10%'>" . htmlentities($msg['acquisition_comment_lo'], ENT_QUOTES, $charset) . "</th>\n\t\t\t\t<td width='40%'>\n\t\t\t\t\t<textarea id='comment_lo[!!no!!]' name='comment_lo[!!no!!]' tabindex='1' class='in_cell' rows='1' wrap='virtual'>!!comment_lo!!</textarea>\n\t\t\t\t</td>\n\t\t\t<tr />\n\t\t</table>\n\t</td>\n</tr>\n"; //Date paiement modifiable $sel_date_pay_mod = "<input type='hidden' id='date_pay' name='date_pay' value='!!date_pay!!' />\n\t\t\t<input type='button' id='date_pay_lib' class='bouton_small' value='!!date_pay_lib!!' onclick=\"openPopUp('./select.php?what=calendrier&caller='+this.form.name+'&date_caller=¶m1=date_pay¶m2=date_pay_lib&auto_submit=NO&date_anterieure=YES', 'date_date_test', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" />\n\t\t\t<input type='button' class='bouton_small' style='width:20px;' value='" . $msg['raz'] . "' onclick=\"this.form.elements['date_pay_lib'].value='" . $msg['parperso_nodate'] . "'; this.form.elements['date_pay'].value='';\" />"; //Date livraison modifiable $sel_date_liv_mod = "<input type='hidden' id='date_liv' name='date_liv' value='!!date_liv!!' />\n\t\t\t<input type='button' id='date_liv_lib' class='bouton_small' value='!!date_liv_lib!!' onclick=\"openPopUp('./select.php?what=calendrier&caller='+this.form.name+'&date_caller=¶m1=date_liv¶m2=date_liv_lib&auto_submit=NO&date_anterieure=YES', 'date_date_test', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" />\n\t\t\t<input type='button' class='bouton_small' style='width:20px;' value='" . $msg['raz'] . "' onclick=\"this.form.elements['date_liv_lib'].value='" . $msg['parperso_nodate'] . "'; this.form.elements['date_liv'].value='';\" />"; //Date livraison non modifiable $sel_date_liv_fix = "<input type='hidden' id='date_liv' name='date_liv' value='!!date_liv!!' />!!date_liv_lib!!"; $bt_enr = "<input type='button' class='bouton' value='" . $msg['77'] . "' \n\t\t\tonclick=\" \n\t\t\t\tr=act_verif();\n\t\t\t\tif (!r) return false;\n\t\t\t\tact_calc(); \n\t\t\t\tdocument.forms['act_modif'].setAttribute('action', 'acquisition.php?categ=ach&sub=cmde&action=update'); \n\t\t\t\tdocument.forms['act_modif'].submit(); \" />";
protected function get_user_param_form($field) { global $msg, $dbh, $charset; global ${$field}; global $location_user_section; $field_deb = substr($field, 0, 6); // $html=" // <script type='text/javascript'> // function dashboard_save_params(name,value){ // var req= new http_request(); // req.request('./ajax.php?module=".$this->module."&categ=dashboard&sub=save_quick_params',1,'".$field."='+value,1,dashboard_params_saved); // } // </script>"; $html = ""; switch ($field_deb) { case "deflt_": if ($field == "deflt_styles") { $html_style = "\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t<div class='colonne60'>" . $msg[$field] . " : \n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class='colonne_suite'>" . make_user_style_combo(${$field}) . "\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n"; } elseif ($field == "deflt_docs_location") { //visibilité des exemplaires if ($pmb_droits_explr_localises && $usr->explr_visible_mod) { $where_clause_explr = "idlocation in (" . $usr->explr_visible_mod . ") and"; } else { $where_clause_explr = ""; } $selector = gen_liste("select distinct idlocation, location_libelle from docs_location, docsloc_section where {$where_clause_explr} num_location=idlocation order by 2 ", "idlocation", "location_libelle", 'form_' . $field, "dashboard_calcule_section(this);", ${$field}, "", "", "", "", 0); $html .= "\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t<div class='colonne60'>" . $msg[$field] . " : \n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class='colonne_suite'>" . $selector . "\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n"; //localisation de l'utilisateur pour le calcul de la section $location_user_section = ${$field}; } elseif ($field == "deflt_collstate_location") { $selector = gen_liste("select distinct idlocation, location_libelle from docs_location order by 2 ", "idlocation", "location_libelle", 'form_' . $field, "", ${$field}, "", "", "0", $msg["all_location"], 0); $html .= "\n\t\t\t\t\t\t<div class='row'><div class='colonne60'>" . $msg[$field] . " : </div>\n\n\t\t\t\t\t\t<div class='colonne_suite'>" . $selector . "</div></div>\n"; } elseif ($field == "deflt_resas_location") { $selector = gen_liste("select distinct idlocation, location_libelle from docs_location order by 2 ", "idlocation", "location_libelle", 'form_' . $field, "", ${$field}, "", "", "0", $msg["all_location"], 0); $html .= "\n\t\t\t\t\t\t<div class='row'><div class='colonne60'>" . $msg[$field] . " : </div>\n\n\t\t\t\t\t\t<div class='colonne_suite'>" . $selector . "</div></div>\n"; } elseif ($field == "deflt_docs_section") { // calcul des sections $selector = ""; if (!$location_user_section) { $location_user_section = $deflt_docs_location; } if ($pmb_droits_explr_localises && $usr->explr_visible_mod) { $where_clause_explr = "where idlocation in (" . $usr->explr_visible_mod . ")"; } else { $where_clause_explr = ""; } $rqtloc = "SELECT idlocation FROM docs_location {$where_clause_explr} order by location_libelle"; $resloc = mysql_query($rqtloc, $dbh); while ($loc = mysql_fetch_object($resloc)) { $requete = "SELECT idsection, section_libelle FROM docs_section, docsloc_section where idsection=num_section and num_location='{$loc->idlocation}' order by section_libelle"; $result = mysql_query($requete, $dbh); $nbr_lignes = mysql_num_rows($result); if ($nbr_lignes) { if ($loc->idlocation == $location_user_section) { $selector .= "<div id=\"dashboard_docloc_section" . $loc->idlocation . "\" style=\"display:block\">\r\n"; } else { $selector .= "<div id=\"dashboard_docloc_section" . $loc->idlocation . "\" style=\"display:none\">\r\n"; } $selector .= "<select name='f_ex_section" . $loc->idlocation . "' id='f_ex_section" . $loc->idlocation . "'>\r\n"; while ($line = mysql_fetch_row($result)) { $selector .= "<option value='{$line['0']}' "; $selector .= $line[0] == ${$field} ? "selected='selected' >" : '>'; $selector .= htmlentities($line[1], ENT_QUOTES, $charset) . '</option>\\r\\n'; } $selector .= '</select></div>'; } } $html .= "\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t<div class='colonne60'>" . $msg[$field] . " : \n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class='colonne_suite'>" . $selector . "\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n"; } elseif ($field == "deflt_upload_repertoire") { $selector = ""; $requpload = "select repertoire_id, repertoire_nom from upload_repertoire"; $resupload = mysql_query($requpload, $dbh); $selector .= "<div id='upload_section'>"; $selector .= "<select name='form_deflt_upload_repertoire'>"; $selector .= "<option value='0'>" . $msg[upload_repertoire_sql] . "</option>"; while ($repupload = mysql_fetch_object($resupload)) { $selector .= "<option value='" . $repupload->repertoire_id . "' "; if (${$field} == $repupload->repertoire_id) { $selector .= "selected='selected' "; } $selector .= ">"; $selector .= htmlentities($repupload->repertoire_nom, ENT_QUOTES, $charset) . "</option>"; } $selector .= "</select></div>"; $html .= "\n\t\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t\t<div class='colonne60'>" . $msg[$field] . " : \n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='colonne_suite'>" . $selector . "\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>"; } elseif ($field == "deflt_import_thesaurus") { $requete = "select * from thesaurus order by 2"; $resultat_liste = mysql_query($requete, $dbh); $nb_liste = mysql_num_rows($resultat_liste); if ($nb_liste == 0) { $html .= ""; } else { $html .= "\n\t\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t\t<div class='colonne60'>" . $msg[$field] . " : \n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t\t\t\t<select class='saisie-30em' name=\"form_" . $field . "\">"; $j = 0; while ($j < $nb_liste) { $liste_values = mysql_fetch_row($resultat_liste); $html .= "<option value=\"" . $liste_values[0] . "\" "; if (${$field} == $liste_values[0]) { $html .= "selected='selected' "; } $html .= ">" . $liste_values[1] . "</option>\n"; $j++; } $html .= "</select>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n"; } } elseif ($field == "deflt_short_loan_activate") { $html .= "<div class='row'><div class='colonne60'>" . $msg[$field] . "</div>\n\n\t\t\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t\t<input type='checkbox' class='checkbox'"; if (${$field} == 1) { $html .= " checked"; } $html .= " value='1' name='form_{$field}'></div></div>\n"; } elseif ($field == "deflt_cashdesk") { $requete = "select * from cashdesk order by cashdesk_name"; $resultat_liste = mysql_query($requete, $dbh); $nb_liste = mysql_num_rows($resultat_liste); if ($nb_liste == 0) { $html .= ""; } else { // $html.=" // <div class='row'> // <div class='colonne60'>".$msg[$field]." : // </div>\n // <div class='colonne_suite'> // <select class='saisie-30em' name=\"form_".$field."\" onchange='dashboard_save_params(this.name,this.value)'>"; $html .= "\n\t\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t\t<div class='colonne60'>" . $msg[$field] . " : \n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t\t\t\t<select class='saisie-30em' name=\"form_" . $field . "\">"; $j = 0; while ($j < $nb_liste) { $liste_values = mysql_fetch_object($resultat_liste); $html .= "<option value=\"" . $liste_values->cashdesk_id . "\" "; if (${$field} == $liste_values->cashdesk_id) { $html .= "selected"; } $html .= ">" . htmlentities($liste_values->cashdesk_name, ENT_QUOTES, $charset) . "</option>\n"; $j++; } $html .= "</select>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n"; } } else { $deflt_table = substr($field, 6); if ($deflt_table == "integration_notice_statut") { $deflt_table = "notice_statut"; } switch ($field) { case "deflt_entites": $requete = "select id_entite, raison_sociale from " . $deflt_table . " where type_entite='1' order by 2 "; break; case "deflt_exercices": $requete = "select id_exercice, libelle from " . $deflt_table . " order by 2 "; break; case "deflt_rubriques": $requete = "select id_rubrique, concat(budgets.libelle,':', rubriques.libelle) from " . $deflt_table . " join budgets on num_budget=id_budget order by 2 "; break; default: $requete = "select * from " . $deflt_table . " order by 2"; break; } $resultat_liste = mysql_query($requete, $dbh); $nb_liste = mysql_num_rows($resultat_liste); if ($nb_liste == 0) { $html .= ""; } else { $html .= "\n\t\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t\t<div class='colonne60'>" . $msg[$field] . " : \n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t\t\t\t<select class='saisie-30em' name=\"form_" . $field . "\">"; $j = 0; while ($j < $nb_liste) { $liste_values = mysql_fetch_row($resultat_liste); $html .= "<option value=\"" . $liste_values[0] . "\" "; if (${$field} == $liste_values[0]) { $html .= "selected='selected' "; } $html .= ">" . $liste_values[1] . "</option>\n"; $j++; } $html .= "</select>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n"; } } break; case "param_": if ($field == "param_allloc") { $html = "<div class='row'><div class='colonne60'>" . $msg[$field] . "</div>\n\n\t\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t<input type='checkbox' class='checkbox'"; if (${$field} == 1) { $html .= " checked"; } $html .= " value='1' name='form_{$field}'></div></div>\n"; } else { $html .= "<div class='row'>"; //if (strpos($msg[$field],'<br />')) $param_user .= "<br />"; $html .= "<input type='checkbox' class='checkbox'"; if (${$field} == 1) { $html .= " checked"; } $html .= " value='1' name='form_{$field}'>\n\n\t\t\t\t\t\t{$msg[$field]}\n\t\t\t\t\t\t</div>\n"; } break; case "value_": switch ($field) { case "value_deflt_fonction": $flist = new marc_list('function'); $f = $flist->table[${$field}]; $html .= "<div class='row'><div class='colonne60'>\n\t\t\t\t\t\t{$msg[$field]} : </div>\n\n\t\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t<input type='text' class='saisie-30emr' id='form_value_deflt_fonction_libelle' name='form_value_deflt_fonction_libelle' value='" . htmlentities($f, ENT_QUOTES, $charset) . "' />\n\t\t\t\t\t\t<input type='button' class='bouton_small' value='" . $msg['parcourir'] . "' onclick=\"openPopUp('./select.php?what=function&caller=userform&p1=form_value_deflt_fonction&p2=form_value_deflt_fonction_libelle', 'select_func0', 400, 400, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes')\" />\n\t\t\t\t\t\t<input type='button' class='bouton_small' value='X' onclick=\"this.form.elements['form_value_deflt_fonction'].value='';this.form.elements['form_value_deflt_fonction_libelle'].value='';return false;\" />\n\t\t\t\t\t\t<input type='hidden' name='form_value_deflt_fonction' id='form_value_deflt_fonction' value=\"\${$field}\" />\n\t\t\t\t\t\t</div></div><br />"; break; case "value_deflt_lang": $llist = new marc_list('lang'); $l = $llist->table[${$field}]; $html .= "<div class='row'><div class='colonne60'>\n\t\t\t\t\t\t{$msg[$field]} : </div>\n\n\t\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t<input type='text' class='saisie-30emr' id='form_value_deflt_lang_libelle' name='form_value_deflt_lang_libelle' value='" . htmlentities($l, ENT_QUOTES, $charset) . "' />\n\t\t\t\t\t\t<input type='button' class='bouton_small' value='" . $msg['parcourir'] . "' onclick=\"openPopUp('./select.php?what=lang&caller=userform&p1=form_value_deflt_lang&p2=form_value_deflt_lang_libelle', 'select_lang', 400, 400, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes')\" />\n\t\t\t\t\t\t<input type='button' class='bouton_small' value='X' onclick=\"this.form.elements['form_value_deflt_lang'].value='';this.form.elements['form_value_deflt_lang_libelle'].value='';return false;\" />\n\t\t\t\t\t\t<input type='hidden' name='form_value_deflt_lang' id='form_value_deflt_lang' value=\"\${$field}\" />\n\t\t\t\t\t\t</div></div><br />"; break; case "value_deflt_relation": case "value_deflt_relation_serial": case "value_deflt_relation_bulletin": case "value_deflt_relation_analysis": $html .= "<div class='row'><div class='colonne60'>\n\t\t\t\t\t\t{$msg[$field]} : </div>\n\n\t\t\t\t\t\t<div class='colonne_suite'>"; $liste_type_relation_down = new marc_list("relationtypedown"); $liste_type_relation_up = new marc_list("relationtypeup"); $liste_type_relation_both = array(); foreach ($liste_type_relation_up->table as $key_up => $val_up) { foreach ($liste_type_relation_down->table as $key_down => $val_down) { if ($val_up == $val_down) { $liste_type_relation_both[$key_down] = $val_down; unset($liste_type_relation_down->table[$key_down]); unset($liste_type_relation_up->table[$key_up]); } } } $html .= "<select onchange='' name='form_" . $field . "' size='1'>\n\t\t\t\t\t\t<optgroup class='erreur' label='{$msg['notice_lien_montant']}'>"; foreach ($liste_type_relation_up->table as $key => $val) { if ($key . '-up' == ${$field}) { $html .= '<option style="color:#000000" value="' . $key . '-up" selected="selected">' . $val . '</option>'; } else { $html .= '<option style="color:#000000" value="' . $key . '-up">' . $val . '</option>'; } } $html .= "</optgroup>\n\t\t\t\t\t\t<optgroup class='erreur' label='{$msg['notice_lien_descendant']}'>"; foreach ($liste_type_relation_down->table as $key => $val) { if ($key . '-down' == ${$field}) { $html .= '<option style="color:#000000" value="' . $key . '-down" selected="selected" >' . $val . '</option>'; } else { $html .= '<option style="color:#000000" value="' . $key . '-down">' . $val . '</option>'; } } $html .= "</optgroup>\n\t\t\t\t\t\t<optgroup class='erreur' label='{$msg['notice_lien_symetrique']}'>"; foreach ($liste_type_relation_both as $key => $val) { if ($key . '-down' == ${$field}) { $html .= '<option style="color:#000000" value="' . $key . '-down" selected="selected" >' . $val . '</option>'; } else { $html .= '<option style="color:#000000" value="' . $key . '-down">' . $val . '</option>'; } } $html .= "</optgroup>\n\t\t\t\t\t\t</select>"; $html .= "</div></div><br />"; break; default: $html .= "<div class='row'><div class='colonne60'>\n\t\t\t\t\t\t{$msg[$field]} : </div>\n\n\t\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t<input type='text' class='saisie-20em' name='form_{$field}' value='" . htmlentities(${$field}, ENT_QUOTES, $charset) . "' />\n\t\t\t\t\t\t</div></div><br />"; break; } break; case "deflt2": if ($field == "deflt2docs_location") { // localisation des lecteurs $deflt_table = substr($field, 6); $requete = "select * from " . $deflt_table . " order by 2"; $resultat_liste = mysql_query($requete, $dbh); $nb_liste = mysql_num_rows($resultat_liste); if ($nb_liste == 0) { $html .= ""; } else { $html .= "\n\t\t\t\t\t\t\t<div class='row'><div class='colonne60'>" . $msg[$field] . " : </div>\n"; $html .= "\n\t\t\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t\t<select class='saisie-30em' name=\"form_" . $field . "\">"; $j = 0; while ($j < $nb_liste) { $liste_values = mysql_fetch_row($resultat_liste); $html .= "<option value=\"" . $liste_values[0] . "\" "; if (${$field} == $liste_values[0]) { $html .= "selected='selected' "; } $html .= ">" . $liste_values[1] . "</option>\n"; $j++; } $html .= "</select></div></div>!!param_allloc!!<br />\n"; } } else { $deflt_table = substr($field, 6); $requete = "select * from " . $deflt_table . " order by 2 "; $resultat_liste = mysql_query($requete, $dbh); $nb_liste = mysql_numrows($resultat_liste); if ($nb_liste == 0) { $html .= ""; } else { $html .= "\n\t\t\t\t\t\t\t\t<div class='row'><div class='colonne60'>" . $msg[$field] . " : </div>\n"; $html .= "\n\t\t\t\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t\t\t\t<select class='saisie-30em' name=\"form_" . $field . "\">"; $j = 0; while ($j < $nb_liste) { $liste_values = mysql_fetch_row($resultat_liste); $html .= "<option value=\"" . $liste_values[0] . "\" "; if (${$field} == $liste_values[0]) { $html .= "selected='selected' "; } $html .= ">" . $liste_values[1] . "</option>\n"; $j++; } $html .= "</select></div></div>\n"; } } break; case "xmlta_": switch ($field) { case "xmlta_indexation_lang": $langues = new XMLlist("{$include_path}/messages/languages.xml"); $langues->analyser(); $clang = $langues->table; $combo = "<select name='form_" . $field . "' id='form_" . $field . "' class='saisie-20em' >"; if (!${$field}) { $combo .= "<option value='' selected>--</option>"; } else { $combo .= "<option value='' >--</option>"; } while (list($cle, $value) = each($clang)) { // arabe seulement si on est en utf-8 if ($charset != 'utf-8' and $user_lang != 'ar' or $charset == 'utf-8') { if (strcmp($cle, ${$field}) != 0) { $combo .= "<option value='{$cle}'>{$value} ({$cle})</option>"; } else { $combo .= "<option value='{$cle}' selected>{$value} ({$cle})</option>"; } } } $combo .= "</select>"; $html .= "\n\t\t\t\t\t\t<div class='row'><div class='colonne60'>" . $msg[$field] . " : </div>\n"; $html .= "\n\t\t\t\t\t\t<div class='colonne_suite'>{$combo}</div></div>\n"; break; case "xmlta_doctype_serial": $html .= "\n\t\t\t\t\t\t\t<div class='row'><div class='colonne60'>" . $msg[$field] . " : </div>\n"; $html .= "\n\t\t\t\t\t\t\t<div class='colonne_suite'>"; $select_doc = new marc_select("doctype", "form_" . $field, ${$field}, ""); $html .= $select_doc->display; $html .= "</div></div>\n"; break; case "xmlta_doctype_bulletin": case "xmlta_doctype_analysis": $html .= "\n\t\t\t\t\t\t\t<div class='row'><div class='colonne60'>" . $msg[$field] . " : </div>\n"; $html .= "\n\t\t\t\t\t\t\t<div class='colonne_suite'>"; $select_doc = new marc_select("doctype", "form_" . $field, ${$field}, "", "0", $msg[$field . "_parent"]); $html .= $select_doc->display; $html .= "</div></div>\n"; break; default: $deflt_table = substr($field, 6); $html .= "\n\t\t\t\t\t\t\t<div class='row'><div class='colonne60'>" . $msg[$field] . " : </div>\n"; $html .= "\n\t\t\t\t\t\t\t<div class='colonne_suite'>"; $select_doc = new marc_select("{$deflt_table}", "form_" . $field, ${$field}, ""); $html .= $select_doc->display; $html .= "</div></div>\n"; break; } case "deflt3": $q = ''; $t = array(); switch ($field) { case "deflt3bibli": $q = "select 0,'" . addslashes($msg['deflt3none']) . "' union "; $q .= "select id_entite, raison_sociale from entites where type_entite='1' order by 2 "; break; case "deflt3exercice": $q = "select 0,'" . addslashes($msg['deflt3none']) . "' union "; $q .= "select id_exercice, libelle from exercices order by 2 "; break; case "deflt3rubrique": $q = "select 0,'" . addslashes($msg['deflt3none']) . "' union "; $q .= "select id_rubrique, concat(budgets.libelle,':', rubriques.libelle) from rubriques join budgets on num_budget=id_budget order by 2 "; break; case "deflt3dev_statut": $t = actes::getStatelist(TYP_ACT_DEV); break; case "deflt3cde_statut": $t = actes::getStatelist(TYP_ACT_CDE); break; case "deflt3liv_statut": $t = actes::getStatelist(TYP_ACT_LIV); break; case "deflt3fac_statut": $t = actes::getStatelist(TYP_ACT_FAC); break; case "deflt3sug_statut": $m = new suggestions_map(); $t = $m->getStateList(); break; case 'deflt3lgstatcde': case 'deflt3lgstatdev': $q = lgstat::getList('QUERY'); break; case 'deflt3receptsugstat': $m = new suggestions_map(); $t = $m->getStateList('ORDERED', TRUE); break; } if ($q) { $r = mysql_query($q, $dbh); $nb = mysql_num_rows($r); while ($row = mysql_fetch_row($r)) { $t[$row[0]] = $row[1]; } } if (count($t)) { $html .= "<div class='row'><div class='colonne60'>" . $msg[$field] . " : </div>\n"; $html .= "<div class='colonne_suite'><select class='saisie-30em' name=\"form_" . $field . "\">"; foreach ($t as $k => $v) { $html .= "<option value=\"" . $k . "\" "; if (${$field} == $k) { $html .= "selected='selected' "; } $html .= ">" . htmlentities($v, ENT_QUOTES, $charset) . "</option>\n"; } $html .= "</select></div></div><br />\n"; } break; case "speci_": $speci_func = substr($field, 6); eval('$speci_user.= get_' . $speci_func . '($id, $$field, $i, \'userform\');'); break; case "explr_": ${$field} = ${$field}; break; default: break; } switch ($field) { case "deflt2docs_location": $html = str_replace("!!param_allloc!!", self::get_user_param_form("param_allloc"), $html); break; } return $html; }
function show_lig_cde_from_sug($sugchk) { global $dbh, $charset; global $acquisition_gestion_tva; global $modif_cde_row_form, $deflt3lgstatcde; $form = "\t\n\t<script type='text/javascript'>\t\n\t\tacquisition_force_ttc='" . $msg["acquisition_force_ttc"] . "';\n\t\tacquisition_force_ht='" . $msg["acquisition_force_ht"] . "';\n\t</script>\n\t"; $i = 0; $lgstat_form = lgstat::getHtmlSelect(array(0 => $deflt3lgstatcde), FALSE, array('id' => 'lg_statut[!!i!!]', 'name' => 'lg_statut[!!i!!]')); $arrchk = unserialize(rawurldecode(stripslashes($sugchk))); foreach ($arrchk as $value) { $i++; $sug = new suggestions($value); $form .= $modif_cde_row_form; $code = ""; $taec = ""; $prix = '0'; $nb = 'none'; if ($sug->num_notice) { $q = "select niveau_biblio from notices where notice_id='" . $sug->num_notice . "' "; $r = pmb_mysql_query($q, $dbh); if (pmb_mysql_num_rows($r)) { $nb = pmb_mysql_result($r, 0, 0); } } switch ($nb) { case 'a': $typ_lig = 1; $notice = new sel_article_display($sug->num_notice, ''); $notice->getData(); $notice->responsabilites = get_notice_authors($sug->num_notice); $notice->doHeader(); $taec = $notice->titre; if ($notice->auteur1) { $taec .= "\n" . $notice->auteur1; } if ($notice->in_bull) { $taec .= "\n" . $notice->in_bull; } $prix = $notice->prix; break; case 'm': $typ_lig = 1; $notice = new sel_mono_display($sug->num_notice, ''); $notice->getData(); $notice->responsabilites = get_notice_authors($sug->num_notice); $notice->doHeader(); $code = $notice->code; $taec = $notice->titre; if ($notice->auteur1) { $taec .= "\n" . $notice->auteur1; } if ($notice->editeur1) { $taec .= "\n" . $notice->editeur1; } if ($notice->editeur1 && $notice->ed_date) { $taec .= ", " . $notice->ed_date; } elseif ($notice->ed_date) { $taec .= $notice->ed_date; } if ($notice->collection) { $taec .= "\n" . $notice->collection; } $prix = $notice->prix; break; default: $typ_lig = 0; $code = htmlentities($sug->code, ENT_QUOTES, $charset); $taec = htmlentities($sug->titre, ENT_QUOTES, $charset); if ($sug->auteur != "") { $taec .= "\n" . htmlentities($sug->auteur, ENT_QUOTES, $charset); } if ($sug->editeur != "") { $taec .= "\n" . htmlentities($sug->editeur, ENT_QUOTES, $charset); if ($sug->date_publi != "0000-00-00") { $taec .= "," . htmlentities($sug->date_publi, ENT_QUOTES, $charset); } } $prix = htmlentities($sug->prix, ENT_QUOTES, $charset); break; } $form = str_replace('!!no!!', $i, $form); $form = str_replace('!!code!!', $code, $form); $form = str_replace('!!lib!!', $taec, $form); $form = str_replace('!!qte!!', $sug->nb, $form); $form = str_replace('!!prix!!', $prix, $form); if ($acquisition_gestion_tva) { $form = str_replace('!!tva!!', $row->tva, $form); if ($acquisition_gestion_tva == 1) { $prix_ttc = round($row->prix + $row->prix / 100 * $row->tva, 2); $onchange_tva = "\n\t\t\t\t\tonChange='document.getElementById(\"convert_ht_ttc_{$i}\").innerHTML=\n\t\t\t\t\t\tht_to_ttc(document.getElementById(\"prix[{$i}]\").value,document.getElementById(\"tva[{$i}]\").value);\n\t\t\t\t\t' "; $convert_prix = "\n\t\t\t\t\tonChange='document.getElementById(\"convert_ht_ttc_{$i}\").innerHTML=\n\t\t\t\t\t\tht_to_ttc(document.getElementById(\"prix[{$i}]\").value,document.getElementById(\"tva[{$i}]\").value);\n\t\t\t\t\t' "; $convert_ht_ttc = "\n\t\t\t\t<span class='convert_ht_ttc' id='convert_ht_ttc_{$i}' \n\t\t\t\t\tonclick='\n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").value=\"\";\n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").style.visibility=\"visible\"; \n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").focus();\n\t\t\t\t\t'\t\t\t\t\t\t\t\n\t\t\t\t>" . $prix_ttc . "</span>\n\t\t\t\t<input style='visibility:hidden' type='text' id='input_convert_ht_ttc_{$i}' name='convert_ht_ttc_{$i}' value='' \t\t\t\t\n\t\t\t\t\tonBlur='document.getElementById(\"input_convert_ht_ttc_{$i}\").style.visibility=\"hidden\";'\t\t\t\t\n\t\t\t\t\tonChange='document.getElementById(\"prix[{$i}]\").value=\n\t\t\t\t\t\tttc_to_ht(document.getElementById(\"input_convert_ht_ttc_{$i}\").value,document.getElementById(\"tva[{$i}]\").value);\n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").style.visibility=\"hidden\"; \n\t\t\t\t\t\tdocument.getElementById(\"convert_ht_ttc_{$i}\").innerHTML=document.getElementById(\"input_convert_ht_ttc_{$i}\").value;\n\t\t\t\t\t' \n\t\t\t\t/>"; } elseif ($acquisition_gestion_tva == 2) { $prix = $row->prix; $tva = $row->tva; $prix_ht = round($prix / ($tva / 100 + 1), 2); $onchange_tva = "\n\t\t\t\t\tonChange='document.getElementById(\"convert_ht_ttc_{$i}\").innerHTML=\n\t\t\t\t\t\tttc_to_ht(document.getElementById(\"prix[{$i}]\").value,document.getElementById(\"tva[{$i}]\").value);\n\t\t\t\t\t' "; $convert_prix = "\n\t\t\t\t\tonChange='document.getElementById(\"convert_ht_ttc_{$i}\").innerHTML=\n\t\t\t\t\t\tttc_to_ht(document.getElementById(\"prix[{$i}]\").value,document.getElementById(\"tva[{$i}]\").value);\n\t\t\t\t\t' "; $convert_ht_ttc = "\n\t\t\t\t<span class='convert_ht_ttc' id='convert_ht_ttc_{$i}' \n\t\t\t\t\tonclick='\n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").value=\"\";\n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").style.visibility=\"visible\"; \n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").focus();\n\t\t\t\t\t'\t\t\t\t\t\t\t\n\t\t\t\t>" . $prix_ht . "</span>\n\t\t\t\t<input style='visibility:hidden' type='text' id='input_convert_ht_ttc_{$i}' name='convert_ht_ttc_{$i}' value='{$prix_ttc}' \t\t\t\t\n\t\t\t\t\tonBlur='document.getElementById(\"input_convert_ht_ttc_{$i}\").style.visibility=\"hidden\";'\t\t\t\t\n\t\t\t\t\tonChange='document.getElementById(\"prix[{$i}]\").value=\n\t\t\t\t\t\tht_to_ttc(document.getElementById(\"input_convert_ht_ttc_{$i}\").value,document.getElementById(\"tva[{$i}]\").value);\n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").style.visibility=\"hidden\"; \n\t\t\t\t\t\tdocument.getElementById(\"convert_ht_ttc_{$i}\").innerHTML=document.getElementById(\"input_convert_ht_ttc_{$i}\").value;\n\t\t\t\t\t' \n\t\t\t\t/>"; } if ($row->debit_tva == 1) { $force_ht_ttc = "<br />\n\t\t\t\t<input type='hidden' id='force_debit[{$i}]' name='force_debit[{$i}]' value='1' />\t\t\t\t\n\t\t\t\t<span class='force_ht_ttc' id='force_ht_ttc_{$i}'\t\t\t\t\n\t\t\t\t\tonclick='\n\t\t\t\t\t\tif(document.getElementById(\"force_debit[{$i}]\").value==1){\n\t\t\t\t\t\t\tdocument.getElementById(\"force_ht_ttc_{$i}\").innerHTML=\"" . $msg["acquisition_force_ttc"] . "\";\n\t\t\t\t\t\t\tdocument.getElementById(\"force_debit[{$i}]\").value=2;\n\t\t\t\t\t\t}else{\t\t\t\t\n\t\t\t\t\t\t\tdocument.getElementById(\"force_ht_ttc_{$i}\").innerHTML=\"" . $msg["acquisition_force_ht"] . "\";\n\t\t\t\t\t\t\tdocument.getElementById(\"force_debit[{$i}]\").value=1;\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t'\t\t\t\t\n\t\t\t\t>" . $msg["acquisition_force_ht"] . "</span>"; } else { $force_ht_ttc = "<br />\n\t\t\t\t<input type='hidden' id='force_debit[{$i}]' name='force_debit[{$i}]' value='2' />\t\t\t\t\n\t\t\t\t<span class='force_ht_ttc' id='force_ht_ttc_{$i}'\t\t\t\t\n\t\t\t\t\tonclick='\n\t\t\t\t\t\tif(document.getElementById(\"force_debit[{$i}]\").value==2){\n\t\t\t\t\t\t\tdocument.getElementById(\"force_ht_ttc_{$i}\").innerHTML=\"" . $msg["acquisition_force_ht"] . "\";\n\t\t\t\t\t\t\tdocument.getElementById(\"force_debit[{$i}]\").value=1;\n\t\t\t\t\t\t}else{\t\t\t\t\n\t\t\t\t\t\t\tdocument.getElementById(\"force_ht_ttc_{$i}\").innerHTML=\"" . $msg["acquisition_force_ttc"] . "\";\n\t\t\t\t\t\t\tdocument.getElementById(\"force_debit[{$i}]\").value=2;\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t'\t\t\t\t\n\t\t\t\t>" . $msg["acquisition_force_ttc"] . "</span>"; } } $form = str_replace('!!onchange_tva!!', $onchange_tva, $form); $form = str_replace('!!convert_prix!!', $convert_prix, $form); $form = str_replace('!!convert_ht_ttc!!', $convert_ht_ttc, $form); $form = str_replace('!!force_ht_ttc!!', $force_ht_ttc, $form); $form = str_replace('!!rem!!', '0.00', $form); $lgstat = str_replace('!!i!!', $i, $lgstat_form); $form = str_replace('!!lgstat!!', $lgstat, $form); $form = str_replace('!!comment_lg!!', htmlentities($row->commentaires_gestion, ENT_QUOTES, $charset), $form); $form = str_replace('!!comment_lo!!', htmlentities($row->commentaires_opac, ENT_QUOTES, $charset), $form); $form = str_replace('!!typ!!', '0', $form); $form = str_replace('!!lib_typ!!', '', $form); $form = str_replace('!!rub!!', '0', $form); $form = str_replace('!!lib_rub!!', '', $form); $form = str_replace('!!id_sug!!', $sug->id_suggestion, $form); $form = str_replace('!!id_lig!!', '0', $form); $form = str_replace('!!typ_lig!!', $typ_lig, $form); $form = str_replace('!!id_prod!!', $sug->num_notice, $form); } $t = array(0 => $i, 1 => $form); return $t; }
function show_delivery_form($msg_client = '') { global $dbh, $msg, $charset; global $no, $id_lig, $id_prod, $typ_lig; global $recept_deliv_form, $recept_deliv_form_suite; global $recept_form_qte_liv, $recept_bt_update, $recept_bt_undo, $previous, $recept_bt_next; $form = $recept_deliv_form; $lg = new lignes_actes($id_lig); $act = new actes($lg->num_acte); $fou = new entites($act->num_fournisseur); $nb_rec = $lg->getNbDelivered($id_lig); $nb_sol = $lg->nb - $nb_rec; if ($nb_sol > 0) { $form = str_replace('<!-- bt_update -->', $recept_bt_update, $form); $form = str_replace('<!-- qte_liv -->', $recept_form_qte_liv, $form); } else { $form = str_replace('<!-- qte_liv -->', '', $form); } if ($previous) { $tp = unserialize(rawurldecode(stripslashes($previous))); if (is_array($tp) && count($tp)) { $form = str_replace('<!-- bt_undo -->', $recept_bt_undo, $form); $form = str_replace('!!previous!!', stripslashes($previous), $form); } else { $previous = 0; } } if (!$previous) { $form = str_replace('<!-- bt_undo -->', '', $form); $form = str_replace('!!previous!!', 0, $form); } $form = str_replace('<!-- bt_next -->', $recept_bt_next, $form); $lgstat_form = lgstat::getHtmlSelect(array(0 => 0), FALSE, array('id' => 'sel_lgstat_!!id_lig!!', 'onchange' => 'recept_upd_lgstat(this.getAttribute("id"));')); $form = str_replace('!!lib_acte!!', htmlentities($msg['acquisition_recept_fou'], ENT_QUOTES, $charset) . " " . htmlentities($fou->raison_sociale, ENT_QUOTES, $charset) . ' ' . htmlentities($act->type_acte ? $msg['acquisition_act_num_dev'] : $msg['acquisition_act_num_cde'], ENT_QUOTES, $charset) . htmlentities($act->numero, ENT_QUOTES, $charset), $form); $form = str_replace('!!code!!', htmlentities($lg->code, ENT_QUOTES, $charset), $form); $form = str_replace('!!lib!!', nl2br(htmlentities($lg->libelle, ENT_QUOTES, $charset)), $form); $form = str_replace('!!qte_cde!!', $lg->nb, $form); $form = str_replace('!!qte_rec!!', $nb_rec, $form); $form = str_replace('!!qte_sol!!', $nb_sol, $form); $lgstat_form = str_replace("value='" . $lg->statut . "'", "value='" . $lg->statut . "' selected='selected' ", $lgstat_form); $form = str_replace('!!lgstat!!', $lgstat_form, $form); $form = str_replace('!!comment_lg!!', nl2br(htmlentities($lg->commentaires_gestion, ENT_QUOTES, $charset)), $form); $form = str_replace('!!comment_lo!!', nl2br(htmlentities($lg->commentaires_opac, ENT_QUOTES, $charset)), $form); $form = str_replace('!!id_lig!!', $id_lig, $form); $form = str_replace('!!id_prod!!', $id_prod, $form); $form = str_replace('!!typ_lig!!', $typ_lig, $form); $form = str_replace('!!no!!', $no, $form); switch ($typ_lig) { case '1': //notice $form .= do_notice_form($id_prod); $form .= do_explnum_form(); $form .= do_expl_form(); if ($lg->num_acquisition) { $form .= do_sugg_form($lg->num_acquisition); } break; case '2': //bulletin $form .= do_bull_form($id_prod); $form .= do_explnum_form(); $form .= do_expl_form(); //if ($lg->num_acquisition) $form.=do_sugg_form($lg->num_acquisition); break; case '3': //frais break; case '4': //abt break; case '5': //article $form .= do_art_form($id_prod); $form .= do_explnum_form(); if ($lg->num_acquisition) { $form .= do_sugg_form($lg->num_acquisition); } break; default: //non catalogué if ($lg->num_acquisition) { $form .= do_sugg_form($lg->num_acquisition); } break; } $form = str_replace('!!msg_client!!', $msg_client, $form); print $form . $recept_deliv_form_suite; }
function show_from_cde() { global $id_cde; global $id_bibli, $id_exer, $f_fou_code, $f_dem_code, $f_rub_code; global $chk_dev, $chk_cde, $cde_query, $all_query, $recept_query, $lgstat_filter; $act = new actes($id_cde); $id_bibli = $act->num_entite; $id_exer = $act->num_exercice; $f_fou_code = array(0 => $act->num_fournisseur); $f_dem_code = array(); $f_rub_code = array(); $chk_dev = 0; $chk_cde = '1'; $cde_query = $act->numero; $all_query = ''; $lgstat_filter = lgstat::getList('ARRAY_VALUES'); $recept_query = ''; }