function verify($userId, $vName) { $query = pdoQuery($_SESSION['signInTable'], array('user_name as name'), array('id' => $userId), null); $r = $query->fetch(); if (md5($r['name']) == $vName) { return true; } else { return false; } }
public function getTokenOnLine() { include_once $GLOBALS['mypath'] . '/includes/db.inc.php'; $appinf = pdoQuery('user_tbl', null, array('weixin_id' => $this->weixinId), null); $data = $appinf->fetch(); $jsonToken = file_get_contents('https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $data['app_id'] . '&secret=' . $data['app_secret']); $geted = json_decode($jsonToken, true); $geted['gettedTime'] = time(); $this->currentToken = $geted['access_token']; $this->gettedTime = $geted['gettedTime']; $this->expiresIn = $geted['expires_in']; $reJson = json_encode($geted); file_put_contents($GLOBALS['mypath'] . '/tokens/' . $this->weixinId . '.token', $reJson); // wxlog($reJson); // wxlog($GLOBALS['mypath'] . '/tokens/'.$this->weixinId.'.token'); wxlog($this->weixinId . ': getTokenOnLine'); }
function expressQuery($msg, $str) { $query = pdoQuery('user_express_query_view', null, array('id' => $str), ' limit 1'); $content = '订单' . $str; if ($row = $query->fetch()) { if ($row['c_id'] == $msg['from']) { if ($row['express_order'] != null) { $name = $row['express_name']; $eorder = $row['express_order']; $content .= '已发货' . "/n" . '物流公司:' . $name . "/n" . '物流单号:' . $eorder; } else { $content .= '尚未发货'; } } else { $content = '无法查询他人创建的订单'; } } else { $content .= '不存在,请检查输入'; } return $content; }
$buttonInf = $menuInf['menu']['button']; include 'menuedit.html.php'; } if (isset($_GET['del_guess_tbl'])) { $sql = 'delete from guess_tbl where weixin_id="' . $_SESSION['weixinId'] . '"'; $pdo->exec($sql); header('location: index.php'); } if (isset($_GET['modultest'])) { //功能测试块 printView('/admin/view/newsEdit.html.php', '测试页'); // unlink("../user_img/gh_904600228e98/eElEEzrE53tgVvwL*"); exit; } if (isset($_GET['getContact'])) { $query = pdoQuery('guess_tbl', null, array('weixin_id' => $_SESSION['weixinId']), ' order by correct_try desc, update_time asc limit 20'); printView('/admin/view/query.html.php', '自动回复设置'); } if (isset($_GET['kfManage'])) { $data = getKFinf(); $dataArray = json_decode($data, true); printView('/admin/view/kfManage.html.php', '客服管理'); exit; } } else { include '../login/index.php'; } /** * Created by PhpStorm. * User: godlee * Date: 2015/4/21
private function checkSignature() { // you must define TOKEN by yourself // if (!defined("TOKEN")) { // throw new Exception('TOKEN is not defined!'); // } $query = pdoQuery('user_tbl', array('token'), array('weixin_id' => $this->weixinId), 'limit 1'); $row = $query->fetch(); $token = $row['token']; $signature = $_GET["signature"]; $timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $tmpArr = array($token, $timestamp, $nonce); sort($tmpArr, SORT_STRING); $tmpStr = implode($tmpArr); $tmpStr = sha1($tmpStr); if ($tmpStr == $signature) { return true; } else { return false; } }
echo $row['inf']; exit; } if (isset($_POST['addToCart'])) { if (isset($_SESSION['customerId'])) { // mylog(('insert')); $cartId = pdoInsert('cart_tbl', array('c_id' => $_SESSION['customerId'], 'g_id' => $_POST['g_id'], 'd_id' => $_POST['d_id'], 'number' => $_POST['number']), 'update'); $value = array(); foreach ($_SESSION['buyNow']['partsList'] as $k => $v) { $value[] = array('cart_id' => $cartId, 'part_id' => $k, 'part_number' => $v); } pdoBatchInsert('part_cart_tbl', $value); if (isset($_SESSION['tempCart'])) { } if (!isset($_SESSION['customerLogin'])) { pdoInsert('custom_login_tbl', array('id' => $_SESSION['customerId']), ' ignore'); $_SESSION['customerLogin'] = true; } } else { $_SESSION['tempCart'][] = array('g_id' => $_POST['g_id'], 'd_id' => $_POST['d_id'], 'number' => $_POST['number']); } } if (isset($_POST['adFilter'])) { $adQuery = pdoQuery('(select * from user_ad_filt_view order by sale asc) p', null, array('mc_id' => $_POST['mc_id']), ' group by g_id limit 10'); $inf = array(); foreach ($adQuery as $row) { $inf[] = $row; } echo json_encode($inf); exit; }
<?php $mypath = $_SERVER['DOCUMENT_ROOT'] . '/wechat'; //用于直接部署 include_once $mypath . '/includes/magicquotes.inc.php'; include_once $mypath . '/includes/db.inc.php'; include_once $mypath . '/includes/helpers.inc.php'; session_start(); if (isset($_POST['checkName'])) { $ncheck = pdoQuery($_SESSION['signInTable'], array('count(*) as num'), array('name' => $_POST['checkName']), null); $row = $ncheck->fetch(); $num = $row['num']; echo $num; // echo 0; }
function getWechatMode($customerId) { $query = pdoQuery('wechat_mode_tbl', null, array('c_id' => $customerId), ' limit 1'); if ($row = $query->fetch()) { $mode = $row['mode']; } else { $mode = 'normal'; pdoInsert('wechat_mode_tbl', array('c_id' => $customerId, 'mode' => $mode), 'ignore'); } return $mode; }
$sql = "call sp_movemenu('d'," . $MenuNum . "," . $LineNum . ")"; pdoQuery($sql, $connAdHoc); } if (isset($_REQUEST['addm'])) { $sql = "call sp_addmenu(" . $MenuNum . ")"; pdoQuery($sql, $connAdHoc); } if (isset($_REQUEST['addq'])) { $sql = "call sp_addquery(" . $nextMenu . ")"; pdoQuery($sql, $connAdHoc); } // end of updates ///////////////// $sql = "call sp_getmenu(" . $nextMenu . ")"; pdoQuery($sql, $connAdHoc); $adHocStmt = pdoQuery($sql, $connAdHoc); $adHocRows = pdoFetch($adHocStmt); ?> <HTML> <HEAD> <?php echo cHeaderComment; ?> <TITLE>Ad Hoc Admin</TITLE> <LINK REL="stylesheet" HREF=<?php echo cStylesheet; ?> TYPE="text/css" /> </HEAD> <BODY BGCOLOR="#000000"> <!-- Header table -->
<?php $mypath = $_SERVER['DOCUMENT_ROOT'] . '/wechat'; include_once $mypath . '/includes/magicquotes.inc.php'; include_once $mypath . '/includes/db.inc.php'; include_once $mypath . '/includes/helpers.inc.php'; include_once $mypath . '/class/wechat.php'; if (isset($_GET['id'])) { wxlog('fetch,to:' . $_GET['id']); $weixinId = $_GET['id']; $query = pdoQuery('duty_tbl', array('duty'), array('weixin_id' => $weixinId), ' limit 1'); $data = $query->fetch(); $decodeData = json_decode($data['duty'], true); $weixin = new wechat($weixinId); $weixin->valid(); $msg = $weixin->receiverFilter(); foreach ($decodeData['dutyContent'] as $row) { // wxlog('include:'.$mypath.'/'.$row); $query = pdoQuery('module_config_tbl', array('config'), array('weixin_id' => $weixinId, 'module_path' => $row), ' limit 1'); if ($config = $query->fetch()) { $config = json_decode($config['config'], true); $config = $config['config']; } include_once $mypath . '/' . $row; } echo ''; eixt; } header('location: admin/index.php');
function getBuyNowDetail($d_id, $number, array $partsList) { $gInfQuery = pdoQuery('user_tmp_list_view', null, array('d_id' => $d_id), null); $row = $gInfQuery->fetch(); $price = isset($row['price']) ? $row['price'] : $row['sale']; $goodsList[0] = array('g_id' => $row['g_id'], 'd_id' => $row['d_id'], 'name' => $row['name'], 'produce_id' => $row['produce_id'], 'category' => $row['category'], 'price' => $price, 'number' => $number, 'total' => $number * $price, 'url' => $row['url']); foreach ($partsList as $k => $v) { $partsId[] = $k; } if (!isset($partsId)) { $partsId = array(); } $pquery = pdoQuery('parts_view', null, array('g_id' => $partsId), null); foreach ($pquery as $prow) { $goodsList[0]['parts'][] = array('part_id' => $prow['g_id'], 'part_name' => $prow['name'], 'part_produce_id' => $prow['produce_id'], 'part_d_id' => $prow['d_id'], 'part_url' => $prow['url'], 'part_sale' => $prow['sale'], 'part_number' => $partsList[$prow['g_id']]); $goodsList[0]['total'] += $prow['sale'] * $partsList[$prow['g_id']]; } return array('totalPrice' => $goodsList[0]['total'], 'totalSave' => 0, 'goodsList' => $goodsList); // $totalPrice=$goodsList[0]['total']; // $totalSave=0; }
<?php include_once '../includePackage.php'; include_once $GLOBALS['mypath'] . '/wechat/interfaceHandler.php'; session_start(); //include 'view/wxpay.html.php'; //mylog('reach'); if (isset($_POST['prePay'])) { // mylog(getArrayInf($_SERVER)); $query = pdoQuery('order_tbl', null, array('id' => $_POST['order_id'], 'stu' => '0'), ' limit 1'); if ($inf = $query->fetch()) { if (0 == $inf['stu']) { $date = array(); $date['appid'] = APP_ID; $date['mch_id'] = MCH_ID; $date['nonce_str'] = getRandStr(32); $date['body'] = 'gshopPay'; $date['spbill_create_ip'] = $_SERVER['REMOTE_ADDR']; $date['out_trade_no'] = $_POST['order_id']; $date['total_fee'] = $inf['total_fee'] * 100; $date['notify_url'] = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; $date['trade_type'] = 'JSAPI'; $date['openid'] = $inf['c_id']; $sign = makeSign($date, KEY); $date['sign'] = $sign; $xml = toXml($date); $handler = new interfaceHandler(WEIXIN_ID); $data = $handler->postByCurl('https://api.mch.weixin.qq.com/pay/unifiedorder', $xml); // mylog('prePayInf:' . $data); $dataArray = xmlToArray($data); $dataJson = json_encode($dataArray, JSON_UNESCAPED_UNICODE);
function loadLinks($dbAdHoc) { $sql = "SELECT q.link_field, m.menu_num, m.line_num FROM queries q" . " JOIN menus m ON q.query_num = m.main_query_num"; $stmt = pdoQuery($sql, $dbAdHoc); return pdoFetch($stmt); }
//adHocParam.php session_start(); require "adHocConst.php"; require "adHocInclude.php"; traceHide("Passed keys / value"); foreach ($_REQUEST as $key => $val) { traceHide("key:" . $key . " / val:" . $val); } $connAdHoc = pdoConnect(cAdHocServer, cAdHocDatabase, cAdHocUsername, cAdHocPassword); $thisMenu = $_REQUEST["menunum"]; $thisLine = $_REQUEST["linenum"]; $sql = " SELECT title, select_stmt" . " FROM menus" . " JOIN queries q1 ON main_query_num = query_num" . " WHERE menu_num = " . $thisMenu . " AND line_num = " . $thisLine; $stmt = pdoQuery($sql, $connAdHoc); $siteNum = $_SESSION["sitenum"]; $sqlSite = "SELECT site_name FROM sites WHERE site_num = " . $siteNum; $siteStmt = pdoQuery($sqlSite, $connAdHoc); $siteRow = pdoFirstRow($siteStmt); $siteName = pdoData($siteRow, "site_name"); //get today's date $pageDate = dateNow(); $row = pdoFirstRow($stmt); ?> <HTML> <HEAD> <?php echo cHeaderComment; ?> <TITLE><?php echo pdoData($row, "title"); ?> adHoc Query - Parameter Entry</TITLE>
/** * 比对上传文件的Md5值,如重复则直接返回原文件信息 * @param $news_id 图文信息名 * @param $md5 上传文件的md5值 */ public function checkFileMd5($md5) { $query = pdoQuery('image_view', null, array('remark' => $md5), 'limit 1'); if ($row = $query->fetch()) { $this->fileName = $row['id']; $this->fullName = $row['url']; return true; } else { return false; } }
function deleteBanByID($id) { pdoQuery("DELETE FROM " . TINYIB_DBBANS . " WHERE id = ?", array($id)); }
exit; } if (isset($_FILES['parts-img-up'])) { $uploader = new uploader('parts-img-up'); $uploader->upFile($_GET['g_id'] . '_' . time() . rand(1000, 9999)); $inf = $uploader->getFileInfo(); $jsonInf = json_encode($inf, JSON_UNESCAPED_UNICODE); if ('SUCCESS' == $inf['state']) { mylog('success'); $temp = pdoQuery('g_image_tbl', null, array('g_id' => $_GET['g_id']), 'limit 1'); if (!($row = $temp->fetch())) { pdoInsert('g_image_tbl', array('g_id' => $_GET['g_id'], 'url' => $inf['url'], 'remark' => $inf['md5']), 'ignore'); mylog("create record"); } else { pdoUpdate('g_image_tbl', array('remark' => $inf['md5'], 'url' => $inf['url']), array('g_id' => $_GET['g_id'])); $query = pdoQuery('image_view', null, array('remark' => $row['remark']), ' limit 1'); if (!($t = $query->fetch())) { unlink('../' . $row['url']); mylog('unlink"../' . $row['url']); } else { mylog('not unlink'); } } } mylog($jsonInf); echo $jsonInf; exit; } // if (isset($_GET['g_id'])){ // // }
header('location: index.php?orders=1'); exit; } if (isset($_GET['start_promotions'])) { pdoInsert('promotions_tbl', array('g_id' => $_GET['g_id'], 'd_id' => $_GET['d_id'])); header('location: index.php?promotions=1'); exit; } if (isset($_GET['delete_promotions'])) { $str = 'delete from promotions_tbl where d_id=' . $_GET['d_id']; exeNew($str); header('location: index.php?promotions=1'); exit; } if (isset($_GET['del_detail_id'])) { $query = pdoQuery('user_order_view', array('count(*) as num'), array('d_id' => $_GET['del_detail_id']), ' '); $value = $query->fetch(); if ($value['num'] > 0) { echo 'cannot delete'; } else { pdoDelete('g_detail_tbl', array('id' => $_GET['del_detail_id'])); header('location:index.php?goods-config=1&g_id=' . $_GET['g_id']); } exit; } //公众号操作 if (isset($_GET['wechat'])) { include_once '../wechat/serveManager.php'; if (isset($_GET['createButton'])) { createButtonTemp(); exit;
?> </TABLE> <?php //----------------------------------------------------------------------------------- if (cShowRelatedQueries) { for ($i = 0; $i < 10; $i++) { traceHide("cShowRelatedQueries=true"); $relatedItem = getName($i); traceHide("relatedItem=" . $relatedItem); if ($relatedItem != "") { $relatedTitle = "Other Queries using " . $relatedItem; //Look for related enquiries, that is, where this user's query string variables // can be used in other adHocQuery records $relatedSelect = "SELECT m.menu_num, m.line_num, m.title, q.select_stmt" . " FROM queries q JOIN menus m ON m.main_query_num = q.query_num" . " WHERE q.select_stmt LIKE '%" . cParamDelimiter . $relatedItem . cParamDelimiter . "%'" . " AND m.hidden = 0" . " AND q.query_num <> " . $thisQuery . " AND (q.pre_select IS NULL OR q.pre_select = '')" . " AND EXISTS( SELECT * FROM menus mm WHERE mm.main_query_num = q.query_num GROUP BY mm.main_query_num" . " HAVING m.menu_num = MIN(mm.menu_num))" . " ORDER BY m.title"; traceHide("relatedSelect=" . $relatedSelect); $adhocStmt = pdoQuery($relatedSelect, $connAdHoc); $numRecords = pdoRowCount($adhocStmt); traceHide($relatedSelect); traceHide($numRecords . " records"); if ($numRecords > 0) { ?> <br/> <p class="ahTitleOtherLinks"><?php echo $relatedTitle; ?> (<?php echo $numRecords; ?> items)</p> <UL> <?php
echo 'ok'; exit; } if (isset($_POST['del_g_img'])) { $urlquery = pdoQuery('g_image_tbl', array('url'), array('g_id' => $_POST['g_id'], 'remark' => $_POST['md5']), 'limit 1'); $url = $urlquery->fetch(); pdoDelete('g_image_tbl', array('g_id' => $_POST['g_id'], 'remark' => $_POST['md5'])); $query = pdoQuery('g_image_tbl', array('id'), array('remark' => $_POST['md5']), ' limit 1'); if (!$query->fetch()) { unlink('../' . $url['url']); } echo 'ok'; exit; } if (isset($_POST['del_front_img'])) { $query = pdoQuery('ad_tbl', array('img_url'), array('id' => $_POST['id']), null); $row = $query->fetch(); pdoDelete('ad_tbl', array('id' => $_POST['id'])); unlink('../' . $row['img_url']); echo 'ok'; exit; } if (isset($_POST['change_part_stu'])) { pdoUpdate('part_tbl', array('dft_check' => $_POST['value']), array('id' => $_POST['id'])); echo $_POST['value']; exit; } if (isset($_POST['manageReview'])) { $id = pdoUpdate('review_tbl', array('priority' => $_POST['priority'], 'public' => $_POST['public']), array('id' => $_POST['id'])); echo $id; }
<?php $mypath = $_SERVER['DOCUMENT_ROOT'] . '/wechat'; include_once $mypath . '/includes/magicquotes.inc.php'; include_once $mypath . '/includes/db.inc.php'; include_once $mypath . '/includes/helpers.inc.php'; session_start(); //date_default_timezone_set('Asia/Shanghai'); if (isset($_SESSION['login']) && $_SESSION['login']) { $query = pdoQuery('user_tbl', array('token'), array('weixin_id' => $_SESSION['weixinId']), ' limit 1'); $row = $query->fetch(); $token = $row['token']; printView('/admin/view/index.html.php', '控制器'); } else { header('location: ../login/index.php'); }
<?php /** * Created by PhpStorm. * User: godlee * Date: 2015/10/20 * Time: 11:44 */ include_once '../includePackage.php'; session_start(); if (!isset($_SESSION['maincate'])) { $cate = pdoQuery('category_view', null, null, ''); $maincate = array(); foreach ($cate as $caRow) { $maincate[$caRow['father_id']] = array('name' => $caRow['father_name'], 'id' => $caRow['father_id']); } $_SESSION['maincate'] = $maincate; } if (isset($_GET['c_id'])) { $_SESSION['customerId'] = $_GET['c_id']; $inf = pdoQuery('custom_inf_tbl', null, array('openid' => $_SESSION['customerId']), ' limit 1'); $_SESSION['userInf'] = $inf->fetch(); // mylog(getArrayInf($_SESSION['userInf'])); } $config = getConfig('config/config.json'); $adQuery = pdoQuery('ad_tbl', null, null, ''); foreach ($adQuery as $adRow) { $adList[$adRow['category']][] = $adRow; } //mylog(getRandStr(32)); include 'view/index.html.php';
<?php /** * Created by PhpStorm. * User: godlee * Date: 2015/5/25 * Time: 13:29 */ include_once $mypath . '/class/interfaceHandler.php'; wxlog('include default ok'); $query = pdoQuery('default_reply_tbl', null, array('weixin_id' => $weixinId), ' order by key_word desc limit 10'); //$queryArray=$query->fetchAll(); foreach ($query as $row) { if (preg_match('/' . $row['key_word'] . '/', $msg['Content'])) { switch ($row['reply_type']) { case 'text': $weixin->replyMsg(array('Content' => $row['content'], 'MsgType' => 'text')); // $response=$weixin->prepareTextMsg($msg['from'],$msg['me'],$row['content']); // echo $response; exit; break; case 'news': $response = $weixin->prepareNewsMsg($msg['from'], $msg['me'], $row['content']); echo $response; exit; break; } } } //$response = $weixin->prepareTextMsg($msg['from'], $msg['me'], ); $response = '';
$mypath = $_SERVER['DOCUMENT_ROOT'] . '/wechat'; $myurl = 'http://115.29.202.69/wechat'; include_once $mypath . '/includes/magicquotes.inc.php'; include_once $mypath . '/includes/db.inc.php'; include_once $mypath . '/includes/helpers.inc.php'; if (isset($_GET['page_offset'])) { if (isset($_GET['page_down'])) { $query = pdoQuery('upload_tbl', array('file_path'), null, 'limit ' . $_GET['page_offset'] . ', 10'); $page_index = $_GET['page_offset'] + 10; echo $_GET['page_offset'] . '--' . $page_index; } else { $page_index = $_GET['page_offset'] - 20; if ($page_index < 0) { $page_index = 0; } $query = pdoQuery('upload_tbl', array('file_path'), null, 'limit ' . $page_index . ', 10'); $page_index += 10; echo $page_index - 10 . '--' . $page_index; } include 'index.html.php'; exit; } $page_index = 10; $query = pdoQuery('upload_tbl', array('file_path'), null, 'limit 0,10'); include 'index.html.php'; /** * Created by PhpStorm. * User: godlee * Date: 2015/4/24 * Time: 15:58 */
$_SESSION['login'] = true; $_SESSION['userName'] = $_POST['name']; header('location: ../admin'); exit; } else { include 'signup.html.php'; exit; } } if (isset($_GET['signup'])) { include 'signup.html.php'; exit; } if (isset($_POST['login'])) { //判断登入是否正确 $password = pdoQuery($_SESSION['signInTable'], null, array('name' => $_POST['user_name']), 'limit 1'); if ($row = $password->fetch()) { if (md5($_POST['password']) == $row['password']) { $_SESSION['login'] = true; $_SESSION['userName'] = $row['user_name']; $_SESSION['weixinId'] = $row['weixin_id']; header('location: ../admin'); } else { $error = '密码不正确'; include 'loginError.html.php'; exit; } } else { $error = '用户名不存在'; include 'loginError.html.php'; exit;
<?php /** * Created by PhpStorm. * User: godlee * Date: 2015/5/15 * Time: 13:15 */ $mypath = $_SERVER['DOCUMENT_ROOT'] . '/wechat'; include_once $mypath . '/includes/magicquotes.inc.php'; include_once $mypath . '/includes/db.inc.php'; include_once $mypath . '/includes/helpers.inc.php'; if (isset($_POST['msgNum'])) { $currentId = (string) $_POST['currentId']; if ($currentId == -1) { $time = (string) time(); $data = pdoQuery('wechat_wall_tbl', null, array('owner' => $_POST['owner']), ' order by id desc limit ' . $_POST['msgNum']); } else { $data = pdoQuery('wechat_wall_tbl', null, array('owner' => $_POST['owner']), ' and id>' . $currentId . ' order by id asc limit ' . $_POST['msgNum']); } $query = array(); foreach ($data as $row) { $query[] = array('id' => $row['id'], 'user_name' => $row['user_name'], 'sex' => $row['sex'], 'user_icon' => $row['user_icon'], 'content' => $row['content'], 'img_url' => $row['img_url'], 'upload_time' => $row['upload_time']); } $jsonData = json_encode($query); echo $jsonData; }
<BODY BGCOLOR="#000000"> <!-- Header table --> <TABLE BORDER="0" WIDTH="800" CELLPADDING="0" CELLSPACING="0"> <TR><TD WIDTH="3"> </TD><TD WIDTH="597"> <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"><TR> <TD><P CLASS="title">Ad Hoc Menu (<?php echo $nextMenu; ?> / <?php echo pdoRowCount($adHocStmt); ?> )</P></TD> <?php if (cMultipleSites) { $sqlSites = "SELECT site_num, site_name FROM sites"; $adHocSitesStmt = pdoQuery($sqlSites, $connAdHoc); $adHocSitesRows = pdoFetch($adHocSitesStmt); ?> <TD> <FORM ACTION="adHocMenu.php" METHOD="post"> <SELECT NAME="sitenum" SIZE="1" ONCHANGE="this.form.submit();"> <?php foreach ($adHocSitesRows as $row) { if ($siteNum == pdoData($row, "site_num")) { $sel = "SELECTED"; } else { $sel = ""; } ?> <OPTION <?php echo $sel;
pdoUpdate('order_tbl', array('stu' => '1'), array('id' => $_GET['out_trade_no'])); //判断该笔订单是否在商户网站中已经做过处理 //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序 //请务必判断请求时的total_fee、seller_id与通知时获取的total_fee、seller_id为一致的 //如果有做过处理,不执行商户的业务程序 //注意: //退款日期超过可退款期限后(如三个月可退款),支付宝系统发送该交易状态通知 //调试用,写文本函数记录程序运行情况是否正常 //logResult("这里写入想要调试的代码变量值,或其他运行的结果记录"); } else { if ($_POST['trade_status'] == 'TRADE_SUCCESS') { // pdoUpdate('order_tbl',array('stu'=>'1'),array('id'=>$_GET['out_trade_no'])); include_once '../wechat/serveManager.php'; $orderId = $out_trade_no; pdoUpdate('order_tbl', array('stu' => "1"), array('id' => $orderId)); $query = pdoQuery('order_tbl', null, array('id' => $orderId), ' limit 1'); $inf = $query->fetch(); $payChkArray = array('first' => array('value' => '您在阿诗顿商城的网购订单已支付成功:'), 'orderno' => array('value' => $orderId, 'color' => '#0000ff'), 'amount' => array('value' => '¥' . $total_fee, 'color' => '#0000ff'), 'remark' => array('value' => '商城即将安排发货,请留意物流通知')); $re = sendTemplateMsg($inf['c_id'], $template_key_order, '', $payChkArray); //判断该笔订单是否在商户网站中已经做过处理 //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序 //请务必判断请求时的total_fee、seller_id与通知时获取的total_fee、seller_id为一致的 //如果有做过处理,不执行商户的业务程序 //注意: //付款完成后,支付宝系统发送该交易状态通知 //调试用,写文本函数记录程序运行情况是否正常 //logResult("这里写入想要调试的代码变量值,或其他运行的结果记录"); } } //——请根据您的业务逻辑来编写程序(以上代码仅作参考)—— echo "success";
if (null == $review) { $review = array(); } printView('admin/view/review.html.php', '评价管理'); exit; } if (isset($_GET['wechatConfig'])) { printView('admin/view/wechatConfig.html.php', '微信公众平台'); exit; } if (isset($_GET['logout'])) { //登出 session_unset(); include 'view/login.html.php'; exit; } $frontImg = pdoQuery('ad_tbl', null, array('category' => 'banner'), null); printView('admin/view/admin_index.html.php'); exit; } else { if (isset($_GET['login'])) { if (md5($_POST['adminName']) . md5($_POST['password']) == '9f6c470eab19fdca07401196068f78d554b51a86e539d9f8f711e67826ea60d5') { $_SESSION['login'] = 1; $frontImg = pdoQuery('ad_tbl', null, array('category' => 'banner'), null); printView('admin/view/admin_index.html.php'); } exit; } include 'view/login.html.php'; exit; }
foreach ($mediaList['item'] as $row) { $allList[] = json_encode($row, JSON_UNESCAPED_UNICODE); } } if (isset($_POST['content'])) { $_POST['key_word'] = trim($_POST['key_word']); $key = $_POST['key_word'] == '' ? '.' : preg_replace('/,|,/', '\\|', $_POST['key_word']); $content = addslashes($_POST['content']); switch ($_POST['type']) { case 'news': $postjsondata = json_encode(array('media_id' => $_POST['content'])); $content = getMedia($postjsondata); $content = addslashes($content); break; } pdoInsert('default_reply_tbl', array('weixin_id' => $_SESSION['weixinId'], 'reply_type' => $_POST['type'], 'key_word' => $key, 'content' => $content), ' ON DUPLICATE KEY UPDATE content="' . $content . '"'); header('location: ?auto_reply=1'); } if (isset($_GET['deleteAutoReply'])) { $sql = 'delete from default_reply_tbl where weixin_id="' . $_SESSION['weixinId'] . '" and id=' . $_GET['deleteAutoReply']; $pdo->exec($sql); header('location: ?auto_reply=1'); } $query = pdoQuery('default_reply_tbl', null, array('weixin_id' => $_SESSION['weixinId']), null); printView('/admin/view/autoreply.html.php', '自动回复设置'); } if (isset($_GET['getDefultReply'])) { reflashAutoReply(); header('location: ?auto_reply=1'); } }