Example #1
0
<?php

//我的劵
InitGP(array("action", "type", "oid", "page"));
//初始化变量全局返回
include_once INC_PATH . "/guestbook.class.php";
$Table = new GuestBookClass();
AjaxHead();
if (empty($action)) {
    $uname = $_USERS['uname'];
    $wherestr[] = "G.uname='{$uname}'";
    if (!empty($wherestr)) {
        $wheresql = implode(' AND ', $wherestr);
    }
    //条件汇总
    //获取当前页码
    $total = $Table->getcount("uname='{$uname}'");
    //总信息数
    $pagesize = 5;
    //一页显示信息数
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
    //偏移量
    $dataarray = $Table->getdata("{$offset},{$pagesize}", $wheresql);
    //获取团购数据
}
//print_r($dataarray);
include template('member_guestbooklist');
//包含输出指定模板
Example #2
0
<?php

include "common.inc.php";
InitGP(array("action", "refuid", "refuname", "referer", "aid", "cityid"));
//初始化变量全局返回
if ($cfg_site_closed == "Y") {
    showmsg(lang('Site_has_been_temporarily_closed'), "-1");
}
//showmessage("站点因正在更新已暂时关闭!","",false,99999);
include_once INC_PATH . "/guestbook.class.php";
//问题质询5条
$Table = new GuestBookClass();
$dataarray = $Table->getdata("5", " G.state=1 ", " G.gid desc,G.addtime desc", "G.msg,G.uname,G.addtime,U.face", "ALL");
//获取推荐商品10个
$goodsobj = new TableClass('goods', 'gid');
$cptjarray = $goodsobj->getdata(10, "flag='c'", 'buynum desc,gid desc', 'gid,gtypeid,goodsurl,goodsname,goodsprice,goodsseller,goodsimg,sellerurl,shopname,rindex,views,buynum,listorder,flag,addtime');
//获取精品活动
$specialobj = new TableClass('special', 'sid');
$specialarray1 = $specialobj->getdata(1, "flag='sy'", 'listorder asc,sid desc', 'sid,title,flag,about,pic,listorder,addtime');
$specialarray2 = $specialobj->getdata("1,6", "flag='sy'", 'listorder asc,sid desc', 'sid,title,flag,about,pic,listorder,addtime');
//获取首页三个广告仑显图
$topcarray = $specialobj->getdata(3, "flag='sy'", 'listorder asc,sid desc', 'sid,title,flag,about,pic,listorder,addtime');
//获取优惠活动
$specialob = new TableClass('special', 'sid');
$special = $specialob->getdata(2, "flag='h'", 'listorder asc,sid desc', 'sid,title,flag,about,pic,listorder,addtime');
//获取折扣信息
$discountobj = new TableClass('discount', 'did');
$discountarray = $discountobj->getdata(2, "flag='h'", 'listorder asc,did desc', 'did,title,flag,about,pic,listorder,addtime');
$discountob = new TableClass('discount', 'did');
$discount = $discountob->getdata(1, "flag='h'", 'listorder asc,did desc', 'did,title,flag,about,pic,listorder,addtime');
//公告