当前位置: 首页>>代码示例>>PHP>>正文


PHP getpage函数代码示例

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


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

示例1: getDetailsList

 public function getDetailsList()
 {
     $m = M("AccessTraceDetails");
     $startDate = $_POST["start_date"];
     $endDate = $_POST["end_date"];
     $where = null;
     if ($startDate != null) {
         $where = "date(thedate) >= date('" . $startDate . "')";
         $this->assign("startDate", $startDate);
     }
     if ($endDate != null) {
         if ($where == null) {
             $where = "date(thedate) <= date('" . $endDate . "')";
         } else {
             $where = $where . " and date(thedate) <= date('" . $endDate . "')";
         }
         $this->assign("endDate", $endDate);
     }
     $Page = getpage($m, $where, C("LIST_PAGE_SIZE"));
     $limit = $Page->firstRow . ',' . $Page->listRows;
     $msglist = $m->where($where)->order("thedate desc")->limit($limit)->select();
     $this->assign("list", $msglist);
     $show = $Page->show();
     $this->assign("page", $show);
     $this->display();
 }
开发者ID:vistajin,项目名称:dmx-php,代码行数:26,代码来源:AccessTraceController.class.php

示例2: index

 /**
  * [articleList 文章列表页]
  * @return [type] [description]
  */
 public function index()
 {
     $arr = I();
     $article = M('article');
     $currenCategory = $_SERVER['CATEGORY'];
     $articleCategory = M('article_category');
     $articleCategorys = $articleCategory->select();
     $where = array('is_show' => '1', 'is_del' => '0');
     if ($arr['category']) {
         $where['category_id'] = $arr['category'];
     }
     // $list = $article->where($where)->order('createtime')->select();
     $listHot = $article->where(array('is_show' => '1', 'is_del' => '0'))->order('visit_num desc')->limit(0, 5)->select();
     $count = $article->where($where)->count();
     // 查询满足要求的总记录数
     $page = getpage($count, 10);
     $page->route = 'article';
     $list = $article->where($where)->limit($page->firstRow . ',' . $page->listRows)->order('is_top desc')->select();
     $this->assign('currenCategory', $currenCategory);
     $this->assign('categorys', $articleCategorys);
     $this->assign('page', $page->show());
     $this->assign('list', $list);
     $this->assign('listHot', $listHot);
     $this->display();
 }
开发者ID:a410202049,项目名称:wederful,代码行数:29,代码来源:ArticleController.class.php

示例3: getpage

function getpage($dmn, $username, $password, $url)
{
    if (!preg_match('#http://(.*?)/wp-admin/$#', $url, $re)) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
        curl_setopt($ch, CURLOPT_TIMEOUT, 60);
        curl_setopt($ch, CURLOPT_HEADER, true);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
        curl_setopt($ch, CURL_COOKIEFILE, '');
        curl_setopt($ch, CURLOPT_REFERER, $url);
        $postdata = "log=" . $username . "&pwd=" . $password . "&wp-submit=Log%20In&redirect_to=" . $dmn . "/wp-admin/&testcookie=1";
        curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
        curl_setopt($ch, CURLOPT_POST, 1);
        $a = curl_exec($ch);
        curl_close($ch);
        if (preg_match('#Location: (.*)#', $a, $r)) {
            $l = trim($r[1]);
            return getpage($dmn, $username, $password, $l);
        }
        $rt = '<no>' . $url . '</no>';
    } else {
        $rt = '<ok>' . $url . '</ok>';
    }
    return $rt;
}
开发者ID:kanvasamsterdam,项目名称:deploykanvas,代码行数:28,代码来源:bepro_ajax.php

