示例#1
0
        <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&amp;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 = '******' 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 = '******' 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&amp;a=view&amp;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
0
}
?>
</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 = "******") ";
} 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 = "******") ";
} 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&amp;a=view&amp;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>";
?>