• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_pager函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_pager函数的典型用法代码示例。如果您正苦于以下问题:PHP get_pager函数的具体用法?PHP get_pager怎么用?PHP get_pager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_pager函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: get_street_stores

function get_street_stores($cate_id = 0, $page = 1, $size = 15)
{
    if ($cate_id) {
        $sql = "select id from " . $GLOBALS['ecs']->table('store_category') . " where id='{$cate_id}'";
        $cate_id = $GLOBALS['db']->getOne($sql);
        if ($cate_id) {
            $where = " and sh.street_cate='{$cate_id}' ";
        }
    }
    /* 获得符合条件的店铺总数 */
    $sql = "select count(sh.id) from " . $GLOBALS['ecs']->table('seller_shopinfo') . " as sh left join " . $GLOBALS['ecs']->table('store_category') . " as c on sh.street_cate=c.id left join " . $GLOBALS['ecs']->table('street_tags') . " as st on sh.street_tags=st.id where sh.status=1 and sh.apply=1 and sh.is_street=1 and c.is_show=1 " . $where;
    $count = $GLOBALS['db']->getOne($sql);
    $max_page = $count > 0 ? ceil($count / $size) : 1;
    if ($page > $max_page) {
        $page = $max_page;
    }
    $sql = "select sh.id,sh.shop_name,sh.street_logo,sh.street_spjpg,sh.shop_title,st.tag_name from " . $GLOBALS['ecs']->table('seller_shopinfo') . " as sh left join " . $GLOBALS['ecs']->table('store_category') . " as c on sh.street_cate=c.id left join " . $GLOBALS['ecs']->table('street_tags') . " as st on sh.street_tags=st.id where sh.status=1 and sh.apply=1 and sh.is_street=1 and c.is_show=1 " . $where . " order by sh.street_order desc";
    $res = $GLOBALS['db']->SelectLimit($sql, $size, ($page - 1) * $size);
    $arr = array();
    while ($row = $GLOBALS['db']->FetchRow($res)) {
        $arr[$row['id']]['id'] = $row['id'];
        $arr[$row['id']]['shop_name'] = $row['shop_name'];
        $arr[$row['id']]['street_logo'] = str_replace('../', './', $row['street_logo']);
        $arr[$row['id']]['street_spjpg'] = str_replace('../', './', $row['street_spjpg']);
        $arr[$row['id']]['shop_title'] = $row['shop_title'];
        $arr[$row['id']]['tag_name'] = $row['tag_name'];
    }
    $pager['search'] = array('cat' => $cate_id);
    $pager = get_pager('store_street.php', $pager['search'], $count, $page, $size);
    $street_stores = array('pager' => $pager, 'result' => $arr);
    return $street_stores;
}
开发者ID:tang7h,项目名称:jzmall,代码行数:32,代码来源:store_street.php


示例2: action_list