示例4: index

 public function index()
 {
     $order = M("order");
     $System = I("get.System");
     //需要调出的字符串
     $needField = array("tp_contact.ordernum", "tp_contact.name", "tp_contact.phone", "tp_contact.address", "tp_order.payment", "tp_order.word", "tp_order.status", "tp_order.expressnum", "tp_order.expressname", "tp_order.id as orderid", "tp_order.num", "tp_order.total", "tp_order.ordertime", "tp_order.client", "tp_order.operator", "tp_products.productname", "tp_products.producttype", "tp_products.price", "tp_orderlist.ordstatus");
     $count = $order->join(array("LEFT JOIN __CONTACT__ ON __CONTACT__.ordernum=__ORDER__.ordernum", "LEFT JOIN __PRODUCTS__ ON __PRODUCTS__.id =__ORDER__.productid"))->count();
     $p = getpage($count, 4);
     $data = $order->field($needField)->join(array("LEFT JOIN __CONTACT__ ON __CONTACT__.ordernum=__ORDER__.ordernum", "LEFT JOIN __PRODUCTS__ ON __PRODUCTS__.id=__ORDER__.productid", "LEFT JOIN __ORDERLIST__ ON __ORDERLIST__.ordid=__ORDER__.ordernum"))->order('ordertime')->limit($p->firstRow, $p->listRows)->select();
     //拼合相同的訂單
     foreach ($data as $v) {
         if ($v["ordernum"]) {
             //合并订单号 ,将相同订单的 合并在同一个数组中
             $test[$v["ordernum"]][] = $v;
         }
         if ($v["total"]) {
             $total[$v["ordernum"]] += $v["total"];
         }
     }
     //$this->assign('data',$data);// 赋值数据集$this->assign('page',$show);// 赋值分页输出
     $this->assign('test', $test);
     // 赋值数据集$this->assign('page',$show);// 赋值分页输出
     $this->assign('total', $total);
     // 赋值数据集$this->assign('page',$show);// 赋值分页输出
     $this->assign('show', $p->show());
     // 赋值数据集$this->assign('page',$show);// 赋值分页输出
     $this->display();
 }
开发者ID:99peiyuan,项目名称:TP,代码行数:28,代码来源:UserController.class.php

示例5: index

 public function index()
 {
     $_scene = M('upfilesys');
     $scenetype = intval(I('get.filetype', 0));
     $where['filetype_int'] = $scenetype;
     $filename_varchar = trim(I('post.filename_varchar'));
     if ($filename_varchar) {
         $where['filename_varchar'] = array('like', '%' . $filename_varchar . '%');
     }
     $order = 'fileid_bigint';
     if (I('post.order')) {
         $order = I('post.order');
     }
     $count = $_scene->where($where)->count();
     $p = getpage($count, 10);
     $list = $_scene->where($where)->order($order . ' desc')->limit($p->firstRow, $p->listRows)->select();
     // echo D('')->getLastSql();exit;
     //print_r($list);
     $this->assign('select', $list);
     $this->assign('page', $p->show());
     $this->assign('filetype_int', $scenetype);
     $this->assign('filename_varchar', $filename_varchar);
     $this->assign('order', $order);
     // var_export($list);
     //echo C('TEST_ADMIN_ID');
     $this->display($display);
 }
开发者ID:sdgdsffdsfff,项目名称:html5Editor,代码行数:27,代码来源:UpfilesysController.class.php

示例6: content

 public function content()
 {
     $title = I('get.title');
     $host = I('get.host');
     $_SESSION['title'] = $title;
     $_SESSION['host'] = $host;
     $this->assign('title', $title);
     $this->assign('host', $host);
     //分页
     $m = M('message');
     $where['title'] = $title;
     $count = $m->where($where)->count();
     $p = getpage($count, 20);
     $list = $m->field(true)->where($where)->order('id')->limit($p->firstRow, $p->listRows)->select();
     $this->assign('select', $list);
     // 赋值数据集
     $this->assign('page', $p->show());
     // 赋值分页输出
     $num = 1;
     $this->assign('num', $num);
     $this->assign('count', $count);
     //分页
     if ($count == 0) {
         $where['title'] = $title;
         $data = M('title')->where($where)->delete();
         $this->success("", U('Home/Message/message', '', ''));
     }
     $this->display('content');
 }
开发者ID:Hennessy-zhao,项目名称:Blog-,代码行数:29,代码来源:ContentController.class.php

示例7: findurl

