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

PHP getPage函数代码示例

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

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



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

示例1: getPager

 /**
 *     功能:
      *       by:
      *     参数:
      * $data=array(
           'condition'=>array(
             '列名'=>array('值','条件','列类型'),   
             '列名'=>array('值','条件','列类型'),
             ...
            ),
           'pg'=>'当前页',
           'order'=>'排序处理',
           'cols'=>'列1,列2,列3...',
           'pageSize'=>'查询限制:15', 
           'pageStrategy'=>'分页策略,默认为getNormalPage',
           'trueTableName'=>'表全名',
           'extWhere'=>'拓展条件查询'
         );
      *     返回:
      *     日期:
      *   修改人:
      * 修改时间:
      *     备注:
      *  1.支持的列类型有 int,smallint,tinyint,mediumint,float,double,BOOL
      *  2.条件包括:= != LIKE IN BETWEEN % %%
 */
 public function getPager(&$data)
 {
     //基本数据处理
     $this->pageSize = isset($data['pageSize']) ? (int) $data['pageSize'] : $this->pageSize;
     $this->PG = getPage();
     $where = $this->getWhere($data['condition']);
     if (isset($data['extWhere']) && $data['extWhere']) {
         $this->extWhere = ' ' . $data['extWhere'];
     }
     $this->trueTableName = $data['trueTableName'];
     $this->handle = M($this->trueTableName);
     $cols = isset($data['cols']) ? $data['cols'] : '*';
     $total = $this->getTotal($where);
     $this->pageCount = ceil($total / $this->pageSize);
     $s = ($this->PG - 1) * $this->pageSize;
     $order = isset($data['order']) ? $this->getOrder($data['order']) : '';
     $limit = $this->getLimit($s);
     $rs = $this->getData($cols, $where, $order, $limit);
     $pageHTML = $this->getNormalPage($this->PG, $this->pageCount);
     //策略处理
     if (isset($data['pageStrategy']) && !empty($data['pageStrategy'])) {
         if (is_array($data['pageStrategy'])) {
             $pageHTML = call_user_func($data['pageStrategy'], $this->PG, $this->pageCount, $total);
         } else {
             $pageHTML = call_user_func(array($this, $data['pageStrategy'] . 'Strategy'), $this->PG, $this->pageCount, $total);
         }
     } else {
         $pageHTML = $this->getNormalPage($this->PG, $this->pageCount);
     }
     return array('data' => $rs, 'paging' => $pageHTML);
 }
开发者ID:beelibrary820145,项目名称:tanxiongfeng,代码行数:57,代码来源:Page2Model.class.php


示例2: parseMovie

 static function parseMovie($id, $p_code)
 {
     $url = replaceStr(SinaTeachParse::BASE_SHOW_EPISODE, '{COURSE_ID}', $id);
     $content = getPage($url, $p_code);
     $content = json_decode($content);
     if (is_object($content) && property_exists($content, 'result') && property_exists($content->result, 'data') && property_exists($content->result->data, 'lessoninfo')) {
         $contents = $content->result->data->lessoninfo;
         if (is_array($contents) && count($contents) > 0) {
             $sites = array();
             $site = array();
             $site['site_url'] = "sina";
             $site['site_name'] = "sinahd";
             $site['max_episode'] = 'true';
             $episodes = array();
             foreach ($contents as $content) {
                 $episodes[] = array('name' => property_exists($content, 'name') ? $content->name : "1", 'guest' => property_exists($content, 'short_name') ? $content->short_name : "1", 'episode' => property_exists($content, 'jieci') ? $content->jieci : "1", 'url' => property_exists($content, 'burl') ? $content->burl : "", 'img_url' => property_exists($content, 'thumb') ? $content->thumb : "", 'time' => property_exists($content, 'length') ? $content->length : "", 'stream_url' => property_exists($content, 'stream_url') && !isN($content->stream_url) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->stream_url : "", 'androidUrl' => property_exists($content, 'android_url') && !isN($content->android_url) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->android_url : "", 'videoAddressUrl' => property_exists($content, 'ipad_url') && !isN($content->ipad_url) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->ipad_url : "");
             }
             $site['episodes'] = $episodes;
             $sites[] = $site;
             //  	 	 	 var_dump($episodes);
             return $sites;
         }
     }
     return false;
 }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:25,代码来源:SinaTeachParse.php


示例3: scrap_amazon_all

