public function EditKuaibkcard()
 {
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $authorid = trim($arr_channelinfo['authorid']);
     $bkcardid = trim($arr_body['bkcardid']);
     $bkcardbankcode = trim($arr_body['bkcardbankid']);
     $bkcardbank = trim($arr_body['bkcardbank']);
     $bkcardno = trim($arr_body['bkcardno']);
     $bkcardbankman = trim($arr_body['bkcardbankman']);
     $bkcardbankphone = trim($arr_body['bkcardbankphone']);
     $bkcardyxmonth = trim($arr_body['bkcardyxmonth']);
     $bkcardyxyear = trim($arr_body['bkcardyxyear']);
     $bkcardcvv = trim($arr_body['bkcardcvv']);
     $bkcardidcard = trim($arr_body['bkcardidcard']);
     $bkcardcardtype = trim($arr_body['bkcardcardtype']);
     $bkcardisdefault = trim($arr_body['bkcardisdefault']);
     $bkcardbankid = getbankid(u2g($bkcardbank));
     if ($bkcardisdefault == 1) {
         $query = "UPDATE tb_author_quickpaycard SET fd_bkcardisdefault = 0 WHERE fd_bkauthorid = " . $authorid;
         $db->query($query);
     }
     $query = "UPDATE tb_author_quickpaycard SET fd_bkcardno = '{$bkcardno}',fd_bkcardbankid = '{$bkcardbankid}',fd_bkcardbankcode = '{$bkcardbankcode}',fd_bkcardbank = '{$bkcardbank}',fd_bkcardbankman = '{$bkcardbankman}',fd_bkcardbankphone = '{$bkcardbankphone}',fd_bkcardyxmonth = '{$bkcardyxmonth}',fd_bkcardyxyear = '{$bkcardyxyear}',fd_bkcardcvv = '{$bkcardcvv}',fd_bkcardidcard = '{$bkcardidcard}',fd_bkcardisdefault = '{$bkcardisdefault}',fd_bkcardcardtype = '{$bkcardcardtype}' WHERE fd_bkcardid = " . $bkcardid;
     $db->query(auto_charset($query, 'utf-8', 'gbk'));
     $retcode = "0";
     $arr_message = array("result" => "success", "message" => "修改成功");
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
示例#2
0
 public function setAnswer()
 {
     $db = new DB_test();
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $authorid = trim($arr_channelinfo['authorid']);
     $query = "DELETE FROM tb_safeguard_secque_useranswer WHERE fd_author_id = {$authorid} ;";
     $db->query($query);
     if (count($arr_body) > 0) {
         for ($i = 0; $i < count($arr_body); $i++) {
             $itemKey = "msgchild" . ($i + 1);
             $questionid = trim($arr_body[$itemKey]['queid']);
             $answer = u2g(trim($arr_body[$itemKey]['answer']));
             if ($questionid != "" && trim($arr_body[$itemKey]['answer']) != "") {
                 $query = "REPLACE INTO tb_safeguard_secque_useranswer (`fd_question_id`, `fd_author_id`, `fd_answer`) \n\t\t\t\t\t\t\tVALUES ( {$questionid} , {$authorid} , '" . $answer . "');";
                 $db->query($query);
             }
         }
         $arr_message = array("result" => "success", "message" => "设置成功");
     } else {
         $arr_message = array("result" => "fail", "message" => "设置失败");
     }
     $retcode = "0";
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
 static function getcouponSale($xml, $listno, $listid, $paytype = 'coupon', $bkntno)
 {
     $db = new DB_test();
     $Publiccls = new PublicClass();
     //初始化类实例
     $arr_xml = $Publiccls->xml_to_array($xml);
     $arr_channelinfo = $arr_xml['operation_request']['msgheader']['channelinfo'];
     $arr_body = $arr_xml['operation_request']['msgbody'];
     $authorid = $arr_channelinfo['authorid'];
     $couponid = trim($arr_body['couponid']);
     $paymoney = trim($arr_body['couponmoney']);
     $paycardid = trim($arr_body['paycardid']);
     $fucardno = trim($arr_body['creditcardno']);
     $fubank = trim(u2g($arr_body['creditbank']));
     $fucardman = trim(u2g($arr_body['creditcardman']));
     $fucardphone = trim(u2g($arr_body['creditcardphone']));
     $method = 'in';
     $method = u2g($method);
     $query1 = "insert into tb_agentpaymoneylist(\n\t\t\t\t\t\t\tfd_agpm_no\t\t\t,fd_agpm_paycardid\t\t,fd_agpm_authorid\t ,\n\t\t\t\t            fd_agpm_paydate\t    ,fd_agpm_shoucardno\t    ,fd_agpm_fucardno\t ,\n\t\t\t\t            fd_agpm_bkntno\t\t,fd_agpm_payrq          ,fd_agpm_paytype     ,\n\t\t\t\t            fd_agpm_current\t    ,fd_agpm_paymoney\t\t,fd_agpm_payfee\t\t ,\n\t\t\t\t            fd_agpm_money\t\t,fd_agpm_shoucardbank   ,fd_agpm_shoucardman ,\n\t\t\t\t            fd_agpm_shoucardmobile,fd_agpm_fucardbank\t,fd_agpm_fucardmobile,\n\t\t\t\t            fd_agpm_fucardman   ,fd_agpm_feebankid      ,fd_agpm_state       ,\n\t\t\t\t            fd_agpm_listid     , fd_agpm_listno         ,fd_agpm_method ,\n\t\t\t\t            fd_agpm_datetime     )values\n\t\t\t\t\t\t   ('{$listno}'\t\t,'{$paycardid}'\t,'{$authorid}'\t\t,\n\t\t\t\t\t\t   now()\t\t,'{$shoucardno}'\t,'{$fucardno}'\t\t,\n\t\t\t\t\t\t   '{$bkntno}'\t\t,'01'\t\t\t,'{$paytype}'\t\t\t,\n\t\t\t\t\t\t   '{$current}'\t\t,'{$paymoney}'\t,'{$payfee}'\t\t\t,\n\t\t\t\t\t\t   '{$paymoney}'\t\t\t,'{$shoucardbank}','{$shoucardman}'\t\t,\n\t\t\t\t\t\t   '{$shoucardmobile}','{$fucardbank}'\t,'{$fucardphone}'  \t,\n\t\t\t\t\t\t   '{$fucardman}'\t\t,'{$feebankid}'\t,'0'\t            ,\t\t\n\t\t\t\t\t\t   '{$listid}'\t\t,'{$listno}'\t    ,'{$method}'\t,now()        \t\t\t\n\t\t\t\t\t\t  )";
     $db->query($query1);
     $authorid = $authorid + 0;
     $file = "./" . date('Y-m-d') . "-paylist" . ".txt";
     $filehandle = fopen($file, "a");
     fwrite($filehandle, "\r\n======响应内容:\r\n" . $query1 . "\r\n\r\n\r\n\r\n<!--------------结束------------>\r\n\r\n\r\n");
     fclose($filehandle);
     return 1;
 }
 /**
  * get_gpath获取以/开头的虚拟路径,GB2312 用于访问文件系统
  * get_upath获取以/开头的虚拟路径,UTF-8  用于页面输出
  * @param unknown_type $path
  * @param unknown_type $type
  * @return unknown
  */
 function get_gpath($path, $type = 'u')
 {
     if ('r' == $type) {
         $path = str_replace('//', '/', REAL_ROOT_PATH . $path);
     }
     if ('u' == $type) {
         $path = str_replace('//', '/', REAL_USER_PATH . $path);
     }
     $path = SYS_WIN ? u2g($path) : $path;
     return $path;
 }
示例#5
0
 public function readBankList()
 {
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $activemobilesms = trim($arr_body['activemobilesms']);
     $querysql = trim(u2g(trim($arr_body['querywhere'])));
     //$appversion = trim($arr_body['appversion']);
     $msgstart = $arr_body['msgstart'] + 0;
     $msgdisplay = $arr_body['msgdisplay'] + 0;
     if ($msgstart < 0) {
         $msgstart = 0;
     }
     if ($msgdisplay == 0) {
         $msgdisplay = 40;
     }
     if ($activemobilesms) {
         $querywhere = " and fd_bank_activemobilesms = '1'";
     }
     if ($querysql != "") {
         $querywhere .= " and fd_bank_name like '%{$querysql}%'";
     }
     $query = "select  1 from tb_bank where fd_bank_active = '1' {$querywhere}  ";
     $db->query($query);
     $msgallcount = $db->nf();
     if ($msgstart >= $msgallcount) {
         $msgstart = $msgallcount - $msgdisplay;
         if ($msgstart < 0) {
             $msgstart = 0;
         }
     }
     $query = "select fd_bank_id as bankid,fd_bank_no as bankno,fd_bank_name as bankname from \n\t\t\t       tb_bank where fd_bank_active = '1' {$querywhere} order by fd_bank_no asc limit {$msgstart}, {$msgdisplay} ";
     //只显示激活的银行列表
     $db->query($query);
     $arr_msg = auto_charset($db->getData('', 'msgbody'), 'gbk', 'utf-8');
     $msgdiscount = $db->nf();
     if (!$arr_msg) {
         $arr_message = array("result" => "failure", "message" => "查询银行列表数据为空!");
         $retcode = "0";
         //反馈状态 0 成功 200 自定义错误
     } else {
         $arr_message = array("result" => "success", "message" => "读取成功!");
         $retcode = "0";
         //反馈状态 0 成功 200 自定义错误
     }
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $arr_msg['msgbody']['msgallcount'] = $msgallcount;
     $arr_msg['msgbody']['msgdiscount'] = $msgdiscount + $msgstart;
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
示例#6
0
 public function getorderinfo($querywhere, $start, $display)
 {
     $dbmsale = new DB_mssale();
     if ($start < 0) {
         $start = 0;
     }
     $start = $start + 0;
     $display = $display + 0;
     $query = "select 1  from web_order where 1=1    {$querywhere} ";
     $dbmsale->query($query);
     $msgallcount = $dbmsale->nf();
     $wfstate = '未付款';
     $wfstate = u2g($wfstate);
     $yfstate = '已付款';
     $yfstate = u2g($yfstate);
     $qfstate = '其他';
     $qfstate = u2g($qfstate);
     $query = "select case \n\t        when fd_order_state ='6' then '" . $wfstate . "'\n\t        when fd_order_state ='7' then '" . $yfstate . "'\n\t        else '" . $qfstate . "' END  orderstate,fd_order_id as orderid,fd_order_no as orderno ,\n\t\t                 fd_order_date as ordertime  ,fd_order_allmoney as ordermoney,fd_order_alldunshu as orderpronum,\n\t\t                 fd_order_type as orderpaytype,fd_order_shman as shman,fd_order_comnpany as shcmpyname,\n\t\t                 fd_order_receiveadderss as shaddress , '' as fhstorage,'' as fhwltype,\n\t\t                 fd_order_memo as ordermemo,'' as allpromoney,'' as fhwlmoney\n\t\t                 from web_order " . "where 1=1  {$querywhere} limit {$start} ,{$display}";
     $dbmsale->query($query);
     //echo $query;
     $msgdiscount = $dbmsale->nf();
     $arr_value = $dbmsale->getData('', 'msorder');
     //$arr_orderinfo = $dbmsale->get_all($query);
     foreach ($arr_value as $key => $value) {
         foreach ($value as $k => $v) {
             $orderid = $v['orderid'];
             $query = "select fd_orderdetail_quantity as pronum,fd_orderdetail_productname as proname,\n\t\t\t\t\t          fd_orderdetail_price as proprice \n\t\t\t\t\t          ,(fd_orderdetail_price*fd_orderdetail_quantity) as promoney from web_orderdetail \n\t\t\t\t\t          where fd_orderdetail_orderid ='{$orderid}'";
             $dbmsale->query($query);
             //echo $query;
             if ($dbmsale->nf()) {
                 $arr_value[$key][$k]['msproinfo'] = $dbmsale->getFiledData('msgchild');
             }
         }
     }
     if (!$arr_value) {
         $arr_message = array("result" => "failure", "message" => "很抱歉,没有找到相关的订单信息!");
     } else {
         $arr_message = array("result" => "success", "message" => "读取成功");
     }
     //echo var_dump($arr_value);
     $arr_message = auto_charset($arr_message, 'utf-8', 'gbk');
     $arr_msg['msgbody'] = $arr_value;
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $arr_msg['msgbody']['msgallcount'] = $msgallcount;
     $arr_msg['msgbody']['msgdiscount'] = $msgdiscount + $start;
     return $arr_msg['msgbody'];
 }
 public function CreateOrder($requestBody, $authorId, $payChannel)
 {
     $logger = Logger::getLogger("transfermoney");
     $logger->debug("开始创建转账付款订单");
     // 调用外部函数******
     $logger->debug("正在创建转账付款订单 : 调用函数GetPayCalcuInfo::readpaycardid,传入参数(" . $requestBody["cardReaderId"] . ", " . $authorId . ")");
     $agentInfo = GetPayCalcuInfo::readpaycardid($requestBody["cardReaderId"], $authorId);
     $logger->debug("正在创建转账付款订单 : 调用函数GetPayCalcuInfo::readpaycardid,返回的结果" . print_r($agentInfo, true));
     // ******调用外部函数
     $cardReaderId = $agentInfo["paycardid"];
     // 刷卡器ID
     $agentId = $agentInfo["cusid"];
     // 代理商ID
     $payChannelFee = 0;
     switch ($payChannel) {
         case "YiBao":
             $payChannelFee = YiBaoPay::GetPayFee($requestBody['payMoney']);
             break;
     }
     $orderId = "tfbtfs" . date("YmdHiss") . mt_rand(1000, 9999);
     // 调用外部函数******
     $orderListNumber = makeorderno("transfermoneyglist", "tfmglist", "tfs");
     // ******调用外部函数
     $payDate = date("Y-m-d H:i:s");
     $feeMoney = 0;
     // 调用外部函数******
     $logger->debug("正在创建转账付款订单 : 调用函数getbankid,传入参数(" . $requestBody["receiveBankName"] . ")");
     $receiveBankId = getbankid(u2g($requestBody["receiveBankName"]));
     if ($receiveBankId == "") {
         ErrorReponse::reponError(array("retcode" => "200", "retmsg" => "不支持的银行"));
     }
     $logger->debug("正在创建转账付款订单 : 调用函数getbankid,返回的结果" . $receiveBankId);
     $logger->debug("正在创建转账付款订单 : 调用函数GetPayCalcuInfo :: readPayFee,传入参数({$authorId}, {$receiveBankId}, " . $requestBody['transferMoney'] . ", " . $requestBody['arriveId'] . ", 2, " . $requestBody["payType"] . ")");
     $payChannelFeeInfo = GetPayCalcuInfo::readPayFee($authorId, $receiveBankId, $requestBody['transferMoney'], $requestBody['arriveId'], 2, $requestBody["payType"]);
     $logger->debug("正在创建转账付款订单 : 调用函数GetPayCalcuInfo :: readPayFee,返回的结果" . print_r($payChannelFeeInfo, true));
     if (is_array($payChannelFeeInfo)) {
         $feeMoney = $payChannelFeeInfo["feemoney"];
     }
     $arriveDate = GetPayCalcuInfo::getfeedate($payDate, $payChannelFeeInfo['addday']);
     $logger->debug("正在创建转账付款订单 : 调用函数GetPayCalcuInfo :: getfeedate,返回的结果" . $arriveDate);
     // ******调用外部函数
     $query = "INSERT INTO tb_transfermoneyglist (fd_tfmglist_no, fd_tfmglist_bkordernumber, fd_tfmglist_payrq, fd_tfmglist_paycardid, fd_tfmglist_authorid, fd_tfmglist_sdcrid, fd_tfmglist_sdcrpayfeemoney, fd_tfmglist_sdcragentfeemoney, fd_tfmglist_paytype, fd_tfmglist_paydate, fd_tfmglist_payfeedirct, fd_tfmglist_fucardno, fd_tfmglist_fucardbank, \n\t\tfd_tfmglist_fucardmobile, fd_tfmglist_fucardman, \n\t\tfd_tfmglist_shoucardno, fd_tfmglist_shoucardbank, \n\t\tfd_tfmglist_shoucardman, fd_tfmglist_shoucardmobile, fd_tfmglist_sendsms, fd_tfmglist_shoucardmemo, fd_tfmglist_current, fd_tfmglist_paymoney, fd_tfmglist_payfee, fd_tfmglist_money, fd_tfmglist_feebankid, fd_tfmglist_arrivedate, fd_tfmglist_arriveid, fd_tfmglist_state) VALUES \n\t\t('{$orderListNumber}', '{$orderId}', '01', \n\t\t'{$cardReaderId}', {$authorId}, 3, {$payChannelFee}, \n\t\t0.00, '" . $requestBody["payType"] . "', '{$payDate}', 'f', \n\t\t'" . $requestBody["sendBankCardId"] . "', '" . $requestBody["sendBankName"] . "', \n\t\t'" . $requestBody["sendPhone"] . "', '" . $requestBody["sendPersonName"] . "', \n\t\t'" . $requestBody["receiveBankCardId"] . "', '" . $requestBody["receiveBankName"] . "', \n\t\t'" . $requestBody["receivePersonName"] . "', '" . $requestBody["receivePhone"] . "', 0, '', \n\t\t'RMB', " . $requestBody["transferMoney"] . ", {$feeMoney}, " . $requestBody["payMoney"] . ", {$receiveBankId}, \n\t\t'{$arriveDate}', '" . $requestBody['arriveId'] . "', '0')";
     $logger->debug("新增数据进 tb_transfermoneyglist 的sql" . $query);
     $db = new DB_test();
     $db->query(u2g($query));
     return $orderId;
 }
示例#8
0
 function authorReg()
 {
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $aumobile = trim($arr_body['aumobile']);
     $aupassword = trim(md5($arr_body['aupassword']));
     $autruename = u2g(trim($arr_body['autruename']));
     $auidcard = trim($arr_body['auidcard']);
     $auemail = trim($arr_body['auemail']);
     $query = "select 1 from tb_author  where fd_author_username = '******'";
     $db->query($query);
     if ($db->nf()) {
         $arr_message = array("result" => "failure", "message" => "该手机号码已注册");
         $retcode = "200";
         //反馈状态 0 成功 200 自定义错误
         $havemobile = 1;
     } else {
         $havemobile = 0;
     }
     if ($havemobile != 1) {
         $query = "insert into tb_author (fd_author_password ,fd_author_mobile ,fd_author_truename,\n\t\t\t\t\t\t\t          fd_author_idcard,fd_author_email ,fd_author_username,fd_author_regtime,fd_author_datetime \n\t\t\t\t\t\t\t          )values( '{$aupassword}' ,'{$aumobile}','{$autruename}','{$auidcard}','{$auemail}','{$aumobile}',now(),now())";
         $db->query($query);
         $listid = $db->insert_id();
         $sdcrid = 3;
         $auindustryid = 4;
         $slotpayfsetid = 8;
         $slotscdmsetid = 14;
         $bkcardpayfsetid = 25;
         $bkcardscdmsetid = 9;
         $memid = 3554;
         $shopid = 102;
         $authortypeid = 5;
         $query = "update tb_author set \n\t\t\t\t\t   fd_author_isstop='0'," . "fd_author_state = '9'," . "fd_author_sdcrid = '{$sdcrid}'," . "fd_author_auindustryid = '{$auindustryid}',\n\t\t               fd_author_slotpayfsetid = '{$slotpayfsetid}',\n\t\t               fd_author_slotscdmsetid = '{$slotscdmsetid}',\n\t\t\t\t\t   fd_author_bkcardpayfsetid='{$bkcardpayfsetid}',\n\t\t\t\t\t   fd_author_bkcardscdmsetid='{$bkcardscdmsetid}' ,\n\t\t\t\t\t   fd_author_couponstate      = 0   ," . "fd_author_memid          = '{$memid}'," . "fd_author_shopid         = '{$shopid}'," . "fd_author_authortypeid   = '{$authortypeid}' \n\t\t\t\t\t   \t\t\t\t\t\t\n\t\t\t\t\t   where fd_author_id='{$listid}'";
         $db->query($query);
         $arr_message = array("result" => "success", "message" => "恭喜您,注册成功!");
         $retcode = "0";
         //反馈状态 0 成功 200 自定义错误
     }
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
 public function authorFeedbck()
 {
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $authorid = trim($arr_channelinfo['authorid']);
     $fdcontent = u2g(trim($arr_body['fdcontent']));
     $fdlinkmethod = u2g(trim($arr_body['fdlinkmethod']));
     $fdcontent = str_replace("'", "‘", $fdcontent);
     $fdcontent = str_replace("¥", "¥", $fdcontent);
     //addslashes
     $query = "insert into tb_feedback (fd_feedback_authorid ,fd_feedback_content ,fd_feedback_linkman,\n\t          fd_feedback_datetime)values( '{$authorid}' ,'{$fdcontent}','{$fdlinkmethod}',now())";
     $db->query($query);
     $arr_message = array("error_id" => "0", "result" => "success", "message" => "感谢您的宝贵意见!");
     $retcode = "0";
     //反馈状态 0 成功 200 自定义错误
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
示例#10
0
 public function modifyAuBkCardInfo()
 {
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $authorid = trim($arr_channelinfo['authorid']);
     $shoucardman = u2g(trim($arr_body['aushoucardman']));
     $shoucardphone = trim($arr_body['aushoucardphone']);
     $shoucardno = trim($arr_body['aushoucardno']);
     $shoucardbank = u2g(trim($arr_body['aushoucardbank']));
     $query = "select * from tb_author  where fd_author_id = '{$authorid}'  and fd_author_couponstate='1'";
     $db->query($query);
     if ($db->nf()) {
         $arr_message = array("result" => "failure", "message" => "银行卡资料已经审批,如需修改请联系客服!");
         $retcode = "200";
         //反馈状态 0 成功 200 自定义错误
         $Error = array('result' => 'failure', 'retcode' => '200', 'retmsg' => $arr_message['message']);
         $arr_msg['msgbody'] = array("result" => "failure", "message" => "银行卡资料已经审批,如需修改请联系客服!");
         $retcode = "200";
         //反馈状态 0 成功 200 自定义错误
         $returnvalue = array("msgbody" => $arr_msg['msgbody']);
         $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
         return $returnval;
         //$ErrorReponse->reponError($Error); //出错反馈
         //return false;
     }
     $query = "update tb_author set   fd_author_shoucardman = '{$shoucardman}',\n\t\t\t   fd_author_shoucardphone = '{$shoucardphone}',\n\t\t\t   fd_author_shoucardno='{$shoucardno}',\n\t\t\t   fd_author_shoucardbank='{$shoucardbank}',fd_author_couponstate = '0' where fd_author_id  = '{$authorid}' ";
     $db->query($query);
     $arr_msg['msgbody'] = array("error_id" => "0", "result" => "success", "message" => "恭喜您,我的银行卡修改成功!");
     $retcode = "0";
     //反馈状态 0 成功 200 自定义错误
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
示例#11
0
        }
        if ($openid) {
            if (!$user && $openid) {
                C::t('#aljwsq#aljwsq_user')->insert(array('nickname' => u2g($wuser['nickname']), 'username' => $_GET['username'], 'openid' => $openid, 'latitude' => $_GET['latitude'], 'longitude' => $_GET['longitude'], 'bindtime' => TIMESTAMP, 'sex' => $wuser['sex'], 'city' => u2g($wuser['city']), 'country' => u2g($wuser['country']), 'province' => u2g($wuser['province']), 'language' => $wuser['language'], 'headimgurl' => $wuser['headimgurl'], 'subscribe_time' => TIMESTAMP));
            } else {
                C::t('#aljwsq#aljwsq_user')->update($openid, array('nickname' => u2g($wuser['nickname']), 'username' => $_GET['username'], 'latitude' => $_GET['latitude'], 'longitude' => $_GET['longitude'], 'bindtime' => TIMESTAMP, 'sex' => $wuser['sex'], 'city' => u2g($wuser['city']), 'country' => u2g($wuser['country']), 'province' => u2g($wuser['province']), 'language' => $wuser['language'], 'headimgurl' => $wuser['headimgurl']));
            }
        }
        showmessage(lang('plugin/aljwsq', 'bind6'), 'forum.php?openid=' . $openid);
    } else {
        $binduser = DB::fetch_first('SELECT * FROM %t WHERE openid=%s', array('aljwsq_user', $openid));
        if ($binduser && $binduser['username']) {
            echo '<script>alert("' . $config['albindtips'] . '");location.href="forum.php?mobile=2&openid=' . $openid . '"</script>';
            exit;
        }
        $_GET['nickname'] = u2g($_GET['nickname']);
        include template('aljwsq:bind');
    }
} else {
    if ($_GET['act'] == 'showqcode') {
        include template('aljwsq:showqcode');
    } else {
        if ($_GET['act'] == 'qrcode') {
            if ($_GET['qid']) {
                DB::query('update %t set num = num+1 where id=%d', array('aljwsq_qrcode', $_GET['qid']));
                $qrcode = C::t('#aljwsq#aljwsq_qrcode')->fetch($_GET['qid']);
                header('Location: ' . $qrcode['url']);
            }
        }
    }
}
示例#12
0
<?php

require "../include/common.inc.php";
require "../include/json.php";
header('Content-Type:text/html;charset=utf-8');
$db = new db_test();
$prov = u2g(unescape($prov));
$query = "select fd_china_city as city  from tb_china  where fd_china_prov = '{$prov}'\n                   group by fd_china_city order by fd_china_areacode asc";
$db->query($query);
if ($db->nf()) {
    while ($db->next_record()) {
        $arr_city_code = g2u($db->f(city));
        $arr_city_name = g2u($db->f(city));
        $select[] = array("id" => $arr_city_code, "title" => $arr_city_name);
    }
}
if (empty($select)) {
    $select[] = array("id" => "", "title" => "");
}
echo json_encode($select);
示例#13
0
 function payagentOrderRq()
 {
     global $weburl;
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $authorid = trim($arr_channelinfo['authorid']);
     $agentid = trim($arr_channelinfo['agentid']);
     $paytype = 'agentbuy';
     $orderprodureid = trim($arr_body['orderprodureid']);
     //支付类型id
     $ordernum = trim($arr_body['ordernum']);
     //充值金额
     $orderprice = trim(u2g($arr_body['orderprice']));
     //实际支付金额
     $ordermoney = trim(u2g($arr_body['ordermoney']));
     //订单金额
     $orderfucardno = trim(u2g($arr_body['orderfucardno']));
     //认证信息
     $orderfucardbank = trim(u2g($arr_body['orderfucardbank']));
     //认证信息
     $ordermemo = trim(u2g($arr_body['ordermemo']));
     //认证信息
     $agentno = trim(u2g($arr_body['agentno']));
     //认证信息
     $arr_paycard = GetPayCalcuInfo::readpaycardid($arr_body['paycardid'], $authorid);
     //刷卡器设备号
     $paycardid = $arr_paycard['paycardid'];
     //刷卡器id
     $cusid = trim($arr_paycard['cusid']);
     //代理商
     $ordermemo = "自订刷卡器" . $ordernum;
     $bkmoney = $ordermoney;
     //promoney+yunmoney
     $paymoney = $ordermoney;
     $listno = makeorderno("salelist", "selt", "xs");
     $arr_bkinfo = BankPayInfo::bankpayorder($authorid, $paycardid, $bkmoney, $orderfucardno);
     $bkntno = trim($arr_bkinfo['bkntno']);
     $sdcrid = trim($arr_bkinfo['sdcrid']);
     $datetime = date("Y-m-d H:i:s");
     $date = date("Y-m-d");
     $bkorderNumber = trim($arr_bkinfo['bkorderNumber']);
     $type = "app";
     //自订
     $datadetailArray['fd_selt_paytype'] = $paytype;
     $datadetailArray['fd_selt_no'] = $listno;
     $datadetailArray['fd_selt_authorid'] = $authorid;
     $datadetailArray['fd_selt_bkntno'] = $bkntno;
     $datadetailArray['fd_selt_date'] = $date;
     $datadetailArray['fd_selt_payrq'] = '01';
     //刚请求的交易码状态为01
     $datadetailArray['fd_selt_bkordernumber'] = $bkorderNumber;
     $datadetailArray['fd_selt_sdcrid'] = $sdcrid;
     $datadetailArray['fd_selt_produreid'] = $orderprodureid;
     $datadetailArray['fd_selt_allquantity'] = $ordernum;
     $datadetailArray['fd_selt_saleprice'] = $orderprice;
     $datadetailArray['fd_selt_fucardno'] = $orderfucardno;
     $datadetailArray['fd_selt_fucardbank'] = $orderfucardbank;
     $datadetailArray['fd_selt_memo'] = u2g($ordermemo);
     $datadetailArray['fd_selt_datetime'] = $datetime;
     $datadetailArray['fd_selt_cusid'] = $agentid;
     //代理商id
     $datadetailArray['fd_selt_paymoney'] = $paymoney;
     //代理商id
     $datadetailArray['fd_selt_authorid'] = $authorid;
     //代理商id
     $datadetailArray['fd_selt_type'] = $type;
     $datadetailArray['fd_selt_skfs'] = '5';
     //在线支付
     $db->insert("tb_salelist", $datadetailArray);
     $listid = $db->insert_id();
     $arr_message = array("result" => "success", "message" => "请求交易码成功!");
     $retcode = "0";
     //反馈状态 0 成功 200 自定义错误
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $arr_msg['msgbody']['bkntno'] = $bkntno;
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
 function RechaMoneyRq()
 {
     global $weburl;
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $authorid = trim($arr_channelinfo['authorid']);
     $paytype = 'qqrecharge';
     $paycardid = trim($arr_body['paycardid']);
     $paytypeid = trim($arr_body['rechapaytypeid']);
     //支付类型id
     $rechamoney = trim($arr_body['rechamoney']);
     //充值金额
     $rechapaymoney = trim(u2g($arr_body['rechapaymoney']));
     //实际支付金额
     $rechaqq = trim(u2g($arr_body['rechaqq']));
     //充值手机号码
     $qqhasrechamoney = $this->readQQhasRechamoney($rechaqq);
     $allqqremoney = $qqhasrechamoney + $rechamoney;
     if ($allqqremoney > 5000) {
         $retcode = "200";
         $arr_msg['msgbody']['result'] = "failure";
         $arr_msg['msgbody']['message'] = "对不起,每个QQ号码每天累计充值Q币数不能大于5000!";
         $returnvalue = array("msgbody" => $arr_msg['msgbody']);
         $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
         return $returnval;
     }
     $rechaqqprov = trim($arr_body['rechaqqprov']);
     //手机所属地区
     $rechabkcardno = trim(u2g($arr_body['rechabkcardno']));
     //银行卡号
     $rechabkcardid = trim($arr_body['rechabkcardid']);
     //银行卡关联id tb_banckcard.fd_bankcard_id
     $merReserved = trim(u2g($arr_body['merReserved']));
     //认证信息
     // $current = trim($arr_body['current']); //币种
     // $paycardid = trim(GetPayCalcuInfo::readpaycardid($paycardid)); //刷卡器设备号
     $arr_paycard = GetPayCalcuInfo::readpaycardid($arr_body['paycardid'], $authorid);
     //刷卡器设备号
     $paycardid = $arr_paycard['paycardid'];
     //刷卡器id
     $cusid = trim($arr_paycard['cusid']);
     //代理商
     $paycardkey = trim($arr_paycard['paycardkey']);
     //刷卡器key
     //$feebankid = getbankid($shoucardbank); //获得银行id返回string
     $onepayfee = $this->readRechacostmoney($rechamoney);
     $payfee = $onepayfee * $rechamoney;
     //金额也就是数量
     $bkmoney = $rechapaymoney;
     $arr_bkinfo = BankPayInfo::bankpayorder($authorid, $paycardid, $bkmoney, $rechabkcardno);
     $bkntno = trim($arr_bkinfo['bkntno']);
     $sdcrid = trim($arr_bkinfo['sdcrid']);
     $sdcrpayfee = substr($arr_bkinfo['sdcrpayfee'], 0, -1);
     //银联收取明盛浮动费率
     $sdcrpayfeemoney = $bkmoney * $sdcrpayfee / 100 > $arr_bkinfo['minsdcrpayfee'] ? $bkmoney * $sdcrpayfee / 100 : $arr_bkinfo['minsdcrpayfee'];
     $paydate = date("Y-m-d H:i:s");
     $today = date("Ymd");
     //$bkmoney  =
     $bkorderNumber = trim($arr_bkinfo['bkorderNumber']);
     $listno = makeorderno("qqrechargelist", "mrclist", "mrc");
     $datadetailArray['fd_mrclist_no'] = $listno;
     $datadetailArray['fd_mrclist_paycardid'] = $paycardid;
     $datadetailArray['fd_mrclist_authorid'] = $authorid;
     $datadetailArray['fd_mrclist_bkntno'] = $bkntno;
     $datadetailArray['fd_mrclist_paydate'] = $paydate;
     $datadetailArray['fd_mrclist_payrq'] = '01';
     //刚请求的交易码状态为01
     $datadetailArray['fd_mrclist_paytypeid'] = $paytypeid;
     //手机充值支付类型 跟paytype 无任何关系
     $datadetailArray['fd_mrclist_paytype'] = $paytype;
     //业务类型
     $datadetailArray['fd_mrclist_bkordernumber'] = $bkorderNumber;
     $datadetailArray['fd_mrclist_sdcrpayfeemoney'] = $sdcrpayfeemoney;
     $datadetailArray['fd_mrclist_sdcrid'] = $sdcrid;
     $datadetailArray['fd_mrclist_rechamoney'] = $rechamoney;
     $datadetailArray['fd_mrclist_bkmoney'] = $bkmoney;
     $datadetailArray['fd_mrclist_qq'] = $rechaqq;
     $datadetailArray['fd_mrclist_paymoney'] = $rechapaymoney;
     $datadetailArray['fd_mrclist_payfee'] = $payfee;
     $datadetailArray['fd_mrclist_qqprov'] = u2g($rechaqqprov);
     $datadetailArray['fd_mrclist_bankcardno'] = $rechabkcardno;
     $datadetailArray['fd_mrclist_bankcardid'] = $rechabkcardid;
     $datadetailArray['fd_mrclist_bankcardbank'] = $rechabkcardname;
     $datadetailArray['fd_mrclist_date'] = $today;
     $datadetailArray['fd_mrclist_datetime'] = $paydate;
     $datadetailArray['fd_mrclist_cusid'] = $cusid;
     $db->insert("tb_qqrechargelist", $datadetailArray);
     $listid = $db->insert_id();
     //$listid = $db->insert_id();
     // $method = 'in';
     // $method = u2g($method);
     //$gettrue = AgentPayglist :: insertPayglist($this->reqxmlcontext, $bkntno, $listid, $ccgno, $paytype, $method, $arr_feeinfo);
     $arr_message = array("result" => "success", "message" => "请求交易码成功!");
     $retcode = "0";
     //反馈状态 0 成功 200 自定义错误
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $arr_msg['msgbody']['bkntno'] = $bkntno;
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
示例#15
0
文件: r.inc.php 项目: deepziyu/JX3PVE
$wechatuser = C::t('#wechat#common_member_wechat')->fetch_by_openid($postObj->FromUserName);
$user = C::t('#aljwsq#aljwsq_user')->fetch($postObj->FromUserName);
echo $this->responsetext(123);
exit;
if (empty($wechatuser) && empty($user)) {
    loaducenter();
    $username = '******' . random(5);
    $return = register($username);
    WeChatHook::bindOpenId($return['uid'], $postObj->FromUserName, 1);
    require_once 'source/plugin/aljwsq/function_core.php';
    $wuser = getwuserinfo($postObj, $config['appid'], $config['appsecret']);
    $user = C::t('#aljwsq#aljwsq_user')->fetch($postObj->FromUserName);
    if (!$user) {
        C::t('#aljwsq#aljwsq_user')->insert(array('nickname' => u2g($wuser['nickname']), 'username' => $username, 'openid' => $postObj->FromUserName, 'bindtime' => TIMESTAMP, 'sex' => $wuser['sex'], 'city' => u2g($wuser['city']), 'country' => u2g($wuser['country']), 'province' => u2g($wuser['province']), 'language' => $wuser['language'], 'headimgurl' => $wuser['headimgurl'], 'subscribe_time' => $wuser['subscribe_time']));
    } else {
        C::t('#aljwsq#aljwsq_user')->update($postObj->FromUserName, array('nickname' => u2g($wuser['nickname']), 'username' => $username, 'bindtime' => TIMESTAMP, 'sex' => $wuser['sex'], 'city' => u2g($wuser['city']), 'country' => u2g($wuser['country']), 'province' => u2g($wuser['province']), 'language' => $wuser['language'], 'headimgurl' => $wuser['headimgurl'], 'subscribe_time' => $wuser['subscribe_time']));
    }
    echo $this->responsetext($postObj, '您已成功注册本站帐号,用户名' . $return['username'] . ',密码' . $return['password'] . '.此帐户已与微信帐户成功绑定,并支持微信扫码登录.');
} else {
    if (empty($user)) {
        $user = getuserbyuid($wechatuser['uid']);
    }
    echo $this->responsetext($postObj, '您已成功注册过帐号,用户名' . $user['username']);
}
function g2u($a)
{
    return is_array($a) ? array_map('g2u', $a) : diconv($a, CHARSET, 'UTF-8');
}
function u2g($a)
{
    return is_array($a) ? array_map('u2g', $a) : diconv($a, 'UTF-8', CHARSET);
示例#16
0
{
    $language = 'text';
    $lans = C('EDIT_CONF.EDIT_ALLOW_TYPE');
    foreach ($lans as $lan => $exts) {
        foreach ($exts as $ex) {
            if ($ext == $ex) {
                $language = $lan;
                break 2;
            }
        }
    }
    return $language;
}
$file = array();
$file['file_utf'] = trim($_REQUEST['file']);
$file['file'] = u2g($file['file_utf']);
$file['content'] = file($file['file']);
$file['encode'] = get_encode($file['file']);
$file['line'] = count($file['content']);
$file['size'] = dealsize(filesize($file['file']));
$file['chmod'] = substr(sprintf('%o', @fileperms($file['file'])), -4);
$file['language'] = get_language(get_ext($file['file']));
if ('GB2312' == $file['encode']) {
    $file['encode_selected']['UTF-8'] = '';
    $file['encode_selected']['GB2312'] = 'selected="selected"';
} else {
    $file['encode_selected']['UTF-8'] = 'selected="selected"';
    $file['encode_selected']['GB2312'] = '';
}
//
$textarea = array();
示例#17
0
 public function modifyAuthorInfo()
 {
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $authorid = trim($arr_channelinfo['authorid']);
     $agentid = trim($arr_channelinfo['agentid']);
     $autruename = u2g(trim($arr_body['autruename']));
     $auidcard = trim($arr_body['auidcard']);
     $auemail = trim($arr_body['auemail']);
     $query = "update tb_author set fd_author_truename = '{$autruename}',fd_author_idcard = '{$auidcard}',\n\t\t\t          fd_author_email = '{$auemail}' where fd_author_id  = '{$authorid}' ";
     $db->query($query);
     $arr_merinfo['fd_cus_allname'] = $arr_body['agentcompany'];
     $arr_merinfo['fd_cus_address'] = $arr_body['agentarea'];
     $arr_merinfo['fd_cus_shaddress'] = $arr_body['agentaddress'];
     $arr_merinfo['fd_cus_manphone'] = $arr_body['agentmanphone'];
     $arr_merinfo['fd_cus_fax'] = $arr_body['agentfax'];
     $wherequery = "fd_cus_id  = '{$agentid}'";
     $db->update("tb_customer", $arr_merinfo, $wherequery);
     $arr_msg['msgbody'] = array("error_id" => "0", "result" => "success", "message" => "恭喜您,用户修改成功!");
     $retcode = "0";
     //反馈状态 0 成功 200 自定义错误
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
 public function readAccglistdetail()
 {
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $acctypeid = trim($arr_body['acctypeid']);
     $authorid = trim($arr_channelinfo['authorid']);
     $msgstart = trim($arr_body['msgstart']) + 0;
     $msgdisplay = trim($arr_body['msgdisplay']) + 0;
     //echo var_dump($arr_body);
     $accyear = substr(trim($arr_body['accmonth']), 0, 4);
     $accmonth = str_replace($accyear, "", $arr_body['accmonth']);
     if ($acctypeid == 'coupon') {
         $wherequery1 = " and 1=2";
     }
     if ($acctypeid == 'recharge') {
         $wherequery2 = " and 1=2";
     }
     if ($msgdisplay == 0) {
         $msgdisplay = 100;
     }
     $paytype = '充值';
     $paytype = u2g($paytype);
     $paytype3 = '订单支付';
     $paytype3 = u2g($paytype);
     $paytype1 = '购买抵用券';
     $paytype1 = u2g($paytype1);
     $paystate = '交易完成';
     $paystate = u2g($paystate);
     $query = "select * from (select fd_accglist_bkordernumber as accglistno," . " case \n        when fd_accglist_paytype ='coupon' then '购买抵用券'\n        when fd_accglist_paytype ='creditcard' then '信用卡还款'" . "when fd_accglist_paytype ='recharge' then   '" . $paytype . "'" . "when fd_accglist_paytype ='pay' then       '还贷款'" . "when fd_accglist_paytype ='order' then '" . $paytype3 . "'" . "when fd_accglist_paytype ='tfmg' then '转账汇款'\n        else '其他业务' END  accgpaymode," . " \n\t\t\t\t                    fd_accglist_datetime as accglistdate , fd_accglist_id as  accglistid ,\n\t\t\t\t                    (fd_accglist_money) as accglistmoney,'" . $paystate . "' as accgstate,'' as accgtype,'' as accgmemo ," . " 'testbank' as accgcardbank,'testno' as accgcardno   \n\t\t\t\t\t\t\t        from tb_authoraccountglist where year(fd_accglist_datetime) = '{$accyear}' and \n\t\t\t\t\t\t\t\t\tmonth(fd_accglist_datetime) = '{$accmonth}' and fd_accglist_authorid='{$authorid}' {$wherequery1} \n\t\t\t\t              " . " union all  select fd_couponsale_bkordernumber as couponno,'" . $paytype1 . "' as accgpaymode ,fd_couponsale_datetime as coupondate," . "fd_couponsale_id as couponid, CONCAT_WS('=',CONCAT_WS('*',(fd_couponsale_money/fd_coupon_money),fd_coupon_money),fd_couponsale_money+0) as couponmoney,'" . $paystate . "','' as accgtype,'' as accgmemo ,'testbank' as accgcardbank,'testno' as accgcardno \n\t\t\t                from \n\t\t\t       tb_couponsale left join tb_coupon on fd_coupon_id =fd_couponsale_couponid where fd_couponsale_authorid = '{$authorid}' and fd_couponsale_payrq = '00' and fd_couponsale_isagentpay = '0'" . " and year(fd_couponsale_datetime) = '{$accyear}' and \n\t\t\t\t\t\t\t\t\tmonth(fd_couponsale_datetime) = '{$accmonth}' {$wherequery2}) as a order by accglistdate desc ";
     $db->query($query);
     $msgallcount = $db->nf();
     //$query = " $query  limit $msgstart,$msgdisplay ";
     //$db->query($query);
     $msgdiscount = $db->nf();
     //  echo $query;
     //  echo $query;
     $arr_msg = auto_charset($db->getData('', 'msgbody'), 'gbk', 'utf-8');
     $arr_message = array("result" => "success", "message" => "读取成功!");
     $retcode = "0";
     //反馈状态 0 成功 200 自定义错误
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $arr_msg['msgbody']['msgallcount'] = $msgallcount;
     $arr_msg['msgbody']['msgdiscount'] = $msgdiscount + $msgstart;
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
示例#19
0
            if ($result) {
                $data['statusCode'] = 200;
                $data['message'] = '<font color="green">新建成功:</font><font color="red">' . g2u(basename($name)) . '</font><br />';
            } else {
                $data['statusCode'] = 300;
                $data['message'] = '<font color="blue">新建失败:</font><font color="red">错误原因未知</font><br />';
            }
        }
    } else {
        $data['statusCode'] = 300;
        $data['message'] = '<font color="blue">操作失败:</font><font color="red">未知操作指令</font><br />';
    }
    $data['message'] .= '<font color="green">执行耗时:</font><font color="red">' . G('_run_start', '_run_end', 6) . ' 秒</font><br />';
    exit(json_encode($data));
} elseif ('imageview' == $action) {
    $file = u2g(trim($_REQUEST['file']));
    require INC_ROOT . 'Image.class.php';
    $Image = new Image();
    $thumbFile = DATA_CACHE_PATH . substr(md5($file), 2, 12) . '.' . get_ext($file);
    if (false !== strpos($file, 'data/Cache/')) {
        $Image->showImg(DATA_CACHE_PATH . basename($file), '', 120, 100);
        //die();
    } else {
        if (!is_file($thumbFile)) {
            $Image->thumb($file, $thumbFile, get_ext($file), 120, 100, true);
        }
        if (!$Image->showImg($thumbFile, '', 120, 100)) {
            $Image->showImg(DATA_PUBLIC_PATH . 'nothumb.png', '', 120, 100);
        }
        if (C('CACHE_DATA_DEL')) {
            unlink($thumbFile);
示例#20
0
<?php

header('Content-Type:text/html;charset=GB2312');
require "../include/common.inc.php";
require "union.php";
$value = u2g($value);
$menufile = "../include/menuarryfile.php";
$menuarry = file($menufile);
//1001±1±地区设置±ico_main_hr.gif±../basic/jxc_area_b.php±0±
//1001代号、1为上级代号、地区设置为名称、ico_main_hr.gif为图片
//../basic/jxc_area_b.php连接地址、0为是否为最底
for ($i = 0; $i < count($menuarry); $i++) {
    $temp_arr1 = $menuarry[$i];
    $temp_arr2 = explode("±", $temp_arr1);
    $a = $temp_arr2[0];
    if ($loginusermenu[$a][item] == 1) {
        // 得出菜单
        if (strstr($temp_arr2[2], $value) and $temp_arr2[4] != "") {
            $arrname[] = $temp_arr2[2];
            $arrprogram[] = $temp_arr2[4];
            $arrunder[] = $temp_arr2[5];
        } else {
            $arrall[$a][code] = $a;
            if (empty($temp_arr2[1])) {
                $arrall[$a][fcode] = 0;
            } else {
                $arrall[$a][fcode] = $temp_arr2[1];
            }
            $arrall[$a][name] = $temp_arr2[2];
            $arrall[$a][icon] = $temp_arr2[3];
            $arrall[$a][program] = $temp_arr2[4];
示例#21
0
if (empty($num) || $_GET['autoact'] == 'reflash') {
    C::t('#aljwsq#aljwsq_citylist')->truncate();
    $apiurl = 'http://mobile.weather.com.cn/js/citylist.xml';
    $ch = curl_init($apiurl);
    curl_setopt($ch, CURLOPT_TIMEOUT, 60);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $citystr = curl_exec($ch);
    curl_close($ch);
    $cityobj = simplexml_load_string($citystr);
    $len = count($cityobj->c->d);
    for ($i = 0; $i < $len; $i++) {
        if (CHARSET == 'gbk') {
            $d1 = u2g((array) $cityobj->c->d[$i]->attributes()->d1);
            $d2 = u2g((array) $cityobj->c->d[$i]->attributes()->d2);
            $d3 = u2g((array) $cityobj->c->d[$i]->attributes()->d3);
            $d4 = u2g((array) $cityobj->c->d[$i]->attributes()->d4);
        } else {
            $d1 = (array) $cityobj->c->d[$i]->attributes()->d1;
            $d2 = (array) $cityobj->c->d[$i]->attributes()->d2;
            $d3 = (array) $cityobj->c->d[$i]->attributes()->d3;
            $d4 = (array) $cityobj->c->d[$i]->attributes()->d4;
        }
        if ($d1[0]) {
            C::t('#aljwsq#aljwsq_citylist')->insert(array('d1' => $d1[0], 'd2' => $d2[0], 'd3' => $d3[0], 'd4' => $d4[0]));
        }
    }
}
function g2u($a)
{
    return is_array($a) ? array_map('g2u', $a) : diconv($a, CHARSET, 'UTF-8');
}
示例#22
0
 static function getrechargeSale($xml, $listno, $listid, $paytype = 'recharge', $bkntno, $arr_feeinfo)
 {
     $db = new DB_test();
     $Publiccls = new PublicClass();
     //初始化类实例
     $arr_xml = $Publiccls->xml_to_array($xml);
     $arr_channelinfo = $arr_xml['operation_request']['msgheader']['channelinfo'];
     $arr_body = $arr_xml['operation_request']['msgbody'];
     $paycardid = trim(GetPayCalcuInfo::readpaycardid($arr_body['paycardid']));
     $authorid = trim($arr_channelinfo['authorid']);
     //操作者
     $paydate = trim(date("Y-m-d"));
     //交易日期
     $fucardbank = u2g(trim($arr_body['bankname']));
     //银行名
     $paymoney = trim($arr_body['paymoney'] + 0);
     //交易摘要
     $fucardno = trim($arr_body['cardno']);
     //银行号
     $banktype = trim($arr_body['banktype']);
     //银行号
     $fucardphone = trim($arr_body['cardmobile']);
     //银行号
     $fucardman = u2g(trim($arr_body['cardman']));
     //银行号
     $arrivedate = $arr_feeinfo['arrivedate'];
     $paydate = $arr_feeinfo['paydate'];
     $bkmoney = $arr_feeinfo['bkmoney'];
     $payfeedirct = $arr_feeinfo['payfeedirct'];
     $bkordernumber = $arr_feeinfo['bkordernumber'];
     $sdcrid = $arr_feeinfo['sdcrid'];
     $sdcrpayfeemoney = $arr_feeinfo['sdcrpayfeemoney'];
     $payfee = $arr_feeinfo['feemoney'];
     $paymoney = $arr_feeinfo['paymoney'];
     $money = round($paymoney + $payfee, 2);
     $method = 'in';
     $method = u2g($method);
     $paytype = 'recharge';
     $query1 = "insert into tb_agentpaymoneylist(\n\t\t\t\t\tfd_agpm_no\t\t\t,fd_agpm_paycardid\t\t,fd_agpm_authorid\t ,\n\t\t\t\t\tfd_agpm_paydate\t    ,fd_agpm_shoucardno\t    ,fd_agpm_fucardno\t ,\n\t\t\t\t\tfd_agpm_bkntno\t\t,fd_agpm_payrq          ,fd_agpm_paytype     ,\n\t\t\t\t\tfd_agpm_current\t    ,fd_agpm_paymoney\t\t,fd_agpm_payfee\t\t ,\n\t\t\t\t\tfd_agpm_money\t\t,fd_agpm_shoucardbank   ,fd_agpm_shoucardman ,\n\t\t\t\t\tfd_agpm_shoucardmobile,fd_agpm_fucardbank\t,fd_agpm_fucardmobile,\n\t\t\t\t\tfd_agpm_fucardman   ,fd_agpm_feebankid      ,fd_agpm_state       ,\n\t\t\t\t\tfd_agpm_listid      ,fd_agpm_listno         ,fd_agpm_method      ,\n\t\t\t\t\tfd_agpm_datetime    ,fd_agpm_payfeedirct    ,fd_agpm_arrivedate  ," . "fd_agpm_bkordernumber,fd_agpm_bkmoney ,fd_agpm_sdcrid      ," . "fd_agpm_sdcrpayfeemoney)values\n\t\t\t\t\t('{$listno}'\t\t,'{$paycardid}'\t,'{$authorid}'\t\t,\n\t\t\t\t\tnow()\t\t,'{$shoucardno}'\t,'{$fucardno}'\t\t,\n\t\t\t\t\t'{$bkntno}'\t\t,'01'\t\t\t,'{$paytype}'\t\t\t,\n\t\t\t\t\t'{$current}'\t\t,'{$paymoney}'\t,'{$payfee}'\t\t\t,\n\t\t\t\t\t'{$paymoney}'\t\t\t,'{$shoucardbank}','{$shoucardman}'\t\t,\n\t\t\t\t\t'{$shoucardmobile}','{$fucardbank}'\t,'{$fucardphone}'  \t,\n\t\t\t\t\t'{$fucardman}'\t\t,'{$feebankid}'\t,'0'\t            ,\t\t\n\t\t\t\t\t'{$listid}'\t\t,'{$listno}'\t    ,'{$method}'\t,now()  ," . "'{$payfeedirct}'   ,'{$arrivedate}'  , '{$bkordernumber}'  , " . "'{$bkmoney}'   ,'{$sdcrid}' ,'{$sdcrpayfeemoney}'   \t\t\t)";
     $db->query($query1);
     return 1;
 }
示例#23
0
 public function couponSale()
 {
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $authorid = $arr_channelinfo['authorid'];
     $couponid = trim($arr_body['couponid']);
     $paymoney = trim($arr_body['couponmoney']);
     //$paycardid = trim(GetPayCalcuInfo::readpaycardid($arr_body['paycardid']));
     $arr_paycard = GetPayCalcuInfo::readpaycardid($arr_body['paycardid'], $authorid);
     //刷卡器设备号
     $paycardid = $arr_paycard['paycardid'];
     //刷卡器id
     $cusid = trim($arr_paycard['cusid']);
     //代理商
     $paycardkey = trim($arr_paycard['paycardkey']);
     //刷卡器key
     $fucardno = trim($arr_body['creditcardno']);
     $fubank = trim(u2g($arr_body['creditbank']));
     $fucardman = trim(u2g($arr_body['creditcardman']));
     $fucardphone = trim(u2g($arr_body['creditcardphone']));
     $paytype = 'coupon';
     $req_appenv = trim($arr_header['req_appenv']);
     // echo "fdf";
     $checkbankinfo = $this->checkshoubankinfo($authorid, $req_appenv);
     //检测我的银行卡信息有没填写
     $arr_feeinfo = GetPayCalcuInfo::readPayFee($authorid, "", $paymoney, "", 5);
     //获取手续费信息返回array
     if (is_array($arr_feeinfo)) {
         $feemoney = $arr_feeinfo['feemoney'];
     }
     $allmoney = round($paymoney + $feemoney, 2);
     $arr_arrive = GetPayCalcuInfo::readarrive($arr_feeinfo['arriveid']);
     $paydate = date("Y-m-d H:i:s");
     $arrivedate = GetPayCalcuInfo::getfeedate($paydate, $arr_feeinfo['addday']);
     $payfeedirct = $arr_feeinfo['defeedirct'];
     if ($arr_feeinfo['defeedirct'] == 's') {
         $bkmoney = $paymoney;
     } else {
         $bkmoney = $allmoney;
     }
     $arr_feeinfo['arrivedate'] = $arrivedate;
     $arr_feeinfo['paydate'] = $paydate;
     $arr_feeinfo['bkmoney'] = $bkmoney;
     $arr_feeinfo['payfeedirct'] = $payfeedirct;
     $payfee = $feemoney;
     $arr_bkinfo = BankPayInfo::bankpayorder($authorid, $paycardid, $paymoney, $fucardno);
     $arr_authorinfo = AuToken::getauthorusername($authorid);
     $arr_feeinfo['shoucardno'] = $shoucardno = $arr_authorinfo['shoucardno'];
     $arr_feeinfo['shoucardmobile'] = $shoucardmobile = $arr_authorinfo['shoucardmobile'];
     $arr_feeinfo['shoucardbank'] = $shoucardbank = $arr_authorinfo['shoucardbank'];
     $arr_feeinfo['shoucardman'] = $shoucardman = $arr_authorinfo['shoucardman'];
     $bkntno = trim($arr_bkinfo['bkntno']);
     $arr_feeinfo['bkordernumber'] = $bkordernumber = $arr_bkinfo['bkorderNumber'];
     $arr_feeinfo['bkmoney'] = $bkmoney = $paymoney;
     $arr_feeinfo['sdcrid'] = $sdcrid = trim($arr_bkinfo['sdcrid']);
     $sdcrpayfee = substr($arr_bkinfo['sdcrpayfee'], 0, -1);
     //银联收取明盛浮动费率
     $arr_feeinfo['sdcrpayfeemoney'] = $sdcrpayfeemoney = $bkmoney * $sdcrpayfee / 100 > $arr_bkinfo['minsdcrpayfee'] ? $bkmoney * $sdcrpayfee / 100 : $arr_bkinfo['minsdcrpayfee'];
     $ccgno = makeorderno("couponsale", "couponsale", "cps");
     $query = "insert into tb_couponsale\n\t\t\t\t\t(fd_couponsale_no\t,\tfd_couponsale_bkntno\t,\tfd_couponsale_couponno\t,\n\t\t\t\t\tfd_couponsale_paycardid,fd_couponsale_authorid  ,\tfd_couponsale_money,\n\t\t\t\t\tfd_couponsale_rebuy,\tfd_couponsale_state,\t\tfd_couponsale_datetime,\n\t\t            fd_couponsale_couponid,\tfd_couponsale_payrq,\t\tfd_couponsale_creditcardno,\n\t\t            fd_couponsale_creditcardbank,fd_couponsale_creditcardman,fd_couponsale_creditcardphone," . "fd_couponsale_bkordernumber,fd_couponsale_sdcrid,   fd_couponsale_sdcrpayfeemoney," . "fd_couponsale_paymoney , fd_couponsale_payfee   ,   fd_couponsale_bkmoney  ," . "fd_couponsale_shoucardno,fd_couponsale_shoucardman,fd_couponsale_shoucardbank," . "fd_couponsale_shoucardmobile\n\t\t            )values\n\t\t\t\t\t('{$ccgno}'\t\t\t,\t'{$bkntno}'\t\t\t\t,\t'{$bkorderNumber}',\n\t\t\t\t\t'{$paycardid}'\t\t,\t'{$authorid}'\t\t\t\t,\t'{$paymoney}',\n\t\t\t\t\t'0'\t\t\t\t\t,\t'0'\t\t\t\t\t\t,\t now()\t\t ,\n\t\t\t\t\t'{$couponid}'\t\t\t,\t'01'  \t\t\t\t\t,    '{$fucardno}',\n\t\t\t\t\t'{$fubank}'           ,   '{$fucardman}'            ,   '{$fucardphone}' , " . "'{$bkordernumber}'   ,   '{$sdcrid}'               ,   '{$sdcrpayfeemoney}'," . "'{$paymoney}'        ,   '{$payfee}'               ,   '{$bkmoney}'        ," . "'{$shoucardno}'      ,   '{$shoucardman}'          ,   '{$shoucardbank}'    ," . "'{$shoucardmobile}'    ) ";
     $db->query($query);
     $listid = $db->insert_id();
     $method = 'in';
     $method = u2g($method);
     $gettrue = AgentPayglist::insertPayglist($this->reqxmlcontext, $bkntno, $listid, $ccgno, $paytype, $method, $arr_feeinfo);
     $arr_message = array("result" => "success", "message" => "获取交易码成功,可以去刷卡支付了!");
     $retcode = "0";
     //反馈状态 0 成功 200 自定义错误
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $arr_msg['msgbody']['bkntno'] = trim($bkntno);
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
示例#24
0
								}
							}else{
								$returnaccess = $token['access_token'];
							}
						}
						
						if($returnaccess){
							$wxuser = getwuserinfo($openid, $returnaccess);
							if($wxuser['nickname']){
								$upuserdata = array();
								$upuserdata['nickname']= addslashes(u2g($wxuser['nickname']));
								$upuserdata['sex']= intval($wxuser['sex']);
								$upuserdata['city']= addslashes(u2g($wxuser['city']));
								$upuserdata['country']= addslashes(u2g($wxuser['country']));
								$upuserdata['province']= addslashes(u2g($wxuser['province']));
								$upuserdata['headimgurl']= addslashes(u2g($wxuser['headimgurl']));
								$upuser = C::t('#hejin_box#hjbox_users')->update_by_id($userinfo['id'],$upuserdata);
								if($upuser){
									$url = 'action=plugins&operation=config&do=' . $_GET['do'] . '&identifier=hejin_toupiao&pmod=toupiao&model=tpjles&zid='.$zid.'&page='.$page;
									cpmsg(lang('plugin/hejin_box', 'getcg'), $url, 'succeed');	
									exit;	
								}else{
									$url = 'action=plugins&operation=config&do=' . $_GET['do'] . '&identifier=hejin_toupiao&pmod=toupiao&model=tpjles&zid='.$zid.'&page='.$page;
									cpmsg(lang('plugin/hejin_box', 'getsb'), $url, 'error');	
									exit;	
								}
							}else{
								$url = 'action=plugins&operation=config&do=' . $_GET['do'] . '&identifier=hejin_toupiao&pmod=toupiao&model=tpjles&zid='.$zid.'&page='.$page;
								cpmsg(lang('plugin/hejin_box', 'getsb'), $url, 'error');
								exit;		
							}
示例#25
0
 function payOrderRq()
 {
     global $weburl;
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $authorid = trim($arr_channelinfo['authorid']);
     $paytype = 'orderbuy';
     $orderpaytypeid = trim($arr_body['orderpaytypeid']);
     $orderprodureid = trim($arr_body['orderprodureid']);
     //支付类型id
     $ordernum = trim($arr_body['ordernum']);
     //充值金额
     $orderprice = trim(u2g($arr_body['orderprice']));
     //实际支付金额
     $ordermoney = trim(u2g($arr_body['ordermoney']));
     //订单金额
     $ordershaddressid = trim($arr_body['ordershaddressid']);
     //手机所属地区
     $oredershaddress = trim(u2g($arr_body['oredershaddress']));
     //银行卡号
     $ordershman = trim(u2g($arr_body['ordershman']));
     //银行卡关联id tb_banckcard.fd_bankcard_id
     $ordershphone = trim(u2g($arr_body['ordershphone']));
     //认证信息
     $orderfucardno = trim(u2g($arr_body['orderfucardno']));
     //认证信息
     $orderfucardbank = trim(u2g($arr_body['orderfucardbank']));
     //认证信息
     $ordermemo = trim(u2g($arr_body['ordermemo']));
     //认证信息
     $agentno = trim(u2g($arr_body['agentno']));
     //认证信息
     $orderpaytype = trim($arr_body['paytype']);
     $promoney = trim(u2g($arr_body['promoney']));
     //认证信息
     $yunmoney = trim(u2g($arr_body['yunmoney']));
     //认证信息
     $produrename = trim(u2g($arr_body['produrename']));
     $bkmoney = $ordermoney;
     //promoney+yunmoney
     $rechabkcardno = makeorderno("orderglist", "orderlist", "orl");
     $arr_bkinfo = BankPayInfo::bankpayorder($authorid, $paycardid, $bkmoney, $orderfucardno);
     $bkntno = trim($arr_bkinfo['bkntno']);
     $sdcrid = trim($arr_bkinfo['sdcrid']);
     if ($agentno != "") {
         // $cusid =$this->checkcusagentno($agentno);
         $query = "select fd_cus_id as cusid from tb_customer where fd_cus_no = '{$agentno}'";
         if ($db->execute($query)) {
             $arr_cusinfo = $db->get_one($query);
             $cusid = $arr_cusinfo['cusid'];
         } else {
             $arr_message = array("result" => "failure", "message" => "对不起,您填写的代理商代号错误,请重新填写!");
             $retcode = "200";
             //反馈状态 0 成功 200 自定义错误
             $arr_msg['msgbody']['result'] = $arr_message['result'];
             $arr_msg['msgbody']['message'] = $arr_message['message'];
             $arr_msg['msgbody']['bkntno'] = $bkntno;
             $returnvalue = array("msgbody" => $arr_msg['msgbody']);
             $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
             return $returnval;
             exit;
         }
     }
     $datetime = date("Y-m-d H:i:s");
     $date = date("Y-m-d");
     //$bkmoney  =
     $bkorderNumber = trim($arr_bkinfo['bkorderNumber']);
     $datadetailArray['fd_orderlist_paytype'] = $paytype;
     $datadetailArray['fd_orderlist_no'] = $listno;
     $datadetailArray['fd_orderlist_authorid'] = $authorid;
     $datadetailArray['fd_orderlist_bkntno'] = $bkntno;
     $datadetailArray['fd_orderlist_date'] = $date;
     $datadetailArray['fd_orderlist_payrq'] = '01';
     //刚请求的交易码状态为01
     $datadetailArray['fd_orderlist_bkordernumber'] = $bkorderNumber;
     $datadetailArray['fd_orderlist_sdcrid'] = $sdcrid;
     $datadetailArray['fd_orderlist_produreid'] = $orderprodureid;
     $datadetailArray['fd_orderlist_produrename'] = $produrename;
     $datadetailArray['fd_orderlist_cusid'] = $cusid;
     //分润代理商
     $datadetailArray['fd_orderlist_num'] = $ordernum;
     $datadetailArray['fd_orderlist_price'] = $orderprice;
     $datadetailArray['fd_orderlist_promoney'] = $promoney;
     $datadetailArray['fd_orderlist_yunmoney'] = $yunmoney;
     $datadetailArray['fd_orderlist_ordermoney'] = $ordermoney;
     $datadetailArray['fd_orderlist_shaddressid'] = $ordershaddressid;
     $datadetailArray['fd_orderlist_shaddress'] = $oredershaddress;
     $datadetailArray['fd_orderlist_shman'] = $ordershman;
     $datadetailArray['fd_orderlist_shphone'] = $ordershphone;
     $datadetailArray['fd_orderlist_fucardno'] = $orderfucardno;
     $datadetailArray['fd_orderlist_fucardbank'] = $orderfucardbank;
     $datadetailArray['fd_orderlist_memo'] = $ordermemo;
     $datadetailArray['fd_orderlist_datetime'] = $datetime;
     $datadetailArray['fd_orderlist_agentno'] = $agentno;
     $db->insert("tb_orderglist", $datadetailArray);
     $listid = $db->insert_id();
     $arr_message = array("result" => "success", "message" => "请求交易码成功!");
     $retcode = "0";
     //反馈状态 0 成功 200 自定义错误
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $arr_msg['msgbody']['bkntno'] = $bkntno;
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
示例#26
0
<?php

/*
 * ×÷ÕߣºÁÁ½£
 * ÁªÏµQQ:578933760
 *
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$config = $_G['cache']['plugin']['aljwsq'];
$openid = u2g($postObj->FromUserName);
$lasttime = DB::result_first('select lasttime from %t where openid = %s', array('aljwsq_user', $openid));
$lasttime = intval($lasttime);
if ($lasttime + $config['time'] < TIMESTAMP) {
    $news = C::t('#aljwsq#aljwsq_autoreply')->fetch_by_mykeyword($location['bindkeyword']);
    DB::query('update %t set lasttime = %d where openid = %s', array('aljwsq_user', TIMESTAMP, $openid));
} else {
    exit;
}
function g2u($a)
{
    return is_array($a) ? array_map('g2u', $a) : diconv($a, CHARSET, 'UTF-8');
}
function u2g($a)
{
    return is_array($a) ? array_map('u2g', $a) : diconv($a, 'UTF-8', CHARSET);
}
示例#27
0
header('Content-Type: application/x-www-form-urlencoded');
header('Content-Type: text/html;charset=utf-8');
require "../include/common.inc.php";
require_once '../include/json.php';
$db = new db_test();
$query = "select fd_paycard_salerid,count(*) as counts from tb_paycard  group by fd_paycard_salerid  ";
$db->query($query);
if ($db->nf()) {
    while ($db->next_record()) {
        $id = $db->f(fd_paycard_salerid);
        //id号
        $arr_membercounts[$id] = g2u($db->f(counts));
    }
}
$aColumns = array("", "a.fd_saler_truename", "a.fd_saler_username", "a.fd_saler_phone", "b.fd_saler_truename", 'a.fd_saler_zjl');
$sSearch = u2g($sSearch);
$sWhere = "";
if ($sSearch != "") {
    $sWhere = "and  (";
    for ($i = 1; $i < count($aColumns); $i++) {
        $sWhere .= $aColumns[$i] . " LIKE '%" . trim($sSearch) . "%' OR ";
    }
    $sWhere = substr_replace($sWhere, "", -3);
    $sWhere .= ')';
}
/* Individual column filtering */
for ($i = 1; $i < count($aColumns); $i++) {
    $b_s = "bSearchable_" . $i;
    $s_s = "sSearch_" . $i;
    if (${$b_s} == "true" && ${$s_s} != '') {
        if ($sWhere == "") {
$query = "select * from  web_salerrewards where fd_rewards_type  = '2'";
//销售提成
$db->query($query);
$count = 0;
//记录数
$vallquantity = 0;
//总价
if ($db->nf()) {
    while ($db->next_record()) {
        $ordermoney = $db->f(fd_rewards_selfmoney);
        $orderbmonth = $db->f(fd_rewards_bmonth);
        $orderemonth = $db->f(fd_rewards_emonth);
    }
}
$state = "已发货";
$state = u2g($state);
//开卡数有效记录
$query = "select fd_salercard_salerid,count(*) as counts,month(fd_salercard_opendate) as monthdate from web_salercard where \nfd_salercard_memberid >0 and fd_salercard_state='1' and fd_salercard_opendate like '%{$beginmonth}%'  \nand fd_salercard_opendate >='{$cardbmonth}' and fd_salercard_opendate <='{$cardemonth}'\ngroup by fd_salercard_salerid,monthdate  ";
$db->query($query);
if ($db->nf()) {
    while ($db->next_record()) {
        $id = $db->f(fd_salercard_salerid);
        //id号
        $month = $db->f(monthdate);
        $arr_membercounts[$id][$month] = g2u($db->f(counts));
    }
}
$query = "select fd_salercard_salerid ,sum(fd_order_alldunshu) as allquantity  ,month(fd_order_date) as monthdate \n          from web_order\n          left join web_salercard on fd_salercard_memberid = fd_order_memeberid \n\t\t  and fd_order_state='{$state}' \n\t\t  and fd_order_date >='{$orderbmonth}' and fd_order_date <='{$orderemonth}'  \n\t\t  where fd_order_alldunshu>'0' and fd_order_date  like '%{$beginmonth}%' group by fd_salercard_salerid,monthdate ";
$db->query($query);
if ($db->nf()) {
    while ($db->next_record()) {
示例#29
0
<?php

/*
 *	DreamArticle Version3.0
 *	Copyright 2007-2008, iDreamSoft
 *	http://www.idreamsoft.cn
 *	By:coolmoo<*****@*****.**>
*/
!defined('DCPATH') && exit('What are you doing?');
if (in_array($action, array('message', 'comment'))) {
    $id = intval($_POST['id']);
    $reply = 'admin||' . u2g(htmlspecialchars($_POST['replytext']));
    $DreamCMS->db->update($action, compact('reply'), compact('id')) && exit('1');
}
示例#30
0
    loaducenter();
    $nickname = u2g($wuser['nickname']);
    if ($config['isname'] && $nickname) {
        $username = $nickname;
    } else {
        $username = random(5);
    }
    while (DB::result_first('select count(*) from %t where username = %s', array('common_member', $username))) {
        $username = random(5);
    }
    $defaultpassword = $config['password'];
    $return = register($username, '', $config['autogroup'], $defaultpassword);
    if (empty($user) && $openid) {
        C::t('#aljwsq#aljwsq_user')->insert(array('nickname' => u2g($wuser['nickname']), 'username' => $username, 'openid' => $openid, 'bindtime' => TIMESTAMP, 'sex' => $wuser['sex'], 'city' => u2g($wuser['city']), 'country' => u2g($wuser['country']), 'province' => u2g($wuser['province']), 'language' => $wuser['language'], 'headimgurl' => $wuser['headimgurl'], 'subscribe_time' => TIMESTAMP));
    } else {
        C::t('#aljwsq#aljwsq_user')->update($openid, array('nickname' => u2g($wuser['nickname']), 'username' => $username, 'bindtime' => TIMESTAMP, 'sex' => $wuser['sex'], 'city' => u2g($wuser['city']), 'country' => u2g($wuser['country']), 'province' => u2g($wuser['province']), 'language' => $wuser['language'], 'headimgurl' => $wuser['headimgurl']));
    }
    $tpl = str_replace('{username}', $return['username'], $config['tpl']);
    $tpl = str_replace('{password}', $return['password'], $tpl);
    $tpl = str_replace('{openid}', $openid, $tpl);
    echo $this->responsetext($postObj, $tpl);
} else {
    $tpl = str_replace('{username}', $user['username'], $config['altpl']);
    echo $this->responsetext($postObj, $tpl);
}
function g2u($a)
{
    return is_array($a) ? array_map('g2u', $a) : diconv($a, CHARSET, 'UTF-8');
}
function u2g($a)
{