本文整理汇总了PHP中paging函数的典型用法代码示例。如果您正苦于以下问题:PHP paging函数的具体用法?PHP paging怎么用?PHP paging使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了paging函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tabel_menu
public function tabel_menu($value = '')
{
// if(!is_direct())
// {
// PAGINATION
$tanggal = '';
$offset = 0;
$uri = $this->uri->segment(4);
if (!empty($uri)) {
$offset = $uri;
}
$limit = 10;
$total = $this->mdb->count_menu();
// $total = count($all_data);
$data_menu = $this->mdb->get_menu($limit, $offset);
$url = base_url() . $this->cname . '/master_menu/tabel_menu';
$data['offset'] = $offset;
$data['no'] = (int) $offset + 1;
$data['kategori_menu'] = $this->mdb->get_kategori();
$data['pagination'] = paging($url, $total, $limit, 4, 2);
//-- END PAGINATION
$data['menu'] = $data_menu;
$this->load->view('v_master_menu_tabel', $data);
// }
}
示例2: lists
public function lists()
{
$must = array();
$this->check_param($must);
$this->check_sign();
extract($this->params);
if (!isset($page_now)) {
$page_now = 1;
}
$where_map = array();
if (isset($district_id) && $district_id != 0) {
$where_map = array('district_id' => $district_id);
}
do {
$this->Table_model->init(T_STREET);
$limit_arr = array($page_size, $page_now);
$res = $this->Table_model->records($where_map, array(), $limit_arr);
if ($res['err_num'] == 0) {
$this->load->model('Street_model');
foreach ($res['results']['records'] as &$value) {
$street_info[] = $this->Street_model->info($value['id']);
}
$res['results']['records'] = $street_info;
$res['results']['pager'] = paging($res['results']['records_num'], $page_now, $this->page_size);
unset($res['results']['records_num']);
$this->op($res);
} else {
$this->st(array(), "获取商场列表失败!", API_UNKNOW_ERR);
}
} while (0);
$this->op();
}
示例3: mall_ad_lists
public function mall_ad_lists()
{
$must = array('mall_id');
$this->check_param($must);
$this->check_sign();
extract($this->params);
if (!isset($page_size)) {
$page_size = 20;
}
if (!isset($page_now)) {
$page_now = 1;
}
do {
$limit_arr = array($page_size, $page_now);
$where_map = array();
if ($mall_id != 0) {
$where_map = array('mall_id' => $mall_id);
}
$this->Table_model->init(T_MALL_AD);
$res = $this->Table_model->records($where_map, array(), $limit_arr);
if ($res['err_num'] == 0) {
$res['results']['pager'] = paging($res['results']['records_num'], $page_now, $page_size);
unset($res['results']['records_num']);
$this->op($res);
} else {
$this->st(0, '该商场下无广告', API_NORMAL_ERR);
}
} while (0);
$this->op();
}
示例4: lists
public function lists()
{
$must = array();
$this->check_param($must);
$this->check_sign();
extract($this->params);
//district_id 可选参数
$where_map = array();
if (isset($district_id) && $district_id != 0) {
$where_map = array('district' => $district_id);
}
do {
$this->Table_model->init(T_MALL);
$limit_arr = array($this->page_size, $this->page_now);
$res = $this->Table_model->records($where_map, array(), $limit_arr);
if ($res['err_num'] == 0) {
$results =& $res['results'];
$results['pager'] = paging($results['records_num'], $this->page_now, $this->page_size);
$this->load->model('Mall_model');
foreach ($results['records'] as &$value) {
$value = array_merge($this->Mall_model->info($value['id']), $value);
if ($value['mall_photo']) {
$value['mall_photo'] = json_decode($value['mall_photo']);
}
}
// unset($results['records_num']);
$this->op($res);
} else {
$this->st(array(), "获取商场列表失败!", API_UNKNOW_ERR);
}
} while (0);
$this->op();
}
示例5: ShowAllUsers
function ShowAllUsers()
{
global $user, $users, $paging;
$total_data = $user->GetUserTotal();
$total_data_in_page = LIMIT_USER_PAGE;
$paging = paging($total_data, $total_data_in_page);
$page = $_REQUEST['page'] - 1;
if ($page <= 0) {
$users_data = $user->BrowseAllUsers(0, $total_data_in_page);
} else {
$users_data = $user->BrowseAllUsers($page * $total_data_in_page, $total_data_in_page);
}
$i = 0;
foreach ($users_data as $value) {
$users[$i]['user_id'] = $value['user_id'];
$users[$i]['username'] = $value['username'];
$users[$i]['firstname'] = $value['firstname'];
$users[$i]['lastname'] = $value['lastname'];
$users[$i]['paid'] = $value['paid'];
if ($i % 2 != 0) {
$users[$i]['color'] = '#f7f7f7';
} else {
$users[$i]['color'] = '#ffffff';
}
$i++;
}
}
示例6: page_cateAction
public function page_cateAction()
{
$cr_page = input_get('page');
$all_page = $this->model->action_db->cate_count_list();
$page = paging($all_page, 5, $cr_page, 'admin.php?c=category&a=page_cate&page={page}');
$cate = $this->model->action_db->cate_get_list($page['start'], $page['limit']);
$datasend = array($cate, $page);
$this->view->load('cate', $datasend);
$this->Load_Footer();
}
示例7: lists
public function lists()
{
$must = array();
$this->check_param($must);
$this->check_sign();
extract($this->params);
do {
if (!isset($page_size)) {
$page_size = 10;
}
//设置默认的 city_id 为 1
if (!isset($city_id)) {
$city_id = 1;
}
$this->Table_model->init(T_DISTRICT);
$where_map = array('city' => $city_id);
//是否只返回已经开发的商圈
if (isset($is_developed)) {
$where_map['is_developed'] = $is_developed;
}
$limit_arr = array($page_size, $this->page_now);
$order_map = array('is_developed' => 'desc');
$res = $this->Table_model->records($where_map, array(), $limit_arr, $order_map);
if ($res['err_num'] == 0) {
$results =& $res['results'];
$results['pager'] = paging($results['records_num'], $this->page_now, $page_size);
foreach ($results['records'] as &$value) {
$value['photo'] = json_decode($value['photo']);
//@todo 因为城市暂时只有一个北京,先临时处理下
$value['city_name'] = "北京";
//如果传参数 longtitude , 和 latitude ,则多返回一个 用户距 商圈距离字段
if (isset($Latitude) && isset($Longitude)) {
if (!$Latitude) {
$value['distance'] = "无法获取您的位置信息";
}
if (!$Longitude) {
$value['distance'] = "无法获取您的位置信息";
} else {
$value['distance'] = getDistance($value['Latitude'], $value['Longitude'], $Latitude, $Longitude);
}
} else {
$value['distance'] = "无法获取您的位置信息";
}
}
unset($results['records_num']);
$this->op($res);
} else {
$this->st(array(), "获取商圈列表失败!", API_UNKNOW_ERR);
}
} while (0);
$this->op();
}
示例8: ShowAllOrders
function ShowAllOrders()
{
global $tpl, $order, $product, $orders, $success, $paging;
$total_data = $order->GetTotalOrders();
$total_data_in_page = LIMIT_ORDER_PAGE;
$paging = paging($total_data, $total_data_in_page);
$page = $_REQUEST['page'] - 1;
if ($page <= 0) {
$orders_data = $order->BrowseAllOrders(0, $total_data_in_page);
} else {
$orders_data = $order->BrowseAllOrders($page * $total_data_in_page, $total_data_in_page);
}
$i = 0;
foreach ($orders_data as $value) {
$orders[$i]['no'] = $i + 1;
$orders[$i]['order_id'] = $value['order_id'];
$orders[$i]['name'] = $value['name'];
$orders[$i]['user_id'] = $value['user_id'];
$orders[$i]['username'] = $value['username'];
$orders[$i]['date_order'] = date("m-d-Y ", $value['date_order']);
$orders[$i]['date_expire'] = date("m-d-Y ", $value['date_expire']);
if ($i % 2 != 0) {
$orders[$i]['color'] = '#f7f7f7';
} else {
$orders[$i]['color'] = '#ffffff';
}
$expire_in = $value['date_expire'] - time();
if ($expire_in <= 0) {
$orders[$i]['expire_in'] = "<font color='#ff0000'>Expire</font>";
} else {
if ($expire_in <= CFG_NOTIFY_EXPIRE * 24 * 60 * 60) {
$expire_days = round($expire_in / 60 / 60 / 24);
if ($expire_days == 0) {
$expire_days = $expire_days + 1;
}
$orders[$i]['expire_in'] = "<font color='#F87217'>Expire in " . $expire_days . " Days</font>";
} else {
$orders[$i]['expire_in'] = "<font color='green'>Active</font>";
}
}
$orders[$i]['description'] = $value['description'];
$i++;
}
}
示例9: search_lists
public function search_lists($search_key, $limit_arr = array(), $order_map = array())
{
/*
* return 格式
* array(
* 'records_num' = >10, //总记录数
* 'records'=>array(), //记录列表
* 'pager'=>array( //记录页码
* )
* );
* */
$return = array();
$sql = "select * from " . T_BRAND . " where name like '%{$search_key}%'";
$return['records'] = $this->ci_query($sql);
foreach ($return['records'] as &$v) {
$v['logo'] = json_decode($v['logo']);
$v['style_id'] = json_decode($v['style_id']);
}
$sql = "select count(*) as records_num from " . T_BRAND . " where name like '%{$search_key}%'";
$return['records_num'] = $this->ci_query($sql)[0]['records_num'];
$return['pager'] = paging($return['records_num'], $limit_arr[1], $limit_arr[0]);
return $return;
}
示例10: lists
public function lists()
{
$must = array('province', 'page_now');
$this->check_param($must);
$this->check_sign();
extract($this->params);
do {
if (!isset($page_size)) {
$page_size = 10;
}
$this->Table_model->init(T_CITY);
$where_map = array('province' => $province);
$limit_arr = array($page_size, $page_now);
$res = $this->Table_model->records($where_map, array(), $limit_arr);
if ($res['err_num'] == 0) {
$res['results']['pager'] = paging($res['results']['records_num'], $page_now, $page_size);
unset($res['results']['records_num']);
$this->op($res);
} else {
$this->st(array(), "获取城市列表失败!", API_UNKNOW_ERR);
}
} while (0);
$this->op();
}
示例11: paging
</div>
</div>
</div>
</li>
<?php
}
?>
</ul>
<?php
}
?>
</div>
<?php
if (isset($pages_count) and $pages_count > 1 and isset($paging_param)) {
?>
<?php
print paging("num={$pages_count}&paging_param={$paging_param}");
?>
<?php
}
?>
示例12: empty
$praiseArray[] = '<a href="">' . $praiseIndex . '</a> ';
}
echo empty($praiseArray) ? '<div id=praiselist_' . $value['eventId'] . '>' : '<div id=praiselist_' . $value['eventId'] . '><i class="mdi-action-favorite-outline"></i>';
echo implode(' , ', $praiseArray);
$hadPraise = $value['hadPraised'] ? 'pink-text mdi-action-favorite' : 'pink-text mdi-action-favorite-outline';
echo '</div>';
if ($value['hadPraised']) {
echo '<h5 class="right-align"><a id=event_a_' . $value['eventId'] . ' onclick="unlikeEvent(' . $value['eventId'] . ', ' . "'{$accessToken}'" . ')"><i id=event_' . $value['eventId'] . ' class="' . $hadPraise . '"></i></a></h5>';
} else {
echo '<h5 class="right-align"><a id=event_a_' . $value['eventId'] . ' onclick="likeEvent(' . $value['eventId'] . ', ' . "'{$accessToken}'" . ')"><i id=event_' . $value['eventId'] . ' class="' . $hadPraise . '"></i></a></h5>';
}
echo '</div>
<div class="col s12 divider"></div>
</div>';
}
echo paging('user/getNoticeList', $_REQUEST, count($noticeInfo), 'atme.php');
?>
</div>
</main>
<?php
require_once 'bottom.php';
?>
<script type="text/javascript">
function likeEvent(eventId, accessToken) {
$.post(getAjaxRequestAddress('user/likeEvent'), {eventId:eventId, accessToken:accessToken}, function(result) {
if (result.code == 0) {
$('#event_' + eventId).attr("class", "pink-text mdi-action-favorite");
$('#event_a_' + eventId).attr("onclick", "unlikeEvent("+eventId+", "+"'"+accessToken+"'"+")");
var appendHeml = '';
示例13: count
$page = $_GET['h'];
$offset = $limit * ($page - 1);
} else {
$offset = 0;
$page = 1;
}
//search
$uri = "?p=news";
$search = "";
//get total record
$qryTotal = "SELECT count(*) total FROM artikel WHERE 0=0 " . $search . " ";
$resTotal = mysql_query($qryTotal);
$row = mysql_fetch_array($resTotal, MYSQL_NUM);
$totalRec = $row[0];
//pagination
$pagination = paging($totalRec, $limit, $page, $uri);
//get record selected
$resQry = "SELECT * FROM artikel \n\t\tWHERE 0=0 " . $search . " \n\t\tORDER BY id DESC\n\t\tLIMIT " . $offset . "," . $limit;
$results = mysql_query($resQry);
$countResults = mysql_num_rows($results);
?>
<h2>Artikel</h2><hr>
<p>
<?php
if ($countResults > 0) {
$i = 1;
while ($r = mysql_fetch_array($results)) {
?>
<div class="boxNews clr">
<span class="pic">
<img src="<?php
示例14: _e
<tr>
<td colspan="100" align="center" style="background: #FFFD8C;"><?php
_e("No items found");
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
if (is_array($data)) {
?>
<div class="mw-paging left"> <?php
print paging("num={$data_paging}");
?>
</div>
<?php
if (isset($params['export_to_excel'])) {
}
if (isset($params['export_to_excel'])) {
}
}
?>
<div id="start-email-campaign"> <a class="mw-ui-btn pull-right" href="javascript:;" onclick="Alert('<?php
_e("Coming Soon");
?>
!');" >
<?php
_e("Start an Email Campaign");
示例15: array
<microweber module="posts/list" file="posts_list_wide" category="<? print $category['id'] ?>" limit="3">
<br />
<?
$params= array();
$params['without_custom_fields']=false;
$the_posts = get_posts($params);
?>
<?
$i = 0;
foreach($the_posts as $the_post):
include(TEMPLATE_DIR.'post_item_wide.php') ;?>
<? if($i == 1): ?>
<div class="post_list" align="center"> <? include(TEMPLATE_DIR.'banner_wide.php') ; ?></div>
<? endif; ?>
<? $i++; endforeach; ?>
<br />
<br />
<? paging($display = 'divs') ?>
<? endif; ?>
</div>
</div>
</div>