function scrap_amazon_all($asin)
{
    $url = "http://www.amazon.com/dp/" . $asin;
    $result['url'] = $url;
    //$url="http://www.amazon.com/gp/offer-listing/".$asin."/ref=dp_olp_new&condition=new";
    $data = getPage($url);
    preg_match_all("%http://ecx.images-amazon.com/images/I/\\w+.jpg%", $data, $matches);
    $imgs = array_unique($matches[0]);
    $html = str_get_html($data);
    $ok = 0;
    foreach ($html->find('h1[id=title]') as $title) {
        $ok = 1;
    }
    if ($ok == 1) {
        $result['scrapok'] = 1;
    } else {
        $result['scrapok'] = 0;
        return $result;
    }
    $price = floatval(str_replace('$', '', $html->find('#priceblock_saleprice,#priceblock_ourprice', 0)->plaintext));
    $q = count((array) $html->find('#quantity option'));
    $prime = (!$price or @$html->find('#soldByThirdParty', 0)->plaintext) ? 'No' : 'Yes';
    $features = array_map(function ($el) {
        return $el->plaintext;
    }, (array) $html->find('#feature-bullets li'));
    $desc = @$html->find('#productDescription', 0)->plaintext || '';
    $result = array('quantity' => intval($q), 'offerprice' => $price, 'sku' => $asin, 'prime' => $prime, 'url' => $url, 'title' => $html->find('#productTitle', 0)->plaintext, 'features' => $features, 'desc' => $desc, 'img' => $imgs);
    return $result;
}
开发者ID:eparst,项目名称:ebay-amazon-sync-tool,代码行数:29,代码来源:amazon.php


示例4: parseMovie

 static function parseMovie($id, $p_code, $info)
 {
     $url = replaceStr(NeteaseTeachParse::BASE_SHOW_EPISODE, '{COURSE_ID}', $id);
     $content = getPage($url, $p_code);
     $content = json_decode($content);
     if (is_object($content)) {
         $info->actor = property_exists($content, 'director') ? $content->director : "";
         $info->brief = property_exists($content, 'description') ? $content->description : "";
         $contents = property_exists($content, 'videoList') ? $content->videoList : array();
         if (is_array($contents) && count($contents) > 0) {
             $sites = array();
             $site = array();
             $site['site_url'] = "126";
             $site['site_name'] = "126";
             $site['max_episode'] = 'true';
             $episodes = array();
             foreach ($contents as $content) {
                 $episodes[] = array('name' => property_exists($content, 'title') ? $content->title : "", 'guest' => property_exists($content, 'subtitle') ? $content->subtitle : "", 'episode' => property_exists($content, 'pnumber') ? $content->pnumber : "", 'url' => property_exists($content, 'weburl') ? $content->weburl : "", 'img_url' => property_exists($content, 'imgpath') ? $content->imgpath : "", 'androidUrl' => property_exists($content, 'repovideourl') && !isN($content->repovideourl) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->repovideourl : "", 'videoAddressUrl' => property_exists($content, 'repoMP3url') && !isN($content->repoMP3url) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->repoMP3url : "");
             }
             $site['episodes'] = $episodes;
             $sites[] = $site;
             //  	 	 	 var_dump($episodes);
             return $sites;
         }
     }
     return false;
 }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:27,代码来源:NeteaseTeachParse.php


示例5: parseVideoIOSUrls

function parseVideoIOSUrls($sql)
{
    global $db;
    writetofile("parseVideo.txt", $sql);
    $rs = $db->query($sql);
    $rscount = $db->num_rows($rs);
    if ($rscount == 0) {
        errmsg("没有可用的数据");
    } else {
        while ($row = $db->fetch_array($rs)) {
            $u_id = $row["u_id"];
            $u_weburl = $row["u_weburl"];
            $p_id = $row["p_id"];
            $m_urltest = $row["m_urltest"];
            if (isN($u_weburl)) {
                $u_weburl = $m_urltest;
            }
            $project = getProgject($p_id);
            $webCode = getPage($u_weburl, $project->p_coding);
            //	    		$videoUrl = crawleVideoByPlayUrl($webCode,$project);
            $videoUrl = ContentProviderFactory::getContentProvider($project->p_playtype)->parseIOSVideoUrlByContent($webCode, $project->p_coding, $project->p_script);
            writetofile("android_log.txt", $strlink . '{===}' . $androidUrl);
            if (!isN($videoUrl)) {
                $sql = "update {pre}cj_vod_url set iso_video_url='" . $videoUrl . "', u_weburl='" . $u_weburl . "',android_vedio_url ='" . $androidUrl . "' where u_id=" . $u_id;
                writetofile("parseVideo.txt", $sql);
                $db->query($sql);
            } else {
                writetofile("videoUrlErrors.txt", '{===}' . $p_id . '{===}' . $u_id . '{===}' . $u_weburl);
            }
        }
    }
    unset($rs);
}
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:33,代码来源:collect_vod_cjVideoIOSUrl.php


