示例#1
0
}
mysql_select_db($database_connHm, $connHm);
$query_rsView = sprintf("SELECT * FROM home_product_management WHERE site_id = %s and user_id = %s ORDER BY title ASC", $colname_rsView, $coluser_rsView);
$query_limit_rsView = sprintf("%s LIMIT %d, %d", $query_rsView, $startRow_rsView, $maxRows_rsView);
$rsView = mysql_query($query_limit_rsView, $connHm) or die(mysql_error());
$row_rsView = mysql_fetch_assoc($rsView);
if (isset($_GET['totalRows_rsView'])) {
    $totalRows_rsView = $_GET['totalRows_rsView'];
} else {
    $all_rsView = mysql_query($query_rsView);
    $totalRows_rsView = mysql_num_rows($all_rsView);
}
$totalPages_rsView = ceil($totalRows_rsView / $maxRows_rsView) - 1;
// pagination
include_once 'PaginateIt_hpm.php';
$PaginateIt = new PaginateIt();
$PaginateIt->linksHref = "home_product_management/view.php";
$PaginateIt->divtag = "centerDiv";
$PaginateIt->SetItemCount($totalRows_rsView);
$PaginateIt->SetItemsPerPage($maxRows_rsView);
$pagination = $PaginateIt->GetPageLinks();
?>
<div class="post">
	<h1 class="title"><a href="#">View My Places</a></h1>
	<p class="byline"><small>List of place created by me.</small></p>
	<div class="entry">
<?php 
if (!$_COOKIE['user_id']) {
    echo '<div class="error">Please login first.</div>';
} else {
    ?>
示例#2
0
function public_page_numbers($count, $limit, $page, $stringVar = 'page')
{
    global $msg_script16, $msg_script17;
    $PaginateIt = new PaginateIt();
    $PaginateIt->SetCurrentPage($page);
    $PaginateIt->SetItemCount($count);
    $PaginateIt->SetItemsPerPage($limit);
    $PaginateIt->SetLinksToDisplay(35);
    $PaginateIt->SetQueryStringVar($stringVar);
    $PaginateIt->SetLinksFormat('&laquo; ' . $msg_script16, ' &bull; ', $msg_script17 . ' &raquo;');
    return $PaginateIt->GetPageLinks();
}