get_sel_header_template(); print $this->get_search_form(); print $this->get_js_script(); if(!$this->user_input) { $this->user_input = '*'; } print $this->get_display_list(); print $this->get_sel_footer_template(); } protected function get_display_list() { global $nb_per_page; global $page; global $grammars; $display_list = ''; if(!$page) { $debut = 0; } else { $debut = ($page-1)*$nb_per_page; } if(!$grammars) { $grammars_in = "'notice_authors'"; } else { $grammars_in = "'".implode("','", explode(',', $grammars))."'"; } $user_input = str_replace('*','',$this->user_input); // on récupére le nombre de lignes if($user_input=="") { $query = "SELECT COUNT(1) FROM vedette where grammar in (".$grammars_in.")"; } else { $query = "SELECT count(id_vedette) FROM vedette where label like '%".$user_input."%' and grammar in (".$grammars_in.") "; } $result = pmb_mysql_query($query); $this->nbr_lignes = pmb_mysql_result($result, 0, 0); if($this->nbr_lignes) { // on lance la vraie requête if($user_input=="") { $query = "SELECT id_vedette, label FROM vedette where grammar in (".$grammars_in.") ORDER BY label LIMIT $debut,$nb_per_page "; } else { $query = "SELECT id_vedette, label FROM vedette where label like '%".$user_input."%' and grammar in (".$grammars_in.") ORDER BY label limit $debut,$nb_per_page"; } $result = pmb_mysql_query($query); $display_list .= "