示例6: parseChannel

function parseChannel($area, $url, $stationname)
{
    global $db;
    $contents = getPage($url, "");
    $content = getBody($contents, '<div class="listmenu2" >', '<div class="listmenu" >');
    if ($content === false || isN($content)) {
        $content = getBodys($contents, '<div class="listmenu2" >');
    }
    // 	var_dump($content);
    $codes = getArray($content, "/program/", '</a>');
    //
    $codesArray = explode("{Array}", $codes);
    ////http://epg.tvsou.com/program/
    $channels = array();
    $currentStation = getBody($content, '<font color="#FF6600">', '</font>');
    $channels[$area . '{Array}' . $stationname . '{Array}' . $currentStation] = $url;
    foreach ($codesArray as $code) {
        $ste = explode('"class=blue2>', $code);
        if (!isN($ste[1])) {
            $channels[$area . '{Array}' . $stationname . '{Array}' . $ste[1]] = 'http://epg.tvsou.com/program/' . $ste[0];
        }
    }
    //var_dump($channels);
    return $channels;
}
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:25,代码来源:collect_tv_station.php


示例7: crawleAndroidVideoByPlayUrl

function crawleAndroidVideoByPlayUrl($url, $project)
{
    $webCode = getPage($url, $project->p_coding);
    $androidUrl = ContentProviderFactory::getContentProvider($project->p_playtype)->parseAndroidVideoUrlByContent($webCode, $project->p_coding, $project->p_script);
    writetofile("android_log.txt", $strlink . '{===}' . $androidUrl);
    return $androidUrl;
}
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:7,代码来源:collect_vod_cjVideoAndroidUrl.php


示例8: parseIOSVideoUrl

 public function parseIOSVideoUrl($url, $p_coding, $p_script)
 {
     $content = getPage($this->p_videocodeApiUrl . $this->from . '/?url=' . $url, "utf-8");
     //  		var_dump($url);
     writetofile("joyplus.log", $this->p_videocodeApiUrl . $this->from . '/?url=' . $url);
     return $this->parseIOSVideoUrlByContent($content, $p_coding, $p_script);
 }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:7,代码来源:QQContent.php


示例9: from_tumblr

function from_tumblr()
{
    global $sessionkey;
    $db = get_db_connectiuon();
    list($sessionkey, $cookies, $u) = get_login_cookie($db);
    $page = getPage();
    $agent = Net_UserAgent_Mobile::singleton();
    // paging a page
    if ($agent->isDoCoMo()) {
        $page = ceil($page / 2);
    }
    //$postid = getPostId();
    $url = 'http://www.tumblr.com/dashboard/';
    if ($page > 1) {
        $url .= $page;
    }
    if ($postid > 1) {
        $url .= "/{$postid}";
    }
    #print "<!--$url-->";
    $retry = 2;
    while ($retry--) {
        $req =& new HTTP_Request($url);
        $req->setMethod(HTTP_REQUEST_METHOD_GET);
        foreach ($cookies as $v) {
            $req->addCookie($v['name'], $v['value']);
        }
        if (PEAR::isError($req->sendRequest())) {
            $err = 1;
        }
        $code = $req->getResponseCode();
        if ($code == 302) {
            $err = true;
            if ($u['email']) {
                list($err, $cookies) = update_cookie_info($u['email'], $u['password'], true, $u['hash']);
            }
            if ($err) {
                $retry = 0;
                break;
            }
        } else {
            if ($code == 200) {
                return $req->getResponseBody();
            } else {
                print '<html><body><pre>x_x';
                print " {$code} ";
                print '</body></html>';
                exit;
            }
        }
    }
    if ($retry == 0) {
        header('Location: /login');
    } else {
        print '<html><body><pre>x_x';
        print '</body></html>';
    }
    exit;
}
开发者ID:ku,项目名称:reblog.ido.nu,代码行数:59,代码来源:dashboard.php


示例10: __construct

 function __construct()
 {
     $post_id = $_REQUEST['id'];
     $this->db = $db = get_db_connectiuon();
     list($sessionkey, $cookies) = get_login_cookie($db);
     $this->sessionkey = $sessionkey;
     $this->page = $page = getPage();
 }
