本文整理匯總了PHP中Institution::getInstsBySearch方法的典型用法代碼示例。如果您正苦於以下問題:PHP Institution::getInstsBySearch方法的具體用法?PHP Institution::getInstsBySearch怎麽用?PHP Institution::getInstsBySearch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Institution
的用法示例。
在下文中一共展示了Institution::getInstsBySearch方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Institution
$opInst = new Institution();
// get the search
$searchtext = "";
if ($_REQUEST["searchtext"]) {
$searchtext = $_REQUEST["searchtext"];
}
// sorting
$sortorder = "name";
if ($_REQUEST["sortorder"]) {
$sortorder = $_REQUEST["sortorder"];
}
// show all
if ($_REQUEST["showall"]) {
$searchtext = "*";
}
$totalItems = $opInst->getInstsBySearch("*", "", "pk", true, "db");
// get count of items
$output = "";
$items = array();
if ($searchtext) {
// no results without doing a search
$returnItems = "pk,name,type,rep_pk,repvote_pk";
$search = $searchtext;
if (strpos($searchtext, "=") === false) {
// there is not a specific search
$search = "name=*{$searchtext}*,type={$searchtext}*";
}
$items = $opInst->getInstsBySearch($search, $sortorder, $returnItems);
$output = "Returned " . count($items) . " items out of " . $totalItems['count'];
} else {
// end use ldap check
示例2: Institution
</div>
</td>
<td valign="top" width="20%">
<?php
if ($User->checkPerm("admin_accounts")) {
?>
<br/><br/><div class="login" style="padding:5px 15px;"><h3 align=center>Statistics:</h3>
<div class="loginheader">Accounts Admin</div>
<div class="padded">
<?php
$user_count = $User->getUsersBySearch("*", "", "pk", true);
$Inst = new Institution();
$inst_count = $Inst->getInstsBySearch("*", "", "pk", true);
?>
<strong>Accounts:</strong> <?php
echo $user_count['db'];
?>
<br/>
<?php
if ($USE_LDAP) {
?>
- LDAP: <?php
echo $user_count['ldap'];
?>
<br/>
<?php
}