function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0) { global $nb_per_page; global $base_url; global $caller; global $msg; global $no_display; global $charset; // on récupére le nombre de lignes qui vont bien if ($user_input == "") { $requete = "SELECT COUNT(1) FROM notices where notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' "; } else { $aq = new analyse_query(stripslashes($user_input)); if ($aq->error) { error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message)); exit; } $members = $aq->get_query_members("notices", "index_wew", "index_sew", "notice_id"); $requete = "select count(notice_id) from notices where (" . $members["where"] . " or code like '" . stripslashes($user_input) . "') and notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1'"; } $res = pmb_mysql_query($requete, $dbh); $nbr_lignes = @pmb_mysql_result($res, 0, 0); if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { // on lance la vraie requête if ($user_input == "") { $requete = "SELECT notice_id, tit1, code FROM notices where notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' ORDER BY tit1, code LIMIT {$debut},{$nb_per_page} "; } else { $requete = "select notice_id, tit1, code, " . $members["select"] . " as pert from notices where (" . $members["where"] . " or code like '" . stripslashes($user_input) . "') and notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' group by notice_id order by pert desc, index_serie, tnvol, index_sew, code limit {$debut},{$nb_per_page}"; } $res = @pmb_mysql_query($requete, $dbh); print "<table><tr>"; while ($notice = pmb_mysql_fetch_object($res)) { $notice_entry = $notice->tit1 . " " . $notice->code; print "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$notice->notice_id}', '" . htmlentities(addslashes($notice->tit1), ENT_QUOTES, $charset) . " ({$notice->code})')\">" . htmlentities($notice->tit1, ENT_QUOTES, $charset) . "</a></td>\n\t\t\t\t\t<td>{$notice->code}</td>"; print "</tr>"; } print "</table>"; pmb_mysql_free_result($res); // constitution des liens $nbepages = ceil($nbr_lignes / $nb_per_page); $suivante = $page + 1; $precedente = $page - 1; } // affichage de la pagination print "<div class='row'> <hr /></div><div align='center'>"; $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input)); $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); print $nav_bar; print "</div>"; }
function dsi_list_classements() { global $dbh, $msg; global $page, $nbr_lignes; global $dsi_list_tmpl; global $form_cb; // nombre de références par pages $nb_per_page = 10; if (!$nbr_lignes) { $requete = "SELECT COUNT(1) FROM classements "; $res = mysql_query($requete, $dbh); $nbr_lignes = @mysql_result($res, 0, 0); } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { // on lance la vraie requête $requete = "SELECT id_classement, nom_classement, type_classement FROM classements ORDER BY type_classement, nom_classement, id_classement LIMIT {$debut},{$nb_per_page} "; $res = @mysql_query($requete, $dbh); $parity = 0; while ($clas = mysql_fetch_object($res)) { if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./dsi.php?categ=options&sub=classements&id_classement={$clas->id_classement}&suite=acces';\" "; $empr_list .= "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'>"; $empr_list .= "\n\t\t\t\t<td>\n\t\t\t\t\t<strong>" . $msg['dsi_clas_type_class_' . $clas->type_classement] . "</strong>\n\t\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<strong>{$clas->nom_classement}</strong>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>"; $parity += 1; } mysql_free_result($res); // affichage de la barre de navig $url_base = "{$PHP_SELF}?categ=options&sub=classements"; $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); if ($nbr_lignes > 0) { $dsi_list_tmpl = str_replace("<!--!!nb_total!!-->", "(" . $nbr_lignes . ")", $dsi_list_tmpl); } $dsi_list_tmpl = str_replace("!!cle!!", $form_cb, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!list!!", $empr_list, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!nav_bar!!", $nav_bar, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!message_trouve!!", "", $dsi_list_tmpl); $ajout = "<br /><input type='button' class='bouton' value='{$msg['dsi_clas_ajouter']}' onclick=\"document.location='./dsi.php?categ=options&sub=classements&suite=add'\" />"; return $dsi_list_tmpl . $ajout; } else { return ""; } }
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0) { global $nb_per_page; global $base_url; global $caller; global $class_path; global $no_display; global $charset; global $msg; global $dbh; // on récupére le nombre de lignes if ($user_input == "") { $requete = "SELECT empr_cp, empr_ville FROM empr group by empr_cp, empr_ville "; } else { $requete = "SELECT empr_cp, empr_ville FROM empr where empr_cp like '{$user_input}%' group by empr_cp, empr_ville "; } $res = mysql_query($requete, $dbh); $nbr_lignes = mysql_num_rows($res); if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { // on lance la vraie requête if ($user_input == "") { $requete = "SELECT empr_cp, empr_ville, count(id_empr) as nbre FROM empr group by empr_cp, empr_ville ORDER BY empr_cp, empr_ville LIMIT {$debut},{$nb_per_page} "; } else { $requete = "SELECT empr_cp, empr_ville, count(id_empr) as nbre FROM empr where empr_cp like '{$user_input}%' group by empr_cp, empr_ville ORDER BY empr_cp, empr_ville LIMIT {$debut},{$nb_per_page} "; } $res = mysql_query($requete, $dbh); while ($cp_ville = mysql_fetch_object($res)) { print "<div class='row'>"; print pmb_bidi("<a href='#' onclick=\"set_parent('{$caller}', '" . htmlentities(addslashes($cp_ville->empr_ville), ENT_QUOTES, $charset) . "', '" . htmlentities(addslashes($cp_ville->empr_cp), ENT_QUOTES, $charset) . "')\">{$cp_ville->empr_cp} - {$cp_ville->empr_ville} : {$cp_ville->nbre}</a>"); print "</div>"; } mysql_free_result($res); // constitution des liens $nbepages = ceil($nbr_lignes / $nb_per_page); $suivante = $page + 1; $precedente = $page - 1; // affichage de la pagination print "<hr /><div align='center'>"; $url_base = $base_url . "&rech_regexp={$rech_regexp}&user_input=" . rawurlencode(stripslashes($user_input)); $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); print $nav_bar; print '</div>'; } }
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0) { global $nb_per_page; global $base_url; global $caller; global $msg; global $charset; global $idaction; global $current_note; $user_input = str_replace('*', '%', $user_input); if ($user_input == "") { $req_count = "select count(1) from demandes_notes where num_action='" . $idaction . "' and id_note !='" . $current_note . "'"; } else { $req_count = "select count(1) from demandes_notes where num_action='" . $idaction . "' and contenu like '%" . $user_input . "%' and id_note !='" . $current_note . "'"; } $res = pmb_mysql_query($req_count, $dbh); $nbr_lignes = @pmb_mysql_result($res, 0, 0); if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { // on lance la vraie requête if ($user_input == "") { $req = "select id_note, date_note, CONCAT(SUBSTRING(contenu,1,50),'','...') as note from demandes_notes where num_action='" . $idaction . "' and id_note !='" . $current_note . "'"; } else { $req = "select id_note, date_note, CONCAT(SUBSTRING(contenu,1,50),'','...') as note from demandes_notes where num_action='" . $idaction . "' and contenu like '%" . $user_input . "%' and id_note !='" . $current_note . "'"; } $res = pmb_mysql_query($req, $dbh); while ($note = pmb_mysql_fetch_object($res)) { print "<div class='row'>"; print "<a href='#' onclick=\"set_parent('{$caller}', '{$note->id_note}', '" . htmlentities(addslashes($note->note), ENT_QUOTES, $charset) . "')\"> [" . htmlentities(formatdate($note->date_note), ENT_QUOTES, $charset) . '] ' . htmlentities($note->note, ENT_QUOTES, $charset) . "</a>"; print "</div>"; } pmb_mysql_free_result($res); // constitution des liens $nbepages = ceil($nbr_lignes / $nb_per_page); $suivante = $page + 1; $precedente = $page - 1; } print "<div class='row'> <hr /></div><div align='center'>"; $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input)); $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); print $nav_bar; print "</div>"; }
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0) { global $nb_per_page; global $base_url; global $caller; global $charset; global $msg; global $expl_list_id; // on récupére le nombre de lignes qui vont bien if (!$id) { if ($user_input == "") { $requete = "SELECT COUNT(1) FROM groupexpl"; } else { $aq = new analyse_query(stripslashes($user_input)); if ($aq->error) { error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message)); exit; } $requete = "select count(distinct id_groupexpl) from groupexpl where groupexpl_name like '%" . $user_input . "%'"; } $res = pmb_mysql_query($requete, $dbh); $nbr_lignes = @pmb_mysql_result($res, 0, 0); } else { $nbr_lignes = 1; } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { $expl_list = explode(",", $expl_list_id); $expl_list_cb = array(); foreach ($expl_list as $id_expl) { $query = "SELECT expl_cb FROM exemplaires WHERE expl_id='" . $id_expl . "'"; $result = pmb_mysql_query($query); if ($result && pmb_mysql_num_rows($result)) { $cb = pmb_mysql_result($result, 0, 0); $expl_list_cb[] = $cb; } } $last_id_used = session::get_last_used("groupexpl"); if ($last_id_used) { print "<div class='selector_last_used'>\n \t\t\t\t<div class='row'>\n \t\t\t\t\t<b>" . $msg["selector_last_groupexpl_used"] . "</b>\n \t\t\t\t</div>\n \t\t\t\t<div class='row'>"; $query = "select id_groupexpl, groupexpl_name from groupexpl where id_groupexpl=" . $last_id_used; $result = pmb_mysql_query($query); while ($group = pmb_mysql_fetch_object($result)) { print pmb_bidi("\n\t\t\t\t\t\t<a href=\"{$base_url}&action=add_expl&id_groupexpl=" . $group->id_groupexpl . "&expl_list=" . implode(",", $expl_list_cb) . "\">\n\t\t\t\t\t\t{$group->groupexpl_name}</a><br />"); } print "</div></div>"; } // on lance la vraie requête if (!$id) { if ($user_input == "") { $requete = "SELECT groupexpl.* FROM groupexpl"; $requete .= " ORDER BY groupexpl_name LIMIT {$debut},{$nb_per_page} "; } else { $requete = "select groupexpl.* from groupexpl where groupexpl_name like '%" . $user_input . "%' order by groupexpl_name LIMIT {$debut},{$nb_per_page}"; } } else { $requete = "select groupexpl.* FROM groupexpl where id_groupexpl='" . $id . "'"; } $res = @pmb_mysql_query($requete, $dbh); while ($group = pmb_mysql_fetch_object($res)) { print pmb_bidi("\n \t\t\t<a href=\"{$base_url}&action=add_expl&id_groupexpl=" . $group->id_groupexpl . "&expl_list=" . implode(",", $expl_list_cb) . "\">\n\t\t\t\t\t{$group->groupexpl_name}</a><br />"); } pmb_mysql_free_result($res); // constitution des liens $nbepages = ceil($nbr_lignes / $nb_per_page); $suivante = $page + 1; $precedente = $page - 1; // affichage pagination print "<div class='row'> <hr /></div><div align='center'>"; $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input)); $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); print $nav_bar; print "</div>"; } }
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0) { global $nb_per_page; global $base_url; global $caller; global $no_display; global $charset; global $msg; global $callback; global $param1; // on récupére le nombre de lignes qui vont bien // if($param1) $restrict=" and abt_id not in (select num_serialcirc_abt from serialcirc) "; if (!$id) { if ($user_input == "") { $requete = "SELECT COUNT(1) FROM abts_abts where abt_id!='{$no_display}' {$restrict}"; } else { $requete = "select count(distinct abt_id) from abts_abts where abt_name like '%abt%' and abt_id!='{$no_display}' {$restrict}"; } $res = pmb_mysql_query($requete, $dbh); $nbr_lignes = pmb_mysql_result($res, 0, 0); } else { $nbr_lignes = 1; } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { // on lance la vraie requête if (!$id) { if ($user_input == "") { $requete = "SELECT * FROM abts_abts where abt_id!='{$no_display}' {$restrict} "; $requete .= "ORDER BY abt_name LIMIT {$debut},{$nb_per_page} "; } else { $requete = "SELECT * FROM abts_abts where abt_name like '%{$user_input}%' and abt_id!='{$no_display}' {$restrict}"; $requete .= "ORDER BY abt_name LIMIT {$debut},{$nb_per_page} "; } } else { $requete = "select * from abts_abts where abt_id='" . $id . "'"; } print "<table>"; $res = @pmb_mysql_query($requete, $dbh); while ($abt = pmb_mysql_fetch_object($res)) { $circlist_info = ""; $flag_circlist_info = 0; $requete = "select id_serialcirc from serialcirc where num_serialcirc_abt=" . $abt->abt_id; $res_circlist = pmb_mysql_query($requete); print "<tr><td>"; if (pmb_mysql_num_rows($res_circlist)) { $circlist_info = "<img align='top' title='" . $msg["serialcirc_img_info"] . "' height='18' width='18' alt='" . $msg["serialcirc_img_info"] . "' src='./images/icon_a.gif'>"; $flag_circlist_info = 1; } print "{$circlist_info}</td><td width='100%'>"; $entry = $abt->abt_name; print pmb_bidi("\n\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$abt->abt_id}', '" . htmlentities(addslashes($entry), ENT_QUOTES, $charset) . "','{$callback}',{$flag_circlist_info})\">\n\t\t\t\t{$entry}</a>"); print "</td>"; } print "</table>"; pmb_mysql_free_result($res); // constitution des liens $nbepages = ceil($nbr_lignes / $nb_per_page); $suivante = $page + 1; $precedente = $page - 1; // affichage pagination print "<div class='row'> <hr /></div><div align='center'>"; $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input)); $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); print $nav_bar; print "</div>"; } }
function show_list_sug($id_bibli = 0) { global $dbh, $base_path; global $msg, $charset; global $sug_map; global $sug_search_form, $sug_list_form, $filtre_src, $user_txt, $user_id, $user_statut; global $nb_per_page; global $class_path; global $user_input, $statut, $num_categ, $page, $nbr_lignes, $last_param; global $script, $bt_chk, $bt_imp, $bt_exporter; global $acquisition_sugg_categ; global $acquisition_sugg_localises, $sugg_location_id; global $deflt_docs_location; if ($acquisition_sugg_localises) { $sugg_location_id = (string) $sugg_location_id == "" ? $deflt_docs_location : $sugg_location_id; } // nombre de références par pages if (!$nb_per_page) { $nb_per_page = 10; } //Affichage form de recherche $titre = htmlentities($msg['recherche'] . ' : ' . $msg['acquisition_sug'], ENT_QUOTES, $charset); $action = "./acquisition.php?categ=sug&action=list&id_bibli=" . $id_bibli . "&user_input=&nb_per_page=" . $nb_per_page; $bouton_add = "<input class='bouton' type='button' value='" . $msg['acquisition_ajout_sug'] . "' onClick=\"document.location='./acquisition.php?categ=sug&sub=todo&action=modif&id_bibli=" . $id_bibli . "&sugg_location_id={$sugg_location_id}';\" />"; $lien_last_sug = ""; $sug_search_form = str_replace('!!form_title!!', $titre, $sug_search_form); $sug_search_form = str_replace('!!action!!', $action, $sug_search_form); $sug_search_form = str_replace('<!-- sel_state -->', $sug_map->getStateSelector(), $sug_search_form); $sug_search_form = str_replace('<!-- bouton_add -->', $bouton_add, $sug_search_form); $sug_search_form = str_replace('<!-- lien_last -->', $lien_last_sug, $sug_search_form); //Selecteur de localisation $list_locs = ''; if ($acquisition_sugg_localises) { if ($sugg_location_id) { $temp_location = $sugg_location_id; } else { $temp_location = 0; } $locs = new docs_location(); $list_locs = $locs->gen_combo_box_sugg($temp_location, 1, "submit();"); } $sug_search_form = str_replace('<!-- sel_location -->', $list_locs, $sug_search_form); //Selecteur de categories if ($acquisition_sugg_categ != '1') { $sel_categ = ""; } else { $tab_categ = suggestions_categ::getCategList(); $sel_categ = "<select class='saisie-25em' id='num_categ' name='num_categ' onchange=\"submit();\">"; $sel_categ .= "<option value='-1'>" . htmlentities($msg['acquisition_sug_tous'], ENT_QUOTES, $charset) . "</option>"; foreach ($tab_categ as $id_categ => $lib_categ) { $sel_categ .= "<option value='" . $id_categ . "' > "; $sel_categ .= htmlentities($lib_categ, ENT_QUOTES, $charset) . "</option>"; } $sel_categ .= "</select>"; } $sug_search_form = str_replace('<!-- sel_categ -->', $sel_categ, $sug_search_form); //Affichage du filtre par source $req = "select * from suggestions_source order by libelle_source"; $res = pmb_mysql_query($req, $dbh); $selected = ""; $option = "<option value='0'>" . htmlentities($msg['acquisition_sugg_all_sources'], ENT_QUOTES, $charset) . "</option>"; while ($src = pmb_mysql_fetch_object($res)) { $src->id_source == $filtre_src ? $selected = "selected" : ($selected = ""); $option .= "<option value='" . $src->id_source . "' {$selected}>" . htmlentities($src->libelle_source, ENT_QUOTES, $charset) . "</option>"; } $selecteur = " <select id='filtre_src' name='filtre_src' onchange=\"this.form.submit();\">" . $option . "</select>"; $sug_search_form = str_replace('!!sug_filtre_src!!', $selecteur, $sug_search_form); $user_name = $user_txt; if (!$user_txt && $user_id) { $req = "select concat(empr_nom,', ',empr_prenom) as nom from empr where id_empr='" . $user_id . "'"; $res = pmb_mysql_query($req, $dbh); $empr = pmb_mysql_fetch_object($res); $user_name = $empr->nom; } $sug_search_form = str_replace('!!user_txt!!', htmlentities($user_name, ENT_QUOTES, $charset), $sug_search_form); $sug_search_form = str_replace('!!user_id!!', htmlentities($user_id, ENT_QUOTES, $charset), $sug_search_form); $sug_search_form = str_replace('!!user_statut!!', htmlentities($user_statut, ENT_QUOTES, $charset), $sug_search_form); $sug_search_form = str_replace('!!user_input!!', htmlentities($user_input, ENT_QUOTES, $charset), $sug_search_form); print $sug_search_form; //Affiche par defaut toutes les categories de suggestions if ($acquisition_sugg_categ != '1') { $num_categ = "-1"; } else { if (!$num_categ) { $num_categ = '-1'; } print "<script type='text/javascript' >document.forms['search'].elements['num_categ'].value = '" . $num_categ . "';</script>"; } if (!$statut) { $statut = getSessionSugState(); //Recuperation du statut courant } else { setSessionSugState($statut); } print "<script type='text/javascript' >document.forms['search'].elements['statut'].value = '" . $statut . "';document.forms['search'].elements['user_input'].focus();\n\tdocument.forms['search'].elements['user_input'].select();</script>"; //Prise en compte du formulaire de recherche $mask = $sug_map->getMask_FILED(); // traitement de la saisie utilisateur require_once $class_path . "/analyse_query.class.php"; //comptage if (!$nbr_lignes) { if (!$user_input) { $nbr_lignes = suggestions::getNbSuggestions($id_bibli, $statut, $num_categ, $mask, 0, $sugg_location_id, '', $filtre_src, $user_id, $user_statut); } else { $aq = new analyse_query(stripslashes($user_input), 0, 0, 0, 0); if ($aq->error) { error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message)); exit; } $nbr_lignes = suggestions::getNbSuggestions($id_bibli, $statut, $num_categ, $mask, $aq, $sugg_location_id, $user_input, $filtre_src, $user_id, $user_statut); } } else { $aq = new analyse_query(stripslashes($user_input), 0, 0, 0, 0); } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { $url_base = "acquisition.php?categ=sug&action=list&id_bibli={$id_bibli}&user_input=" . rawurlencode(stripslashes($user_input)) . "&statut={$statut}&num_categ={$num_categ}&sugg_location_id={$sugg_location_id}&filtre_src={$filtre_src}&user_id={$user_id}&user_statut={$user_statut}"; //affichage if (!$user_input) { $q = suggestions::listSuggestions($id_bibli, $statut, $num_categ, $mask, $debut, $nb_per_page, 0, '', $sugg_location_id, '', $filtre_src, $user_id, $user_statut); } else { $q = suggestions::listSuggestions($id_bibli, $statut, $num_categ, $mask, $debut, $nb_per_page, $aq, '', $sugg_location_id, $user_input, $filtre_src, $user_id, $user_statut); } $res = pmb_mysql_query($q, $dbh); //Affichage liste des suggestions $nbr = pmb_mysql_num_rows($res); $aff_row = ""; $parity = 1; for ($i = 0; $i < $nbr; $i++) { $row = pmb_mysql_fetch_object($res); //recuperation origine $lib_orig = ""; $typ_orig = "0"; $q = suggestions_origine::listOccurences($row->id_suggestion, '1'); $list_orig = pmb_mysql_query($q, $dbh); if (pmb_mysql_num_rows($list_orig)) { $row_orig = pmb_mysql_fetch_object($list_orig); $orig = $row_orig->origine; $typ_orig = $row_orig->type_origine; } //Récupération du nom du créateur de la suggestion $idempr = 0; switch ($typ_orig) { default: case '0': $requete_user = "******" . $orig . "' limit 1 "; $res_user = pmb_mysql_query($requete_user, $dbh); $row_user = pmb_mysql_fetch_row($res_user); $lib_orig = $row_user[1]; if ($row_user[2]) { $lib_orig .= ", " . $row_user[2]; } break; case '1': $requete_empr = "SELECT id_empr, empr_nom, empr_prenom, empr_adr1 FROM empr where id_empr = '" . $orig . "' limit 1 "; $res_empr = pmb_mysql_query($requete_empr, $dbh); $row_empr = pmb_mysql_fetch_row($res_empr); $lib_orig = $row_empr[1]; if ($row_empr[2]) { $lib_orig .= ", " . $row_empr[2]; } $idempr = $row_empr[0]; break; case '2': $lib_orig = $orig; break; } $lib_statut = $sug_map->getHtmlComment($row->statut); $col2 = ""; if (trim($row->code) != "") { $col2 = htmlentities(trim($row->code), ENT_QUOTES, $charset) . "<br />"; } $col2 .= htmlentities(trim($row->titre), ENT_QUOTES, $charset); $col3 = ""; $col30 = ""; $col31 = ""; if (trim($row->auteur) != "") { $col30 = htmlentities(trim($row->auteur), ENT_QUOTES, $charset); } if (trim($row->editeur) != "") { $col31 = "[" . htmlentities(trim($row->editeur), ENT_QUOTES, $charset) . "]"; } $col3 = $col30; if ($col3 != "" && $col31 != "") { $col3 .= "<br />"; } $col3 .= $col31; if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $parity += 1; $tr_javascript_l1 = "onmouseover=\"this.className='surbrillance';this.parentNode.rows[this.rowIndex+1].className='surbrillance';\" onmouseout=\"this.className='" . $pair_impair . "';this.parentNode.rows[this.rowIndex+1].className='" . $pair_impair . "'\" "; $tr_javascript_l2 = "onmouseover=\"this.className='surbrillance';this.parentNode.rows[this.rowIndex-1].className='surbrillance';\" onmouseout=\"this.className='" . $pair_impair . "';this.parentNode.rows[this.rowIndex-1].className='" . $pair_impair . "'\" "; $dn_javascript = "onmousedown=\"document.location='./acquisition.php?categ=sug&action=modif&id_bibli=" . $id_bibli . "&id_sug=" . $row->id_suggestion . "' \" "; if ($idempr) { $link_empr = "<a href='circ.php?categ=pret&id_empr={$idempr}'>"; $link_empr_fin = "</a>"; } else { $link_empr = ""; $link_empr_fin = ""; } $aff_row .= "<tr class='" . $pair_impair . "' " . $tr_javascript_l1 . " style='cursor: pointer' >\n\t\t\t\t\t\t<td " . $dn_javascript . " >" . formatdate($row->date_creation) . "<br />{$link_empr}" . htmlentities($lib_orig, ENT_QUOTES, $charset) . "{$link_empr_fin}</td>\n\t\t\t\t\t\t<td " . $dn_javascript . " >" . $col2 . "</td>\n\t\t\t\t\t\t<td " . $dn_javascript . " >" . $col3 . "</td>\n\t\t\t\t\t\t<td " . $dn_javascript . " >" . htmlentities($row->nb, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t\t<td " . $dn_javascript . " >" . htmlentities($row->prix, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t\t<td " . $dn_javascript . " >{$lib_statut}</td>"; if (!$row->num_notice) { $aff_row .= "<td " . $dn_javascript . " ></td>"; } else { $req_ana = "select analysis_bulletin as bull , analysis_notice as noti from analysis where analysis_notice ='" . $row->num_notice . "'"; $res_ana = pmb_mysql_query($req_ana, $dbh); $num_rows_ana = pmb_mysql_num_rows($res_ana); if ($num_rows_ana) { $ana = pmb_mysql_fetch_object($res_ana); $url_view = "catalog.php?categ=serials&sub=bulletinage&action=view&bul_id={$ana->bull}&art_to_show=" . $ana->noti; } else { $url_view = "./catalog.php?categ=isbd&id=" . $row->num_notice; } $aff_row .= "<td style='text-align:center;'><a href=\"" . $url_view . "\"><img border=\"0\" align=\"middle\" title=\"" . $msg['acquisition_sug_view_not'] . "\" alt=\"" . $msg['acquisition_sug_view_not'] . "\" src=\"./images/notice.gif\" /></a></td>"; } $sug_src = new suggestion_source($row->sugg_source); if ($acquisition_sugg_categ == '1') { $categ = new suggestions_categ($row->num_categ); $aff_row .= "<td " . $dn_javascript . " >" . htmlentities($categ->libelle_categ, ENT_QUOTES, $charset) . "<br />" . htmlentities($sug_src->libelle_source, ENT_QUOTES, $charset) . "</td>"; $colspan = '10'; } else { $aff_row .= "<td " . $dn_javascript . " >" . htmlentities($sug_src->libelle_source, ENT_QUOTES, $charset) . "</td>"; $colspan = '9'; } $sug = new suggestions($row->id_suggestion); $img_pj = "<a href=\"{$base_path}/explnum_doc.php?explnumdoc_id=" . $sug->get_explnum('id') . "\" target=\"_LINK_\"><img src='{$base_path}/images/globe_orange.png' /></a>"; $img_import = "<a href=\"{$base_path}/acquisition.php?categ=sug&sub=import&explnumdoc_id=" . $sug->get_explnum('id') . " \"><img src='{$base_path}/images/upload.gif' /></a>"; $aff_row .= "<td align='center'><i>" . ($sug->get_explnum('id') ? "{$img_pj} {$img_import}" : '') . "</i></td>"; $aff_row .= "<td ><input type='checkbox' id='chk[" . $row->id_suggestion . "]' name='chk[]' value='" . $row->id_suggestion . "' /></td>\n\t\t\t\t\t</tr>"; $aff_row .= "\t\t<tr class='" . $pair_impair . "' " . $tr_javascript_l2 . " style='cursor: pointer' >\n\t\t\t\t\t\t<td colspan='" . $colspan . "' " . $dn_javascript . " ><i>" . htmlentities($row->commentaires, ENT_QUOTES, $charset) . "</i></td>\n\t\t\t\t\t</tr>"; } $sug_list_form = str_replace('<!-- sug_list -->', $aff_row, $sug_list_form); //Affichage des boutons //Bouton Imprimer $imp = "openPopUp('./pdf.php?pdfdoc=listsug&user_input=" . urlencode(stripslashes($user_input)) . "&statut=" . $statut . "&num_categ=" . $num_categ . "&sugg_location_id=" . $sugg_location_id . "' ,'print_PDF', 600, 500, -2, -2, 'toolbar=no, dependent=yes, resizable=yes');"; $bt_imp = str_replace('!!imp!!', $imp, $bt_imp); $sug_list_form = str_replace('<!-- bt_imp -->', $bt_imp, $sug_list_form); //Génération de la liste des conversions possibles $catalog = _parser_text_no_function_(file_get_contents($base_path . "/admin/convert/imports/catalog.xml"), "CATALOG"); $list_export = "<select name='export_list'>"; for ($i = 0; $i < count($catalog["ITEM"]); $i++) { $item = $catalog["ITEM"][$i]; if ($item["EXPORT"] == "yes") { $list_export .= "<option value='" . $i . "'>" . htmlentities($item["EXPORTNAME"], ENT_QUOTES, $charset) . "</option>\n"; } } $list_export .= "</select>"; $bt_exporter = str_replace("<!-- list_export -->", $list_export, $bt_exporter); //Lien vers la page suivante $link_export = "document.sug_list_form.action='acquisition.php?categ=sug&sub=export'; document.sug_list_form.submit();"; $bt_exporter = str_replace("!!exp!!", $link_export, $bt_exporter); $sug_list_form = str_replace('<!-- bt_exporter -->', $bt_exporter, $sug_list_form); //Bouton Sélectionner $sug_list_form = str_replace('<!-- bt_chk -->', $bt_chk, $sug_list_form); //Liste Boutons $button_list = $sug_map->getButtonList($statut); $sug_list_form = str_replace('<!-- bt_list -->', $button_list, $sug_list_form); //Bouton Reprendre $bt_todo = $sug_map->getButtonList_TODO($statut); $sug_list_form = str_replace('<!-- bt_todo -->', $bt_todo, $sug_list_form); if ($acquisition_sugg_categ == '1') { //Selecteur Affecter a une categorie $to_categ = $sug_map->getCategModifier($statut, $num_categ, $nb_per_page); } else { $to_categ = ""; } $sug_list_form = str_replace('<!-- to_categ -->', $to_categ, $sug_list_form); //Bouton Supprimer $button_sup = $sug_map->getButtonList_DELETED($statut); $sug_list_form = str_replace('<!-- bt_sup -->', $button_sup, $sug_list_form); //JavaScript $script_list = $sug_map->getScriptList($statut, $num_categ, $nb_per_page); $script = str_replace('<!-- script_list -->', $script_list, $script); $sug_list_form = str_replace('<!-- script -->', $script, $sug_list_form); //Barre de navigation if (!$last_param) { $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, true, true); } else { $nav_bar = ""; } $sug_list_form = str_replace('<!-- nav_bar -->', $nav_bar, $sug_list_form); print $sug_list_form; } else { // la requête n'a produit aucun résultat error_message($msg['acquisition_sug_rech'], str_replace('!!sug_cle!!', stripslashes($user_input), $msg['acquisition_sug_rech_error']), 0, './categ=sug&sub=todo&action=list&id_bibli=' . $id_bibli); } }
function show_list_fac($id_bibli) { global $msg, $charset; global $search_form_actes, $faclist_form, $faclist_bt_chk, $faclist_script; global $faclist_bt_pay; global $nb_per_page_acq, $nb_per_page; global $class_path; global $user_input, $statut, $page, $nbr_lignes, $tri_param, $limit_param, $last_param, $sortBy; global $tab_bib; //gestion du tri if (!isset($sortBy)) { if (trim($_SESSION["acquisition_fac_sort"])) { $sortBy = $_SESSION["acquisition_fac_sort"]; } else { $sortBy = ""; } } else { $_SESSION["acquisition_fac_sort"] = $sortBy; } //Creation selecteur etablissement $sel_bibli = "<select class='saisie-50em' id='id_bibli' name='id_bibli' onchange=\"submit();\" >"; foreach ($tab_bib[0] as $k => $v) { $sel_bibli .= "<option value='" . $v . "' "; if ($v == $id_bibli) { $sel_bibli .= "selected='selected' "; } $sel_bibli .= ">" . htmlentities($tab_bib[1][$k], ENT_QUOTES, $charset) . "</option>"; } $sel_bibli .= "</select>"; $search_form_actes = str_replace('<!-- sel_bibli -->', $sel_bibli, $search_form_actes); //Creation selecteur statut $sel_statut = "<select class='saisie-25em' id='statut' name='statut' onchange=\"submit();\" >"; $list_statut = actes::getStatelist(TYP_ACT_FAC); foreach ($list_statut as $k => $v) { $sel_statut .= "<option value='" . $k . "'>" . htmlentities($v, ENT_QUOTES, $charset) . "</option>"; } $sel_statut .= "</select>"; $search_form_actes = str_replace('<!-- sel_statut -->', $sel_statut, $search_form_actes); //Affichage form de recherche $titre = htmlentities($msg['recherche'] . ' : ' . $msg['acquisition_ach_fac'], ENT_QUOTES, $charset); $action = "./acquisition.php?categ=ach&sub=fact&action=list&user_input="; $search_form_actes = str_replace('!!form_title!!', $titre, $search_form_actes); $search_form_actes = str_replace('!!action!!', $action, $search_form_actes); $search_form_actes = str_replace('!!user_input!!', $user_input, $search_form_actes); $search_form_actes = str_replace('!!sortBy!!', $sortBy, $search_form_actes); print $search_form_actes; if (!$statut) { $statut = getSessionFacState(); //Recuperation du statut courant } else { setSessionFacState($statut); } print "<script type='text/javascript' >document.forms['search'].elements['statut'].value = " . $statut . ";document.forms['search'].elements['user_input'].focus();\n\tdocument.forms['search'].elements['user_input'].select();</script>"; //Prise en compte du formulaire de recherche // nombre de références par pages if (!isset($nb_per_page)) { if ($nb_per_page_acq != "") { $nb_per_page = $nb_per_page_acq; } else { $nb_per_page = 10; } } // traitement de la saisie utilisateur require_once $class_path . "/analyse_query.class.php"; // on récupére le nombre de lignes qui vont bien if (!$nbr_lignes) { if (!$user_input) { $nbr_lignes = entites::getNbActes($id_bibli, TYP_ACT_FAC, $statut); } else { $aq = new analyse_query(stripslashes($user_input), 0, 0, 0, 0); if ($aq->error) { error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message)); exit; } $nbr_lignes = entites::getNbActes($id_bibli, TYP_ACT_FAC, $statut, $aq, $user_input); } } else { $aq = new analyse_query(stripslashes($user_input), 0, 0, 0, 0); } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { $url_base = "{$PHP_SELF}?categ=ach&sub=fact&action=list&id_bibli={$id_bibli}&user_input=" . rawurlencode(stripslashes($user_input)) . "&statut={$statut}&sortBy={$sortBy}"; // on lance la vraie requête if (!$user_input) { $res = entites::listActes($id_bibli, TYP_ACT_FAC, $statut, $debut, $nb_per_page, 0, '', $sortBy); } else { $res = entites::listActes($id_bibli, TYP_ACT_FAC, $statut, $debut, $nb_per_page, $aq, $user_input, $sortBy); } //Affichage liste des factures $fac_list = ""; $nbr = pmb_mysql_num_rows($res); $parity = 1; for ($i = 0; $i < $nbr; $i++) { $row = pmb_mysql_fetch_object($res); $st = $row->statut & ~STA_ACT_ARC; switch ($st) { case STA_ACT_REC: $st_fac = htmlentities($msg['acquisition_fac_rec'], ENT_QUOTES, $charset); break; case STA_ACT_PAY: $st_fac = htmlentities($msg['acquisition_fac_pay'], ENT_QUOTES, $charset); break; default: $st_fac = ''; } if (($row->statut & STA_ACT_ARC) == STA_ACT_ARC) { $st_fac = '<s>' . $st_fac . '</s>'; } if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $parity += 1; $tr_javascript = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" "; $dn_javascript = "onmousedown=\"document.location='./acquisition.php?categ=ach&sub=fact&action=modif&id_bibli=" . $id_bibli . "&id_fac=" . $row->id_acte . "' \" "; $fac_list .= "<tr class='" . $pair_impair . "' " . $tr_javascript . " style='cursor: pointer' >\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>" . $row->numero . "</i></td>\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>" . $row->num_acte_parent . "</i></td>\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>" . htmlentities($row->raison_sociale, ENT_QUOTES, $charset) . "</i></td>\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>" . formatdate($row->date_acte) . "</i></td>\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>{$st_fac}</i></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<a href=# onclick=\"openPopUp('./pdf.php?pdfdoc=fact&id_fac=" . $row->id_acte . "' ,'print_PDF', 600, 500, -2, -2, 'toolbar=no, dependent=yes, resizable=yes');\" >\n\t\t\t\t\t\t\t\t<img src='./images/print.gif' border='0' align='center' alt='" . htmlentities($msg['imprimer'], ENT_QUOTES, $charset) . "' title='" . htmlentities($msg['imprimer'], ENT_QUOTES, $charset) . "' />\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</td>"; if ($statut == STA_ACT_REC) { $fac_list .= "<td><input type='checkbox' name='chk[]' id='chk[" . $row->id_acte . "]' value='" . $row->id_acte . "'/></td>"; } $fac_list .= "</tr>"; } if (!$last_param) { $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, true, true); } else { $nav_bar = ""; } $fieldList = array("1" => "numero", "2" => "num_acte_parent", "3" => "raison_sociale", "4" => "date_acte"); foreach ($fieldList as $k => $field) { if ($sortBy == $field) { $faclist_form = str_replace('!!sortBy_' . $k . '_1!!', "-" . $field, $faclist_form); $faclist_form = str_replace('!!sortBy_' . $k . '_2!!', " ▴", $faclist_form); } elseif ($sortBy == "-" . $field) { $faclist_form = str_replace('!!sortBy_' . $k . '_1!!', $field, $faclist_form); $faclist_form = str_replace('!!sortBy_' . $k . '_2!!', " ▾", $faclist_form); } else { $faclist_form = str_replace('!!sortBy_' . $k . '_1!!', $field, $faclist_form); $faclist_form = str_replace('!!sortBy_' . $k . '_2!!', "", $faclist_form); } } $faclist_form = str_replace('<!-- fac_list -->', $fac_list, $faclist_form); $faclist_form = str_replace('<!-- nav_bar -->', $nav_bar, $faclist_form); $bt_list = ''; $bt_sup = ''; if ($statut == STA_ACT_REC) { //colonne chk $faclist_form = str_replace("<!-- chk_th -->", "<th class='act_cell_chkbox'> </th>", $faclist_form); //Bouton Sélectionner $faclist_form = str_replace('<!-- bt_chk -->', $faclist_bt_chk, $faclist_form); //JavaScript $faclist_form = str_replace('<!-- script -->', $faclist_script, $faclist_form); //bouton payer $bt_list = $faclist_bt_pay; } $faclist_form = str_replace('<!-- bt_list -->', $bt_list, $faclist_form); $faclist_form = str_replace('<!-- bt_sup -->', $bt_sup, $faclist_form); print $faclist_form; } else { // la requête n'a produit aucun résultat error_message($msg['acquisition_fac_rech'], str_replace('!!fac_cle!!', stripslashes($user_input), $msg['acquisition_fac_rech_error']), 0, './categ=ach&sub=fact&action=list&id_bibli=' . $id_bibli); } }
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0) { global $nb_per_page; global $base_url; global $caller; global $callback; global $charset; global $msg; global $no_display; // on récupére le nombre de lignes qui vont bien if (!$id) { if ($user_input == "") { $requete = "SELECT COUNT(1) FROM collections where collection_id!='{$no_display}' "; } else { $aq = new analyse_query(stripslashes($user_input)); if ($aq->error) { error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message)); exit; } $requete = $aq->get_query_count("collections", "collection_name", "index_coll", "collection_id", "collection_id!='{$no_display}'"); } $res = mysql_query($requete, $dbh); $nbr_lignes = @mysql_result($res, 0, 0); } else { $nbr_lignes = 1; } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { // on lance la vraie requête if (!$id) { if ($user_input == "") { $requete = "SELECT collections.*,publishers.* FROM collections, publishers WHERE collection_id!='{$no_display}' and ed_id=collection_parent group by collection_id"; $requete .= " ORDER BY index_coll, index_publisher LIMIT {$debut},{$nb_per_page} "; } else { $members = $aq->get_query_members("collections", "collection_name", "index_coll", "collection_id"); $requete = "select collections.*,publishers.*, " . $members["select"] . " as pert from collections, publishers where " . $members["where"] . " and collection_id!='{$no_display}' and ed_id=collection_parent group by collection_id order by pert desc, index_coll, index_publisher LIMIT {$debut},{$nb_per_page}"; } } else { $requete = "select collections.*,publishers.* from collections,publishers where collection_id='" . $id . "' and collection_parent=ed_id group by collection_id"; } $res = @mysql_query($requete, $dbh); while ($col = mysql_fetch_object($res)) { print pmb_bidi("\n \t\t\t<a href='#' onclick=\"set_parent('{$caller}', {$col->collection_id}, '" . htmlentities(addslashes($col->collection_name), ENT_QUOTES, $charset) . "', {$col->ed_id}, '" . htmlentities(addslashes($col->ed_name), ENT_QUOTES, $charset) . "','{$callback}')\">\n\t\t\t\t{$col->collection_name}</a>"); print pmb_bidi(". {$col->ed_name}<br />"); } mysql_free_result($res); // constitution des liens $nbepages = ceil($nbr_lignes / $nb_per_page); $suivante = $page + 1; $precedente = $page - 1; // affichage pagination print "<div class='row'> <hr /></div><div align='center'>"; $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input)); $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); print $nav_bar; print "</div>"; } }
$pair_impair = "even"; } else { $pair_impair = "odd"; } $parity += 1; $liste_mots .= "<tr class='{$pair_impair}'><td><strong>" . stripslashes($r->mot) . "</strong></td>"; $liste_mots .= "<td width='50%'> </td><td><input type='radio' id='type_lien2_" . $r->id_mot . "' name='type_lien2_" . $r->id_mot . "' onClick='modify_type_mot_vide(" . $r->id_mot . ",2);'"; if ($r->type_lien == 2) { $liste_mots .= " checked"; } $liste_mots .= "></td><td><input type='radio' id='type_lien3_" . $r->id_mot . "' name='type_lien3_" . $r->id_mot . "' onClick='modify_type_mot_vide(" . $r->id_mot . ",3);'"; if ($r->type_lien == 3) { $liste_mots .= " checked"; } $liste_mots .= "></td><td><input type='radio' id='type_lien4_" . $r->id_mot . "' name='type_lien4_" . $r->id_mot . "' onClick='modify_type_mot_vide(" . $r->id_mot . ",4);'"; if ($r->type_lien == 4) { $liste_mots .= " checked"; } $liste_mots .= "></td><td><div class='right'><input type='button' class='bouton_small' value='" . $msg["63"] . "' onClick=\"response=confirm('" . $msg["word_del_confirm"] . "'); if (response) document.location='./autorites.php?categ=semantique&sub=empty_words&action=del&id_mot=" . $r->id_mot . "&type_lien=" . $r->type_lien . "';\"></div></td>"; $liste_mots .= "</tr>\n"; } //affichage de la pagination $autorites_list_empty_word = str_replace("!!pagination!!", "<div class='row'>" . aff_pagination($baseurl, $compt, $nb_per_page, $page) . "</div>", $autorites_list_empty_word); } else { $autorites_list_empty_word = str_replace("!!pagination!!", "", $autorites_list_empty_word); } $autorites_list_empty_word = str_replace("!!see_last_words!!", "<div class='right'><a href='./autorites.php?categ=semantique&sub=empty_words&action=last_words'>" . $msg["see_last_words_added"] . "</a></div>", $autorites_list_empty_word); } $autorites_list_empty_word = str_replace("!!liste_mots!!", $liste_mots, $autorites_list_empty_word); print $autorites_list_empty_word; }
function dsi_list_empr($form_cb = "", $ban_priv_seuls = 1) { global $dbh, $msg; global $page, $nbr_lignes; global $dsi_list_tmpl, $empr_location_id; global $deflt2docs_location, $empr_location_id, $pmb_lecteurs_localises; if ($ban_priv_seuls) { $form_restrict_priv = " join bannettes on num_bannette=id_bannette "; $where_restrict_priv = " and proprio_bannette=id_empr "; } $retour = array(); // nombre de références par pages $nb_per_page = 10; if ($form_cb) { $form_cb_rech = str_replace("*", "%", $form_cb); $clause = "WHERE empr_nom like '{$form_cb_rech}%' and empr_categ=id_categ_empr"; if ($pmb_lecteurs_localises && $empr_location_id) { $clause .= " and empr_location={$empr_location_id} "; } } else { $clause = "WHERE empr_categ=id_categ_empr"; } if ($empr_location_id && $pmb_lecteurs_localises) { $clause .= " and empr_location='{$empr_location_id}' "; } if (!$nbr_lignes) { $requete = "SELECT COUNT(distinct id_empr) FROM empr join bannette_abon on id_empr=num_empr {$form_restrict_priv}, empr_categ {$clause} {$where_restrict_priv} "; $res = mysql_query($requete, $dbh) or die(mysql_error() . "<br /><br />{$requete}"); $nbr_lignes = @mysql_result($res, 0, 0); } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes == 1) { // on lance la vraie requête $requete = "SELECT distinct id_empr as id FROM empr join bannette_abon on id_empr=num_empr {$form_restrict_priv}, empr_categ {$clause} {$where_restrict_priv} "; $res = @mysql_query($requete, $dbh); $id = @mysql_result($res, '0', 'id'); if ($id) { $retour['id_empr'] = $id; $retour['message'] = $msg[dsi_encours_de_dev] . " // lecteur trouvé à partir du nom..."; return $retour; } } else { if ($nbr_lignes) { // on lance la vraie requête $requete = "SELECT distinct libelle, empr_cb, empr_nom, empr_prenom, id_empr FROM empr join bannette_abon on id_empr=num_empr {$form_restrict_priv}, empr_categ {$clause} {$where_restrict_priv} ORDER BY empr_nom, empr_prenom LIMIT {$debut},{$nb_per_page} "; $res = mysql_query($requete, $dbh) or die(mysql_error() . $requete); $parity = 0; while ($empr = mysql_fetch_object($res)) { if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./dsi.php?categ=bannettes&sub=abo&id_empr={$empr->id_empr}&suite=acces';\" "; $empr_list .= "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'>"; $empr_list .= "\n\t\t\t\t<td>\n\t\t\t\t\t<strong>{$empr->empr_cb}</strong>\n\t\t\t\t\t</td>\n\t\t\t\t<td>\n \t\t\t\t{$empr->empr_nom} {$empr->empr_prenom}\n\t\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t{$empr->libelle}\n\t\t\t\t\t</td>\n\t\t\t\t</tr>"; $parity += 1; } mysql_free_result($res); // affichage de la barre de navig $url_base = "{$PHP_SELF}?categ=bannettes&sub=abo&suite=search&form_cb=" . rawurlencode($form_cb) . "&ban_priv_seuls={$ban_priv_seuls}&empr_location_id={$empr_location_id}"; $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); $dsi_list_tmpl = str_replace("!!cle!!", $form_cb, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!list!!", $empr_list, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!nav_bar!!", $nav_bar, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!message_trouve!!", $msg['dsi_empr_trouves'], $dsi_list_tmpl); $retour['id_empr'] = 0; $retour['message'] = $dsi_list_tmpl; return $retour; } else { $retour['id_empr'] = 0; $retour['message'] = $msg[dsi_lect_aucun_trouve]; return $retour; } } }
break; case "retard": case "retard_par_date": $bouton_imprime_tout = "<input type='hidden' name='act' value=''><input type='button' class='bouton' value=\"" . $msg['lettres_relance'] . "\" onclick=\"this.form.act.value='print'; this.form.submit();\" >"; break; case "owner": break; case "encours": default: break; } if ($bouton_imprime_tout) { echo "\n\t\t\t\t\t<br />\n\t\t\t\t\t<form class='form-{$current_module}' action='' method='post'>\n\t\t\t\t\t{$bouton_imprime_tout}\n\t\t\t\t\t</form>"; } } $nav_bar = aff_pagination("{$url_page}?categ={$categ}&sub={$sub}", $nombre_lignes_pret, $nb_per_page, $page, 10, false, true); print $nav_bar; //impression/emails (on est dans le cas retards/retards par date) if ($act == "print") { $not_all_mail = array(); if ($nombre_lignes_pret) { $resultat = pmb_mysql_query($sql); while ($r = pmb_mysql_fetch_object($resultat)) { $mail_sended = 0; if (($mailretard_priorite_email == 1 || $mailretard_priorite_email == 2) && $r->empr_mail) { // l'objet du mail $var = "mailretard_" . $relance . "objet"; eval("\$objet=\"" . ${$var} . "\";"); // la formule de politesse du bas (le signataire) $var = "mailretard_" . $relance . "fdp"; eval("\$fdp=\"" . ${$var} . "\";");
$affichage_mots .= htmlentities($valeur_syn, ENT_QUOTES, $charset) . "</a><br />\n"; } $compt++; } } else { if (pmb_substr($valeur_syn, 0, 1) == '0' || !array_search(convert_diacrit(pmb_strtolower(pmb_substr($valeur_syn, 0, 1))), $alphabet)) { if ($compt >= ($page - 1) * $nb_per_page && $compt < $page * $nb_per_page) { $affichage_mots .= "<a href='#' onClick=\"set_parent('" . $key . "','" . htmlentities(addslashes($valeur_syn), ENT_QUOTES, $charset) . "')\">"; $affichage_mots .= htmlentities($valeur_syn, ENT_QUOTES, $charset) . "</a><br />\n"; } } $compt++; } } } $affichage_mots .= "</div>"; $affichage_mots .= "<div class='row'> </div><hr />\n"; //affichage de la pagination $affichage_mots .= aff_pagination($baseurl . "&user_input={$user_input}&letter=" . $letter, $compt, $nb_per_page, $page); $affichage_mots .= "<div class='row'> </div>\n"; } //ajout du script $sel_word = str_replace("!!jscript!!", $jscript, $sel_word); //ajout des lettres $sel_word = str_replace("!!lettres!!", $affichage_lettres, $sel_word); //ajout des mots $sel_word = str_replace("!!liste_mots!!", $affichage_mots, $sel_word); //ajout de l'url $sel_word = str_replace("!!action!!", $baseurl, $sel_word); print $sel_word; }
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0) { global $nb_per_page; global $base_url; global $caller; global $class_path; global $no_display; global $charset; global $msg; global $callback; if (!$id) { // on récupére le nombre de lignes if ($user_input == "") { $requete = "SELECT COUNT(1) FROM titres_uniformes where tu_id!='{$no_display}' "; } else { $aq = new analyse_query(stripslashes($user_input)); if ($aq->error) { error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message)); exit; } $requete = $aq->get_query_count("titres_uniformes", "tu_name,", "index_tu", "tu_id", "tu_id!='{$no_display}'"); } $res = pmb_mysql_query($requete, $dbh); $nbr_lignes = @pmb_mysql_result($res, 0, 0); } else { $nbr_lignes = 1; } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { // on lance la vraie requête if (!$id) { if ($user_input == "") { $requete = "SELECT * FROM titres_uniformes where tu_id!='{$no_display}' ORDER BY tu_name LIMIT {$debut},{$nb_per_page} "; } else { $members = $aq->get_query_members("titres_uniformes", "tu_name", "index_tu", "tu_id"); $requete = "select *," . $members["select"] . " as pert from titres_uniformes where " . $members["where"] . " and tu_id!='{$no_display}' group by tu_id order by pert desc,index_tu limit {$debut},{$nb_per_page}"; } } else { $requete = "select * from titres_uniformes where tu_id='" . $id . "'"; } $res = @pmb_mysql_query($requete, $dbh); while ($titre_uniforme = pmb_mysql_fetch_object($res)) { $tu = new titre_uniforme($titre_uniforme->tu_id); $titre_uniforme_entry = $tu->display; print "<div class='row'>"; print pmb_bidi("<a href='#' onclick=\"set_parent('{$caller}', '{$titre_uniforme->tu_id}', '" . htmlentities(addslashes($titre_uniforme_entry), ENT_QUOTES, $charset) . "','{$callback}')\">{$titre_uniforme_entry}</a>"); print "</div>"; } pmb_mysql_free_result($res); // constitution des liens $nbepages = ceil($nbr_lignes / $nb_per_page); $suivante = $page + 1; $precedente = $page - 1; // affichage du lien précédent si nécéssaire print "<div class='row'> <hr /></div><div align='center'>"; $url_base = $base_url . "&rech_regexp={$rech_regexp}&user_input=" . rawurlencode(stripslashes($user_input)); $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); print $nav_bar; print "</div>"; } else { print $msg["aut_titre_uniforme_not_found"]; } }
break; } $nb_per_page = 100; if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; $rqt .= " limit {$debut},{$nb_per_page}"; $res = mysql_query($rqt, $dbh); $st = "odd"; while ($data = mysql_fetch_array($res)) { if ($st == "odd") { $st = "even"; } else { $st = "odd"; } $lien = str_replace("!!id!!", $data[0], $link); if ($data[2]) { $lien = str_replace("!!id_notice!!", $data[2], $lien); } $liste .= "<tr class='" . $st . "' onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $st . "'\" style='cursor: pointer'>\n\t\t\t\t\t<td onClick=\"parent.location.href='" . $lien . "';\">" . $data[1] . "</td>\n\t\t\t\t</tr>"; } $global = "\n<div class='row'>\n\t<div class='right'><a href='#' onClick='parent.kill_frame_items();return false;'><img src='" . $base_path . "/images/close.gif' border='0' align='right'></a></div>\n\t<h3>" . $titre . " (" . $total . ")</h3>\n\t<table>\t\n\t\t!!liste!!\n\t</table>\n</div>"; print str_replace("!!liste!!", $liste, $global); print "<div class='row'><div align='center'>"; $url_base = $base_path . "/admin/docs/frame_liste_items.php?what=" . $what . "&item=" . $item . "&total=" . $total; $nav_bar = aff_pagination($url_base, $total, $nb_per_page, $page, 10, false, true); print $nav_bar; print "</div>"; print "</body></html>"; mysql_close($dbh);
/** * Renvoie l'affichage html de la liste pour le selecteur d'autorité * * @param onto_common_controler $controler * @param onto_param $params * * @return string $form */ public static function get_list_selector($controler, $params) { global $msg, $charset, $element_form, $ontology_tpl, $list_form, $lang; if ($params->objs) { $property = $controler->get_onto_property_from_pmb_name($params->objs); $element = $property->range[$params->range]; } else { $element = $controler->get_class_uri($params->element); } $elements = $controler->get_list_elements($params); $elements_form = ""; $list = $list_form; if ($elements["nb_total_elements"]) { foreach ($elements['elements'] as $uri => $item) { switch ($element) { case "http://www.w3.org/2004/02/skos/core#Concept": if ($controler->has_narrower($uri, $params)) { $current_element_form = $ontology_tpl['skos_concept_list_selector_line_folder']; $current_element_form = str_replace("!!folder_href!!", $params->base_url . "&parent_id=" . onto_common_uri::get_id($uri), $current_element_form); } else { $current_element_form = $ontology_tpl['skos_concept_list_selector_line_doc']; } break; default: $current_element_form = $element_form; break; } $current_element_form = str_replace("!!caller!!", $params->caller, $current_element_form); $current_element_form = str_replace("!!element!!", $params->element, $current_element_form); $current_element_form = str_replace("!!order!!", $params->order, $current_element_form); $current_element_form = str_replace("!!uri!!", $uri, $current_element_form); $current_element_form = str_replace("!!item!!", addslashes(isset($item[substr($lang, 0, 2)]) ? $item[substr($lang, 0, 2)] : $item['default']), $current_element_form); $current_element_form = str_replace("!!range!!", rawurlencode($element ? $element : $controler->get_class_uri($params->sub)), $current_element_form); $current_element_form = str_replace("!!callback!!", $params->callback, $current_element_form); $current_element_form = str_replace("!!item_libelle!!", htmlentities(isset($item[substr($lang, 0, 2)]) ? $item[substr($lang, 0, 2)] : $item['default'], ENT_QUOTES, $charset), $current_element_form); $infobulle_libelle = ""; if ($controler->has_broader($uri, $params)) { $parents = $controler->get_broaders($uri, $params); if ($parents[0]["id"]) { $infobulle_libelle .= $msg["onto_skos_concept_broader"] . " " . $parents[0]["label"] . ". "; } } $infos = $controler->get_informations_concept($uri); if ($infos[0]["scopeNote"]) { $infobulle_libelle .= $msg["onto_skos_concept_scopenote"] . " " . $infos[0]["scopeNote"]; } $current_element_form = str_replace("!!infobulle_libelle!!", htmlentities($infobulle_libelle, ENT_QUOTES, $charset), $current_element_form); $elements_form .= $current_element_form; } $list = str_replace("!!elements_form!!", $elements_form, $list); $list = str_replace("!!aff_pagination!!", aff_pagination($params->base_url . "&concept_scheme=" . $params->concept_scheme . "&parent_id=" . $params->parent_id, $elements['nb_total_elements'], $elements['nb_onto_element_per_page'], $params->page, 10, true, true), $list); } else { $list = $msg["1915"]; } return $list; }
} while ($perio = mysql_fetch_object($myQuery)) { if ($nb++ > 5) { $recherche_ajax_mode = 1; } $edPerio = ""; if ($perio->ed1_id) { $editeur = new editeur($perio->ed1_id); $edPerio = ' - ' . $editeur->display; } $link_serial = './catalog.php?categ=serials&sub=view&serial_id=!!id!!'; $link_analysis = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!bul_id!!&art_to_show=!!id!!'; $link_bulletin = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!id!!'; $link_explnum = "./catalog.php?categ=serials&sub=analysis&action=explnum_form&bul_id=!!bul_id!!&analysis_id=!!analysis_id!!&explnum_id=!!explnum_id!!"; // function serial_display ($id, $level='1', $action_serial='', $action_analysis='', $action_bulletin='', $lien_suppr_cart="", $lien_explnum="", $bouton_explnum=1,$print=0,$show_explnum=1, $show_statut=0) $serial = new serial_display($perio->notice_id, 6, $link_serial, $link_analysis, $link_bulletin, "", $link_explnum, 0, 0, 1, 1, true, 0, $recherche_ajax_mode); print pmb_bidi($serial->result); } print '</div>'; // affichage de la pagination print "<div class='row'><div align='center'>"; $nav_bar = aff_pagination($base_url, $nbr_lignes, $nb_per_page_a_search, $page, 10, false, true); print $nav_bar; print '</div></div>'; } else { // la recherche ne renvoit qu'un résultat -> on y va direct $requete = "SELECT notice_id FROM notices {$acces_j} WHERE {$where} limit 1"; $myQuery = mysql_query($requete, $dbh); $perio = mysql_fetch_object($myQuery); show_serial_info($perio->notice_id, 0, 0); }
function get_display_list($base_url, $filtre, $debut = 0, $page = 0, $type = 0, $form = 1, $no_pagination = false) { global $dbh, $msg, $nb_per_page_a_search, $tpl_collstate_liste, $tpl_collstate_liste_line, $tpl_collstate_liste_form, $tpl_collstate_surloc_liste, $tpl_collstate_surloc_liste_line; global $explr_invisible, $pmb_droits_explr_localises, $pmb_etat_collections_localise, $deflt_docs_location; global $pmb_sur_location_activate; $location = $filtre->location; if (!$pmb_etat_collections_localise) { $location = ""; } if ($pmb_droits_explr_localises && $explr_invisible) { $restrict_location = " location_id not in (" . $explr_invisible . ") and "; } else { $restrict_location = ""; } if ($pmb_sur_location_activate) { $join_sur_loc = " left join sur_location on docs_location.surloc_num=sur_location.surloc_id "; $order_sur_loc = "surloc_libelle,"; } else { $join_sur_loc = ""; $order_sur_loc = ""; } //On compte les bulletins à afficher $rqt = "SELECT count( collstate_id) FROM collections_state WHERE {$restrict_location} " . ($location ? "(location_id='{$location}') and " : "") . " id_serial='" . $this->serial_id . "' "; $myQuery = pmb_mysql_query($rqt, $dbh); $nbr_lignes = pmb_mysql_result($myQuery, 0, 0); $req = "SELECT collstate_id , location_id FROM collections_state LEFT JOIN docs_location ON location_id=idlocation " . $join_sur_loc . " LEFT JOIN arch_emplacement ON collstate_emplacement=archempla_id WHERE {$restrict_location} " . ($location ? "(location_id='{$location}') and " : "") . "\n\tid_serial='" . $this->serial_id . "' ORDER BY " . $order_sur_loc . " " . ($pmb_etat_collections_localise ? "location_libelle, " : "") . "archempla_libelle, collstate_cote " . ($no_pagination ? '' : "LIMIT {$debut},{$nb_per_page_a_search}"); $myQuery = pmb_mysql_query($req, $dbh); if (pmb_mysql_num_rows($myQuery)) { if ($pmb_sur_location_activate) { $tpl_collstate_liste[$type] = str_replace('<!-- surloc -->', $tpl_collstate_surloc_liste, $tpl_collstate_liste[$type]); $tpl_collstate_liste_line[$type] = str_replace('<!-- surloc -->', $tpl_collstate_surloc_liste_line, $tpl_collstate_liste_line[$type]); } $parity = 1; while ($coll = pmb_mysql_fetch_object($myQuery)) { $my_collstate = new collstate($coll->collstate_id); /* Avoir comment gerer un + pour des grands etats de collections if (count($my_collstate->state_collections)>80 || count($my_collstate->lacune)>80) { $plus_statecollection="<img src='images/plus.gif' class='img_plus' onClick='if (event) e=event; else e=window.event; e.cancelBubble=true; if (e.stopPropagation) e.stopPropagation(); show_sources(\"!!id!!\"); '/>"; $texte_statecollection="<tr class='$pair_impair' style='display:none' id='".$coll->collstate_id."'><td> </td><td colspan='3'><table style='border:1px solid'> <td>".str_replace("\n","<br />",$my_collstate->state_collections)."</td> <td>".str_replace("\n","<br />",$my_collstate->lacune)."</td>"; } else $plus_statecollection="<td> </td>"; */ if ($parity++ % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } // Si modifiable, ajout du lien vers le formulaire if ($my_collstate->explr_acces_autorise == "MODIF") { $tr_javascript = " onmousedown=\"document.location='./catalog.php?categ=serials&sub=collstate_form&id=" . $coll->collstate_id . "&serial_id=" . $this->serial_id . "';\" "; } else { $tr_javascript = ""; } $tr_surbrillance = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" "; $line = str_replace('!!tr_javascript!!', $tr_javascript, $tpl_collstate_liste_line[$type]); $line = str_replace('!!tr_surbrillance!!', $tr_surbrillance, $line); $line = str_replace('!!pair_impair!!', $pair_impair, $line); if ($pmb_sur_location_activate) { $line = str_replace('!!surloc!!', $my_collstate->surloc_libelle, $line); } $line = str_replace('!!localisation!!', $my_collstate->location_libelle, $line); $line = str_replace('!!cote!!', $my_collstate->cote, $line); $line = str_replace('!!type_libelle!!', $my_collstate->type_libelle, $line); $line = str_replace('!!emplacement_libelle!!', $my_collstate->emplacement_libelle, $line); $line = str_replace('!!statut_libelle!!', "<span class='" . $my_collstate->statut_class_html . "' style='margin-right: 3px;'><img src='./images/spacer.gif' width='10' height='10' /></span>" . $my_collstate->statut_gestion_libelle, $line); $line = str_replace('!!origine!!', $my_collstate->origine, $line); $line = str_replace('!!state_collections!!', str_replace("\n", "<br />", $my_collstate->state_collections), $line); $line = str_replace('!!archive!!', $my_collstate->archive, $line); $line = str_replace('!!lacune!!', str_replace("\n", "<br />", $my_collstate->lacune), $line); $liste .= $line; } $liste = str_replace('!!collstate_liste!!', $liste, $tpl_collstate_liste[$type]); } else { $liste = $msg["collstate_no_collstate"]; } if ($form) { $liste = str_replace('!!collstate_table!!', $liste, $tpl_collstate_liste_form); } $liste = str_replace('!!base_url!!', $base_url, $liste); $liste = str_replace('!!location!!', $location, $liste); $this->liste = $liste; $this->nbr = $nbr_lignes; // barre de navigation par page $this->pagination = aff_pagination($base_url . "&location={$location}", $nbr_lignes, $nb_per_page_a_search, $page, 10, false, true); }
$nb_pret = 0; $requete = "SELECT count( pret_idempr ) as nb_pret FROM empr_groupe,pret where groupe_id={$rgroup->id_groupe} and empr_id = pret_idempr"; $res_pret = pmb_mysql_query($requete, $dbh); if (pmb_mysql_num_rows($res_pret)) { $rpret = pmb_mysql_fetch_object($res_pret); $nb_pret = $rpret->nb_pret; } $nb_resa = 0; $requete = "SELECT count( resa_idempr ) as nb_resa FROM empr_groupe,resa where groupe_id={$rgroup->id_groupe} and empr_id = resa_idempr"; $res_resa = pmb_mysql_query($requete, $dbh); if (pmb_mysql_num_rows($res_resa)) { $rresa = pmb_mysql_fetch_object($res_resa); $nb_resa = $rresa->nb_resa; } $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./circ.php?categ=groups&action=showgroup&groupID={$rgroup->id_groupe}';\" "; $group_list .= "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'>\n\t\t \t\t\t<td>{$rgroup->libelle_groupe}</td>\n\t\t\t\t\t<td>{$rgroup->resp_name}</td>\n\t\t\t\t\t<td>{$rgroup->nb_empr}</td>\n\t\t\t\t\t<td>{$nb_pret}</td>\n\t\t\t\t\t<td>{$nb_resa}</td>\n\t\t\t\t\t</tr>"; } pmb_mysql_free_result($res); $nav_bar = aff_pagination("{$PHP_SELF}?categ=groups&action=listgroups", $nbr_lignes, $nb_per_page, $page, 10, false, true); // affichage du résultat list_group($group_query, $filter_list, $group_list, $nav_bar, $nbr_lignes); } else { $rgroup = $rgroup = pmb_mysql_fetch_object($res); $groupID = $rgroup->id_groupe; include './circ/groups/show_group.inc.php'; } } else { // la requête n'a produit aucun résultat print pmb_bidi($group_search); error_message($msg[917], str_replace('!!group_cle!!', htmlentities(stripslashes($group_query), ENT_QUOTES, $charset), $msg[918]), 0, './circ.php?categ=groups'); }
break; case "retard": case "retard_par_date": $bouton_imprime_tout = "<input type='hidden' name='act' value=''><input type='button' class='bouton' value=\"" . $msg['lettres_relance'] . "\" onclick=\"this.form.act.value='print'; this.form.submit();\" >"; break; case "owner": break; case "encours": default: break; } if ($bouton_imprime_tout) { echo "\n\t\t\t\t\t<br />\n\t\t\t\t\t<form class='form-{$current_module}' action='' method='post'>\n\t\t\t\t\t{$bouton_imprime_tout}\n\t\t\t\t\t</form>"; } } $nav_bar = aff_pagination("{$url_page}?categ={$categ}&sub={$sub}&empr_location_id={$empr_location_id}&docs_location_id={$docs_location_id}", $nombre_lignes_pret, $nb_per_page, $page, 10, false, true); print $nav_bar; //impression/emails (on est dans le cas retards/retards par date) if ($act == "print") { $not_all_mail = array(); if ($nombre_lignes_pret) { $resultat = pmb_mysql_query($sql); while ($r = pmb_mysql_fetch_object($resultat)) { $mail_sended = 0; if (($mailretard_priorite_email == 1 || $mailretard_priorite_email == 2) && $r->empr_mail) { // l'objet du mail $var = "mailretard_" . $relance . "objet"; eval("\$objet=\"" . ${$var} . "\";"); // la formule de politesse du bas (le signataire) $var = "mailretard_" . $relance . "fdp"; eval("\$fdp=\"" . ${$var} . "\";");
function show_list_dev($id_bibli) { global $msg, $charset; global $search_form_actes, $devlist_form, $devlist_bt_chk, $devlist_script; global $devlist_bt_arc, $devlist_bt_delete, $devlist_bt_rec; global $nb_per_page_acq; global $class_path; global $user_input, $statut, $page, $nbr_lignes, $last_param; global $tab_bib; global $acquisition_pdfdev_by_mail; $bib = new entites($id_bibli); $bib_coord = pmb_mysql_fetch_object(entites::get_coordonnees($id_bibli, 1)); //Creation selecteur etablissement $sel_bibli = "<select class='saisie-50em' id='id_bibli' name='id_bibli' onchange=\"submit();\" >"; foreach ($tab_bib[0] as $k => $v) { $sel_bibli .= "<option value='" . $v . "' "; if ($v == $id_bibli) { $sel_bibli .= "selected='selected' "; } $sel_bibli .= ">" . htmlentities($tab_bib[1][$k], ENT_QUOTES, $charset) . "</option>"; } $sel_bibli .= "</select>"; $search_form_actes = str_replace('<!-- sel_bibli -->', $sel_bibli, $search_form_actes); //Creation selecteur statut $sel_statut = "<select class='saisie-25em' id='statut' name='statut' onchange=\"submit();\" >"; $list_statut = actes::getStatelist(TYP_ACT_DEV); foreach ($list_statut as $k => $v) { $sel_statut .= "<option value='" . $k . "'>" . htmlentities($v, ENT_QUOTES, $charset) . "</option>"; } $sel_statut .= "</select>"; $search_form_actes = str_replace('<!-- sel_statut -->', $sel_statut, $search_form_actes); //Affichage form de recherche $titre = htmlentities($msg['recherche'] . ' : ' . $msg['acquisition_ach_dev'], ENT_QUOTES, $charset); $action = "./acquisition.php?categ=ach&sub=devi&action=list&user_input="; $bouton_add = "<input class='bouton' type='button' value='" . $msg['acquisition_ajout_dev'] . "' onClick=\"document.location='./acquisition.php?categ=ach&sub=devi&action=modif&id_bibli=" . $id_bibli . "&id_dev=0';\" />"; $search_form_actes = str_replace('!!form_title!!', $titre, $search_form_actes); $search_form_actes = str_replace('!!action!!', $action, $search_form_actes); $search_form_actes = str_replace('<!-- bouton_add -->', $bouton_add, $search_form_actes); $search_form_actes = str_replace('!!user_input!!', $user_input, $search_form_actes); print $search_form_actes; if (!$statut) { $statut = getSessionDevState(); //Recuperation du statut courant } else { setSessionDevState($statut); } print "<script type='text/javascript' >document.forms['search'].elements['statut'].value = '" . $statut . "';document.forms['search'].elements['user_input'].focus();\n\tdocument.forms['search'].elements['user_input'].select();</script>"; //Prise en compte du formulaire de recherche // nombre de références par pages if ($nb_per_page_acq != "") { $nb_per_page = $nb_per_page_acq; } else { $nb_per_page = 10; } // traitement de la saisie utilisateur require_once $class_path . "/analyse_query.class.php"; // on récupére le nombre de lignes qui vont bien if (!$nbr_lignes) { if (!$user_input) { $nbr_lignes = entites::getNbActes($id_bibli, TYP_ACT_DEV, $statut); } else { $aq = new analyse_query(stripslashes($user_input), 0, 0, 0, 0); if ($aq->error) { error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message)); exit; } $nbr_lignes = entites::getNbActes($id_bibli, TYP_ACT_DEV, $statut, $aq, $user_input); } } else { $aq = new analyse_query(stripslashes($user_input), 0, 0, 0, 0); } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { $url_base = "{$PHP_SELF}?categ=ach&sub=devi&action=list&id_bibli={$id_bibli}&user_input=" . rawurlencode(stripslashes($user_input)) . "&statut={$statut}"; // on lance la requete if (!$user_input) { $res = entites::listActes($id_bibli, TYP_ACT_DEV, $statut, $debut, $nb_per_page); } else { $res = entites::listActes($id_bibli, TYP_ACT_DEV, $statut, $debut, $nb_per_page, $aq, $user_input); } //Affichage liste des devis $dev_list = ""; $nbr = pmb_mysql_num_rows($res); $parity = 1; for ($i = 0; $i < $nbr; $i++) { $row = pmb_mysql_fetch_object($res); $fourn = new entites($row->num_fournisseur); $st = $row->statut & ~STA_ACT_ARC; switch ($st) { case STA_ACT_ENC: $st_dev = htmlentities($msg['acquisition_dev_enc'], ENT_QUOTES, $charset); break; case STA_ACT_REC: $st_dev = htmlentities($msg['acquisition_dev_rec'], ENT_QUOTES, $charset); break; default: $st_dev = htmlentities($msg['acquisition_dev_enc'], ENT_QUOTES, $charset); } if (($row->statut & STA_ACT_ARC) == STA_ACT_ARC) { $st_dev = '<s>' . $st_dev . '</s>'; } if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $parity += 1; $tr_javascript = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" "; $dn_javascript = "onmousedown=\"document.location='./acquisition.php?categ=ach&sub=devi&action=modif&id_bibli=" . $id_bibli . "&id_dev=" . $row->id_acte . "' \" "; $dev_list .= "<tr class='" . $pair_impair . "' " . $tr_javascript . " style='cursor: pointer' >\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>" . $row->numero . "</i></td>\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>" . htmlentities($fourn->raison_sociale, ENT_QUOTES, $charset) . "</i></td>\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>" . formatdate($row->date_acte) . "</i></td>\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>{$st_dev}</i></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<a href=# onclick=\"document.location='./acquisition.php?categ=ach&sub=devi&action=print&id_bibli=" . $id_bibli . "&id_dev=" . $row->id_acte . "&page=" . $page . "&by_mail=0'\" >\n\t\t\t\t\t\t\t\t<img src='./images/print.gif' border='0' align='center' alt='" . htmlentities(addslashes($msg['imprimer']), ENT_QUOTES, $charset) . "' title='" . htmlentities(addslashes($msg['imprimer']), ENT_QUOTES, $charset) . "' />\n\t\t\t\t\t\t\t</a>"; if (($row->statut & ~STA_ACT_ARC) == STA_ACT_ENC && $acquisition_pdfdev_by_mail && strpos($bib_coord->email, '@')) { $dev_list .= "\t\t\t\n\t\t\t\t\t\t\t<a href=# onclick=\"document.location='./acquisition.php?categ=ach&sub=devi&action=print&id_bibli=" . $id_bibli . "&id_dev=" . $row->id_acte . "&page=" . $page . "&by_mail=1'\" >\n\t\t\t\t\t\t\t\t<img src='./images/mail.png' border='0' align='center' alt='" . htmlentities($msg['58'], ENT_QUOTES, $charset) . "' title='" . htmlentities($msg['58'], ENT_QUOTES, $charset) . "' />\n\t\t\t\t\t\t\t</a>"; } $dev_list .= "\t</td>"; if ($statut != STA_ACT_ALL) { $dev_list .= "<td><input type='checkbox' name='chk[]' id='chk[" . $row->id_acte . "]' value='" . $row->id_acte . "'/></td>"; } $dev_list .= "</tr>"; } if (!$last_param) { $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page); } else { $nav_bar = ""; } $devlist_form = str_replace('<!-- dev_list -->', $dev_list, $devlist_form); $devlist_form = str_replace('<!-- nav_bar -->', $nav_bar, $devlist_form); $bt_list = ''; $bt_sup = ''; if ($statut != STA_ACT_ALL) { //colonne chk $devlist_form = str_replace("<!-- chk_th -->", "<th class='act_cell_chkbox'> </th>", $devlist_form); //Bouton Sélectionner $devlist_form = str_replace('<!-- bt_chk -->', $devlist_bt_chk, $devlist_form); //JavaScript $devlist_form = str_replace('<!-- script -->', $devlist_script, $devlist_form); //Bouton recevoir + archiver if ($statut == STA_ACT_ENC) { $bt_list = $devlist_bt_rec . ' ' . $devlist_bt_arc; } //Bouton archiver if ($statut == STA_ACT_REC) { $bt_list = $devlist_bt_arc; } //Bouton supprimer $bt_sup = $devlist_bt_delete; } $devlist_form = str_replace('<!-- bt_list -->', $bt_list, $devlist_form); $devlist_form = str_replace('<!-- bt_sup -->', $bt_sup, $devlist_form); print $devlist_form; } else { // la requête n'a produit aucun résultat error_message($msg['acquisition_dev_rech'], str_replace('!!dev_cle!!', stripslashes($user_input), $msg['acquisition_dev_rech_error']), 0, './categ=ach&sub=devi&action=list&id_bibli=' . $id_bibli); } }
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0) { global $nb_per_page; global $base_url; global $caller; global $msg; global $no_display; global $charset; global $niveau_biblio, $modele_id, $serial_id; global $acces_j; if ($niveau_biblio) { $filtre_notice = " and niveau_biblio='{$niveau_biblio}' "; } // on récupére le nombre de lignes qui vont bien if ($user_input == "") { $requete_count = "SELECT COUNT(1) FROM notices "; $requete_count .= $acces_j; $requete_count .= "where notice_id!='" . $no_display . "' {$filtre_notice} "; } else { $aq = new analyse_query(stripslashes($user_input)); if ($aq->error) { error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message)); exit; } $members = $aq->get_query_members("notices", "index_wew", "index_sew", "notice_id"); $isbn_verif = traite_code_isbn(stripslashes($user_input)); $suite_rqt = ""; if (isISBN($isbn_verif)) { if (strlen($isbn_verif) == 13) { $suite_rqt = " code like '" . formatISBN($isbn_verif, 13) . "' or code like '" . addslashes($isbn_verif) . "' "; } else { $suite_rqt = " code like '" . formatISBN($isbn_verif, 10) . "' or code like '" . addslashes($isbn_verif) . "' "; } $requete_count = "select count(1) from notices "; $requete_count .= $acces_j; $requete_count .= "where ( " . $suite_rqt . " ) "; $requete_count .= "and notice_id!='" . $no_display . "' {$filtre_notice}"; } else { $requete_count = "select count(1) from notices "; $requete_count .= $acces_j; $requete_count .= "where (" . $members["where"] . " or code like '" . addslashes($isbn_verif) . "' ) "; $requete_count .= "and notice_id!='" . $no_display . "' {$filtre_notice}"; } } $res = mysql_query($requete_count, $dbh); $nbr_lignes = @mysql_result($res, 0, 0); if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { // on lance la vraie requête if ($user_input == "") { $requete = "SELECT notice_id, tit1, serie_name, tnvol, code FROM notices "; $requete .= $acces_j; $requete .= "left join series on serie_id=tparent_id "; $requete .= "where notice_id!='" . $no_display . "' {$filtre_notice} ORDER BY index_sew, code LIMIT {$debut},{$nb_per_page} "; } else { $isbn_verif = traite_code_isbn(stripslashes($user_input)); $suite_rqt = ""; if (isISBN($isbn_verif)) { if (strlen($isbn_verif) == 13) { $suite_rqt = " code like '" . formatISBN($isbn_verif, 13) . "' or code like '" . addslashes($isbn_verif) . "' "; } else { $suite_rqt = " code like '" . formatISBN($isbn_verif, 10) . "' or code like '" . addslashes($isbn_verif) . "' "; } $requete = "select notice_id, tit1, serie_name, tnvol, code from notices "; $requete .= $acces_j; $requete .= "left join series on serie_id=tparent_id "; $requete .= "where ( " . $suite_rqt . " ) "; $requete .= "and notice_id!='" . $no_display . "' {$filtre_notice} group by notice_id limit {$debut},{$nb_per_page}"; } else { $requete = "select notice_id, tit1, serie_name, tnvol, code, " . $members["select"] . " as pert from notices "; $requete .= $acces_j; $requete .= "left join series on serie_id=tparent_id where (" . $members["where"] . " or (code like '" . addslashes($isbn_verif) . "' )) "; $requete .= "and notice_id!='" . $no_display . "' {$filtre_notice} group by notice_id order by pert desc, index_sew, code limit {$debut},{$nb_per_page}"; } } $res = @mysql_query($requete, $dbh); while ($notice = mysql_fetch_object($res)) { $notice_entry = ""; if ($notice->serie_name) { $notice_entry .= $notice->serie_name; if ($notice->tnvol) { $notice_entry .= ", " . $notice->tnvol; } } $notice_entry ? $notice_entry .= '. ' . $notice->tit1 : ($notice_entry = $notice->tit1); if ($niveau_biblio) { $location = "./catalog.php?categ=serials&sub=modele&act=copy&modele_id={$modele_id}&serial_id={$serial_id}&new_serial_id={$notice->notice_id}"; $display = new mono_display($notice->notice_id, 0, '', 0, '', '', '', 0, 0, 0, 0, "", 0, false, true); print pmb_bidi("<div class='row'>\n\t\t\t\t\t\t\t\t<div class='left'>\n\t\t\t\t\t\t\t\t\t<a href='#' onclick=\"copier_modele('{$location}')\">" . $display->result . "</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='right'>\n\t\t\t\t\t\t\t\t\t" . htmlentities($notice->code, ENT_QUOTES, $charset) . "\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>"); } else { $display = new mono_display($notice->notice_id, 0, '', 0, '', '', '', 0, 0, 0, 0, "", 0, false, true); print pmb_bidi("<div class='row'>\n\t\t\t\t\t\t\t\t<div class='left'>\n\t\t\t\t\t\t\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$notice->notice_id}', '" . htmlentities(addslashes($notice_entry), ENT_QUOTES, $charset) . " ({$notice->code})')\">" . $display->result . "</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='right'>\n\t\t\t\t\t\t\t\t\t" . htmlentities($notice->code, ENT_QUOTES, $charset) . "\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>"); } } mysql_free_result($res); // constitution des liens $nbepages = ceil($nbr_lignes / $nb_per_page); $suivante = $page + 1; $precedente = $page - 1; } print "<div class='row'> <hr /></div><div align='center'>"; $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input)); $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); print $nav_bar; print "</div>"; }
function show_list_liv($id_bibli) { global $msg, $charset; global $search_form_actes, $livlist_form; global $nb_per_page_acq; global $class_path; global $user_input, $statut, $page, $nbr_lignes, $tri_param, $limit_param, $last_param; global $tab_bib; //Creation selecteur etablissement $sel_bibli = "<select class='saisie-50em' id='id_bibli' name='id_bibli' onchange=\"submit();\" >"; foreach ($tab_bib[0] as $k => $v) { $sel_bibli .= "<option value='" . $v . "' "; if ($v == $id_bibli) { $sel_bibli .= "selected='selected' "; } $sel_bibli .= ">" . htmlentities($tab_bib[1][$k], ENT_QUOTES, $charset) . "</option>"; } $sel_bibli .= "</select>"; $search_form_actes = str_replace('<!-- sel_bibli -->', $sel_bibli, $search_form_actes); //Creation selecteur statut $sel_statut = "<select class='saisie-25em' id='statut' name='statut' onchange=\"submit();\" >"; $list_statut = actes::getStatelist(TYP_ACT_LIV); foreach ($list_statut as $k => $v) { $sel_statut .= "<option value='" . $k . "'>" . htmlentities($v, ENT_QUOTES, $charset) . "</option>"; } $sel_statut .= "</select>"; $search_form_actes = str_replace('<!-- sel_statut -->', $sel_statut, $search_form_actes); //Affichage form de recherche $titre = htmlentities($msg['recherche'] . ' : ' . $msg['acquisition_ach_liv'], ENT_QUOTES, $charset); $action = "./acquisition.php?categ=ach&sub=livr&action=list&user_input="; $search_form_actes = str_replace('!!form_title!!', $titre, $search_form_actes); $search_form_actes = str_replace('!!action!!', $action, $search_form_actes); $search_form_actes = str_replace('!!user_input!!', $user_input, $search_form_actes); print $search_form_actes; if (!$statut) { $statut = getSessionLivState(); //Recuperation du statut courant } else { setSessionLivState($statut); } print "<script type='text/javascript' >document.forms['search'].elements['statut'].value = " . $statut . ";document.forms['search'].elements['user_input'].focus();\n\tdocument.forms['search'].elements['user_input'].select();</script>"; //Prise en compte du formulaire de recherche // nombre de références par pages if ($nb_per_page_acq != "") { $nb_per_page = $nb_per_page_acq; } else { $nb_per_page = 10; } // traitement de la saisie utilisateur require_once $class_path . "/analyse_query.class.php"; // on récupére le nombre de lignes qui vont bien if (!$nbr_lignes) { if (!$user_input) { $nbr_lignes = entites::getNbActes($id_bibli, TYP_ACT_LIV, $statut); } else { $aq = new analyse_query(stripslashes($user_input), 0, 0, 0, 0); if ($aq->error) { error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message)); exit; } $nbr_lignes = entites::getNbActes($id_bibli, TYP_ACT_LIV, $statut, $aq, $user_input); } } else { $aq = new analyse_query(stripslashes($user_input), 0, 0, 0, 0); } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { $url_base = "{$PHP_SELF}?categ=ach&sub=livr&action=list&id_bibli={$id_bibli}&user_input=" . rawurlencode(stripslashes($user_input)) . "&statut={$statut}"; // on lance la vraie requête if (!$user_input) { $res = entites::listActes($id_bibli, TYP_ACT_LIV, $statut, $debut, $nb_per_page); } else { $res = entites::listActes($id_bibli, TYP_ACT_LIV, $statut, $debut, $nb_per_page, $aq, $user_input); } //Affichage liste des livraisons $liv_list = ""; $nbr = pmb_mysql_num_rows($res); $parity = 1; for ($i = 0; $i < $nbr; $i++) { $row = pmb_mysql_fetch_object($res); $fourn = new entites($row->num_fournisseur); $id_cde = liens_actes::getParent($row->id_acte); $cde = new actes($id_cde); $st = $row->statut & ~STA_ACT_ARC; switch ($st) { case STA_ACT_REC: $st_liv = htmlentities($msg['acquisition_liv_rec'], ENT_QUOTES, $charset); break; default: $st_liv = ''; } if (($row->statut & STA_ACT_ARC) == STA_ACT_ARC) { $st_liv = '<s>' . $st_liv . '</s>'; } if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $parity += 1; $tr_javascript = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" "; $dn_javascript = "onmousedown=\"document.location='./acquisition.php?categ=ach&sub=livr&action=modif&id_bibli=" . $id_bibli . "&id_liv=" . $row->id_acte . "' \" "; $liv_list .= "<tr class='" . $pair_impair . "' " . $tr_javascript . " style='cursor: pointer' >\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>" . $row->numero . "</i></td>\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>" . $cde->numero . "</i></td>\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>" . htmlentities($fourn->raison_sociale, ENT_QUOTES, $charset) . "</i></td>\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>" . formatdate($row->date_acte) . "</i></td>\n\t\t\t\t\t\t<td " . $dn_javascript . " ><i>{$st_liv}</i></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<a href=# onclick=\"openPopUp('./pdf.php?pdfdoc=livr&id_liv=" . $row->id_acte . "' ,'print_PDF', 600, 500, -2, -2, 'toolbar=no, dependent=yes, resizable=yes');\" >\n\t\t\t\t\t\t\t\t<img src='./images/print.gif' border='0' align='center' alt='" . htmlentities($msg['imprimer'], ENT_QUOTES, $charset) . "' title='" . htmlentities($msg['imprimer'], ENT_QUOTES, $charset) . "' />\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>"; } if (!$last_param) { $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page); } else { $nav_bar = ""; } $livlist_form = str_replace('<!-- liv_list -->', $liv_list, $livlist_form); $livlist_form = str_replace('<!-- nav_bar -->', $nav_bar, $livlist_form); print $livlist_form; } else { // la requête n'a produit aucun résultat error_message($msg['acquisition_liv_rech'], str_replace('!!liv_cle!!', stripslashes($user_input), $msg['acquisition_liv_rech_error']), 0, './categ=ach&sub=livr&action=list&id_bibli=' . $id_bibli); } }
public function showlist($params = array()) { //un handler specifique ? $this->get_handler('showlist', $params); if (!$this->handled && $params['object'] && array_key_exists($params['object'], $this->op->t_objects)) { //recuperation et verification parametres $this->params = array('object' => $params['object'], 'page' => 1, 'offset' => 0, 'limit' => $this->limit); if ($params['page']) { $this->params['page'] = $params['page']; } $this->params['page'] += 0; if (!$this->params['page']) { $this->params['page'] = 1; $this->params['offset'] = 0; } if ($params['limit']) { $this->params['limit'] = $params['limit']; } $this->params['limit'] += 0; if (!$this->params['limit']) { $this->params['limit'] = $this->limit; } if ($this->params['page'] > 1) { $this->params['offset'] = ($this->params['page'] * 1 - 1) * $this->params['limit']; } $this->params['url_base'] = $params['url_base']; global $msg, $charset; global $ontology_tpl; $fname = $this->format($this->params['object']); //comptage des objets $count = $this->count_objects($this->params); //récupération des objets $objs = $this->get_objects($this->params); //récupération des proprietes a afficher dans la liste $p = $this->op->get_pmb_display_label($this->params['object']); if ($p && count($objs)) { foreach ($objs as $ko => $vo) { $op = $this->get_object_properties($vo['s'], array($p)); $objs[$ko]['properties'] = $op; } } //Affichage entete liste $tpl = $ontology_tpl['list']; if ($msg['ontology_' . $fname]) { $m = $msg['ontology_' . $fname]; } else { $m = $this->params['object']; } $tpl = str_replace('!!list_header!!', $m, $tpl); //Generation de l'affichage des lignes if (count($objs)) { $parity = 1; foreach ($objs as $ko => $vo) { $row = $ontology_tpl['odd_row']; if ($parity % 2) { $row = $ontology_tpl['even_row']; } $parity += 1; $tpl = str_replace('<!-- rows -->', $row . '<!-- rows -->', $tpl); $uri = $vo['s']; //lien edition if ($this->params['url_base']) { $form_edit_js = $ontology_tpl['edit_js']; $form_edit_js = str_replace('!!edit_url!!', $this->params['url_base'] . 'edit&uri=' . rawurlencode($uri), $form_edit_js); $tpl = str_replace('!!edit_url!!', $form_edit_js, $tpl); } else { $tpl = str_replace('!!edit_url!!', '', $tpl); } $t_label = array('uri' => $uri); foreach ($vo['properties'] as $kp => $vp) { if ($vp['p'] == $p) { $t_label[$vp['o lang']] = $vp['o']; } } $label = $t_label['uri']; foreach ($this->t_lang as $kl => $vl) { if (array_key_exists($kl, $t_label)) { $label = $t_label[$kl]; break; } } if ($charset == 'iso-8859-1') { $label = utf8_decode($label); } $label = htmlentities($label, ENT_QUOTES, $charset); $title = htmlentities($t_label['uri'], ENT_QUOTES, $charset); $tpl = str_replace('!!row_content!!', $label, $tpl); $tpl = str_replace('!!row_title!!', $title, $tpl); } //Affichage pagination $pagination_bar = ''; if ($this->params['url_base']) { $pagination_bar = aff_pagination($this->params['url_base'], $count, $this->params['limit'], $this->params['page']); } $tpl = str_replace('<!-- pagination -->', $ontology_tpl['pagination'], $tpl); $tpl = str_replace('<!-- pagination -->', $pagination_bar, $tpl); } //Affichage du bouton ajouter if ($this->params['url_base']) { $tpl = str_replace('<!-- add_button -->', $ontology_tpl['add_button'], $tpl); $tpl = str_replace('!!add_url!!', $this->params['url_base'] . 'add', $tpl); if ($msg['ontology_' . $fname . '_toadd']) { $m = $msg['ontology_' . $fname . '_toadd']; } else { $m = sprintf($msg['ontology_object_add'], $this->params['object']); } $tpl = str_replace('!!add_msg!!', $m, $tpl); } } $this->result = $tpl; return $this->result; }
/** * Renvoie l'affichage html de la liste * * @param onto_common_controler $controler * @param onto_param $params */ public static function get_list($controler, $params) { global $msg, $charset, $ontology_tpl; $elements = $controler->get_list_elements($params); $list = $ontology_tpl['list']; $list = str_replace("!!list_header!!", htmlentities($msg['103'], ENT_QUOTES, $charset), $list); $list_content = ''; foreach ($elements['elements'] as $uri => $item) { $line = $ontology_tpl['list_line']; $line = str_replace("!!list_line_href!!", './' . $controler->get_base_resource() . 'categ=' . $params->categ . '&sub=' . $params->sub . '&action=edit&id=' . onto_common_uri::get_id($uri), $line); $line = str_replace("!!list_line_libelle!!", htmlentities(isset($item[substr($lang, 0, 2)]) ? $item[substr($lang, 0, 2)] : $item['default'], ENT_QUOTES, $charset), $line); $list_content .= $line; } $list = str_replace("!!list_content!!", $list_content, $list); if (isset($msg['onto_' . $controler->get_onto_name() . '_add_' . $params->sub])) { $add_msg = $msg['onto_' . $controler->get_onto_name() . '_add_' . $params->sub]; } else { $add_msg = sprintf($msg['onto_common_add'], $controler->get_label($params->sub)); } $list = str_replace("!!list_onclick!!", 'document.location=\'./' . $controler->get_base_resource() . 'categ=' . $params->categ . '&sub=' . $params->sub . '&id=&action=edit\'', $list); $list = str_replace("!!list_value!!", htmlentities($add_msg, ENT_QUOTES, $charset), $list); $list = str_replace("!!list_pagination!!", aff_pagination("./" . $controler->get_base_resource() . "categ=" . $params->categ . "&sub=" . $params->sub . "&action=" . $params->action, $elements['nb_total_elements'], $elements['nb_onto_element_per_page'], $params->page, 10, true, true), $list); return $list; }
function show_list_coord($id_bibli) { global $msg, $charset; global $search_form; global $nb_per_page_acq; global $class_path; global $user_input, $page, $nbr_lignes, $tri_param, $limit_param, $last_param; global $tab_bib; //Creation selecteur etablissement $sel_bibli = "<select class='saisie-50em' id='id_bibli' name='id_bibli' onchange=\"submit();\" >"; foreach ($tab_bib[0] as $k => $v) { $sel_bibli .= "<option value='" . $v . "' "; if ($v == $id_bibli) { $sel_bibli .= "selected='selected' "; } $sel_bibli .= ">" . htmlentities($tab_bib[1][$k], ENT_QUOTES, $charset) . "</option>"; } $sel_bibli .= "</select>"; $search_form = str_replace('<!-- sel_bibli -->', $sel_bibli, $search_form); //Affichage form de recherche $titre = htmlentities($msg['recherche'] . ' : ' . $msg['acquisition_ach_fou'], ENT_QUOTES, $charset); $action = "./acquisition.php?categ=ach&sub=fourn&action=list&user_input="; $bouton_add = "<input class='bouton' type='button' value=' " . $msg[acquisition_ajout_fourn] . " ' onclick=\"document.location='./acquisition.php?categ=ach&sub=fourn&action=add&id_bibli=" . $id_bibli . "';\" />"; $lien_last_fou = ""; $search_form = str_replace('!!form_title!!', $titre, $search_form); $search_form = str_replace('!!action!!', $action, $search_form); $search_form = str_replace('<!-- bouton_add -->', $bouton_add, $search_form); $search_form = str_replace('<!-- lien_last -->', $lien_last_fou, $search_form); $search_form = str_replace('!!user_input!!', $user_input, $search_form); print $search_form; print "<script type='text/javascript' >document.forms['search'].elements['user_input'].focus();\n\tdocument.forms['search'].elements['user_input'].select();</script>"; //Prise en compte du formulaire de recherche // nombre de références par pages if ($nb_per_page_acq != "") { $nb_per_page = $nb_per_page_acq; } else { $nb_per_page = 10; } // traitement de la saisie utilisateur require_once $class_path . "/analyse_query.class.php"; // on récupére le nombre de lignes qui vont bien if (!$nbr_lignes) { if (!$user_input) { $nbr_lignes = entites::getNbFournisseurs($id_bibli); } else { $aq = new analyse_query(stripslashes($user_input), 0, 0, 0, 0); if ($aq->error) { error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message)); exit; } $nbr_lignes = entites::getNbFournisseurs($id_bibli, $aq); } } else { $aq = new analyse_query(stripslashes($user_input), 0, 0, 0, 0); } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { $url_base = "{$PHP_SELF}?categ=ach&sub=fourn&action=list&id_bibli=" . $id_bibli . "&user_input=" . rawurlencode(stripslashes($user_input)); // on lance la vraie requête if (!$user_input) { $res = entites::list_fournisseurs($id_bibli, $debut, $nb_per_page); } else { $res = entites::list_fournisseurs($id_bibli, $debut, $nb_per_page, $aq); } //Affichage liste des fournisseurs print "<table>"; $nbr = pmb_mysql_num_rows($res); $parity = 1; for ($i = 0; $i < $nbr; $i++) { $row = pmb_mysql_fetch_object($res); if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $parity += 1; $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" "; $dn_javascript = " onmousedown=\"document.location='./acquisition.php?categ=ach&sub=fourn&action=modif&id_bibli=" . $id_bibli . "&id=" . $row->id_entite . "'\" "; print "<tr class='" . $pair_impair . "' " . $tr_javascript . " >\n\t\t\t\t\t\t<td " . $dn_javascript . " style='cursor: pointer'><i>" . htmlentities($row->raison_sociale, ENT_QUOTES, $charset) . "</i></td>\n\t\t\t\t\t\t<td ><a href='./acquisition.php?categ=ach&sub=fourn&action=cond&id_bibli=" . $id_bibli . "&id=" . $row->id_entite . "' >" . htmlentities($msg['acquisition_cond_fourn'], ENT_QUOTES, $charset) . "</a></td>\n\t\t\t\t\t\t<td ><a href='./acquisition.php?categ=ach&sub=fourn&action=histrel&id_bibli=" . $id_bibli . "&id=" . $row->id_entite . "' >" . htmlentities($msg['acquisition_hist_rel_fou'], ENT_QUOTES, $charset) . "</a></td>\n\t\t\t\t\t</tr>"; } print "</table>"; if (!$last_param) { $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page); } else { $nav_bar = ""; } print $nav_bar; } else { // la requête n'a produit aucun résultat error_message($msg['acquisition_fou_rech'], str_replace('!!fou_cle!!', stripslashes($user_input), $msg['acquisition_fou_rech_error']), 0, './categ=ach&sub=fourn&action=list&id_bibli=' . $id_bibli); } }
//show_results($dbh, $user_input, $nbr_lignes, $page); $params['objects'] = $t_objs; $params['user_input'] = $user_input; $res = $sh->search_objects($params); if (!is_array($res)) { print $res; print "<br />"; } else { $nbr_lignes = count($res); if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; if ($nbr_lignes) { for ($i = $debut; $i < $nb_per_page + $debut; $i++) { $label = $sh->get_object_label($res[$i]["subject_type"], $res[$i]["subject_uri"]); print pmb_bidi("\n \t\t\t\t<a href='#' onclick=\"set_parent('" . $caller . "', '" . rawurlencode($res[$i]["subject_uri"]) . "', '" . htmlentities(addslashes($label), ENT_QUOTES, $charset) . "','" . $callback . "')\">" . htmlentities($label, ENT_QUOTES, $charset) . "</a><br />"); } // constitution des liens $nbepages = ceil($nbr_lignes / $nb_per_page); $suivante = $page + 1; $precedente = $page - 1; // affichage pagination print "<div class='row'> <hr /></div><div align='center'>"; $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input)); $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); print $nav_bar; print "</div>"; } } print $sel_footer;
function aff_cart_objects($idcaddie = 0, $url_base = "./catalog.php?categ=caddie&sub=gestion&quoi=panier&idcaddie=0", $no_del = false, $rec_history = 0, $no_point = false) { global $msg; global $dbh; global $begin_result_liste, $end_result_liste; global $affich_tris_result_liste; global $pmb_nb_max_tri; global $nbr_lignes, $page, $nb_per_page_search; global $url_base_suppr_cart; $url_base_suppr_cart = $url_base; $cb_display = "\n\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t \t\t<span class=\"notice-heada\">!!heada!!</span>\n\t \t\t<br />\n\t\t\t</div>\n\t\t\t"; // nombre de références par pages if ($nb_per_page_search != "") { $nb_per_page = $nb_per_page_search; } else { $nb_per_page = 10; } // on récupére le nombre de lignes if (!$nbr_lignes) { $requete = "SELECT count(1) FROM caddie_content where caddie_id='" . $idcaddie . "' "; $res = pmb_mysql_query($requete, $dbh); $nbr_lignes = pmb_mysql_result($res, 0, 0); } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; //Calcul des variables pour la suppression de notices $modulo = $nbr_lignes % $nb_per_page; if ($modulo == 1) { $page_suppr = !$page ? 1 : $page - 1; } else { $page_suppr = $page; } $nb_after_suppr = $nbr_lignes ? $nbr_lignes - 1 : 0; if ($nbr_lignes) { // on lance la vraie requête $myCart = new caddie($idcaddie); $caddie_type = $myCart->type; switch ($caddie_type) { case "NOTI": $from = " caddie_content left join notices on notice_id = object_id "; $order_by = " index_sew "; break; case "EXPL": $from = " caddie_content left join exemplaires on expl_id=object_id left join notices on notice_id = expl_notice "; $order_by = " index_sew "; break; case "BULL": $from = " caddie_content left join bulletins on bulletin_id = object_id "; $order_by = " date_date "; break; } $requete = "SELECT * FROM {$from} where caddie_id='" . $idcaddie . "' order by {$order_by}"; $requete .= " LIMIT {$debut},{$nb_per_page} "; //gestion du tri if ($caddie_type == "NOTI") { if ($nbr_lignes <= $pmb_nb_max_tri) { if ($_SESSION["tri"]) { $requete = "SELECT notice_id,caddie_content.* FROM {$from} where caddie_id='" . $idcaddie . "'"; $sort = new sort('notices', 'base'); $requete = $sort->appliquer_tri($_SESSION["tri"], $requete, "notice_id", $debut, $nb_per_page); } } } // fin gestion tri $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); // l'affichage du résultat est fait après le else } else { print $msg[399]; return; } $liste = array(); $result = @pmb_mysql_query($requete, $dbh); // or die (pmb_mysql_error()); if ($result) { if (pmb_mysql_num_rows($result)) { while ($temp = pmb_mysql_fetch_object($result)) { $liste[] = array('object_id' => $temp->object_id, 'content' => $temp->content, 'blob_type' => $temp->blob_type, 'flag' => $temp->flag); } } } if (!sizeof($liste) || !is_array($liste)) { print $msg[399]; return; } else { print "\n\t\t<script>\n\t\t\tvar ajax_pointage=new http_request();\n\t\t\tvar num_caddie=0;\n\t\t\tvar num_item=0;\n\t\t\tvar action='';\n\t\t\tfunction add_pointage_item(idcaddie,id_item) {\n\t\t\t\tnum_caddie=idcaddie;\n\t\t\t\tnum_item=id_item;\n\t\t\t\taction='add_item';\t\n\t\t\t\tvar url = './ajax.php?module=catalog&categ=pointage_add&sub=pointage&moyen=manu&action=add_item&idcaddie='+idcaddie+'&id_item='+id_item;\n\t\t \t\tajax_pointage.request(url,0,'',1,pointage_callback,0,0);\n\t\t\t}\n\t\t\t\n\t\t\tfunction del_pointage_item(idcaddie,id_item) {\n\t\t\t\tnum_caddie=idcaddie;\n\t\t\t\tnum_item=id_item;\n\t\t\t\taction='del_item';\n\t\t\t\tvar url = './ajax.php?module=catalog&categ=pointage_del&sub=pointage&moyen=manu&action=del_item&idcaddie='+idcaddie+'&id_item='+id_item;\n\t\t\t\tajax_pointage.request(url,0,'',1,pointage_callback,0,0); \n\t\t\t}\n\t\t\tfunction pointage_callback(response) {\n\t\t\t\tdata = eval('('+response+')');\n\t\t\t\tswitch (action) {\n\t\t\t\t\tcase 'add_item':\n\t\t\t\t\t\tif (data.res_pointage == 1) {\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).src='./images/depointer.png';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).title='" . $msg['caddie_item_depointer'] . "';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).setAttribute('onclick','del_pointage_item('+num_caddie+','+num_item+')');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).src='./images/pointer.png';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).title='" . $msg['caddie_item_pointer'] . "';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).setAttribute('onclick','add_pointage_item('+num_caddie+','+num_item+')');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'del_item':\n\t\t\t\t\t\tif (data.res_pointage == 1) {\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).src='./images/pointer.png';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).title='" . $msg['caddie_item_pointer'] . "';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).setAttribute('onclick','add_pointage_item('+num_caddie+','+num_item+')');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).src='./images/depointer.png';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).title='" . $msg['caddie_item_depointer'] . "';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).setAttribute('onclick','del_pointage_item('+num_caddie+','+num_item+')');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvar div = document.createElement('div');\n\t\t\t\tdiv.setAttribute('id','cart_'+data.idcaddie+'_nb_items');\n\t\t\t\tdiv.innerHTML = data.aff_cart_nb_items;\n\t\t\t\tdocument.getElementById('cart_'+data.idcaddie+'_nb_items').parentNode.replaceChild(div,document.getElementById('cart_'+data.idcaddie+'_nb_items'));\n\t\t\t}\n\t\t</script>"; // en fonction du type de caddie on affiche ce qu'il faut if ($caddie_type == "NOTI") { // boucle de parcours des notices trouvées // inclusion du javascript de gestion des listes dépliables // début de liste print $begin_result_liste; //Affichage du lien impression et panier if ($rec_history && $_SESSION["CURRENT"] !== false) { $current = $_SESSION["CURRENT"]; print " <a href='#' onClick=\"openPopUp('./print_cart.php?current_print={$current}&action=print_prepare','print',600,700,-2,-2,'scrollbars=yes,menubar=0'); return false;\"><img src='./images/basket_small_20x20.gif' border='0' align='center' alt=\"" . $msg["histo_add_to_cart"] . "\" title=\"" . $msg["histo_add_to_cart"] . "\"></a> <a href='#' onClick=\"openPopUp('./print.php?current_print={$current}&action_print=print_prepare','print',500,600,-2,-2,'scrollbars=yes,menubar=0'); return false;\"><img src='./images/print.gif' border='0' align='center' alt=\"" . $msg["histo_print"] . "\" title=\"" . $msg["histo_print"] . "\"/></a>"; print " <a href='#' onClick=\"openPopUp('./download.php?current_download={$current}&action_download=download_prepare" . $tri_id_info . "','download',500,600,-2,-2,'scrollbars=yes,menubar=0'); return false;\"><img src='./images/upload_docnum.gif' border='0' align='center' alt=\"" . $msg["docnum_download"] . "\" title=\"" . $msg["docnum_download"] . "\"/></a>"; if ($nbr_lignes <= $pmb_nb_max_tri) { print " " . $affich_tris_result_liste; } } print caddie::show_actions($idcaddie, $caddie_type); while (list($cle, $object) = each($liste)) { if ($object[content] == "") { // affichage de la liste des notices sous la forme 'expandable' $requete = "SELECT * FROM notices WHERE notice_id={$object['object_id']} LIMIT 1"; $fetch = pmb_mysql_query($requete); if (pmb_mysql_num_rows($fetch)) { $notice = pmb_mysql_fetch_object($fetch); if ($notice->niveau_biblio == 'b') { // notice de bulletin $rqtbull = "select bulletin_id from bulletins where num_notice=" . $notice->notice_id; $fetchbull = pmb_mysql_query($rqtbull); $bull = pmb_mysql_fetch_object($fetchbull); $link = "./catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=" . $bull->bulletin_id; // pas affichés pour l'instant: $link_expl = ''; $link_explnum = ''; if (!$no_point) { if ($object[flag]) { $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>"; } else { $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>"; } } else { if ($object[flag]) { $marque_flag = "<img src='images/tick.gif'/>"; } else { $marque_flag = ""; } } if (!$no_del) { $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=NOTI&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}"; } else { $lien_suppr_cart = $marque_flag; } $display = new mono_display($notice, 6, $link, 1, $link_expl, $lien_suppr_cart, $link_explnum, 0, 0, 1, 1); print pmb_bidi($display->result); } elseif ($notice->niveau_biblio != 's' && $notice->niveau_biblio != 'a') { // notice de monographie $link = './catalog.php?categ=isbd&id=!!id!!'; $link_expl = './catalog.php?categ=edit_expl&id=!!notice_id!!&cb=!!expl_cb!!&expl_id=!!expl_id!!'; $link_explnum = './catalog.php?categ=edit_explnum&id=!!notice_id!!&explnum_id=!!explnum_id!!'; if (!$no_point) { if ($object[flag]) { $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>"; } else { $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>"; } } else { if ($object[flag]) { $marque_flag = "<img src='images/tick.gif'/>"; } else { $marque_flag = ""; } } if (!$no_del) { $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=NOTI&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}"; } else { $lien_suppr_cart = $marque_flag; } $display = new mono_display($notice, 6, $link, 1, $link_expl, $lien_suppr_cart, $link_explnum, 0, 0, 1, 1); print pmb_bidi($display->result); } else { // on a affaire à un périodique // préparation des liens pour lui $link_serial = './catalog.php?categ=serials&sub=view&serial_id=!!id!!'; $link_analysis = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!bul_id!!&art_to_show=!!id!!'; $link_bulletin = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!id!!'; if (!$no_point) { if ($object[flag]) { $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>"; } else { $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>"; } } else { if ($object[flag]) { $marque_flag = "<img src='images/tick.gif'/>"; } else { $marque_flag = ""; } } if (!$no_del) { $lien_suppr_cart = "<a href='{$url_base}&action=del_item&action=del_item&object_type=NOTI&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}"; } else { $lien_suppr_cart = $marque_flag; } if ($notice->niveau_biblio == 's') { $link_explnum = "./catalog.php?categ=serials&sub=explnum_form&serial_id=!!serial_id!!&explnum_id=!!explnum_id!!"; } else { $link_explnum = "./catalog.php?categ=serials&sub=analysis&action=explnum_form&bul_id=!!bul_id!!&analysis_id=!!analysis_id!!&explnum_id=!!explnum_id!!"; } $serial = new serial_display($notice, 6, $link_serial, $link_analysis, $link_bulletin, $lien_suppr_cart, $link_explnum, 0, 0, 1, 1); print pmb_bidi($serial->result); } } } else { if ($object[flag]) { $marque_flag = "<img src='images/tick.gif'/>"; } else { $marque_flag = ""; } if (!$no_del) { $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL_CB&item=" . $object[content] . "&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}"; } else { $lien_suppr_cart = $marque_flag; } $cb_display = "\n\t\t\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t\t\t\t \t\t<span class=\"notice-heada\"><strong>{$lien_suppr_cart} " . $msg["4014"] . " : {$object['content']} : {$msg[395]}</strong></span>\n\t\t\t\t \t\t<br />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t"; print $cb_display; } } // fin de liste print $end_result_liste; } // fin si NOTI // si EXPL if ($caddie_type == "EXPL") { // boucle de parcours des exemplaires trouvés // inclusion du javascript de gestion des listes dépliables // début de liste print $begin_result_liste; print caddie::show_actions($idcaddie, $caddie_type); while (list($cle, $expl) = each($liste)) { if (!$expl[content]) { if ($stuff = get_expl_info($expl[object_id])) { if (!$no_point) { if ($expl[flag]) { $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $stuff->expl_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $stuff->expl_id . ");' style='cursor: pointer'/>"; } else { $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $stuff->expl_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $stuff->expl_id . ");' style='cursor: pointer'/>"; } } else { if ($expl[flag]) { $marque_flag = "<img src='images/tick.gif'/>"; } else { $marque_flag = ""; } } if (!$no_del) { $stuff->lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL&item={$stuff->expl_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}"; } else { $stuff->lien_suppr_cart = $marque_flag; } $stuff = check_pret($stuff); print pmb_bidi(print_info($stuff, 0, 1)); } else { print "<strong>ID : {$expl['object_id']} : {$msg[395]}</strong>"; } } else { if (!$no_point) { if ($expl[flag]) { $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $stuff->expl_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $stuff->expl_id . ");' style='cursor: pointer'/>"; } else { $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $stuff->expl_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $stuff->expl_id . ");' style='cursor: pointer'/>"; } } else { if ($expl[flag]) { $marque_flag = "<img src='images/tick.gif'/>"; } else { $marque_flag = ""; } } if (!$no_del) { $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL_CB&item=" . $expl[content] . "&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}"; } else { $lien_suppr_cart = $marque_flag; } $cb_display = "\n\t\t\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t\t\t\t \t\t<span class=\"notice-heada\"><strong>{$lien_suppr_cart} Code-barre : {$expl['content']} : {$msg[395]}</strong></span>\n\t\t\t\t \t\t<br />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t"; print $cb_display; } } // fin de liste print $end_result_liste; } // fin si EXPL if ($caddie_type == "BULL") { // boucle de parcours des bulletins trouvés // inclusion du javascript de gestion des listes dépliables // début de liste print $begin_result_liste; print caddie::show_actions($idcaddie, $caddie_type); while (list($cle, $expl) = each($liste)) { if (!$no_del) { $show_del = 1; } else { $show_del = 0; } if ($bull_aff = show_bulletinage_info($expl[object_id], 0, $show_del, $expl[flag], 1)) { print pmb_bidi($bull_aff); } else { if (!$no_point) { if ($expl[flag]) { $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $expl[object_id] . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $expl[object_id] . ");' style='cursor: pointer'/>"; } else { $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $expl[object_id] . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $expl[object_id] . ");' style='cursor: pointer'/>"; } } else { if ($expl[flag]) { $marque_flag = "<img src='images/tick.gif'/>"; } else { $marque_flag = ""; } } if (!$no_del) { $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL_CB&item=" . $expl[content] . "&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}"; } else { $lien_suppr_cart = $marque_flag; } $cb_display = "\n\t\t\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t\t\t\t \t\t<span class=\"notice-heada\"><strong>{$lien_suppr_cart} Code-barre : {$expl['content']} : {$msg[395]}</strong></span>\n\t\t\t\t \t\t<br />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t"; print $cb_display; } } // fin de liste print $end_result_liste; } // fin si BULL } print "<br />" . $nav_bar; return; }
function get_list_selector() { global $msg, $charset, $dbh; global $user_query, $user_input, $page, $nbr_lignes, $last_param; global $callback; global $caller; global $base_url; $nb_per_page = 10; if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; $search_word = str_replace('*', '%', $user_input); if (!($nb_per_page * 1)) { $nb_per_page = $nb_per_page_search; } if (!$page) { $page = 1; } if (!$last_param) { $debut = ($page - 1) * $nb_per_page; $requete = "SELECT count(1) FROM authperso_authorities where ( authperso_infos_global like '%" . $search_word . "%' or authperso_index_infos_global like '%" . $user_input . "%' ) and authperso_authority_authperso_num= " . $this->id; $res = pmb_mysql_query($requete, $dbh); $nbr_lignes = pmb_mysql_result($res, 0, 0); $req = "select * from authperso_authorities where ( authperso_infos_global like '%" . $search_word . "%' or authperso_index_infos_global like '%" . $user_input . "%' ) and authperso_authority_authperso_num= " . $this->id; $req .= " order by authperso_index_infos_global LIMIT " . $debut . "," . $nb_per_page . " "; } else { // les derniers créés $req = "select * from authperso_authorities where authperso_authority_authperso_num= " . $this->id; $req .= " order by id_authperso_authority DESC LIMIT {$nb_per_page}"; } $res = pmb_mysql_query($req, $dbh); while ($r = pmb_mysql_fetch_object($res)) { $id = $r->id_authperso_authority; $isbd = $this->get_isbd($id); $auth_lines .= "<a href='#' onclick=\"set_parent('" . $caller . "', '" . $id . "', '" . htmlentities(addslashes($isbd), ENT_QUOTES, $charset) . "','" . $callback . "')\">" . htmlentities($isbd, ENT_QUOTES, $charset) . "</a><br />"; } //$url_base = $base_url."&user_input=".rawurlencode(stripslashes($user_input)); $nav_bar = aff_pagination($base_url, $nbr_lignes, $nb_per_page, $page, 10, false, true); $authperso_list_tpl = "\t\t\r\n\t\t\t<br />\r\n\t\t\t\t{$auth_lines}\n\t\t\t<div class='row'> <hr /></div><div align='center'>\t\t\t\r\n\t\t\t\t{$nav_bar}\r\n\t\t\t</div>\r\n\t\t"; return $authperso_list_tpl; }
function show_search_list($action = '', $url_base = '', $page = 1) { global $form_search, $fichier_menu_display, $perso_word, $prefix; global $dbh, $msg, $charset; global $nb_per_page_search, $nb_per_page; global $dest; $search_word = str_replace('*', '%', $perso_word); if (!($nb_per_page * 1)) { $nb_per_page = $nb_per_page_search; } if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page; $requete = "SELECT count(1) FROM fiche where infos_global like '%" . $search_word . "%' or index_infos_global like '%" . $perso_word . "%'"; $res = pmb_mysql_query($requete, $dbh); $nbr_lignes = pmb_mysql_result($res, 0, 0); $req = "select id_fiche from fiche where infos_global like '%" . $search_word . "%' or index_infos_global like '%" . $perso_word . "%' "; if (!isset($dest) || !$dest) { $req .= " LIMIT " . $debut . "," . $nb_per_page . " "; } $res = pmb_mysql_query($req, $dbh); while ($fic = pmb_mysql_fetch_object($res)) { $result[$fic->id_fiche] = $this->get_values($fic->id_fiche, 1); } $form_search = str_replace("!!nb_per_page!!", $nb_per_page, $form_search); $form_search = str_replace("!!perso_word!!", htmlentities(stripslashes($perso_word), ENT_QUOTES, $charset), $form_search); if (!$result) { $form_search = str_replace("!!message_result!!", sprintf($msg['fichier_no_result_found'], $perso_word), $form_search); print $form_search; } else { $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true); $form_search = str_replace("!!message_result!!", "", $form_search); if ($dest == "TABLEAUHTML") { print $this->display_results_tableau($result, "", $debut, true); } elseif ($dest == "TABLEAU") { $this->print_results_tableau($result); } else { print $form_search; print $this->display_results_tableau($result, "", $debut); print $nav_bar; } } }