开发者ID:ku,项目名称:reblog.ido.nu,代码行数:8,代码来源:status.php


示例11: messager

 public function messager()
 {
     $ip = ipDecode(get_client_ip());
     $messagers = D('Messagers');
     $page = getPage($messagers, 5, "ip = {$ip}");
     $list = $messagers->field(true)->order('id DESC')->limit($page->firstRow . ',' . $page->listRows)->select();
     $this->assign('page', $page->show());
     $this->assign('messagers', $list);
     $this->display();
 }
开发者ID:Jerrybucc,项目名称:Messager,代码行数:10,代码来源:IndexController.class.php


示例12: getLZLReplyList

 public function getLZLReplyList($to_f_reply_id, $order, $page = 1, $limit = 3)
 {
     $list = M('GroupLzlReply')->where('status=1 and to_f_reply_id=' . $to_f_reply_id)->order($order)->select();
     foreach ($list as $k => &$v) {
         $v['userInfo'] = query_user(array('avatar128', 'nickname', 'uid', 'space_url'), $v['uid']);
         $v['content'] = parse_weibo_mobile_content($v['content']);
     }
     unset($v);
     $list = getPage($list, $limit, $page);
     return $list;
 }
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:11,代码来源:GroupLzlReplyModel.class.php


示例13: scrape_overstock

function scrape_overstock($itemid)
{
    $result = array();
    $url = "http://www.overstock.com/search/" . $itemid;
    //echo $url;
    $data = getPage($url);
    $result['itemid'] = $itemid;
    $html = str_get_html($data);
    foreach ($html->find('div[id=prod_mainCenter] h1') as $title) {
        $result['title'] = $title->plaintext;
        break;
    }
    foreach ($html->find('ul[class=bulleted-list]') as $description) {
        $result['description'] = $description->plaintext;
        break;
    }
    $result['description'] = str_replace('more', '', $result['description']);
    foreach ($html->find('div[id=proImageHero] div[class=proImageStack] img') as $image) {
        $result['imageurl'] = $image->src;
        break;
    }
    $result['imageurl'] = str_replace('_320', '_1000', $result['imageurl']);
    $i = 0;
    foreach ($html->find('div[id=proImageHero]') as $divimage) {
        //echo $divimage;die;
        foreach ($divimage->find('img') as $img) {
            $result['pictures' . $i] = $img->src;
            $result['pictures' . $i] = str_replace('_320', '_80', $result['pictures' . $i]);
            $i++;
        }
    }
    //}
    foreach ($html->find('span[class=price_sale main-price-red] span[class=Ovalue main-price-red]') as $price) {
        $result['price'] = $price->plaintext;
        break;
    }
    $qte = 0;
    foreach ($html->find('div[id=addCartMain_quantity] select') as $select) {
        foreach ($select->find('option') as $opt) {
            $qte++;
        }
    }
    $result['quantity'] = $qte;
    foreach ($html->find('ul[id=details_descFull]') as $features) {
        $result['features'] = $features;
        break;
    }
    foreach ($html->find('div[class=product-brand-name] a') as $brand) {
        $result['brand'] = $brand->plaintext;
        break;
    }
    $result['prime'] = 'Yes';
    return $result;
}
开发者ID:eparst,项目名称:ebay-amazon-sync-tool,代码行数:54,代码来源:scraping_overstock.php


示例14: getVideoUrlByProjectAndUrl

function getVideoUrlByProjectAndUrl($url, $pid)
{
    //    	global $db;
    $project = getProgject($pid);
    $webCode = getPage($url, $project->p_coding);
    $videoUrl = ContentProviderFactory::getContentProvider($project->p_playtype)->parseIOSVideoUrlByContent($webCode, $project->p_coding, $project->p_script);
    $androidUrl = ContentProviderFactory::getContentProvider($project->p_playtype)->parseAndroidVideoUrlByContent($webCode, $project->p_coding, $project->p_script);
    if (!isN($videoUrl) || !isN($androidUrl)) {
        return $videoUrl . MovieType::VIDEO_SEP_VERSION . $androidUrl;
    } else {
        return "Can't find";
    }
}
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:13,代码来源:collect_vod_cjVideoUrl.php