function action_list()
{
    $smarty = $GLOBALS['smarty'];
    /* 取得预售活动总数 */
    $count = pre_sale_count();
    if ($count > 0) {
        /* 取得每页记录数 */
        $size = isset($_CFG['page_size']) && intval($_CFG['page_size']) > 0 ? intval($_CFG['page_size']) : 12;
        /* 计算总页数 */
        $page_count = ceil($count / $size);
        /* 取得当前页 */
        $page = isset($_REQUEST['page']) && intval($_REQUEST['page']) > 0 ? intval($_REQUEST['page']) : 1;
        $page = $page > $page_count ? $page_count : $page;
        /* 缓存id:语言 - 每页记录数 - 当前页 */
        $cache_id = $_CFG['lang'] . '-' . $size . '-' . $page;
        $cache_id = sprintf('%X', crc32($cache_id));
    } else {
        /* 缓存id:语言 */
        $cache_id = $_CFG['lang'];
        $cache_id = sprintf('%X', crc32($cache_id));
    }
    assign_template();
    /* 如果没有缓存,生成缓存 */
    if (!$smarty->is_cached('pre_sale_list.dwt', $cache_id) || true) {
        if ($count > 0) {
            /* 取得当前页的预售活动 */
            $ps_list = pre_sale_list($size, $page);
            $smarty->assign('ps_list', $ps_list);
            /* 设置分页链接 */
            $pager = get_pager('pre_sale.php', array('act' => 'list'), $count, $page, $size);
            $smarty->assign('pager', $pager);
        }
        /* 模板赋值 */
        $smarty->assign('cfg', $_CFG);
        assign_template();
        $position = assign_ur_here();
        $smarty->assign('page_title', $position['title']);
        // 页面标题
        $smarty->assign('ur_here', $position['ur_here']);
        // 当前位置
        $smarty->assign('categories', get_categories_tree());
        // 分类树
        $smarty->assign('helps', get_shop_help());
        // 网店帮助
        $smarty->assign('top_goods', get_top10());
        // 销售排行
        $smarty->assign('promotion_info', get_promotion_info());
        $smarty->assign('feed_url', $_CFG['rewrite'] == 1 ? "feed-typepre_sale.xml" : 'feed.php?type=pre_sale');
        // RSS
        // URL
        assign_dynamic('pre_sale_list');
    }
    /* 显示模板 */
    $smarty->display('pre_sale_list.dwt', $cache_id);
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:55,代码来源:pre_sale.php


示例3: myinvite

 function myinvite($page = NULL)
 {
     check_login();
     $page = intval($page) < 1 ? 1 : intval($page);
     $limit = $this->config->item('per_page');
     $start = ($page - 1) * $limit;
     $page_all = ceil($this->invite->get_user_invite_num() / $limit);
     $base = '/invite/myinvite';
     $data['list'] = $this->invite->get_user_invite($start, $limit);
     $data['pager'] = get_pager($page, $page_all, $base);
     $this->view('myinvite', $data);
 }
开发者ID:yunsite,项目名称:easysns,代码行数:12,代码来源:invite.php


示例4: index

 function index($page = NULL)
 {
     check_admin();
     $data = array();
     $limit = 10;
     $page = intval($page) > 0 ? $page : 1;
     $start = ($page - 1) * $limit;
     $data['froms'] = $this->form->get_forms($start, $limit);
     $page_all = ceil(get_count() / $limit);
     $data['pager'] = get_pager($page, $page_all, '/design');
     $this->view('index', $data);
 }
开发者ID:yunsite,项目名称:easysns,代码行数:12,代码来源:design.php


示例5: index

 function index()
 {
     //$data = array();
     $data['ci_top_title'] = '微件列表';
     $args = func_get_args();
     if (isset($args[2])) {
         $search = strip_tags(trim($args[2]));
         $search = urldecode($search);
     } else {
         $search = strip_tags(trim(v('search')));
     }
     $data['search'] = $search;
     $type = intval(v('type'));
     if ($args) {
         $mid = intval($args[0]);
     }
     if (!isset($mid) || $mid == '') {
         $mid = $type;
     }
     //
     if ($mid == '0') {
         $where = " AND `name` LIKE '%" . $search . "%' ";
         //$data['name'] = '全部范围';
     } elseif ($mid > '0') {
         $where = " AND `mid` = '" . intval($mid) . "' AND `name` LIKE '%" . $search . "%'";
         $name = lazy_get_var("SELECT `name` FROM `u2_plugs` WHERE 1 AND `id` = '" . intval($mid) . "'");
         if (!$name) {
             info_page('错误的组件ID');
         }
     } else {
         info_page('错误的组件ID');
     }
     $data['mid'] = $mid;
     $data['plugs_name'] = lazy_get_data("SELECT * FROM `u2_plugs`");
     $data['page'] = $page = !isset($args[1]) || intval($args[1]) < 1 ? 1 : intval($args[1]);
     $limit = 5;
     $start = ($page - 1) * $limit;
     $item = lazy_get_data("SELECT sql_calc_found_rows * FROM `u2_plugs_widget` WHERE 1 {$where} ORDER BY `id` DESC  LIMIT {$start},{$limit}");
     $all = get_count();
     $data['item'] = $item;
     //$type = urlencode( $type );
     $base = '/plugs/index/' . $mid;
     $page_all = ceil($all / $limit);
     $text = urlencode($search);
     $data['pager'] = get_pager($page, $page_all, $base, $text);
     $data['is_admin'] = is_admin() ? true : false;
     $domain = _sess('domain');
     if ($domain != '') {
         $data['domain'] = $domain;
     }
     $this->view('list', $data);
 }
开发者ID:yunsite,项目名称:easysns,代码行数:52,代码来源:plugs.php


示例6: action_my_comment

function action_my_comment()
{
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $_SESSION['user_id'];
    $min_time = gmtime() - 86400 * $_CFG['comment_youxiaoqi'];
    $page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
    $count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('order_goods') . " AS og \r\n\t\t\t\t\t\t  LEFT JOIN " . $ecs->table('order_info') . " AS o ON og.order_id=o.order_id\r\n\t\t\t\t\t\t  WHERE o.user_id = '{$user_id}' AND o.shipping_time_end > 0 AND og.is_back = 0");
    $size = 20;
    $page_count = $count > 0 ? intval(ceil($count / $size)) : 1;
    // 代码添加$o_id,if判断
    $o_id = $_REQUEST['order_id'];
    if ($o_id) {
        $sql = "SELECT og.*, o.add_time, o.shipping_time_end, o.order_id, g.goods_thumb, s.shaidan_id, s.pay_points AS shaidan_points, s.status AS shaidan_status,\r\n\t\t\tc.status AS comment_status,g.supplier_id,ifnull(ssc.value,'网站自营') AS shopname\r\n\t\t\tFROM " . $ecs->table('order_goods') . " AS og\r\n\t\t\tLEFT JOIN " . $ecs->table('order_info') . " AS o ON og.order_id=o.order_id\r\n\t\t\tLEFT JOIN " . $ecs->table('goods') . " AS g ON og.goods_id=g.goods_id\r\n\t\t\tLEFT JOIN " . $ecs->table('shaidan') . " AS s ON og.rec_id=s.rec_id\r\n\t\t\tLEFT JOIN " . $ecs->table('comment') . " AS c ON og.rec_id=c.rec_id\r\n\t\t\tLEFT JOIN " . $ecs->table('supplier_shop_config') . " AS ssc ON ssc.supplier_id=g.supplier_id AND ssc.code='shop_name'\r\n\t\t\tWHERE o.user_id = '{$user_id}' AND og.order_id = '{$o_id}' AND o.shipping_time_end > 0 AND og.is_back = 0 ORDER BY o.add_time DESC";
    } else {
        $sql = "SELECT og.*, o.add_time, o.shipping_time_end, o.order_id, g.goods_thumb, s.shaidan_id, s.pay_points AS \tshaidan_points, s.status AS shaidan_status, \r\n\t\t\tc.status AS comment_status,g.supplier_id,ifnull(ssc.value,'网站自营') AS shopname \r\n\t\t\tFROM " . $ecs->table('order_goods') . " AS og \r\n\t\t\tLEFT JOIN " . $ecs->table('order_info') . " AS o ON og.order_id=o.order_id\r\n\t\t\tLEFT JOIN " . $ecs->table('goods') . " AS g ON og.goods_id=g.goods_id\r\n\t\t\tLEFT JOIN " . $ecs->table('shaidan') . " AS s ON og.rec_id=s.rec_id\r\n\t\t\tLEFT JOIN " . $ecs->table('comment') . " AS c ON og.rec_id=c.rec_id\r\n\t\t\tLEFT JOIN " . $ecs->table('supplier_shop_config') . " AS ssc ON ssc.supplier_id=g.supplier_id AND ssc.code='shop_name'\r\n\t\t\tWHERE o.user_id = '{$user_id}' AND o.shipping_time_end > 0 AND c.content > 0 AND og.is_back = 0 ORDER BY o.add_time DESC";
    }
    $res = $db->selectLimit($sql, $size, ($page - 1) * $size);
    $points_list = array();
    while ($row = $db->fetchRow($res)) {
        $row['thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true);
        $row['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']);
        $row['add_time_str'] = local_date("Y-m-d", $row['add_time']);
        $row['goods_tags'] = $db->getAll("SELECT * FROM " . $ecs->table('goods_tag') . " WHERE goods_id = '{$row['goods_id']}'");
        $item_list[] = $row;
    }
    // 代码增加 for 循环
    for ($i = 1; $i < count($item_list); $i++) {
        $item_list[$i]['o_id'] = $item_list[$i]['order_id'];
        unset($item_list[$i]['order_id']);
    }
    $smarty->assign('item_list', $item_list);
    // 统计信息
    $num['x'] = $db->getOne("SELECT COUNT(*) AS num FROM " . $ecs->table('order_goods') . " AS og \r\n\t\t\t\t\t\t\tLEFT JOIN " . $ecs->table('order_info') . " AS o ON og.order_id=o.order_id\r\n\t\t\t\t\t\t\tWHERE o.user_id = '{$user_id}' AND og.is_back = 0 AND og.comment_state = 0 AND o.shipping_time_end > {$min_time}");
    $num['y'] = $db->getOne("SELECT COUNT(*) AS num FROM " . $ecs->table('order_goods') . " AS og \r\n\t\t\t\t\t\t\tLEFT JOIN " . $ecs->table('order_info') . " AS o ON og.order_id=o.order_id\r\n\t\t\t\t\t\t\tWHERE o.user_id = '{$user_id}' AND og.is_back = 0 AND og.shaidan_state = 0 AND o.shipping_time_end > {$min_time}");
    $smarty->assign('num', $num);
    $pager = get_pager('user.php', array('act' => $action), $count, $page, $size);
    $smarty->assign('min_time', $min_time);
    $smarty->assign('pager', $pager);
    $smarty->display('user_my_comment.dwt');
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:45,代码来源:user.php


示例7: urlencode

 $smarty->assign('min_price', $min_price);
 $smarty->assign('max_price', $max_price);
 $smarty->assign('outstock', $_REQUEST['outstock']);
 /* 分页 */
 $url_format = "search.php?category={$category}&amp;keywords=" . urlencode(stripslashes($_REQUEST['keywords'])) . "&amp;brand=" . $_REQUEST['brand'] . "&amp;action=" . $action . "&amp;goods_type=" . $_REQUEST['goods_type'] . "&amp;sc_ds=" . $_REQUEST['sc_ds'];
 if (!empty($intromode)) {
     $url_format .= "&amp;intro=" . $intromode;
 }
 if (isset($_REQUEST['pickout'])) {
     $url_format .= '&amp;pickout=1';
 }
 $url_format .= "&amp;min_price=" . $_REQUEST['min_price'] . "&amp;max_price=" . $_REQUEST['max_price'] . "&amp;sort={$sort}";
 $url_format .= "{$attr_url}&amp;order={$order}&amp;page=";
 $pager['search'] = array('keywords' => stripslashes(urlencode($_REQUEST['keywords'])), 'category' => $category, 'brand' => $_REQUEST['brand'], 'sort' => $sort, 'order' => $order, 'min_price' => $_REQUEST['min_price'], 'max_price' => $_REQUEST['max_price'], 'action' => $action, 'intro' => empty($intromode) ? '' : trim($intromode), 'goods_type' => $_REQUEST['goods_type'], 'sc_ds' => $_REQUEST['sc_ds'], 'outstock' => $_REQUEST['outstock']);
 $pager['search'] = array_merge($pager['search'], $attr_arg);
 $pager = get_pager('search.php', $pager['search'], $count, $page, $size);
 $pager['display'] = $display;
 $smarty->assign('url_format', $url_format);
 $smarty->assign('pager', $pager);
 assign_template();
 assign_dynamic('search');
 $position = assign_ur_here(0, $ur_here . ($_REQUEST['keywords'] ? '_' . $_REQUEST['keywords'] : ''));
 $smarty->assign('page_title', $position['title']);
 // 页面标题
 $smarty->assign('ur_here', $position['ur_here']);
 // 当前位置
 $smarty->assign('intromode', $intromode);
 $smarty->assign('categories', get_categories_tree());
 // 分类树
 $smarty->assign('helps', get_shop_help());
 // 网店帮助
开发者ID:a494008974,项目名称:bzbshop,代码行数:31,代码来源:search.php


示例8: CONCAT

 $where = " WHERE w.enabled = 1 AND CONCAT(',', w.rank_ids, ',') LIKE '" . '%,' . $_SESSION['user_rank'] . ',%' . "'";
 /* 取得批发商品总数 */
 $sql = "SELECT COUNT(*) FROM " . $ecs->table('wholesale') . " AS w " . $where;
 $count = $db->getOne($sql);
 if ($count > 0) {
     /* 取得每页记录数 */
     $size = isset($_CFG['page_size']) && intval($_CFG['page_size']) > 0 ? intval($_CFG['page_size']) : 10;
     /* 计算总页数 */
     $page_count = ceil($count / $size);
     /* 取得当前页 */
     $page = isset($_REQUEST['page']) && intval($_REQUEST['page']) > 0 ? intval($_REQUEST['page']) : 1;
     $page = $page > $page_count ? $page_count : $page;
     /* 取得当前页的批发商品 */
     $wholesale_list = wholesale_list($size, $page, $where);
     $smarty->assign('wholesale_list', $wholesale_list);
     $pager = get_pager('wholesale.php', array('act' => 'list'), $count, $page, $size);
     $smarty->assign('pager', $pager);
     /* 批发商品购物车 */
     $smarty->assign('cart_goods', isset($_SESSION['wholesale_goods']) ? $_SESSION['wholesale_goods'] : array());
 }
 /* 模板赋值 */
 assign_template();
 $position = assign_ur_here();
 $smarty->assign('page_title', $position['title']);
 // 页面标题
 $smarty->assign('ur_here', $position['ur_here']);
 // 当前位置
 $smarty->assign('categories', get_categories_tree());
 // 分类树
 $smarty->assign('helps', get_shop_help());
 // 网店帮助
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:wholesale.php


示例9: get_categories_tree

    $smarty->assign('categories', get_categories_tree());
    // 分类树
    $smarty->assign('top_goods', get_top10());
    // 销售排行
    $smarty->assign('cat_list', cat_list(0, 0, true, 2, false));
    $smarty->assign('brand_list', get_brand_list());
    $smarty->assign('promotion_info', get_promotion_info());
    $smarty->assign('enabled_mes_captcha', intval($_CFG['captcha']) & CAPTCHA_MESSAGE);
    $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('comment') . " WHERE STATUS =1 AND comment_type =0 ";
    $record_count = $db->getOne($sql);
    $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('feedback') . " WHERE `msg_area`='1' AND `msg_status` = '1' ";
    $record_count += $db->getOne($sql);
    /* 获取留言的数量 */
    $page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
    $pagesize = get_library_number('message_list', 'message_board');
    $pager = get_pager('message.php', array(), $record_count, $page, $pagesize);
    $msg_lists = get_msg_list($pagesize, $pager['start']);
    assign_dynamic('message_board');
    $smarty->assign('rand', mt_rand());
    $smarty->assign('msg_lists', $msg_lists);
    $smarty->assign('pager', $pager);
    $smarty->display('message_board.dwt');
}
/**
 * 获取留言的详细信息
 *
 * @param   integer $num
 * @param   integer $start
 *
 * @return  array
 */