function findurl($keywords)
{
    $find = '鲁大学生网';
    $url_tmpl = "http://www.baidu.com/s?word=%s&pn=%d";
    $result = array();
    foreach ($keywords as $k => $v) {
        $i = 0;
        while ($i <= 1000) {
            $url = sprintf($url_tmpl, urlencode($v), $i);
            $contents = trimall(getpage($url));
            $pattern = '/title":"' . $find . '(.*?)url":"(.*?)"/si';
            preg_match($pattern, $contents, $matches);
            $site_url = isset($matches[2]) ? $matches[2] : null;
            if ($site_url) {
                $ua = getua();
                $page_content = getpage($site_url, array('ua' => $ua));
                $result[] = array('page' => $i / 10 + 1, 'keyword' => $v, 'url' => $site_url);
                break;
            } else {
                $i += 10;
            }
        }
    }
    return $result;
}
开发者ID:ldsn,项目名称:spider,代码行数:25,代码来源:func.php

示例8: result

 /**
 * 查找结果
 * @date: 2016-2-01 上午06:49:55
 * @author: zhouqg
 * @param: variable
 * @return:
 */
 public function result()
 {
     //**分类id
     $keyword = I('post.keywords');
     $where['news_title'] = array('like', "%{$keyword}%");
     $this->assign('keyword', $keyword);
     //新闻中心
     $m = D('News');
     $where['news_del'] = '0';
     $order = 'news_sort,news_addtime desc';
     $result = D('News')->where($where)->order($order)->relation(true)->select();
     //分页
     $count = count($result);
     // 查询满足要求的总记录数
     $Page = getpage($count, '25');
     $show = $Page->show();
     // 分页显示输出
     $this->assign('page', $show);
     // 赋值分页输出
     $result = D('News')->where($where)->order($order)->limit($Page->firstRow . ',' . $Page->listRows)->relation(true)->select();
     foreach ($result as $k => $v) {
         $result[$k]['url'] = __APP__ . '/News/detail/id/' . $v['id'];
     }
     $this->assign('newsList', $result);
     $this->display();
 }
开发者ID:zqge,项目名称:eplus,代码行数:33,代码来源:SearchController.class.php

示例9: index

 /**
  * [contentManage 文章内容列表页]
  * @return [type] [description]
  */
 public function index()
 {
     $arr = I();
     $table = M('article');
     $articleCategory = M('article_category');
     $where = array('is_del' => 0);
     if ($arr['search']) {
         $where['title'] = array('like', "%" . $arr['search'] . "%");
     }
     if ($arr['categoryid']) {
         $where['category_id'] = $arr['categoryid'];
     }
     $articleCategorys = $articleCategory->select();
     $count = $table->where($where)->count();
     $pagesize = C('BACKEND_PAGESIZE');
     $page = getpage($count, $pagesize);
     $result = $table->where($where)->order('createtime desc')->limit($page->firstRow . ',' . $page->listRows)->select();
     foreach ($result as $key => $value) {
         $category = $articleCategory->where(array('id' => $value['category_id']))->find();
         $result[$key]['categoryName'] = $category['name'];
     }
     $nowPage = $arr['p'] && $arr['p'] > 1 ? $arr['p'] : 1;
     $totalSize = $count;
     $totalPage = ceil($count / $pagesize);
     $this->assign('page', $page->show());
     $this->assign('search', $arr['search']);
     $this->assign('categoryid', $arr['categoryid']);
     $this->assign('categorys', $articleCategorys);
     $this->assign('nowPage', $nowPage);
     $this->assign('result', $result);
     // 赋值数据集
     $this->assign('totalSize', $totalSize);
     $this->assign('totalPage', $totalPage);
     $this->display();
 }
开发者ID:a410202049,项目名称:wederful,代码行数:39,代码来源:ArticleController.class.php