示例15: crawlerProgramItems

 static function crawlerProgramItems($date, $chnnel)
 {
     $dateTime = strtotime($date);
     $date = date('w', $dateTime);
     if ($date === '0') {
         $date = '7';
     }
     $url = replaceStr(TVSouLiveParse::BASE_EPISODE, '{DATE}', $date);
     $url = replaceStr($url, '{TV_CODE}', $chnnel);
     $content = getPage($url, "gb2312");
     writetofile("program_live_item_crawler.log", "url:[" . $url . "]");
     //  	 	var_dump($url);
     return TVSouLiveParse::parseMovieInfoByContent($content, $p_code, $type);
 }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:14,代码来源:TVSouLiveParse.php


示例16: getReplyList

 public function getReplyList($map, $order, $page, $limit)
 {
     $replyList = S('post_replylist_' . $map['post_id']);
     if ($replyList == null) {
         $replyList = M('ForumPostReply')->where($map)->order($order)->select();
         foreach ($replyList as &$reply) {
             $reply['user'] = query_user(array('avatar128', 'nickname', 'space_url', 'rank_link'), $reply['uid']);
             $reply['lzl_count'] = M('forum_lzl_reply')->where('is_del=0 and to_f_reply_id=' . $reply['id'])->count();
         }
         unset($reply);
         S('post_replylist_' . $map['post_id'], $replyList, 60);
     }
     $replyList = getPage($replyList, $limit, $page);
     return $replyList;
 }
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:15,代码来源:ForumPostReplyModel.class.php


示例17: getLZLReplyList

 public function getLZLReplyList($to_f_reply_id, $order, $page = 1, $limit)
 {
     $list = S('post_replylzllist_' . $to_f_reply_id);
     if ($list == null) {
         $list = D('forum_lzl_reply')->where('is_del=0 and to_f_reply_id=' . $to_f_reply_id)->order($order)->select();
         foreach ($list as $k => &$v) {
             $v['userInfo'] = query_user(array('avatar', 'username', 'uid', 'space_url', 'icons_html'), $v['uid']);
             $v['content'] = op_t($v['content']);
         }
         unset($v);
         S('post_replylzllist_' . $to_f_reply_id, $list, 60);
     }
     $list = getPage($list, $limit, $page);
     return $list;
 }
开发者ID:nullog,项目名称:zhanglubao,代码行数:15,代码来源:ForumLzlReplyModel.class.php


示例18: getPayedUser

 function getPayedUser($pageNum = NULL)
 {
     $model = new Model();
     $sql = "SELECT username,name,gender,phone,nicker ,coachid, FROM_UNIXTIME(time_end,'%Y-%m-%d %H:%m:%s') AS pay_time,money/100 AS money FROM xorder,user_info WHERE xorder.uid=user_info.id ORDER BY time_end DESC";
     $result = $model->query($sql);
     $rowCount = count($result);
     $pageSize = 10;
     $offset = 0;
     $url = "Admin/getPayedUser";
     $rowPage = getPage($rowCount, $pageSize, $pageNum, $url);
     $offset = $rowPage['offset'];
     $sql = "SELECT username,name,gender,phone,nicker,coachid, FROM_UNIXTIME(time_end,'%Y-%m-%d %H:%m:%s') AS pay_time,money/100 AS money FROM xorder,user_info WHERE xorder.uid=user_info.id ORDER BY time_end DESC LIMIT {$offset},{$pageSize}";
     $result = $model->query($sql);
     foreach ($result as $k => $v) {
         $result[$k]['coach'] = M("user_info")->where("id={$v['coachid']}")->getField("name");
     }
     $this->assign("offset", $offset + 1);
     $this->assign("count", $rowCount);
     $this->assign("pageList", $rowPage['show']);
     $this->assign("result", $result);
     $this->display();
     /*		echo "<pre>";
     		print_r($result);
     		echo "</pre>";*/
     /*		$title = "用户名&nbsp&nbsp&nbsp&nbsp姓名&nbsp&nbsp&nbsp&nbsp电话&nbsp&nbsp&nbsp&nbsp昵称&nbsp&nbsp&nbsp&nbsp付款时间&nbsp&nbsp&nbsp&nbsp金额<br>";
     		echo $title;
     		for ($i=0; $i < count($result); $i++) { 
     			$username = $result[$i]['username'];
     			$name = $result[$i]['name'];
     			$gender = $result[$i]['gender'] == 0 ? '男' : '女';
     			$phone = $result[$i]['phone'];
     			$nicker = $result[$i]['nicker'];
     			$pay_time = $result[$i]['pay_time'];
     			$money = $result[$i]['money'];
     
     			$line = $username.'&nbsp&nbsp&nbsp&nbsp'.$name.'&nbsp&nbsp&nbsp&nbsp'.$gender.'&nbsp&nbsp&nbsp&nbsp'.$phone.'&nbsp&nbsp&nbsp&nbsp'.$nicker.'&nbsp&nbsp&nbsp&nbsp'.$pay_time.'&nbsp&nbsp&nbsp&nbsp'.$money.'<br>';
     			echo $line;
     			
     		}
     
     		echo "<br>总共".count($result).'个付款的健友';*/
 }