开发者ID:jinjing1989,项目名称:wei,代码行数:31,代码来源:message.php


示例10: dirname

include_once dirname(__FILE__) . '/function.php';
$data = array();
$tab_type = 'items';
$data['ci_top_title'] = '物品';
$data['tab_type'] = $tab_type;
$data['tab_array'] = $tab_array;
$page = array_shift($args);
$page = intval($page) < 1 ? 1 : intval($page);
$limit = '48';
$start = ($page - 1) * $limit;
$uid = format_uid();
$items = lazy_get_data("select sql_calc_found_rows * from `global_user_items` where `uid` = '{$uid}' and `count` > 0 LIMIT {$start} , {$limit} ");
$all = get_count();
$base = '/app/native/ihome/items';
$page_all = ceil($all / $limit);
$data['pager'] = get_pager($page, $page_all, $base);
$data['list'] = array();
if ($items) {
    foreach ($items as $v) {
        $iid[] = $v['iid'];
        $count[$v['iid']] = $v['count'];
    }
    $items_info = lazy_get_data("select * from `global_items` where `id` IN(" . join(',', $iid) . ") ");
    if ($items_info) {
        foreach ($items_info as $v) {
            $v['count'] = $count[$v['id']];
            $data['list'][] = $v;
        }
    }
}
$data['baggage_count'] = count($data['list']);
开发者ID:yunsite,项目名称:easysns,代码行数:31,代码来源:items.php


