Exemplo n.º 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');
//包含输出指定模板
Exemplo n.º 2
0
<?php

include "common.inc.php";
InitGP(array("action", "page"));
//初始化变量全局返回
include_once INC_PATH . "/guestbook.class.php";
$Table = new GuestBookClass();
$wherestr[] = " G.state=1";
$wherestr[] = " G.hide=0";
if (!empty($wherestr)) {
    $wheresql = implode(' AND ', $wherestr);
}
//条件汇总
//获取当前页码
$total = $Table->getcount("state=1 and hide=0");
//总信息数
$pagesize = 10;
//一页显示信息数
$page = isset($page) ? max(1, intval($page)) : 1;
//处理页码变量
$offset = ($page - 1) * $pagesize;
//偏移量
$dataarray = $Table->getdata("{$offset},{$pagesize}", $wheresql);
//获取团购数据
//读取编辑推荐
$goodsobj = new TableClass('goods', 'gid');
$rightarray = $goodsobj->getdata(4, "flag='c'", 'listorder asc,gid desc', 'gid,gtypeid,goodsurl,goodsname,goodsprice,goodsseller,goodsimg,sellerurl,shopname,rindex,views,buynum,listorder,flag,addtime');
//读取4条折扣信息
$discountobj = new TableClass('discount', 'did');
$discountarray = $discountobj->getdata(4, "flag='c'", 'listorder asc,did desc', 'did,title,flag,about,pic,discounttime,listorder,addtime');
//输出测试
Exemplo n.º 3
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');
//公告
Exemplo n.º 4
0
} elseif ($action == "guestbook") {
    InitGP(array("msg", "code"), 1);
    //初始化变量全局返回
    include INC_PATH . "/code/securimage.php";
    $img = new Securimage();
    $valid = $img->check($code);
    if ($valid != true) {
        print "<script language='javascript'>alert('验证码错误');history.go(-1);</script>";
        exit;
    }
    if (empty($msg) && strlen($msg) < 4) {
        print "<script language='javascript'>alert('留言内容少于四个字符或者为空!');history.go(-1);</script>";
        exit;
    }
    include_once INC_PATH . "/guestbook.class.php";
    $Table = new GuestBookClass();
    $addarray = array('uid' => $_USERS['uid'], 'uname' => $_USERS['uname'], 'addtime' => $timestamp, 'msg' => $msg, 'state' => 0, 'hide' => 1);
    $info = $Table->add($addarray);
    if (GetNum($info)) {
        print "<script language='javascript'>alert('您的提问发布成功,请耐心等待管理员回复!');</script>";
        jumpurl(url('m.php?name=guestbooklist'));
    } else {
        print "<script language='javascript'>alert('发布提问失败,请稍微重试!');</script>";
        jumpurl(url('m.php?name=guestbooklist'));
    }
} elseif ($action == "upmember") {
    //会员升级操作
    include_once INC_PATH . "/member.class.php";
    $m = new memberclass();
    if ($_USERS['utype'] == 0) {
        if ($_USERS['scores'] >= $cfg_vip_score1) {