开发者ID:kaka2007,项目名称:xplan,代码行数:42,代码来源:AdminController.class.php


示例19: scrap_hayneedle

function scrap_hayneedle($url)
{
    return array('offerprice' => 0, 'quantity' => 0, 'prime' => 'No', 'scrapok' => true);
    if (!filter_var($url, FILTER_VALIDATE_URL)) {
        $url = "http://search.hayneedle.com/search/index.cfm?Ntt=" . $url;
    }
    $data = getPage($url);
    $html = str_get_html($data);
    $result['scrapok'] = 0;
    if ($html) {
        foreach ($html->find('span[class=standard-style noWrap]') as $item) {
            $itemnumber = $item->plaintext;
            $result['scrapok'] = 1;
            break;
        }
        $result['scrapok'] = 1;
        $result['itemid'] = $itemnumber;
        preg_match("|<span.*?itemprop=\"price\".*?>(.*?)</span>|s", $html, $match_item_price);
        if (isset($match_item_price[1])) {
            $item_price = trim($match_item_price[1]);
        }
        $result['offerprice'] = $item_price;
        $result['offerprice'] = str_replace('$', '', $result['offerprice']);
        $result['offerprice'] = str_replace(',', '', $result['offerprice']);
        /*
        $qte=0;
        foreach($html->find('div[id=addCartMain_quantity] select') as $select) {
        foreach($select->find('option') as $opt) {
        $qte++;
        }
        }
        */
        $result['quantity'] = 100;
        $result['prime'] = 'Yes';
        $result['url'] = $url;
        return $result;
    } else {
        return -1;
    }
}
开发者ID:eparst,项目名称:ebay-amazon-sync-tool,代码行数:40,代码来源:hayneedle.php


示例20: getStudent

 public function getStudent($pageNum = NULL)
 {
     $coachid = $_GET['coachid'];
     $url = "User/getStudent";
     if ($coachid != "") {
         $sql1 = "SELECT count(*) AS count FROM xorder WHERE coachid={$coachid} ORDER BY time_end DESC";
         $rowCount = M()->query($sql1);
         $rowCount = $rowCount[0]['count'];
         $pageSize = 10;
         $offset = 0;
         $rowPage = getPageC($rowCount, $pageSize, $pageNum, $url, $coachid);
         $offset = $rowPage['offset'];
         $sql2 = "SELECT x.time_end,u.id,u.name,u.gender FROM xorder AS x LEFT JOIN user_info AS u ON x.uid=u.id WHERE x.coachid={$coachid} ORDER BY x.time_end DESC LIMIT {$offset},{$pageSize}";
         $student = M()->query($sql2);
         foreach ($student as $k => $v) {
             $time_end = $student[$k]['time_end'];
             $student[$k]['time_end'] = date("Y-m-d H:i:s", $time_end);
         }
     } else {
         $rowCount = M("xorder")->where("status=1")->count();
         $pageSize = 10;
         $offset = 0;
         $rowPage = getPage($rowCount, $pageSize, $pageNum, $url);
         $offset = $rowPage['offset'];
         $sql = "SELECT * FROM xorder AS x INNER JOIN user_info AS u ON x.uid=u.id WHERE x.status=1 ORDER BY x.time_end DESC LIMIT {$offset},{$pageSize}";
         $student = M()->query($sql);
         foreach ($student as $k => $v) {
             $time_end = $student[$k]['time_end'];
             $student[$k]['time_end'] = date("Y-m-d H:i:s", $time_end);
         }
     }
     $managerTip = ":后台管理:学员管理";
     $this->assign("managerTip", $managerTip);
     $this->assign("offset", $offset + 1);
     $this->assign("pageList", $rowPage['show']);
     $this->assign("count", $rowCount);
     $this->assign("student", $student);
     $this->display("student");
 }
开发者ID:kaka2007,项目名称:xplan_backend,代码行数:39,代码来源:UserController.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP getPageContent函数代码示例发布时间:2022-05-15
下一篇:
PHP getPOST函数代码示例发布时间: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