示例10: index

 public function index()
 {
     $arr = I();
     $pagesize = C('BACKEND_PAGESIZE');
     $package = M('package');
     $product = M('product');
     $category = D('ProductCategory');
     $vendors = D('vendors');
     $destination = M('destination');
     $destinations = $destination->select();
     $where = "where p.is_del=0 ";
     if ($arr['search']) {
         $where .= "and p.name like '%" . $arr['search'] . "%' ";
         // $where['name']=array('like',"%".$arr['search']."%");
     }
     if ($arr['categoryid']) {
         $where .= "and pro.category_id =" . $arr['categoryid'] . " ";
         $relat = M('vendorsCategoryRelation');
         $data = $relat->where(array('category_id' => $arr['categoryid']))->select();
         foreach ($data as $k => $v) {
             $vdata = $vendors->where(array('id' => $v['vendors_id']))->find();
             $vendorsArr[] = $vdata;
         }
     }
     if ($arr['vendorid']) {
         $where .= " and v.id =" . $arr['vendorid'];
     }
     if ($arr['order']) {
         $where .= " order by p.price " . $arr['order'];
     }
     if ($arr['area']) {
         $where .= " and p.area_id =" . $arr['area'];
     }
     $dao = M();
     $countData = $dao->query("SELECT count(*) as count from package as p LEFT JOIN product as pro on p.product_id = pro.id LEFT JOIN vendors as v on pro.vendors_id = v.id LEFT JOIN product_category as cate on cate.id = pro.category_id " . $where);
     $count = $countData[0]['count'];
     $page = getpage($count, $pagesize);
     $where .= ' limit ' . $page->firstRow . ',' . $page->listRows;
     $data = $dao->query("SELECT cate.name as categoryname,p.*,pro.category_id as categoryid ,pro.id as proid,pro.name as proname,v.name as vendorname from package as p LEFT JOIN product as pro on p.product_id = pro.id LEFT JOIN vendors as v on pro.vendors_id = v.id LEFT JOIN product_category as cate on cate.id = pro.category_id " . $where);
     $category = D('ProductCategory');
     $categorys = $category->where(array('parent_id' => 0))->select();
     $nowPage = $arr['p'] && $arr['p'] > 1 ? $arr['p'] : 1;
     $totalSize = $count;
     $totalPage = ceil($count / $pagesize);
     $this->assign('areaid', $arr['area']);
     $this->assign('destinations', $destinations);
     $this->assign('order', $arr['order']);
     $this->assign('page', $page->show());
     $this->assign('categorys', $categorys);
     $this->assign('totalSize', $totalSize);
     $this->assign('totalPage', $totalPage);
     $this->assign('nowPage', $nowPage);
     $this->assign('keywords', $arr['search']);
     $this->assign('categoryid', $arr['categoryid']);
     $this->assign('packageData', $data);
     $this->assign('vendorsArr', $vendorsArr);
     $this->assign('vendorid', $arr['vendorid']);
     $this->display();
 }
开发者ID:a410202049,项目名称:wederful,代码行数:59,代码来源:GoodsController.class.php

示例11: Index

 function Index()
 {
     $Advisory = M("advisory");
     $count = $Advisory->count();
     $p = getpage($count, 8);
     $data = $Advisory->order("lefttime desc")->limit($p->firstRow, $p->listRows)->select();
     $this->assign("data", $data);
     $this->assign("show", $p->show());
     $this->display();
 }
开发者ID:99peiyuan,项目名称:TP,代码行数:10,代码来源:AdvisoryController.class.php

示例12: index

 /**
  * [serviceManage 服务项管理]
  * @return [type] [description]
  */
 public function index()
 {
     $arr = I();
     $table = M('product');
     $package = M('package');
     $vendors = M('vendors');
     $where = array('is_del' => '0');
     $pagesize = C('BACKEND_PAGESIZE');
     $vendorsArr = array();
     if ($arr['categoryid']) {
         $relat = M('vendorsCategoryRelation');
         $data = $relat->where(array('category_id' => $arr['categoryid']))->select();
         foreach ($data as $k => $v) {
             $vdata = $vendors->where(array('id' => $v['vendors_id']))->find();
             $vendorsArr[] = $vdata;
         }
         $where['category_id'] = $arr['categoryid'];
     }
     if ($arr['search']) {
         $where['name'] = array('like', "%" . $arr['search'] . "%");
     }
     if ($arr['vendorid']) {
         $where['vendors_id'] = $arr['vendorid'];
     }
     $count = $table->where($where)->count();
     $page = getpage($count, $pagesize);
     $result = $table->where($where)->limit($page->firstRow . ',' . $page->listRows)->select();
     $category = D('ProductCategory');
     $categorys = $category->where(array('parent_id' => 0))->select();
     $totalPage = ceil($count / $pagesize);
     $totalSize = $count;
     $nowPage = $arr['p'] && $arr['p'] > 1 ? $arr['p'] : 1;
     foreach ($result as $key => $value) {
         $cid = $value['category_id'];
         $vid = $value['vendors_id'];
         $cate = $category->where(array('id' => $cid))->find();
         $vendor = $vendors->where(array('id' => $vid))->find();
         $result[$key]['categoryName'] = $cate['name'];
         $result[$key]['vendorName'] = $vendor['name'];
         $packageCount = $package->where(array('product_id' => $value['id'], 'is_del' => '0', 'is_show' => '1'))->count();
         $result[$key]['packageCount'] = $packageCount;
     }
     $this->assign('page', $page->show());
     $this->assign('keywords', $arr['search']);
     $this->assign('vendorsArr', $vendorsArr);
     $this->assign('result', $result);
     // 赋值数据集
     $this->assign('nowPage', $nowPage);
     $this->assign('categorys', $categorys);
     $this->assign('totalSize', $totalSize);
     $this->assign('totalPage', $totalPage);
     $this->assign('categoryid', $arr['categoryid']);
     $this->assign('vendorid', $arr['vendorid']);
     $this->display();
 }
开发者ID:a410202049,项目名称:wederful,代码行数:59,代码来源:ServiceController.class.php

示例13: All

 function All()
 {
     //默认显示全部
     $products = M("products");
     $count = $products->count();
     $p = getpage($count, 8);
     $data = $products->order('uptime')->limit($p->firstRow, $p->listRows)->select();
     $this->assign("data", $data);
     $this->assign("show", $p->show());
     $this->display();
 }
开发者ID:99peiyuan,项目名称:TP,代码行数:11,代码来源:ProductController.class.php

示例14: Index

 public function Index()
 {
     $news = M("news");
     $count = $news->count();
     $p = getpage($count, 8);
     $newsData = $news->order("pushtime desc")->limit($p->firstRow, $p->listRows)->select();
     $this->assign('show', $p->show());
     // 赋值数据集$this->assign('page',$show);// 赋值分页输出
     $this->assign("newsData", $newsData);
     $this->display();
 }
开发者ID:99peiyuan,项目名称:TP,代码行数:11,代码来源:NewsController.class.php

示例15: goodsManage

 public function goodsManage()
 {
     $arr = I();
     $pagesize = C('BACKEND_PAGESIZE');
     $table = M('product');
     $where = array('is_del' => 0);
     if ($arr['search']) {
         $where['name'] = array('like', "%" . $arr['search'] . "%");
     }
     if ($arr['countryid']) {
         $destination = M('destination');
         $condition = array('parent_id' => $arr['countryid'], 'type_id' => '1');
         $cityList = $destination->field('id,name')->where($condition)->select();
         $this->assign('cityList', $cityList);
         $cityId = array();
         foreach ($cityList as $key => $value) {
             $cityId[] = $value['id'];
         }
         $where['destination_id'] = array('in', $str);
         if ($cityId) {
             $where['destination_id'] = array('in', $cityId);
         } else {
             $where['destination_id'] = $arr['countryid'];
         }
         $this->assign('countryid', $arr['countryid']);
     }
     if ($arr['destinationid']) {
         $where['destination_id'] = $arr['destinationid'];
         $this->assign('destinationid', $arr['destinationid']);
     }
     $count = $table->where($where)->count();
     $page = getpage($count, $pagesize);
     $result = $table->where($where)->order('createtime desc')->limit($page->firstRow . ',' . $page->listRows)->select();
     $dao = M();
     foreach ($result as $k => $v) {
         $price = $dao->query("SELECT min(price) as price from package where product_id = '%s'", $v['id']);
         $result[$k]['startPrice'] = $price[0]['price'];
     }
     $nowPage = $arr['p'] && $arr['p'] > 1 ? $arr['p'] : 1;
     $totalSize = $count;
     $totalPage = ceil($count / $pagesize);
     $destination = M('destination');
     $countryCondition = array('type_id' => '0');
     $destinationData = $destination->where($countryCondition)->select();
     $this->assign('destinationData', $destinationData);
     $this->assign('result', $result);
     // 赋值数据集
     $this->assign('nowPage', $nowPage);
     $this->assign('totalSize', $totalSize);
     $this->assign('totalPage', $totalPage);
     $this->assign('keywords', $arr['search']);
     $this->assign('page', $page->show());
     $this->display();
 }
开发者ID:a410202049,项目名称:wederful,代码行数:54,代码来源:IndexController.class.php


注:本文中的getpage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。