示例11: get_widget_pager

function get_widget_pager($wid, $page, $page_all, $extra = NULL)
{
    $pid = _Page('pid');
    $base = 'JavaScript:ajax_widget_page( ' . intval($wid) . ' , ' . intval(_Page('cid')) . ' , ' . intval(_Page('pid')) . ', \'';
    $extra = $extra . "')";
    return get_pager($page, $page_all, $base, $extra);
}
开发者ID:yunsite,项目名称:easysns,代码行数:7,代码来源:lazy_helper.php


示例12: goodsByBrandId

	public function goodsByBrandId ()
	{
		$list = array();
	    if (!empty($_REQUEST['id'])) 
		{
	        $id = trim($_REQUEST['id']);
	        $page = !empty($_REQUEST['page']) ? intval(trim($_REQUEST['page'])) : 1;
	        $page_size = !empty($_REQUEST['page_size']) ? intval(trim($_REQUEST['page_size'])) : 10;
	        $orderStr = !empty($_REQUEST['orderStr']) ? trim($_REQUEST['orderStr']) : "shop_price";
	        $orderVal = !empty($_REQUEST['orderVal']) ? trim($_REQUEST['orderVal']) : "0";
	        //正序 倒叙排列
	        if ($orderVal == "0") 
			{
	            $order = "asc";
	        } else if ($orderVal == "1")
			{
	            $order = "desc";
	        }
	        $sql_count = "SELECT count(*) FROM " . $GLOBALS['ecs']->table('goods') . " where brand_id = " . $id ;
	        $record_count = $GLOBALS['db']->getOne($sql_count);
	        $page_count = ($record_count > 0) ? intval(ceil($record_count / $page_size)) : 1;
	        if($record_count>0)
			{
	                $sql = "SELECT goods_id,goods_name,promote_start_date,promote_end_date,promote_price,market_price,shop_price,goods_brief,goods_thumb,is_best,is_hot,is_new FROM " . $GLOBALS['ecs']->table('goods') . " as g where g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 and g.brand_id = " . $id . " order by " . $orderStr . " $order ";
	                $res = $GLOBALS['db']->selectLimit($sql, $page_size, ($page - 1) * $page_size);
	                $index = 0;
	                while($row =$GLOBALS['db']->fetchRow($res))
					{
						/* 促销时间倒计时 */
				        $time = gmtime();
				        if ($time >= $row['promote_start_date'] && $time <= $row['promote_end_date'])
				        {
				             $row['gmt_end_time']  = $row['promote_end_date'];
				        }
				        else
				        {
				            $row['gmt_end_time'] = 0;
				        }
	                    $arr[$index] = $row;
	                    $arr[$index]['format_market_price'] = price_format($row['market_price']);
	                    $arr[$index]['format_shop_price'] = price_format($row['shop_price']);
	                    $arr[$index]['format_promote_price'] = price_format($row['promote_price']);
	                    $index++;
	                }
	                $pager = get_pager('goods_list.php', array('act' => "goodsByBrandId"), $record_count, $page, $page_size);
	                if(!empty($arr))
					{
	                    $list['goods'] = $arr;
	                    $list['pager'] = $pager;
	                    
	                }
	        }
	    } 
	    jsonExit($list);
	}
