本文整理匯總了PHP中Pager::getPagerScript方法的典型用法代碼示例。如果您正苦於以下問題:PHP Pager::getPagerScript方法的具體用法?PHP Pager::getPagerScript怎麽用?PHP Pager::getPagerScript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Pager
的用法示例。
在下文中一共展示了Pager::getPagerScript方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: chr
<td align="center" bgcolor="silver"><a href="./index.php?m=ingredients&where=%">
<?php
echo $LangUI->_('All');
?>
</a></td>
<?php
for ($a = 0; isset($alphabet[$a]); $a++) {
// List the alphabet
$cu = $alphabet[$a];
$cl = chr(ord($cu) + 32);
$bg = strpos($let, "{$cl}") > 0 ? "><a href=\"./index.php?m=ingredients&where={$cu}\">{$cu}</a>" : 'style="background-color:#ffffff;">' . $cu;
echo "<td align=\"center\" {$bg}</td>\n";
}
?>
</tr>
</table>
<?php
$sql_count = "SELECT count(*) FROM {$db_table_ingredients} WHERE ingredient_user = '" . $DB_LINK->addq($SMObj->getUserID(), get_magic_quotes_gpc()) . "' AND ingredient_name LIKE '" . $DB_LINK->addq($where, get_magic_quotes_gpc()) . "%'";
$sql = "SELECT ingredient_id,ingredient_name FROM {$db_table_ingredients} WHERE ingredient_user = '" . $DB_LINK->addq($SMObj->getUserID(), get_magic_quotes_gpc()) . "' AND ingredient_name LIKE '" . $DB_LINK->addq($where, get_magic_quotes_gpc()) . "%' ORDER BY ingredient_name";
$pagerObj = new Pager($sql_count, $sql, $page);
while (!$pagerObj->dbResults->EOF) {
echo '<br /><a href="./index.php?m=ingredients&a=view&ingredient_id=' . $pagerObj->dbResults->fields['ingredient_id'] . '">' . $pagerObj->dbResults->fields['ingredient_name'] . "</a>\n";
$pagerObj->dbResults->MoveNext();
}
echo "<br /><br /><center>";
$pagerObj->getPagerScript("./index.php?m=ingredients&where=" . $where);
$pagerObj->showPager($page);
echo "</center>";
?>
示例2: count
}
?>
</tr>
</table>
<?php
$sql_count = "SELECT count(*) FROM {$db_table_recipes} WHERE recipe_name LIKE '" . $DB_LINK->addq($where, get_magic_quotes_gpc()) . "%' AND";
if ($SMObj->isUserLoggedIn()) {
$sql_count .= " (recipe_private = 0 OR recipe_user = " . $SMObj->getUserID() . ") ";
} else {
$sql_count .= " recipe_private = 0 ";
}
$sql = "SELECT recipe_id,recipe_name FROM {$db_table_recipes} WHERE recipe_name LIKE '" . $DB_LINK->addq($where, get_magic_quotes_gpc()) . "%' AND";
if ($SMObj->isUserLoggedIn()) {
$sql .= " (recipe_private = 0 OR recipe_user = " . $SMObj->getUserID() . ") ";
} else {
$sql .= " recipe_private = 0 ";
}
$sql .= " ORDER BY recipe_name";
$pagerObj = new Pager($sql_count, $sql, $page);
while (!$pagerObj->dbResults->EOF) {
echo '<br /><a href="./index.php?m=recipes&a=view&recipe_id=' . $pagerObj->dbResults->fields['recipe_id'] . '">' . $pagerObj->dbResults->fields['recipe_name'] . '</a>';
$pagerObj->dbResults->MoveNext();
}
echo "<br /><br /><center>";
$pagerObj->getPagerScript("./index.php?m=recipes&where=" . $where);
$pagerObj->showPager($page);
echo "</center>";
?>