Exemple #1
0
function helplist($num, $id = '', $aids = "", $orderby = "aid asc")
{
    if (is_numeric($id)) {
        $wherestr[] = "typeid = " . $id;
    } elseif (is_array($id)) {
        $ids = getdotstring($id, 'int');
        $wherestr[] = "typeid in ({$ids})";
    } elseif (is_string($id) && (strexists($id, ',') || strexists($id, '|'))) {
        if (strexists($id, ',')) {
            $ids = getdotstring($id, 'int');
        } else {
            $ids = getdotstring(explode('|', $ids), 'int');
        }
        $wherestr[] = "typeid in ({$ids})";
    } else {
        $wherestr[] = "";
    }
    if (!empty($aids)) {
        $aids = getdotstring($aids, 'int');
        $wherestr[] = "aid in ({$ids})";
    }
    $num = GetNum($num);
    $wheresql = implode(' AND ', $wherestr);
    //条件汇总
    $articleobj = new TableClass('article', 'aid');
    $articlearray = $articleobj->getdata($num, $wheresql, $orderby, 'aid,typeid,title');
    return $articlearray;
}
Exemple #2
0
function getareaselect($var = "", $value = "", $other = "")
{
    $Table = new TableClass("area", "aid");
    $arraydata = $Table->getdata('', '', 'aid asc');
    foreach ($arraydata as $val) {
        $arrayoption[$val['aid']] = $val['name_cn'];
    }
    return getselectstr($var, $arrayoption, $value, $other);
}
Exemple #3
0
function getatypeselect($var = "", $value = "", $other = "")
{
    $Table = new TableClass("atype", "typeid");
    $arraydata = $Table->getdata('', '', 'typeid asc');
    foreach ($arraydata as $val) {
        $arrayoption[$val['typeid']] = $val['typename'];
    }
    return getselectstr($var, $arrayoption, $value, $other);
}
    $wherestrc[] = "endtime >= " . time();
    $wherestrc[] = "state = 1";
    if (!empty($wherestrc)) {
        $wheresqlc = implode(' AND ', $wherestrc);
    }
    //条件汇总
    $couponarray = $couponobj->getdata("", $wheresqlc, "");
    //获取数据
    include template('member_tosendorder');
    //包含输出指定模板
} elseif ($action == "save") {
    InitGP(array("action", "LOCKDATA", "consignee", "tel", "country", "city", "address", "zip", "area", "remark", "did", "usecoupon", "couponid"));
    //初始化变量全局返回
    //创建运送方式对象
    $deliveryobj = new TableClass('delivery', 'did');
    $areaobj = new TableClass('area', 'aid');
    $couponid = GetNum($couponid);
    //处理提交信息
    @(list($ids, $countmoney, $countweight) = explode("\t", cookie_authcode($LOCKDATA, 'DECODE')));
    //if($ids==$oids and !empty($ids) and !empty($countmoney) and !empty($countweight)){  //允许包裹重量为0,所以去掉!empty($countweight)
    if ($ids == $oids and !empty($ids) and !empty($countmoney)) {
        $oids = $ids;
        $countmoney = GetNum($countmoney);
        $countweight = GetNum($countweight);
    } else {
        exit('数据异常');
    }
    //判断订单状态
    $wherestro[] = "uname='" . $_USERS['uname'] . "'";
    $wherestro[] = "oid in(" . $oids . ")";
    if (!empty($wherestro)) {
Exemple #5
0
<?php

include "../common.inc.php";
include "function_common.php";
InitGP(array("page", "action", "state", "value", "payid", "ids", "did", "delids"));
//初始化变量全局返回
$Table = new TableClass("admin", "adminid");
AjaxHead();
//禁止页面缓存
if (empty($action)) {
    InitGP(array("type", "raction", "orderby", "orderway", "keywords"));
    //初始化变量全局返回
    if (!empty($type)) {
        $wherestr[] = "type='{$type}'";
    }
    if (!empty($wherestr)) {
        $wheresql = implode(' AND ', $wherestr);
    }
    //条件汇总
    $orderway = $orderway == "desc" ? "desc" : "asc";
    if (!empty($orderby)) {
        $orderstr = "{$orderby} {$orderway}";
    }
    //获取当前页码
    $total = $Table->getcount($wheresql);
    //总信息数
    $pagesize = 20;
    //一页显示信息数
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
Exemple #6
0
    //获取数据
    //print_r($dataarray);
    include template('recommend_list');
    //包含输出指定模板
} elseif ($action == 'view') {
    $gid = GetNum($gid);
    $value = $goodsobj->getone($gid);
    $gtype = $typeobj->getone($value['gtypeid']);
    if ($gtype['node'] == 0) {
        $position = "<span>&gt;</span><a href='recommend.php?action=list&tid=" . $gtype['typeid'] . "'>" . $gtype['typename'] . "</a>";
    } else {
        $cgtype = $typeobj->getone($gtype['node']);
        $position = "<span>&gt;</span><a href='recommend.php?action=list&tid=" . $cgtype['typeid'] . "'>" . $cgtype['typename'] . "</a>";
        $position .= "<span>&gt;</span><a href='recommend.php?action=list&tid=" . $gtype['typeid'] . "'>" . $gtype['typename'] . "</a>";
    }
    $leftarray = $goodsobj->getdata(10, "flag='c'", 'buynum desc,gid desc', 'gid,gtypeid,goodsurl,goodsname,goodsprice,goodsseller,goodsimg,sellerurl,shopname,rindex,views,buynum,listorder,flag,addtime');
    addfield($goodsobj->table, 'views', "gid=" . $gid, 1);
    //增加浏览次数
    include template('recommend_view');
    //包含输出指定模板
} else {
    $rightarray = $goodsobj->getdata(6, "flag='c'", 'listorder asc,gid desc', 'gid,gtypeid,goodsurl,goodsname,goodsprice,goodsseller,goodsimg,sellerurl,shopname,rindex,views,buynum,listorder,flag,addtime');
    $rightuserarray = $goodsobj->getdata(6, "flag='c' and usertype=1 and Audit=1", 'listorder asc,gid desc', 'gid,gtypeid,usertype,uname,goodsurl,goodsname,goodsprice,goodsseller,goodsimg,sellerurl,shopname,rindex,views,buynum,listorder,flag,why,addtime');
    $leftarray = $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');
    $topcarray = $specialobj->getdata(3, "flag='tj'", 'listorder asc,sid desc', 'sid,title,flag,about,pic,listorder,addtime');
    //print_r($rightarray);
    //print_r($leftarray);
    include template('recommend');
    //包含输出指定模板
}
Exemple #7
0
<?php

//弹出一键填单相关ajax数据处理
include "../common.inc.php";
InitGP(array("action", "url", "refuname", "referer", "aid", "cityid"));
//初始化变量全局返回
$deliveryobj = new TableClass('delivery', 'did');
AjaxHead();
if ($action == 'getdelivery') {
    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
    $aid = GetNum($jsondata->aid);
    $info = $deliveryobj->getdata('', "areaid=" . $aid);
    echo json_encode($info);
    exit;
} else {
    if ($action == 'present') {
        $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
        $uname = Char_cv($jsondata->name);
        $sn = Char_cv($jsondata->code);
        $info = $coupon->present($sn, $uname, $_USERS['uname']);
        echo json_encode($info);
        exit;
    } else {
        if ($action == 'sell') {
            $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
            $price = GetNum($jsondata->price);
            $sn = Char_cv($jsondata->code);
            $info = $coupon->sellcoupon($sn, $price, $_USERS['uname']);
            echo json_encode($info);
            exit;
        } else {
Exemple #8
0
<?php

include "../common.inc.php";
include "function_common.php";
InitGP(array("page", "action", "state", "value", "payid", "ids", "did", "delids"));
//初始化变量全局返回
$Table = new TableClass("order", "oid");
AjaxHead();
//禁止页面缓存
header("Content-type: text/html; charset=" . CHARSET);
if (empty($action)) {
    InitGP(array("oid", "uid", "uname", "goodsurl", "goodsname", "goodsprice", "oldgoodsprice", "sendprice", "oldsendprice", "goodsnum", "goodssize", "goodscolor", "goodsseller", "sellerurl", "expressno", "goodsremark", "orderweight", "orderremark", "payid", "state"));
    //初始化变量全局返回
    if (!empty($_POST) and GetNum($oid)) {
        $oid = GetNum($oid);
        //处理价格和运费修改扣除用户相应金额账户余额
        if ($goodsprice != $oldgoodsprice) {
            //商品价格调整
            $tempmoney = 0;
            $tempmoney = GetNum($oldgoodsprice - $goodsprice);
            include_once INC_PATH . "/member.class.php";
            $m = new memberclass();
            $note = "调整商品<a href=\\'" . $goodsurl . "\\' target=\\'_blank\\'>《" . $goodsname . "》</a>价格:" . -$tempmoney . "订单ID:" . $oid;
            $m->moneyedit($uname, $tempmoney, 5, $note);
            //扣去账户余额
        }
        if ($sendprice != $oldsendprice) {
            //商品运费调整
            $tempmoney = 0;
            $tempmoney = GetNum($oldsendprice - $sendprice);
            //计算运费调整
Exemple #9
0
<?php

//帮助中心
include "common.inc.php";
InitGP(array("action", "id", "keyword", "referer", "aid", "cityid"));
//初始化变量全局返回
//创建对象
$atypeobj = new TableClass('atype', 'typeid');
$articleobj = new TableClass('article', 'aid');
$atypearray = $atypeobj->getdata('', '', 'typeid asc');
$articlearray = $articleobj->getdata('', '', 'aid asc', 'aid,typeid,title');
if (empty($action)) {
    $id = GetNum($id);
    foreach ($atypearray as $r) {
        if ($r['node'] == $id) {
            $rightatypearray[] = $r;
        }
    }
    //$rightatypearray=$atypearray;
    $rightarticlearray = $articlearray;
    include template('help');
    //包含输出指定模板
} elseif ($action == 'list') {
    $typeid = GetNum($id);
    if (!empty($typeid)) {
        $rightatypearray = $atypeobj->getdata('', 'typeid=' . $typeid, 'typeid asc');
        $rightarticlearray = $articleobj->getdata('', 'typeid=' . $typeid, 'aid asc', 'aid,typeid,title');
    } elseif (!empty($keyword)) {
        $keyword = Char_cv($keyword);
        $rightatypearray = $atypearray;
        $rightarticlearray = $articleobj->getdata('', 'title like \'%' . $keyword . '%\'', 'aid asc', 'aid,typeid,title');
Exemple #10
0
<?php

include "../common.inc.php";
include "function_common.php";
InitGP(array("page", "action", "startid", "endid", "starttime", "endtime", "type", "oid", "ids", "did", "delids"));
//初始化变量全局返回
$Table = new TableClass("order", "oid");
AjaxHead();
//禁止页面缓存
set_time_limit(0);
if (!empty($type) || !empty($oid)) {
    if (!empty($oid)) {
        if (is_numeric($oid)) {
            $wherestr[] = "oid" . " = " . $oid;
        } elseif (is_array($oid)) {
            $ids = getdotstring($oid, 'int');
            $wherestr[] = "oid" . " in ({$ids})";
        } elseif (is_string($oid) && (strexists($oid, ',') || strexists($oid, '|'))) {
            if (strexists($oid, ',')) {
                $ids = getdotstring($oid, 'int');
            } else {
                $ids = getdotstring(explode('|', $ids), 'int');
            }
            $wherestr[] = "oid" . " in ({$ids})";
        } else {
            exit("ID格式错误");
        }
    } elseif (!empty($type)) {
        if ($type == "all") {
        } elseif ($type == "idlist") {
            if (GetNum($startid) and GetNum($endid)) {
Exemple #11
0
//获取推荐商品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');
//公告
$newsobj = new TableClass('news', 'nid');
$newsarray = $newsobj->getdata(9, $wheresql);
//获取数据
//帮助信息->常见问题
$wheresql = "";
$articleobj = new TableClass('article', 'aid');
$articlearray = $articleobj->getdata(9, $wheresql, "", 'aid,typeid,title');
include_once INC_PATH . '/rate.class.php';
$rate = RateClass::init();
//获取最新汇率信息
$ratedata = $rate->get();
include template('index');
//包含输出指定模板
Exemple #12
0
InitGP(array("type", "s", "e", "page"));
//初始化变量全局返回
if (!empty($type)) {
    $type = GetNum($type);
    $wherestr[] = "type='{$type}'";
}
if (!empty($s)) {
    $s = strtotime($s);
    $wherestr[] = "addtime > '{$s}'";
}
if (!empty($e)) {
    $e = strtotime($e);
    $wherestr[] = "addtime < '{$e}'";
}
$r = new TableClass("scorerecord", "sid");
if (!empty($_USERS['uname'])) {
    $uname = $_USERS['uname'];
    $wherestr[] = "uname='{$uname}'";
    if (!empty($wherestr)) {
        $wheresql = implode(' AND ', $wherestr);
    }
    //条件汇总
    //获取当前页码
    $total = $r->getcount($wheresql);
    //总信息数
    $pagesize = 10;
    //一页显示信息数
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
Exemple #13
0
<?php

include "../common.inc.php";
InitGP(array("page", "action", "did", "delids"));
//初始化变量全局返回
include "function_common.php";
$mange = new TableClass("adminmange", "mid");
$menuarray = $mange->getdata('', '', 'listorder asc,mid asc');
$menuname = array('zone' => '管理分区', 'group' => '管理分组', 'item' => '管理项');
if ($action == "add") {
    InitGP(array("mid", "mname", "type", "node", "murl", "listorder", "mcode", "Submit"));
    //初始化变量全局返回
    if (!empty($Submit)) {
        if ($type == "zone") {
            $node = 0;
        }
        $arrayinsert = array("mname" => Char_cv($mname), "type" => Char_cv($type), "node" => GetNum($node), "murl" => Char_cv($murl), "listorder" => GetNum($listorder), "mcode" => Char_cv($mcode));
        $info = $mange->add($arrayinsert);
        if (GetNum($info)) {
            showmsg("添加成功!", PHP_SELF);
            //成功
        } else {
            showmsg($info, "-1");
        }
        //出错!
    }
} elseif ($action == "edit") {
    InitGP(array("mid", "mname", "type", "node", "murl", "listorder", "mcode", "Submit"));
    //初始化变量全局返回
    if (!empty($Submit)) {
        $mid = GetNum($mid);
Exemple #14
0
 function moneyedit($uname, $num = 0, $action = 0, $note = "")
 {
     $returnstr = "OK";
     if (!empty($uname) && $num != 0 && is_numeric($num)) {
         $row = $this->db->fetch_first("Select uid,money From `{$this->table}` where uname like '{$uname}' ");
         if (is_array($row)) {
             $this->db->query("update `{$this->table}` SET money= money+{$num} WHERE uname='{$uname}' limit 1");
             if ($num > 0) {
                 $edittype = lang('adds');
                 $type = 2;
             } else {
                 $edittype = lang('Minus');
                 $type = 1;
             }
             $action = GetNum($action);
             $accountmoney = sprintf("%01.2f", $row['money'] + $num);
             //记录日志操作
             $record_table = new TableClass('record', 'rid');
             $addarray = array('uid' => $row['uid'], 'uname' => $uname, 'type' => $type, 'action' => $action, 'money' => $num, 'accountmoney' => $accountmoney, 'remark' => $note, 'addtime' => time());
             $info = $record_table->add($addarray);
             if (GetNum($info)) {
                 $returnstr = "OK";
             } else {
                 $returnstr = lang('Error_log');
             }
             //写入日志文件
             $datastr = date('Y-m-d h:i:s');
             $log = $datastr . lang('uname') . $uname . '|' . $edittype . lang('Amount') . $num . lang('legend') . $note;
             @writelog('money_edit', $log);
             //增加写入文件日志操作!记录每次用户钱币改动
         } else {
             $returnstr = lang('username_notexist');
         }
     } else {
         $returnstr = lang('Missing_parameter_err');
     }
     return $returnstr;
 }
Exemple #15
0
<?php

include "../common.inc.php";
InitGP(array("page", "action", "aid", "delids"));
//初始化变量全局返回
include "function_common.php";
$mange = new TableClass("adminmange", "mid");
//控制只显示有权限的控制选项
$wherestr = "mid in({$_ADMINUSERS['adminmid']})";
$menuarray = $mange->getdata('', $wherestr, 'listorder asc,mid asc');
$menuzone = array();
$menugroup = array();
$zonestrarray = array();
$groupstrarray = array();
$itemstrarray = array();
foreach ($menuarray as $value) {
    if ($value['type'] == 'zone') {
        $menuzone[] = $value;
    }
    if ($value['type'] == 'group') {
        $menugroup[] = $value;
    }
    if ($value['type'] == 'item') {
        $itemstrarray[$value['node']][] = "'{$value['mcode']}' : ['{$value['mname']}','{$value['murl']}','']";
    }
}
foreach ($menuzone as $value) {
    foreach ($menugroup as $value1) {
        if ($value1['node'] == $value['mid']) {
            $groupstrarray[$value['mid']][] = "'{$value1['mcode']}' : {" . implode_field_value($itemstrarray[$value1['mid']], ',') . "}";
        }
Exemple #16
0
if (empty($action)) {
    if (!empty($_USERS['uname'])) {
        $uname = $_USERS['uname'];
        $wherestr[] = "uname='{$uname}'";
        if (!empty($wherestr)) {
            $wheresql = implode(' AND ', $wherestr);
        }
        //条件汇总
        //获取当前页码
        $dataarray = $r->getdata("", $wheresql);
        //获取团购数据
    }
} elseif ($action == 'refund' && !empty($rid)) {
    $rid = GetNum($rid);
    if ($rid) {
        $recharge = new TableClass("rechargerecord", "rid");
        $row = $recharge->getone($rid);
        if (!empty($_POST)) {
            InitGP(array('money', 'remark'));
            //初始化变量全局返回
            $addarray = array('rechargeid' => $rid, 'uid' => $_USERS['uid'], 'uname' => $_USERS['uname'], 'money' => GetNum($money), 'remark' => Char_cv($remark), 'rechargetime' => $row['successtime'], 'rechargemoney' => $row['money'], 'rechargesn' => $row['sn'], 'addtime' => time());
            $info = $r->add($addarray);
            if (GetNum($info)) {
                print "<script language='javascript'>alert(" . lang('apply_success') . ");</script>";
                jumpurl(url('m.php?name=refundrecord'));
            } else {
                print "<script language='javascript'>alert(" . lang('apply_error') . ");</script>";
                jumpurl(url('m.php?name=refundrecord&action=refund&' . $rid));
            }
        }
    }
Exemple #17
0
<?php

//我的劵
InitGP(array("action", "bid", "page"));
//初始化变量全局返回
//获取地区信息
$areaobj = new TableClass('area', 'aid');
$areaarray = $areaobj->getdata('', 'state=1');
include template('member_estimates');
//包含输出指定模板
Exemple #18
0
        $arrayadd = array("fromuid" => 0, "fromuname" => Char_cv($_ADMINUSERS['adminname']), "touid" => $uid, "touname" => Char_cv($uname), "type" => 1, "subject" => Char_cv($subject), "message" => Char_cv($message), "sendtime" => $timestamp, "writetime" => $timestamp, "hasview" => 0, "isadmin" => $isadmin);
        $info = $Table->add($arrayadd);
        if (GetNum($info)) {
            if (!empty($inbox)) {
                exit("<script language='javascript'>alert('发送成功');parent.\$.fn.colorbox.close();</script>");
            } else {
                showmsg("发送成功", PHP_SELF);
                //出错!
            }
        } else {
            if (!empty($inbox)) {
                exit("<script language='javascript'>alert('发送失败');location.reload();</script>");
            } else {
                showmsg("发送成功", PHP_SELF);
                //出错!
            }
        }
    } else {
        if (!empty($uid)) {
            $Tableu = new TableClass("users", "uid");
            $evalue = $Tableu->getone($uid);
        } elseif (!empty($uname)) {
            $evalue['uname'] = $uname;
        }
        //print_r($evalue);
        include "tpl/pm_send.htm";
    }
} else {
    showmsg("未知请求", "-1");
    //出错!
}
Exemple #19
0
<?php

//我的劵
InitGP(array("action", "type", "sid", "page"));
//初始化变量全局返回
include_once INC_PATH . '/rate.class.php';
$rate = RateClass::init();
//获取最新汇率信息
$ratedata = $rate->get();
if (empty($action)) {
    $recharge = new TableClass("rechargerecord", "rid");
    $uname = $_USERS['uname'];
    $wherestr[] = "uname='{$uname}'";
    $wherestr[] = "state='2'";
    if (!empty($wherestr)) {
        $wheresql = implode(' AND ', $wherestr);
    }
    //条件汇总
    $dataarray = $recharge->getdata("", $wheresql, "");
    //获取团购数据
    include template('member_rmbaccount');
    //包含输出指定模板
} elseif ($action == "pay") {
    if (empty($type)) {
        $type = 1;
    }
    include template('member_rmbaccount_pay');
    //包含输出指定模板
}
//print_r($dataarray);
Exemple #20
0
$wherestr[] = "commenttime <> ''";
$wherestr[] = "reply <> ''";
if (!empty($wherestr)) {
    $wheresql = implode(' AND ', $wherestr);
}
//条件汇总
//获取当前页码
$total = $Table->getcount($wheresql . " and state=3 and commenttime <> ''");
//总信息数
$pagesize = 10;
//一页显示信息数
$page = isset($page) ? max(1, intval($page)) : 1;
//处理页码变量
$offset = ($page - 1) * $pagesize;
//偏移量
$dataarray = $Table->getdata("{$offset},{$pagesize}", $wheresql, "sid desc");
//获取团购数据
foreach ($dataarray as &$val) {
    $face = DB::result_first("select face from dg_users where uname='" . $val['uname'] . "'");
    $val['face'] = $face;
}
//读取编辑推荐
$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');
//输出测试
//print_r($dataarray);
include template('guestbook');
//包含输出指定模板
Exemple #21
0
<?php

include "../common.inc.php";
include "function_common.php";
InitGP(array("page", "action", "state", "value", "type", "aid", "ids", "did", "delids"));
//初始化变量全局返回
$Table = new TableClass("service", "aid");
AjaxHead();
//禁止页面缓存
if (empty($action)) {
    InitGP(array("state", "orderby", "orderway", "keywords"));
    //初始化变量全局返回
    if (!empty($state)) {
        $wherestr[] = "state='{$state}'";
    }
    if ($type != null) {
        $wherestr[] = "type='{$type}'";
    }
    if (!empty($keywords)) {
        $wherestr[] = " CONCAT(aid,' ',uname,' ',account) like '%{$keywords}%' ";
    }
    if (!empty($wherestr)) {
        $wheresql = implode(' AND ', $wherestr);
    }
    //条件汇总
    $orderway = $orderway == "desc" ? "desc" : "asc";
    if (!empty($orderby)) {
        $orderstr = "{$orderby} {$orderway}";
    }
    //获取当前页码
    $total = $Table->getcount($wheresql);
Exemple #22
0
<?php

include "common.inc.php";
InitGP(array("action", "sid", 'page'));
//初始化变量全局返回
$specialobj = new TableClass('special', 'sid');
if (empty($action)) {
    $wherestr[] = "flag='hd'";
    if (!empty($wherestr)) {
        $wheresql = implode(' AND ', $wherestr);
    }
    //条件汇总
    //获取当前页码
    $total = $specialobj->getcount($wheresql);
    //总信息数
    if ($total > 1000) {
        $total = 1000;
    }
    //显示最大一千条
    $pagesize = 6;
    //一页显示信息数
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
    //偏移量
    $dataarray = $specialobj->getdata("{$offset},{$pagesize}", $wheresql, "", 'sid,title,flag,about,pic,listorder,addtime');
    //获取数据
    //获取头条和推荐
    $topharray = $specialobj->getdata(1, "flag='hd'", 'listorder asc,sid desc', 'sid,title,flag,about,pic,listorder,addtime');
    $topcarray = $specialobj->getdata(3, "flag='hd'", 'listorder asc,sid desc', 'sid,title,flag,about,pic,listorder,addtime');
    include template('special');
Exemple #23
0
        $orderstr = "{$orderby} {$orderway}";
    }
    //获取当前页码
    $total = $Table->getcount($wheresql);
    //总信息数
    $pagesize = 15;
    //一页显示信息数
    $page = isset($page) ? max(1, intval($page)) : 1;
    //处理页码变量
    $offset = ($page - 1) * $pagesize;
    //偏移量
    $dataarray = $Table->getdata("{$offset},{$pagesize}", $wheresql, $orderstr);
    //获取团购数据
    //print_r($dataarray);
    //获取分类保存到数组
    $Tabletype = new TableClass("atype", "typeid");
    $tempdata = $Tabletype->getdata();
    foreach ($tempdata as $v) {
        $ATYPE[$v['typeid']] = $v['typename'];
    }
    //包含后台模板文件
    include "tpl/article_list.htm";
} elseif ($action == "del" && !empty($did)) {
    //执行删除操作
    $did = GetNum($did);
    $info = $Table->del($did);
    if ($info == "OK") {
        showmsg("删除成功!", PHP_SELF);
    } else {
        showmsg($info, PHP_SELF);
    }
Exemple #24
0
        $jsonarray[$key]['c'] = $val['typeid'];
        $jsonarray[$key]['d'] = ddate('m-d', $val['addtime']);
        $jsonarray[$key]['id'] = $val['oid'];
        $jsonarray[$key]['m'] = $val['goodsprice'];
        $jsonarray[$key]['n'] = $val['goodsname'];
        $jsonarray[$key]['p'] = $val['showimg'];
        $jsonarray[$key]['s'] = $val['goodssite'];
        $jsonarray[$key]['u'] = $val['goodsurl'];
        $jsonarray[$key]['un'] = substrs($val['uname'], 2, 1) . "***";
    }
    echo json_encode($jsonarray);
    //echo '[{"id":755285,"un":"木***y","n":"2010日韩新款秋季甜美向日葵娃娃鞋女鞋/单鞋/平底鞋/订大码","u":"http://item.taobao.com/item.htm?id=5970369688&taomi=8aR2LQR6GJQQsvvZN5m1a7Q8hHfQgg%2BrQHW2MVsqGxBX%2BBsSaNVdF2aNxTE3UMqSeG%2BfpJaI0obJL6V2Q%2BFP2s5KwHnvk%2Fh629ylx1BFsfIDL5BWmtieSYGhBWSvxqwM32LznBT4Lm","p":"http://img.panli.com/goods/small/2010/08/31/755285.jpg","m":39.90,"d":"8分钟前","c":99,"s":"淘宝"},{"id":755284,"un":"木***y","n":"JJS 推荐 2010春天 韩版瑞丽女装  长袖开身显瘦休闲外套1500","u":"http://item.taobao.com/item.htm?id=5195199724&taomi=8aR2LQR6GJQYVWg2cyUMEwq6qDueIMvH8WFfVSp83Sb2cf6c2Cn6Wg%2BwtyQibpmBIAtGoqHqqOsFNz0PlN28lM7I4l2YJlwXU9w6oeroKZxkjMkHG0TTyyJ4GeSMvzVRDdVOaIxLWyNmeisf%2","p":"http://img.panli.com/goods/small/2010/08/31/755284.jpg","m":12.00,"d":"8分钟前","c":99,"s":"淘宝"},{"id":755283,"un":"木***y","n":"包邮!正品匡威川久保玲PLAY明星鬼脸米色高帮爱心男女情侣帆布鞋","u":"http://item.taobao.com/item.htm?id=7035442987&ali_refid=a3_419342_1006:1102983467:6:%B7%AB%B2%BC%D0%AC:00c32dac57e5923cfd643311bc0ff810&ali_trackid=1_00c32dac57e5923cfd643311bc0ff810","p":"http://img.panli.com/goods/small/2010/08/31/755283.jpg","m":88.00,"d":"8分钟前","c":99,"s":"淘宝"},{"id":755282,"un":"木***y","n":"(台湾馆)**PG美人网**Y580【6/18缤纷洞洞侧肩包】4色","u":"http://item.taobao.com/item.htm?id=5861366980&taomi=8aR2LQR6GJQRJG%2FMR%2BNE0u2uOmIMBhGhN9v%2F61VbirwB%2BUGMra5cv9kBuk4iH%2BzbBuFFonT6YF%2BFBWZCRw0E3DHFVMAYOLTL%2Bcd6OoUhRGzKzwRXhqkwDwFh9BrRTQiAFTvDdu","p":"http://img.panli.com/goods/small/2010/08/31/755282.jpg","m":52.00,"d":"8分钟前","c":99,"s":"淘宝"},{"id":755281,"un":"v***g","n":"质感一流~韩版纯手工编织毛球短檐网眼毛线帽/女款冬季帽子","u":"http://item.taobao.com/item.htm?id=3740516109","p":"http://img.panli.com/goods/small/2010/08/31/755281.jpg","m":38.00,"d":"9分钟前","c":99,"s":"淘宝"},{"id":755276,"un":"l***n","n":"伊人小径 超值韩版!优雅女人味 花朵珍珠腰链 水钻pd1866","u":"http://auction1.taobao.com/auction/item_detail-0db2-26a3927e7bf299c0799ffbbee52664bd.jhtml","p":"http://img.panli.com/goods/small/2010/08/31/755276.jpg","m":28.00,"d":"14分钟前","c":99,"s":"淘宝"},{"id":755275,"un":"l***n","n":"呛口小辣椒同款 ZARA限量款百搭铆钉圆钉松紧腰带腰封","u":"http://item.taobao.com/item.htm?id=5601838968","p":"http://img.panli.com/goods/small/2010/08/31/755275.jpg","m":12.80,"d":"14分钟前","c":99,"s":"淘宝"},{"id":755274,"un":"l***n","n":"韩国时尚 复古柳钉金属亮片 百搭朋克松紧宽腰封/女式束腰带/裙带","u":"http://item.taobao.com/item.htm?id=4143404593","p":"http://img.panli.com/goods/small/2010/08/31/755274.jpg","m":5.80,"d":"14分钟前","c":99,"s":"淘宝"},{"id":755273,"un":"l***n","n":"[美一步皇冠店]舒适满载铆钉超可爱平底侧花朵娃鞋鞋(推荐款)","u":"http://item.taobao.com/auction/item_detail-0db1-dc36f00dd0c1c299f7d12749e4288efc.htm","p":"http://img.panli.com/goods/small/2010/08/31/755273.jpg","m":49.00,"d":"14分钟前","c":99,"s":"淘宝"},{"id":755272,"un":"v***g","n":"10新款能穿的韩版T恤哦~特小号-特大号,瑞丽KOKO杂志款0A1017","u":"http://item.taobao.com/item.htm?id=1639260120","p":"http://img.panli.com/goods/small/2010/08/31/755272.jpg","m":96.00,"d":"15分钟前","c":99,"s":"淘宝"},{"id":755271,"un":"v***g","n":"10新款大码胖装肥装简约运动型螺纹弹力腰头休闲裤D0359 黑色","u":"http://item.taobao.com/item.htm?id=4486123938","p":"http://img.panli.com/goods/small/2010/08/31/755271.jpg","m":89.00,"d":"15分钟前","c":99,"s":"淘宝"},{"id":755270,"un":"v***g","n":"09新款秋季大尺码胖装肥装超百搭折皱中领内搭衣A8516 三色入","u":"http://item.taobao.com/item.htm?id=1638510536","p":"http://img.panli.com/goods/small/2010/08/31/755270.jpg","m":39.00,"d":"15分钟前","c":99,"s":"淘宝"},{"id":755269,"un":"v***g","n":"09新款秋季大码胖MM的高领彩色百搭打底衫长袖T恤A8517 4色入","u":"http://item.taobao.com/item.htm?id=1757501054","p":"http://img.panli.com/goods/small/2010/08/31/755269.jpg","m":39.00,"d":"15分钟前","c":99,"s":"淘宝"},{"id":755268,"un":"悠***y","n":"会拉丝的老祖母冷制纯橄榄皂 添加蛋黄 干皮必选","u":"http://item.taobao.com/item.htm?id=2227452249","p":"http://img.panli.com/goods/small/2010/08/31/755268.jpg","m":9.90,"d":"15分钟前","c":99,"s":"淘宝"},{"id":755267,"un":"v***g","n":"09新款大码胖装肥装 大筒围大腿围真牛皮内增高骑士靴YM10081","u":"http://item.taobao.com/item.htm?id=1644662476","p":"http://img.panli.com/goods/small/2010/08/31/755267.jpg","m":228.00,"d":"15分钟前","c":99,"s":"淘宝"}]';
    exit;
} else {
    if ($action == 'recommendproduct') {
        $goodsobj = new TableClass('goods', 'gid');
        $dataarray = $goodsobj->getdata(10, "flag='c'", 'buynum asc,gid desc', 'gid,gtypeid,goodsurl,goodsname,goodsprice,goodsseller,goodsimg,sellerurl,shopname,rindex,views,buynum,listorder,flag,addtime');
        $j = $i = 0;
        foreach ($dataarray as $key => $val) {
            $jsonarray[$j][$i]['id'] = $val['gid'];
            $jsonarray[$j][$i]['m'] = $val['goodsprice'];
            $jsonarray[$j][$i]['n'] = $val['goodsname'];
            $jsonarray[$j][$i]['p'] = $val['goodsimg'];
            $jsonarray[$j][$i]['s'] = $val['buynum'];
            $i++;
            if ($i >= 5) {
                $i = 0;
                $j++;
            }
        }
        echo json_encode($jsonarray);
Exemple #25
0
$pagesize = 10;
//一页显示信息数
$page = isset($page) ? max(1, intval($page)) : 1;
//处理页码变量
$offset = ($page - 1) * $pagesize;
//偏移量
$dataarray = $orderobj->getdata("{$offset},{$pagesize}", $wheresql);
//获取数据
//读取编辑推荐
$goodsobj = new TableClass('goods', 'gid');
$rightarray = $goodsobj->getdata(5, "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');
//读取分类
$typeobj = new TableClass('goodstype', 'typeid');
$typearray = $typearray2 = array();
$typearray = $typeobj->getdata('', '', 'typeid asc');
foreach ($typearray as $val) {
    $typearray2[$val['typeid']] = $val;
}
$temparray = array('typeid' => 0, 'typename' => lang('All_Categories'));
$typearray2[0] = $temparray;
//utf-8过滤用于搜索的字符串
function FilterSearch($keyword)
{
    $keyword = ereg_replace("[\"\r\n\t\$\\><']", '', $keyword);
    if ($keyword != stripslashes($keyword)) {
        return '';
    } else {
        return $keyword;
Exemple #26
0
    $wherestr[] = "touname='{$_ADMINUSERS['adminname']}'";
}
//自己的短信列表
if (!empty($wherestr)) {
    $wheresql = implode(' AND ', $wherestr);
}
//条件汇总
$pmarray = $PM->getdata(3, $wheresql);
//获取短信息
$GUESTBOOK = new TableClass("guestbook", "gid");
$guestbookarray = $GUESTBOOK->getdata(3);
//获取留言数据
$SENDORDER = new TableClass("sendorder", "sid");
$sendorderarray = $SENDORDER->getdata(4);
//获取发货单数据
$ADMIN = new TableClass("admin", "adminid");
$adminarray = $ADMIN->getdata(5);
//获取管理员列表
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.3790.0" name=GENERATOR>
<link href="skin/skin_0/style/main.css" rel="stylesheet" type="text/css" />
<!--划动门内容CSS-->
<link href="skin/skin_0/style/HX101515261033.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
 function setsmtp()
 {
     $smtp = new TableClass("smtpaccount", 'eid');
     //设置总数和数组
     $this->smtpcount = $smtp->getcount("state=1");
     $this->smtparray = $smtp->getdata("", "state=1");
     //查询获取数据
     unset($smtp);
 }
Exemple #28
0
<?php

include "../common.inc.php";
include "function_common.php";
InitGP(array("page", "action", "state", "value", "nid", "ids", "did", "delids"));
//初始化变量全局返回
$Table = new TableClass("news", "nid");
AjaxHead();
//禁止页面缓存
if (empty($action)) {
    InitGP(array("nid", "title", "seokeywords", "seodescription", "listorder", "body"));
    //初始化变量全局返回
    if (!empty($_POST) and !empty($title)) {
        $nid = GetNum($nid);
        if (empty($body)) {
            showmsg("内容不能为空!", PHP_SELF);
        }
        //出错!
        $arrayadd = array("title" => Char_cv($title), "seokeywords" => Char_cv($seokeywords), "seodescription" => Char_cv($seodescription), "listorder" => GetNum($listorder), "body" => HtmlReplace($body, -1), "addtime" => time());
        $info = $Table->add($arrayadd);
        if (GetNum($info)) {
            showmsg("发布成功!", PHP_SELF);
            //出错!
        } else {
            showmsg("发布失败!", "-1");
            //出错!
        }
    } else {
        //print_r($evalue);
        include "tpl/news_add.htm";
    }
Exemple #29
0
 function carttofavorite($id)
 {
     if (!empty($id)) {
         $wherestr = $this->joinid($id);
     }
     if (empty($wherestr)) {
         return lang('goodsID_notempty');
     }
     //获取数据
     $temparray = $this->getdata("", $wherestr);
     if (!empty($temparray)) {
         foreach ($temparray as $value) {
             if (!empty($value['uname'])) {
                 $addarray = array('uid' => $value['uid'], 'uname' => $value['uname'], 'goodsurl' => $value['goodsurl'], 'goodsname' => $value['goodsname'], 'goodsprice' => $value['goodsprice'], 'goodsimg' => $value['goodsimg'], 'goodsseller' => $value['goodsseller'], 'sellerurl' => $value['sellerurl'], 'goodssite' => $value['goodssite'], 'siteurl' => $value['siteurl'], 'addtime' => time());
                 //处理插入数据库
                 $f = new TableClass("favorite", "fid");
                 $info = $f->add($addarray);
                 if (GetNum($info)) {
                     $seccessid[] = $info;
                 } else {
                     return lang('Handling_goodsID') . $value['gid'] . lang('Error_add_Favorite');
                 }
             }
         }
         return 'OK';
     } else {
         return lang('Data_notfound');
     }
 }
Exemple #30
0
<?php

//我的劵
InitGP(array("action", "type", "bid", "page"));
//初始化变量全局返回
$r = new TableClass("address", "aid");
if (empty($action)) {
    $defaid = DB::result_first("select aid from " . DB::table("address") . " where def=1 and uname='" . $_USERS['uname'] . "'");
    if (empty($defaid)) {
        $defaid = -1;
    }
    include template('member_myaddress');
    //包含输出指定模板
} elseif ($action == "get") {
    if (!empty($_USERS['uname'])) {
        $uname = $_USERS['uname'];
        $wherestr[] = "uname='{$uname}'";
        if (!empty($wherestr)) {
            $wheresql = implode(' AND ', $wherestr);
        }
        //条件汇总
        //获取当前页码
        $dataarray = $r->getdata("", $wheresql);
        //获取团购数据
        $temparray = array();
        foreach ($dataarray as $key => $val) {
            $temparray[$key]['ID'] = $val['aid'];
            $temparray[$key]['AreaID'] = $val['aid'];
            $temparray[$key]['CountryName'] = $val['country'];
            $temparray[$key]['CityName'] = $val['city'];
            $temparray[$key]['Telephone'] = $val['tel'];