if (isset($info[0]['error'])) { $imgdata = ""; } $arrayadd = array("gtypeid" => GetNum($gtypeid), "goodsname" => Char_cv($goodsname), "goodsimg" => $imgdata, "goodsprice" => GetNum($goodsprice), "rindex" => GetNum($rank), "views" => GetNum($views), "buynum" => GetNum($buynum), "listorder" => GetNum($listorder), "about" => HtmlReplace($about, -1), "addtime" => time()); $info = $Table->add($arrayadd); if (GetNum($info)) { showmsg("发布成功!", PHP_SELF); //出错! } else { showmsg("发布失败!", "-1"); //出错! } } else { if (!empty($_POST['goodsurl'])) { include INC_PATH . "/shopsite.class.php"; $shop = ShopClass::init(); $shopinfo = $shop->get($_POST['goodsurl']); $evalue = $shopinfo; $evalue['goodsurl'] = $shopinfo['url']; } //print_r($evalue); include "tpl/shop_goods_add.htm"; } } elseif ($action == "edit" && !empty($gid)) { InitGP(array("gid", "gtypeid", "goodsurl", "goodsname", "goodsprice", "goodsseller", "imgold", "sellerurl", "shopname", "views", "buynum", "rank", "why", "listorder", "about")); if (!empty($_POST) and !empty($goodsname) and !empty($gid)) { $gid = GetNum($gid); if (empty($gtypeid)) { showmsg("必须选择分类!", PHP_SELF); } //出错!
<?php //弹出一键填单相关ajax数据处理 include "../common.inc.php"; InitGP(array("action", "url", "refuname", "referer", "aid", "cityid")); //初始化变量全局返回 include INC_PATH . "/shopsite.class.php"; $shopsite = ShopClass::init(); AjaxHead(); if ($action == 'get' and !empty($url)) { $url = str_replace("tmall", "taobao", $url); $info = $shopsite->get($url); if (empty($info)) { $data['_statusCode'] = 500; } $info['sellerurl'] = str_replace('" target="_blank', '', $info['sellerurl']); $data['d'] = array('Href' => $info['url'], 'Name' => $info['goodsname'], 'BuyNum' => $info['goodsnum'], 'Freight' => $info['sendprice'], 'IsAuction' => 0, 'IsFreightFree' => 'false', 'Picture' => $info['goodsimg'], 'Price' => $info['goodsprice'], 'Remark' => '', 'Shop' => array('Href' => $info['sellerurl'], 'Name' => $info['goodsseller'], 'Credit' => 0, 'DeliverySpeed' => 0, 'PositiveRatio' => 0, 'ServiceAttitude' => 0, 'Trueness' => 0), 'Thumbnail' => $info['goodsimg'], 'VIPPrice1' => -1, 'VIPPrice2' => -1, 'VIPPrice3' => -1, 'Error' => '', 'UserGroup' => 0); echo json_encode($data); exit; } else { if ($action == 'add') { //抓取商品加入购物车ajax $strjson = str_replace("'", '"', stripslashes($_POST['adddata'])); $pdata = json_decode($strjson); $p_name = Char_cv($pdata->name); $p_price = GetNum($pdata->price); $p_fee = GetNum($pdata->freight); $p_num = GetNum($pdata->buyNum); $p_note = Char_cv($pdata->remark); $p_url = Char_cv($pdata->href); $p_size = Char_cv($pdata->chicun);
<?php include "../common.inc.php"; include "function_common.php"; InitGP(array("page", "action", "state", "value", "sid", "ids", "did", "delids")); //初始化变量全局返回 $Table = new TableClass("shopsite", "sid"); AjaxHead(); //禁止页面缓存 include_once INC_PATH . '/shopsite.class.php'; $ShopSite = new ShopClass(); if (empty($action)) { InitGP(array("state", "orderby", "orderway", "keywords")); //初始化变量全局返回 if (!empty($state)) { $wherestr[] = "state='{$state}'"; } if (!empty($wherestr)) { $wheresql = implode(' AND ', $wherestr); } //条件汇总 $orderway = $orderway == "desc" ? "desc" : "asc"; if (!empty($orderby)) { $orderstr = "{$orderby} {$orderway}"; } //获取当前页码 $total = $Table->getcount($wheresql); //总信息数 $pagesize = 15; //一页显示信息数 $page = isset($page) ? max(1, intval($page)) : 1;