本文整理汇总了PHP中search::get_results方法的典型用法代码示例。如果您正苦于以下问题:PHP search::get_results方法的具体用法?PHP search::get_results怎么用?PHP search::get_results使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类search
的用法示例。
在下文中一共展示了search::get_results方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_search
public function action_search()
{
$urlparams = array('search' => optional_param('search', null, PARAM_TEXT), 'group' => optional_param('group', 0, PARAM_INT), 'page' => optional_param('page', 1, PARAM_INT), 'role' => optional_param('role', 0, PARAM_INT), 'type' => optional_param('type', base::TYPE_ALL, PARAM_INT));
if (optional_param('resetbutton', 0, PARAM_ALPHA)) {
redirect(new \moodle_url('/mod/mediagallery/view.php', array('action' => 'search', 'id' => $this->cm->id)));
}
$params = array_merge($urlparams, array('collection' => $this->collection, 'courseid' => $this->course->id, 'context' => $this->context));
$search = new search($params);
$results = $search->get_results();
if (optional_param('exportbutton', 0, PARAM_ALPHA)) {
return $search->download_csv();
}
$form = new form\search(null, array('context' => $this->context, 'collection' => $this->collection), 'post', '', array('id' => 'searchform'));
$pageurl = new \moodle_url('/mod/mediagallery/search.php', $urlparams);
$perpage = 0;
$totalcount = 0;
$renderable = new output\searchresults\renderable($results, $pageurl, $totalcount, $params['page'], $perpage);
return $this->renderer->search_page($form, $renderable);
}
示例2: count
switch ($sub) {
case "launch":
if ((string) $page == "") {
$_SESSION["CURRENT"] = count($_SESSION["session_history"]);
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["URI"] = "./catalog.php?categ=search&mode=8";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["POST"] = $_POST;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["GET"] = $_GET;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["GET"]["sub"] = "";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["POST"]["sub"] = "";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["HUMAN_QUERY"] = $sc->make_human_query();
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["HUMAN_TITLE"] = $msg["search_exemplaire"];
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["SEARCH_TYPE"] = "EXPL";
$_POST["page"] = 0;
$page = 0;
}
$table = $sc->get_results("./catalog.php?categ=search&mode=8&sub=launch", "./catalog.php?categ=search&mode=8&option_show_notice_fille={$option_show_notice_fille}&option_show_expl={$option_show_expl}", true);
print_results($sc, $table, "./catalog.php?categ=search&mode=8&sub=launch&option_show_notice_fille={$option_show_notice_fille}&option_show_expl={$option_show_expl}", "./catalog.php?categ=search&mode=8&option_show_notice_fille={$option_show_notice_fille}&option_show_expl={$option_show_expl}", true);
if ($_SESSION["CURRENT"] !== false) {
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["URI"] = "./catalog.php?categ=search&mode=8";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["POST"] = $_POST;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["GET"] = $_GET;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["PAGE"] = $page + 1;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["HUMAN_QUERY"] = $sc->make_human_query();
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["SEARCH_TYPE"] = "expl";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["TEXT_QUERY"] = "";
}
break;
default:
print $sc->show_form("./catalog.php?categ=search&mode=8&option_show_notice_fille={$option_show_notice_fille}&option_show_expl={$option_show_expl}", "./catalog.php?categ=search&mode=8&sub=launch");
break;
}
示例3: count
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["POST"]["sub"] = "";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["HUMAN_QUERY"] = $sc->make_human_query();
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["HUMAN_TITLE"] = $msg["search_emprunteur"];
$_POST["page"] = 0;
$page = 0;
}
if ($_SESSION["CURRENT"] !== false) {
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EMPR"]["URI"] = "./circ.php?categ=search&sub=launch";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EMPR"]["POST"] = $_POST;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EMPR"]["GET"] = $_GET;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EMPR"]["PAGE"] = $page + 1;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EMPR"]["HUMAN_QUERY"] = $sc->make_human_query();
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EMPR"]["SEARCH_TYPE"] = "empr";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EMPR"]["TEXT_QUERY"] = "";
}
$table = $sc->get_results("./circ.php?categ=search&sub=launch", "./circ.php?categ=search", true);
$sc->link = './circ.php?categ=empr_saisie&id=!!id!!';
$url = "./circ.php?categ=search&sub=launch";
$url_to_search_form = "./circ.php?categ=search";
$search_target = "";
if (!$page) {
$page = 1;
}
$debut = ($page - 1) * $nb_per_page;
$requete = "select count(1) from {$table}";
$res = mysql_query($requete);
if ($res) {
$nbr_lignes = mysql_result($res, 0, 0);
} else {
$nbr_lignes = 0;
}