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; }
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); }
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); }
//我的劵 header("content-type: text/html; charset=utf-8"); InitGP(array('action', 'rid')); //初始化变量全局返回 $r = new TableClass("refund", "rid"); 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'));
} //自己的短信列表 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"> <!-- .STYLE1 {font-size: 14px}
$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); exit;
//弹出一键填单相关ajax数据处理 include "../common.inc.php"; InitGP(array("action", "url", "refuname", "referer", "aid", "cityid")); //初始化变量全局返回 $deliveryobj = new TableClass('delivery', 'did'); AjaxHead(); if ($action == 'getdetails') { $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input'))); $countweight = GetNum($jsondata->TotleWeight); $productcost = GetNum($jsondata->TotleProductCost); $areaid = GetNum($jsondata->Area); $returntemp = array(); //获取地区信息 $areaobj = new TableClass('area', 'aid'); $arearow = $areaobj->getone($areaid); $deliveryarray = $deliveryobj->getdata('', "areaid=" . $areaid); //$serverfee=$arearow['serverfeepct']*$productcost > $arearow['serverfee']?$arearow['serverfee']:$arearow['serverfeepct']*$productcost; if (is_array($deliveryarray)) { foreach ($deliveryarray as $key => $val) { //循环处理数据 $returntemp[$key] = $val; //$returntemp[$key]['serverfee']=$serverfee; //计算运费 if ($countweight <= $val['first_weight']) { $freight = $val['first_fee']; } elseif ($countweight > $val['first_weight']) { $freight = $val['first_fee'] + ceil(($countweight - $val['first_weight']) / $val['continue_weight']) * $val['continue_fee']; } $returntemp[$key]['sendfee'] = $freight; $returntemp[$key]['serverfee'] = $arearow['serverfeepct'] * ($productcost + $freight) > $arearow['serverfee'] ? $arearow['serverfee'] : $arearow['serverfeepct'] * ($productcost + $freight); $returntemp[$key]['totlefee'] = $freight + $returntemp[$key]['serverfee'] + $val['customs_fee'];
$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; } return $restr;
} //获取当前页码 $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); } } elseif ($action == "dels") {
//获取推荐商品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'); //包含输出指定模板
<?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);
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; //偏移量 $dataarray = $r->getdata("{$offset},{$pagesize}", $wheresql); //获取团购数据 } //print_r($dataarray); include template('member_scorerecords'); //包含输出指定模板
<?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']], ',') . "}"; }
foreach ($dataarray as $value) { $tempoids[] = $value['oid']; $countmoney += $value['goodsprice'] * $value['goodsnum']; $countweight += $value['orderweight']; } $ids = getdotstring($tempoids, 'int'); $auth = $ids . "\t" . $countmoney . "\t" . $countweight; $LOCKDATA = cookie_authcode($auth, 'ENCODE'); //加密数据 //print_r($dataarray); //获取地区信息 $areaobj = new TableClass('area', 'aid'); $areaarray = $areaobj->getdata('', 'state=1'); //获取用户地址 $addressobj = new TableClass('address', 'aid'); $addressarray = $addressobj->getdata('', "uname='" . $_USERS['uname'] . "'", "def desc,aid desc"); //获取优惠卷 include_once INC_PATH . "/coupon.class.php"; $couponobj = CouponClass::init(); $wherestrc[] = "uname='" . $_USERS['uname'] . "'"; $wherestrc[] = "endtime >= " . time(); $wherestrc[] = "state = 1"; if (!empty($wherestrc)) { $wheresqlc = implode(' AND ', $wherestrc); } //条件汇总 $couponarray = $couponobj->getdata("", $wheresqlc, ""); //获取数据 include template('member_tosendorder'); //包含输出指定模板 } elseif ($action == "save") {
$wherestr[] = "state in({$tid})"; } if (!empty($wherestr)) { $wheresql = implode(' AND ', $wherestr); } //条件汇总 //获取当前页码 $total = $smtp->getcount($wheresql); //总信息数 $pagesize = 15; //一页显示信息数 $page = isset($page) ? max(1, intval($page)) : 1; //处理页码变量 $offset = ($page - 1) * $pagesize; //偏移量 $dataarray = $smtp->getdata("{$offset},{$pagesize}", $wheresql); //获取团购数据 //包含后台模板文件 include "tpl/smtp_list.htm"; } elseif ($action == "edit") { InitGP(array("eid", "smtp_server", "smtp_port", "smtp_email", "smtp_account", "smtp_password", "reply_address", "smtp_auth", "smtp_ssl", "state", "Submit")); //初始化变量全局返回 if (!empty($Submit)) { $editarray = array("smtp_server" => $smtp_server, "smtp_port" => $smtp_port, "smtp_email" => $smtp_email, "smtp_account" => $smtp_account, "smtp_password" => $smtp_password, "reply_address" => $reply_address, "smtp_ssl" => $smtp_ssl, "state" => $state, "smtp_auth" => $smtp_auth); $info = $smtp->edit($eid, $editarray); if ($info == "OK") { showmsg("编辑成功!", "smtp_list.php"); //成功 } else { showmsg($info, "-1"); }
<?php //我的劵 InitGP(array("action", "bid", "page")); //初始化变量全局返回 //获取地区信息 $areaobj = new TableClass('area', 'aid'); $areaarray = $areaobj->getdata('', 'state=1'); include template('member_estimates'); //包含输出指定模板
//if(!empty($state))$wherestr[]="state='{$state}'"; $wherestr[] = "orderimg is NULL or orderimg =''"; if (!empty($wherestr)) { $wheresql = implode(' AND ', $wherestr); } //条件汇总 //获取当前页码 $total = $Table->getcount($wheresql); //总信息数 $pagesize = 10; //一页显示信息数 $page = isset($page) ? max(1, intval($page)) : 1; //处理页码变量 $offset = ($page - 1) * $pagesize; //偏移量 $dataarray = $Table->getdata("{$offset},{$pagesize}", $wheresql, '', 'oid,goodsimg,orderimg'); //获取团购数据 $msg = "总共需要抓取图片:{$total}个<br/>"; if (!empty($dataarray)) { //抓取图片操作 foreach ($dataarray as $val) { //远程图本地化 if (!empty($val['goodsimg'])) { $tempimg = GetRemoteImage($val['goodsimg']); $thumbname = "../" . $tempimg['savepath'] . "_thumb_" . $tempimg['filename']; makeThumb("../" . $tempimg['filepath'], $thumbname); editstate($Table->table, "orderimg", "oid=" . $val['oid'], $tempimg['filepath']); //更改图片地址操作 $msg .= "更新订单ID:{$val['oid']} 图片地址成功<br/>"; } }
<?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);
<?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');
<?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 {
function setsmtp() { $smtp = new TableClass("smtpaccount", 'eid'); //设置总数和数组 $this->smtpcount = $smtp->getcount("state=1"); $this->smtparray = $smtp->getdata("", "state=1"); //查询获取数据 unset($smtp); }
//获取数据 //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>></span><a href='recommend.php?action=list&tid=" . $gtype['typeid'] . "'>" . $gtype['typename'] . "</a>"; } else { $cgtype = $typeobj->getone($gtype['node']); $position = "<span>></span><a href='recommend.php?action=list&tid=" . $cgtype['typeid'] . "'>" . $cgtype['typename'] . "</a>"; $position .= "<span>></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'); //包含输出指定模板 }
<?php //我的劵 header("Content-type: text/html; charset=utf-8"); InitGP(array("action", "bid", "page")); //初始化变量全局返回 if (empty($action)) { //最新公告 $newsobj = new TableClass('news', 'nid'); $newsarray = $newsobj->getdata(5); //获取数据 //获取最新的两个专题 $specialobj = new TableClass('special', 'sid'); $specialarray = $specialobj->getdata(2, "", 'listorder asc,sid desc', 'sid,title,flag,about,pic,listorder,addtime'); //统计订单和运单 $COUNT_ORDER4 = DB::result_first("Select count(oid) From " . DB::table('order') . " where " . "uname='" . $_USERS['uname'] . "' and state = 4"); $COUNT_ORDER3 = DB::result_first("Select count(oid) From " . DB::table('order') . " where " . "uname='" . $_USERS['uname'] . "' and state = 3"); $COUNT_SENDORDER23 = DB::result_first("Select count(sid) From " . DB::table('sendorder') . " where " . "uname='" . $_USERS['uname'] . "' and state in(2,3)"); $COUNT_SENDORDERSERVER = DB::result_first("Select count(sid) From " . DB::table('sendorder') . " where " . "uname='" . $_USERS['uname'] . "' and state =3 and commenttime is null"); } 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>";
$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'); //包含输出指定模板
<?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'); include template('tools'); //包含输出指定模板
} //条件汇总 $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; //偏移量 $dataarray = $Table->getdata("{$offset},{$pagesize}", $wheresql, $orderstr); //获取团购数据 //print_r($dataarray); //包含后台模板文件 include "tpl/admin_list.htm"; } elseif ($action == "updatestate" && !empty($ids)) { //更改状态 $state = GetNum($state); $ids = getdotstring(explode('|', $ids)); $wheresqlarr = "adminid in({$ids})"; editstate($Table->table, "state", $wheresqlarr, $state); //更改状态操作 exit("1"); } elseif ($action == "del" && !empty($did)) { //执行删除操作 $did = GetNum($did);
$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'); //包含输出指定模板 } elseif ($action == "view") { $sid = GetNum($sid); $value = $specialobj->getone($sid); include template('special_view'); //包含输出指定模板 } else { exit(lang('Missing_parameter')); }