开发者ID:noikiy,项目名称:mdwp,代码行数:55,代码来源:goods_list.action.php


示例13: isset

     //$integral_records = get_all_integral_records($user_id);
     //$smarty->assign('integral_records',$integral_records);
     $ctl = isset($_REQUEST['ctl']) ? $_REQUEST['ctl'] : '0';
     $smarty->assign('ctl', $ctl);
     $integralCondition = array();
     $integralCondition[] = array($user_id, ' 1 ', ' is_frozen=0 ');
     $integralCondition[] = array($user_id, 'type = 0', ' is_frozen=0 ');
     $integralCondition[] = array($user_id, 'type = 1', ' is_frozen=0 ');
     $integralCondition[] = array($user_id, 'type = 5', ' is_frozen=0 ');
     $integralCondition[] = array($user_id, ' 1 ', ' is_frozen=1 ');
     $integral_records_list = array();
     $all_pages = array();
     for ($i = 0; $i < 5; $i++) {
         $page = isset($_REQUEST["page{$i}"]) ? intval($_REQUEST["page{$i}"]) : 0;
         $record_count = get_integral_records_count($integralCondition[$i][0], $integralCondition[$i][1], $integralCondition[$i][2]);
         $all_pages[$i] = get_pager('user.php', array('act' => $action), $record_count, $page, 10, "page{$i}=", "&ctl={$i}", '#tab');
         $integral_records_list[$i] = get_integral_records($integralCondition[$i][0], $integralCondition[$i][1], $integralCondition[$i][2], $all_pages[$i]['size'], $all_pages[$i]['start']);
     }
     $smarty->assign('integral_records_list', $integral_records_list);
     $smarty->assign('all_pages', $all_pages);
     $smarty->assign('frozen_integral', get_frozen_integral($user_id));
     $smarty->display('user_clips.dwt');
 } elseif ($action == 'user_complain') {
     $order_id = $_REQUEST['order_id'];
     $type = $_REQUEST['type'];
     $content = $_REQUEST['content'];
     $captcha = $_REQUEST['captcha'];
     $now = gmtime();
     include_once 'includes/cls_captcha.php';
     $validator = new captcha($_SESSION['captcha_word']);
     if (!$validator->check_word($_POST['captcha'])) {
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:user.php


示例14: get_pager

            ?>
          </div>
        </div>
        <?php 
        }
        ?>
      </div>
      <?php 
    }
} else {
    echo "<div class=\"project-preview\">Ничего не найдено</div>";
}
?>
    </div>
    <?php 
