本文整理匯總了PHP中rating::get_work_count方法的典型用法代碼示例。如果您正苦於以下問題:PHP rating::get_work_count方法的具體用法?PHP rating::get_work_count怎麽用?PHP rating::get_work_count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rating
的用法示例。
在下文中一共展示了rating::get_work_count方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: rating
<?php
require_once 'config.php';
require_once 'class/rating.php';
$renderObj = new rating();
//$renderObj->sample_get_book_details_id(1);
$session_val = $renderObj->check_session();
//echo "<pre>";print_r($status_flag);exit;
$limit = 20;
//how many items to show per page
$page = $_GET["page"];
if ($session_val == 1) {
$user_count = $renderObj->get_work_count($_SESSION['userinfo']->id);
if ($page) {
$start = ($page - 1) * $limit;
} else {
$start = 0;
}
//if no page var is given, set start to
if ($page == 0) {
$page = 1;
}
//if no page var is given, default to 1.
$prev = $page - 1;
//previous page is page - 1
$next = $page + 1;
//next page is page + 1
$lastpage = ceil($user_count / $limit);
//lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1;
//last page minus 1