Example #1
0
 function make_first_search()
 {
     global $search_tu;
     global $msg, $charset;
     global $browser, $browser_url, $search_form_titre_uniforme;
     $aq = new analyse_query(stripslashes($search_tu), 0, 0, 1, 1);
     if (!$aq->error) {
         $this->nbresults = 0;
         //Recherche dans les titres uniformes
         $rq_tu_count = $aq->get_query_count("titres_uniformes", "tu_name", "index_tu", "tu_id");
         $this->nb_tu = @pmb_mysql_result(@pmb_mysql_query($rq_tu_count), 0, 0);
         if ($this->nb_tu) {
             $rq_tu = $aq->get_query("titres_uniformes", "tu_name", "index_tu", "tu_id");
             $this->tu_query = @pmb_mysql_query($rq_tu);
             return AUT_LIST;
         } else {
             $search_form_titre_uniforme = str_replace("!!base_url!!", $this->base_url, $search_form_titre_uniforme);
             print $search_form_titre_uniforme;
             error_message($msg["searcher_no_result"], $msg["searcher_no_result_desc"]);
             $browser = str_replace("!!browser_url!!", $browser_url, $browser);
             print $browser;
             return;
         }
     } else {
         $this->show_error($aq->current_car, $aq->input_html, $aq->error_message);
     }
 }
Example #2
0
 function filterSearch($start, $datas)
 {
     global $dbh;
     //Liste des identifiants de périodiques disponibles
     $listeId = array();
     if (count($this->titles)) {
         foreach ($this->titles as $title) {
             $listeId[] = $title["id"];
         }
     }
     //commence par
     $this->start = $start;
     $titles = array_filter($this->titles, array($this, startwith));
     //on complète
     if (count($titles) < 20) {
         $aq = new analyse_query(stripslashes($datas . "*"));
         $query = $aq->get_query("notices", "index_sew", "index_sew", "notice_id", "niveau_biblio='s' AND niveau_hierar='1' AND notice_id IN (" . implode(",", $listeId) . ")");
         $result = pmb_mysql_query($query, $dbh);
         if ($result) {
             while ($row = pmb_mysql_fetch_object($result)) {
                 foreach ($this->titles as $title) {
                     if ($title["id"] == $row->notice_id) {
                         if (!in_array($title, $titles)) {
                             $titles[] = $title;
                         }
                         continue;
                     }
                 }
             }
         }
     }
     return $titles;
 }
 function make_first_search()
 {
     global $msg, $dbh;
     global $elt_query;
     global $nb_per_page, $nb_per_page_select;
     global $results_show_all;
     if (!$nb_per_page) {
         $nb_per_page = $nb_per_page_select;
     }
     $aq = new analyse_query(stripslashes($elt_query));
     if ($aq->error) {
         $this->show_form();
         error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message));
     } else {
         $q_count = $aq->get_query_count('frais', 'libelle', 'index_libelle', 'id_frais');
         $r_count = pmb_mysql_query($q_count);
         $n_count = pmb_mysql_result($r_count, 0, 0);
         $this->nbresults = $n_count;
         if (!$results_show_all) {
             $q_list = $aq->get_query('frais', 'libelle', 'index_libelle', 'id_frais', $this->page * $nb_per_page, $nb_per_page);
         } else {
             $q_list = $aq->get_query('frais', 'libelle', 'index_libelle', 'id_frais');
         }
         $r_list = pmb_mysql_query($q_list, $dbh);
         $this->t_query = $r_list;
         if (!$results_show_all) {
             $this->nbepage = ceil($this->nbresults / $nb_per_page);
         } else {
             $this->nbepage = 1;
         }
         return ELT_LIST;
     }
 }