print get_pager($pages, $page, "?p=list&fld={$folder}&page=");
?>
<script><?php 
if ($pages <= $page || !$prj_count) {
    ?>
function dprj(){}<?php 
} else {
    ?>
var prjc=<?php 
    echo $prj_count;
    ?>
;function dprj(){if(!(--prjc))window.location.href='?p=list&fld=<?php 
    echo $folder;
    ?>
&page=<?php 
    echo $page;
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:content_list.php


示例15: search

 function search($page = NULL, $searchtext = NULL)
 {
     $searchtext = urldecode($searchtext);
     $page = intval($page) < 1 ? 1 : intval($page);
     $start = intval(c('user_per_page')) * ($page - 1);
     $data['users'] = $this->user->get_users($start, $searchtext);
     $all = get_count();
     $page_all = ceil($all / intval(c('user_per_page')));
     $url_base = '/user/search';
     $data['action'] = 'search';
     $data['searchtext'] = $searchtext;
     $data['pager'] = get_pager($page, $page_all, $url_base, $searchtext);
     $this->view('ulist', $data);
 }
开发者ID:yunsite,项目名称:easysns,代码行数:14,代码来源:user.php


示例16: get_virtual_goods_list

/**
 * 获取虚拟商品列表
 * @param type $search
 * @return type
 */
function get_virtual_goods_list($search)
{
    $page = !empty($_REQUEST['page']) && intval($_REQUEST['page']) > 0 ? intval($_REQUEST['page']) : 1;
    $size = !empty($_CFG['page_size']) && intval($_CFG['page_size']) > 0 ? intval($_CFG['page_size']) : 8;
    $sort = empty($_REQUEST['sort']) ? $search['list_default_sort'] : trim($_REQUEST['sort']);
    $order = empty($_REQUEST['order']) ? 'DESC' : trim($_REQUEST['order']);
    $cat_id = $search['cat_id'];
    $catch_id = $search['catch_id'];
    $city_id = $search['city_id'];
    $county_id = $search['county_id'];
    $district_id = $search['district_id'];
    $where = '';
    $wherecat = '';
    //    if($cat_id != 0){
    //        $wherecat = " and cat_id = '$cat_id'";
    //    }
    //    if($cat_id != 0 && $catch_id != 0){
    //        $wherecat = " and cat_id = '$catch_id'";
    //    }
    if ($cat_id != 0) {
        if ($catch_id != 0) {
            $wherecat = " and cat_id = '{$catch_id}'";
        } else {
            $sql = "select distinct cat_id  from " . $GLOBALS['ecs']->table("category") . " where parent_id={$cat_id}";
            $cat_ids = $GLOBALS['db']->getCol($sql);
            if (empty($cat_ids)) {
                $cat_ids = array(0);
            }
            $wherecat = " and (cat_id = '{$cat_id}' or cat_id in (" . implode(',', $cat_ids) . "))";
        }
    }
    if ($city_id != 0) {
        $where .= " and city = '{$city_id}'";
    }
    if ($county_id != 0) {
        $where .= " and county= '{$county_id}'";
    }
    if ($district_id != 0) {
        $where .= " and district_id = {$district_id}";
    }
    $sql = "select distinct district_id from " . $GLOBALS['ecs']->table("virtual_goods_district") . " where 1 " . $where;
    $district_ids = $GLOBALS['db']->getAll($sql);
    $district_ids_array = array();
    foreach ($district_ids as $k => $v) {
        $district_ids_array[] = $v['district_id'];
    }
    if (empty($district_ids_array)) {
        $district_ids_array = array(0);
    }
    $sql = "select goods_id from " . $GLOBALS['ecs']->table("virtual_district") . " where district_id in (" . implode(',', $district_ids_array) . ")";
    $goods_ids = $GLOBALS['db']->getAll($sql);
    $goods_ids_array = array();
    foreach ($goods_ids as $k => $v) {
        $goods_ids_array[] = $v['goods_id'];
    }
    if (empty($goods_ids_array)) {
        $goods_ids_array = array(0);
    }
    $sql = "select count(*) from " . $GLOBALS['ecs']->table("goods") . " where is_on_sale='1' and is_delete = '0' and is_real='0' and extension_code = 'virtual_good' " . $wherecat . "  and goods_id in (" . implode(',', $goods_ids_array) . ")";
    $count = $GLOBALS['db']->getOne($sql);
    $max_page = $count > 0 ? ceil($count / $size) : 1;
    if ($page > $max_page) {
        $page = $max_page;
    }
    //$sql = "select * from ".$GLOBALS['ecs']->table("goods")." where is_delete = '0' and is_real='0' and extension_code = 'virtual_good' ".$wherecat."  and goods_id in (".implode(',',$goods_ids_array).") ORDER BY $sort $order";
    $sql = "select g.goods_id,g.goods_name,g.goods_number,g.supplier_id,g.cat_id,g.add_time,g.valid_date,g.last_update,g.shop_price,g.goods_thumb,ifnull(salenum,0) as salenum from " . $GLOBALS['ecs']->table("goods") . " as g left join (select goods_id,order_id, count(*) as salenum from " . $GLOBALS['ecs']->table("order_goods") . " group by goods_id) as og on og.goods_id = g.goods_id \r\n            left join (select order_id from " . $GLOBALS['ecs']->table("order_info") . " where order_status = '5') as oi on oi.order_id = og.order_id" . " where g.is_on_sale='1' and g.is_delete = '0' and g.is_real='0' and g.extension_code = 'virtual_good' " . $wherecat . "  and g.goods_id in (" . implode(',', $goods_ids_array) . ") ORDER BY {$sort} {$order}";
    $res = $GLOBALS['db']->selectLimit($sql, $size, ($page - 1) * $size);
    $virtual_goods = array();
    while ($goods_list = $GLOBALS['db']->fetchRow($res)) {
        $sql = "select supplier_id,supplier_name from " . $GLOBALS['ecs']->table("supplier") . " where supplier_id = " . $goods_list['supplier_id'];
        $supplier = $GLOBALS['db']->getRow($sql);
        $goods_list['supplier_name'] = $supplier['supplier_name'];
        $goods_list['add_time'] = date("Y-m-d H:i:s", $goods_list['add_time']);
        $goods_list['last_update'] = date("Y-m-d H:i:s", $goods_list['last_update']);
        $goods_list['valid_date'] = date("Y-m-d H:i:s", $goods_list['valid_date']);
        $goods_list['count1'] = selled_count($goods_list['goods_id']);
        $virtual_goods[] = $goods_list;
    }
    $pager = get_pager('virtual_group.php', array('act' => 'list', 'show' => 'goods'), $count, $page, $size);
    $pager['sort'] = $sort;
    $pager['order'] = $order;
    return array('pager' => $pager, 'virtual_goods' => $virtual_goods);
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:88,代码来源:virtual_group.php


示例17: _POST

        $rec_id = _POST('rec_id', 0);
        $add = '';
        if ($rec_id) {
            $add = " AND rec_id < {$rec_id} ";
        }
        $record_count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('collect_goods') . " WHERE user_id='{$user_id}' {$add}");
        $smarty->assign('goods_list', GZ_get_collection_goods($user_id, $page['count'], $page['page'], $rec_id));
        $smarty->assign('url', $ecs->url());
        $smarty->assign('user_id', $user_id);
        $data = array();
        foreach ($smarty->_var['goods_list'] as $key => $value) {
            $temp = API_DATA("SIMPLEGOODS", $value);
            $temp['rec_id'] = $value['rec_id'];
            $data[] = $temp;
        }
        $pager = get_pager('collection', array(), $record_count, $page['page'], $page['count']);
        GZ_Api::outPut($data, array("total" => $record_count, "count" => count($data), "more" => intval($pager['page_count'] > $pager['page'])));
        break;
    default:
        GZ_Api::outPut(101);
        break;
}
/**
 *  获取指定用户的收藏商品列表
 *
 * @access  public
 * @param   int     $user_id        用户ID
 * @param   int     $num            列表最大数量
 * @param   int     $start          列表其实位置
 *
 * @return  array   $arr
开发者ID:dx8719,项目名称:ECMobile_Universal,代码行数:31,代码来源:collect.php


示例18: get_category_recommend_goods

        $smarty->assign('vote', $vote['content']);
    }
    $smarty->assign('best_goods', get_category_recommend_goods('best', $children, $brand, $price_min, $price_max, $ext));
    $smarty->assign('promotion_goods', get_category_recommend_goods('promote', $children, $brand, $price_min, $price_max, $ext));
    $smarty->assign('hot_goods', get_category_recommend_goods('hot', $children, $brand, $price_min, $price_max, $ext));
    $count = get_cagtegory_goods_count($children, $brand, $price_min, $price_max, $ext);
    $max_page = $count > 0 ? ceil($count / $size) : 1;
    if ($page > $max_page) {
        $page = $max_page;
    }
    /*甜心100修改  分类页面为翻页模式*/
    $page = !empty($_REQUEST['page']) && intval($_REQUEST['page']) > 0 ? intval($_REQUEST['page']) : 1;
    $size = !empty($_CFG['page_size']) && intval($_CFG['page_size']) > 0 ? intval($_CFG['page_size']) : 10;
    $goodslist = category_get_goods($children, $brand, $price_min, $price_max, $ext, $size, $page, $sort, $order);
    $pager['search'] = array("id" => $cat_id);
    $pager = get_pager('category.php', $pager['search'], $count, $page, $size);
    /*甜心100修改  分类页面为翻页模式*/
    if ($display == 'grid') {
        if (count($goodslist) % 2 != 0) {
            $goodslist[] = array();
        }
    }
    $smarty->assign('pager', $pager);
    $smarty->assign('goods_list', $goodslist);
    $smarty->assign('category', $cat_id);
    $smarty->assign('script_name', 'category');
}
$smarty->display('category.dwt', $cache_id);
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
开发者ID:seanguo166,项目名称:microdistribution,代码行数:31,代码来源:category.php


