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();
 }
 /**
  * [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();
 }
Ejemplo n.º 3
0
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;
}
Ejemplo n.º 4
0
 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();
 }
 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);
 }
 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');
 }
Ejemplo n.º 7
0
Archivo: func.php Proyecto: ldsn/spider
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;
}
Ejemplo n.º 8
0
 /**
 * 查找结果
 * @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();
 }
 /**
  * [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();
 }
Ejemplo n.º 10
0
 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();
 }
Ejemplo n.º 11
0
 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();
 }
Ejemplo n.º 12
0
 /**
  * [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();
 }
Ejemplo n.º 13
0
 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();
 }
Ejemplo n.º 14
0
 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();
 }
Ejemplo n.º 15
0
 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();
 }
Ejemplo n.º 16
0
 public function msglist()
 {
     $m = M("Message");
     $where = null;
     $Page = getpage($m, $where, C("LIST_PAGE_SIZE"));
     $limit = $Page->firstRow . ',' . $Page->listRows;
     $msglist = $m->where($where)->order("submit_time desc")->limit($limit)->select();
     $this->assign("list", $msglist);
     $show = $Page->show();
     $this->assign("page", $show);
     $this->display();
 }
Ejemplo n.º 17
0
 public function sellerList()
 {
     $m = M("Seller");
     $where = null;
     $Page = getpage($m, $where, C("LIST_PAGE_SIZE"));
     $limit = $Page->firstRow . ',' . $Page->listRows;
     $list = $m->where($where)->order("oseq desc, name")->limit($limit)->select();
     $this->assign("list", $list);
     $show = $Page->show();
     $this->assign("page", $show);
     $this->display();
 }
 public function admin()
 {
     $m = M('admin');
     $where = array();
     $count = $m->where($where)->count();
     $p = getpage($count, 16);
     $list = $m->field(true)->where($where)->order('USERID ASC')->limit($p->firstRow, $p->listRows)->select();
     $this->assign('select', $list);
     $this->assign('page', $p->show());
     // var_export($list);
     //echo C('TEST_ADMIN_ID');
     $this->display();
 }
Ejemplo n.º 19
0
 /**
 * 文章内容
 * @date: 2016-2-01 上午06:49:55
 * @author: zhouqg
 * @param: variable
 * @return:
 */
 public function group()
 {
     //**分类id
     $id = I('get.id');
     if (!preg_match('/^\\d+$/i', $id)) {
         $this->error('url参数错误');
         exit;
         //仿制用户恶意输出url参数
     }
     //新闻中心
     $where = null;
     $m = D('News');
     $where['news_del'] = '0';
     $where['column_id'] = $id;
     $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);
     //获取上下级栏目
     $m = D('Column')->order('column_sort ASC')->relation(true)->select();
     //$m=Category::getChilds($m,$id);//获取id所有的下级栏目的信息
     $m = Category::getParents($m, $id);
     //获取id所有的下级栏目的信息
     foreach ($m as $k => $v) {
         $m[$k]['url'] = __APP__ . '/News/group/id/' . $v['id'];
     }
     $this->assign('clist', $m);
     //相关列表
     $m = D('News');
     $where['news_del'] = '0';
     $where['id'] = array('neq', $id);
     $order = 'news_sort,news_updatetime desc';
     $list = $m->where($where)->order($order)->limit('10')->relation(true)->select();
     foreach ($list as $k => $v) {
         $list[$k]['url'] = __APP__ . '/News/detail/id/' . $v['id'];
     }
     $this->assign('vlist', $list);
     $this->display();
 }
 /**
  * [providerManage 服务商管理]
  * @return [type] [description]
  */
 public function index()
 {
     $arr = I();
     $vendors = M('vendors');
     $relation = M('vendorsCategoryRelation');
     $table = D('ProductCategory');
     $categorys = $table->where(array('parent_id' => 0))->select();
     $pagesize = C('BACKEND_PAGESIZE');
     $where = array();
     if ($arr['search']) {
         $where['name'] = array('like', "%" . $arr['search'] . "%");
         $str = " and name like '%" . $arr['search'] . "%'";
     }
     if ($arr['categoryid']) {
         $dao = M();
         $data = $dao->query("SELECT * from vendors where id in (SELECT vendors_id from vendors_category_relation where category_id = '%s') ", $arr['categoryid']);
         $count = count($data);
         $page = getpage($count, $pagesize);
         $result = $dao->query("SELECT * from vendors where id in (SELECT vendors_id from vendors_category_relation where category_id = '%s') limit %s,%s", $arr['categoryid'], $page->firstRow, $page->listRows);
     } else {
         $count = $vendors->where($where)->count();
         $page = getpage($count, $pagesize);
         $result = $vendors->where($where)->limit($page->firstRow . ',' . $page->listRows)->select();
     }
     foreach ($result as $key => $value) {
         $condition = array('vendors_id' => $value['id']);
         $relat = $relation->where($condition)->select();
         $str = "";
         foreach ($relat as $k => $v) {
             $cid = $v['category_id'];
             $category = $table->where(array('id' => $cid))->find();
             $str .= $category['name'] . ',';
         }
         $str = substr($str, 0, -1);
         $result[$key]['category'] = $str;
     }
     $totalPage = ceil($count / $pagesize);
     $totalSize = $count;
     $nowPage = $arr['p'] && $arr['p'] > 1 ? $arr['p'] : 1;
     $this->assign('page', $page->show());
     $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('keywords', $arr['search']);
     $this->display();
 }
Ejemplo n.º 21
0
 public function message()
 {
     //分页
     $m = M('title');
     $where = "id>0";
     $count = $m->where($where)->count();
     $p = getpage($count, 20);
     $list = $m->field(true)->where($where)->order('id desc')->limit($p->firstRow, $p->listRows)->select();
     $this->assign('select', $list);
     // 赋值数据集
     $this->assign('page', $p->show());
     // 赋值分页输出
     //分页
     $this->display('message');
 }
Ejemplo n.º 22
0
function getpage($url)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    $a = curl_exec($ch);
    curl_close($ch);
    if (preg_match('#Location: (.*)#', $a, $r)) {
        $l = trim($r[1]);
        return getpage($l);
    }
    return $a;
}
 public function auctionGoodsList()
 {
     $m = M("AuctionGoods");
     $where = null;
     $Page = getpage($m, $where, C("LIST_PAGE_SIZE"));
     $limit = $Page->firstRow . ',' . $Page->listRows;
     $msglist = $m->where($where)->order("update_time desc")->limit($limit)->select();
     $this->assign("list", $msglist);
     $show = $Page->show();
     $this->assign("page", $show);
     // 为了在列表把category的数字ID转换成文字
     self::getProductCategory();
     $this->assign("goodsStatusList", C("goodsStatus"));
     $this->display();
 }
Ejemplo n.º 24
0
 public function getList($category)
 {
     $m = M("RichText");
     $where["category"] = $category;
     $Page = getpage($m, $where, C("LIST_PAGE_SIZE"));
     $limit = $Page->firstRow . ',' . $Page->listRows;
     $list = $m->where($where)->limit($limit)->order("isShow desc, seq")->select();
     $show = $Page->show();
     $this->assign("page", $show);
     $this->assign("rtlist", $list);
     $this->assign("category", $category);
     $this->assign("categoryText", C($category));
     $this->assign("nowPage", $Page->nowPage);
     $this->assign("totalPages", $Page->totalPages);
     $this->display();
 }
 public function index()
 {
     if (!defined('VIRIFY')) {
         aboutaa();
     }
     $m = M('users');
     $where = array();
     $count = $m->where($where)->count();
     $p = getpage($count, 16);
     $list = $m->field(true)->where($where)->order('create_time desc')->limit($p->firstRow, $p->listRows)->select();
     $this->assign('select', $list);
     $this->assign('page', $p->show());
     //var_export($list);
     //echo C('TEST_ADMIN_ID');
     $this->display();
 }
 public function index()
 {
     if (!defined('VIRIFY')) {
         aboutaa();
     }
     $m = M('cate');
     $type = I('get.filetype', 'bgType');
     $where = array('type' => $type);
     $count = $m->where($where)->count();
     $p = getpage($count, 16);
     $list = $m->field(true)->where($where)->order('create_time desc')->limit($p->firstRow, $p->listRows)->select();
     $this->assign('select', $list);
     $this->assign('page', $p->show());
     $this->assign('type', $type);
     $this->display();
 }
Ejemplo n.º 27
0
 public function index()
 {
     $this->meta_title = '文章首页';
     $Article = M('article');
     // 实例化Article数据表
     $count = $Article->count();
     $show = getpage($count, 4);
     // 分页显示输出,调用公共函数getpage
     //$orderby['num']='desc';
     $list = $Article->order('num')->limit($show->firstRow, $show->listRows)->select();
     $this->assign('list', $list);
     // 赋值数据集
     $this->assign('page', $show->show());
     // 赋值分页输出
     $this->display();
     // 输出模板
 }
Ejemplo n.º 28
0
function getStreamInfo()
{
    $str = getpage(SERVER . '/admin/listclients.xsl?mount=/' . M1);
    $ips = '';
    if (preg_match_all('/\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b/isU', $str, $match1)) {
        foreach ($match1[0] as $key => $value) {
            $ips = $ips . $value . ',';
        }
    }
    $str2 = getpage(SERVER . '/admin/listclients.xsl?mount=/' . M2);
    if (preg_match_all('/\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b/isU', $str2, $match2)) {
        foreach ($match2[0] as $key => $value) {
            $ips = $ips . $value . ',';
        }
    }
    return $ips;
}
Ejemplo n.º 29
0
 function NewsList()
 {
     //显示列表
     $News = M("News");
     $Host = $_SERVER['HTTP_HOST'];
     $Info = BottomInfo($Host);
     list($Company, $ICP, $MonitorCode) = $Info;
     $this->assign("Company", $Company);
     $this->assign("ICP", $ICP);
     $this->assign("MonitorCode", $MonitorCode);
     //不需要调出  content内容。浪费资源
     $count = $News->count();
     $p = getpage($count, 10);
     $data = $News->Field("content", True)->order("pushtime desc")->limit($p->firstRow, $p->listRows)->select();
     $this->assign("data", $data);
     $this->assign("show", $p->show());
     $this->display("list");
 }
Ejemplo n.º 30
0
 public function adsList($category)
 {
     $m = M("Ads");
     $where["category"] = $category;
     $Page = getpage($m, $where, C("LIST_PAGE_SIZE"));
     $limit = $Page->firstRow . ',' . $Page->listRows;
     $joinStr = "think_seller on think_seller.uid = think_ads.seller_uid";
     $fields = "think_seller.name as name, think_ads.isShow as isShow, think_ads.category as category, think_ads.uid as uid";
     $list = $m->join($joinStr)->where($where)->field($fields)->limit($limit)->order("isShow desc, seq")->select();
     $show = $Page->show();
     $this->assign("page", $show);
     $this->assign("rtlist", $list);
     $this->assign("category", $category);
     $this->assign("categoryText", C($category));
     $this->assign("nowPage", $Page->nowPage);
     $this->assign("totalPages", $Page->totalPages);
     $this->display();
 }