Exemplo n.º 1
0
 function elt_list()
 {
     global $msg, $charset;
     global $elt_query;
     global $results_show_all;
     $research .= '<b>' . htmlentities($msg['selector_lib_noti'], ENT_QUOTES, $charset) . '</b>&nbsp;' . htmlentities(stripslashes($elt_query), ENT_QUOTES, $charset);
     $this->show_form();
     if ($this->nbresults) {
         $research .= " => " . sprintf($msg["searcher_results"], $this->nbresults);
         if (!$results_show_all && $this->nbepage != 1) {
             $research .= "&nbsp;&nbsp;&nbsp;<input type='button' class='bouton_small' onclick='results_show_all();' name='searcher_results_show_all' value='" . htmlentities($msg['searcher_results_show_all'], ENT_QUOTES, $charset) . "'>";
         }
         $this->elt_b_list = str_replace('!!research!!', $research, $this->elt_b_list);
         print $this->elt_b_list;
         //Boutons check/uncheck/add selection
         print "<div class='row'>\n\t\t\t\t\t\t<input type='button' class='bouton_small' onclick='check_uncheck(1);' id='searcher_results_check_all' name='searcher_results_check_all' value='" . htmlentities($msg['searcher_results_check_all'], ENT_QUOTES, $charset) . "'>\n\t\t\t\t\t\t&nbsp;&nbsp;\n\t\t\t\t\t\t<input type='button' class='bouton_small' onclick='add_selection();' id='searcher_results_add_selection' name='searcher_results_add_selection' value='" . htmlentities($msg['searcher_results_add_selection'], ENT_QUOTES, $charset) . "'>\n\t\t\t\t\t</div>";
         print "<form name='searcher_results_check_form'>";
         // on lance la requête
         while ($nz = pmb_mysql_fetch_object($this->t_query)) {
             // notice d'article
             $art = new sel_article_display($nz->notice_id, $this->base_url, 'sel_searcher_select_');
             $art->action = $this->action;
             $art->action_values = $this->action_values;
             $art->doForm();
             $list .= $this->elt_r_list;
             if (count($this->elt_r_list_values)) {
                 foreach ($this->elt_r_list_values as $v) {
                     $list = str_replace("!!{$v}!!", $art->{$v}, $list);
                 }
             }
         }
         print $list;
         // fin de liste
         print "</form>";
         print $this->elt_e_liste;
         print $this->back_script;
         print $this->back_script_show_all;
     } else {
         error_message_history($msg[357], $msg[1915], 1);
     }
 }
Exemplo n.º 2
0
function show_lig_dev_from_sug($sugchk)
{
    global $dbh, $charset;
    global $acquisition_gestion_tva;
    global $modif_dev_row_form;
    $form = "";
    $i = 0;
    $arrchk = unserialize(rawurldecode(stripslashes($sugchk)));
    foreach ($arrchk as $value) {
        $i++;
        $sug = new suggestions($value);
        $form .= $modif_dev_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);
                }
                $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!!', '0.00', $form);
        }
        $form = str_replace('!!typ!!', '0', $form);
        $form = str_replace('!!lib_typ!!', '', $form);
        $form = str_replace('!!rem!!', '0.00', $form);
        $form = str_replace('!!id_sug!!', $sug->id_suggestion, $form);
        $form = str_replace('!!id_lig!!', '0', $form);
        $form = str_replace('!!id_prod!!', $sug->num_notice, $form);
    }
    $t = array(0 => $i, 1 => $form);
    return $t;
}
Exemplo n.º 3
0
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;
}