示例19: COUNT

//shipped 待收货
//finished 历史订单
if (!in_array($type, array('await_pay', 'await_ship', 'shipped', 'finished', 'unconfirmed'))) {
    GZ_Api::outPut(101);
}
$record_count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('order_info') . " WHERE user_id = '{$user_id}'" . GZ_order_query_sql($type));
// $order_all = $db->getAll("SELECT * FROM ".$ecs->table('order_info')." WHERE user_id='$user_id'");
// foreach ($order_all[0] as $key => $val) {
//   if ($order_all[0][$key] == $order_all[1][$key]) {
//     unset($order_all[0][$key]);
//     unset($order_all[1][$key]);
//   }
// }
// $sql = "SELECT COUNT(*) FROM " .$ecs->table('order_info'). " WHERE user_id = '$user_id'". GZ_order_query_sql($type);
//  print_r($sql);exit;
$pager = get_pager('user.php', array('act' => $action), $record_count, $page, $page_parm['count']);
$orders = GZ_get_user_orders($user_id, $pager['size'], $pager['start'], $type);
// print_r($orders);exit;
foreach ($orders as $key => $value) {
    unset($orders[$key]['order_status']);
    $orders[$key]['order_time'] = formatTime($value['order_time']);
    $goods_list = GZ_order_goods($value['order_id']);
    //$orders[$key]['ss'] = $goods_list;
    $goods_list_t = array();
    // $goods_list = API_DATA("SIMPLEGOODS", $goods_list);
    foreach ($goods_list as $v) {
        $goods_list_t[] = array("goods_id" => $v['goods_id'], "name" => $v['goods_name'], "goods_number" => $v['goods_number'], "subtotal" => price_format($v['subtotal'], false), "formated_shop_price" => price_format($v['goods_price'], false), "img" => array('small' => API_DATA('PHOTO', $v['goods_thumb']), 'thumb' => API_DATA('PHOTO', $v['goods_img']), 'url' => API_DATA('PHOTO', $v['original_img'])));
    }
    $orders[$key]['goods_list'] = $goods_list_t;
    $order_detail = get_order_detail($value['order_id'], $user_id);
    $orders[$key]['formated_integral_money'] = $order_detail['formated_integral_money'];
开发者ID:dx8719,项目名称:ECMobile_Universal,代码行数:31,代码来源:list.php


示例20: session_start

 * $Author: liubo $
 * $Id: user.php 16643 2009-09-08 07:02:13Z liubo $
*/
session_start();
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
/* 载入语言文件 */
require_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/user.php';
if ($_SESSION['user_id'] > 0) {
    $smarty->assign('user_name', $_SESSION['user_name']);
}
include_once ROOT_PATH . 'includes/lib_clips.php';
$page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
$user_id = $_SESSION['user_id'];
$record_count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('collect_goods') . " WHERE user_id='{$user_id}' ORDER BY add_time DESC");
$pager = get_pager('favorites.php', array(), $record_count, $page);
$smarty->assign('pager', $pager);
$smarty->assign('goods_list', get_collection_goods($user_id, $pager['size'], $pager['start']));
$username = isset($_POST['username']) ? trim($_POST['username']) : '';
$smarty->assign('shop_name', $GLOBALS['_CFG']['shop_name']);
$smarty->assign('shop_address', $GLOBALS['_CFG']['shop_address']);
$smarty->assign('qq', $GLOBALS['_CFG']['qq']);
$smarty->assign('ww', $GLOBALS['_CFG']['ww']);
$smarty->assign('skype', $GLOBALS['_CFG']['skype']);
$smarty->assign('ym', $GLOBALS['_CFG']['ym']);
$smarty->assign('msn', $GLOBALS['_CFG']['msn']);
$smarty->assign('service_email', $GLOBALS['_CFG']['service_email']);
$smarty->assign('service_phone', $GLOBALS['_CFG']['service_phone']);
$act = isset($_GET['act']) ? $_GET['act'] : '';
/* 用户中心 */
if ($_SESSION['user_id'] > 0) {
开发者ID:will0306,项目名称:bianli100,代码行

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_pages函数代码示例发布时间:2022-05-15
下一篇:
PHP get_pagenum_link函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap