查看文件: index_ordercar.php
大小: 5.18 KB
类型: application/octet-stream
<?php require_once('./Connections/BE2.php'); ?> <? if (!isset($_SESSION)){ session_start(); } if(! isset($_SESSION['login_memid']) || $_SESSION['login_memid']=='0'){ ?> <script>alert('請記的先登入');location.href = '/';</script> <? exit; } // 超商取貨 -金額 // 到店取貨 -金 // 宅配 --金額 // if((isset($_POST["paytoesafe"])) && ($_POST["paytoesafe"] == "pay")) { // dpay 1 信用卡線上刷卡 ,2 超商取貨付款,3 臨櫃匯款,4 ATM轉帳 // 物流 1 宅配 2超商取貨 3 到店取貨 p_moneyKind $pay_num=date('YmdHis').sprintf("%05d",$_SESSION['login_memid']) ; //dcode $order_pay=$_POST["order_pay"]; $order_invoice=$_POST["order_invoice"]; // m1 pay_money應付 pay_skybni- 雲點數 $pay_m1=$_POST["pay_money"]-$_POST["pay_skybni"]; // 付款主單 mysql_select_db($database_BE2, $BE2); $InsertSQL = sprintf("insert into order_tmp2(dcode,dsess,dmoney,dexpess,dall,dcash,dsky,ddate,dpay,dcar,duser)VALUES('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')",$pay_num,session_id(),$_POST["order_moneyALL"],$_POST["order_express"],$_POST["pay_money"],$pay_m1,$_POST["pay_skybni"],date('Y-m-d'),$order_pay,$_POST["p_moneyKind"],$_SESSION['login_memid']); mysql_query($InsertSQL, $BE2) or die(mysql_error()); // 採購單 中介 mysql_select_db($database_BE2, $BE2); $UpSQL = sprintf("update order_tmp as a,tmporder1 as b set a.dcode='%s',a.p_sess='2' where a.p_sess='1' AND a.ccid=b.mid AND b.sess='%s'",$pay_num,session_id() ); //$UpSQL = sprintf("update order_tmp set dcode='%s' where p_sess='%s'",$pay_num,session_id() ); mysql_query($UpSQL, $BE2) or die(mysql_error()); mysql_select_db($database_BE2, $BE2); // 物流檔 $InsertSQL2 = sprintf("INSERT INTO order_express(dcode,mem_id,mem_name2,mem_mobile2,mem_mail2,mem_address2,order_invoice, order_invoice2,order_invoice3,order_time,order_pay,dcar,atm_code,mem_note) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",$pay_num,$_SESSION['login_memid'],$_POST["mem_name2"],$_POST["mem_mobile2"],$_POST["mem_mail2"],$_POST["mem_address2"],$_POST["order_invoice"],$_POST["order_invoice2"],$_POST["order_invoice3"],$_POST["order_time"],$_POST["order_pay"],$_POST["p_moneyKind"],$_POST["atm_code"],$_POST["mem_note"]); mysql_query( $InsertSQL2, $BE2) or die(mysql_error()); mysql_select_db($database_BE2, $BE2); // 發票檔 $InsertSQL2 = sprintf("INSERT INTO order_bill(dcode,mem_id,selb2c,uncode,qphone,donationcode,email,ordertime,billcode,ck) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", $pay_num,$_SESSION['login_memid'],$_POST["selb2c"],$_POST["q_uncode"],$_POST["q_phone"],$_POST["q_donationcode"],$_POST["q_email"],date('Y-m-d'),"","N"); mysql_query( $InsertSQL2, $BE2) or die(mysql_error()); mysql_select_db($database_BE2, $BE2); // echo "11111111111111111111<br>" ; // echo $InsertSQL2 ; // echo "<br>"; // 0731 $pay_money - pay_skybni $pay_title="天空商城商品購買" ; $pay_money=$_POST["pay_money"]-$_POST["pay_skybni"]; $pay_name=$_POST["mem_name"]; $pay_mobile=$_POST["mem_mobile"]; $mem_mail=$_POST["mem_mail"]; $pay_Card_Type=0; $pay_Term=$_POST["order_pay2"]; // if($order_pay=="1"){ //信用卡線上刷卡 $webA="S1703130573"; }else if($order_pay=="2"){ //超商取貨付款 $webA="S1703130631"; }else { // LOCAL PAY 貨付款 $webA="S0000000001"; } $vdata = $webA; $vdata = $vdata."sky25281957";//"sky42656789"; $vdata = $vdata.$pay_money; $vdata = $vdata.$pay_Term; $CheckValue =strtoupper(sha1($vdata)); //$CheckValue = Sha1("商家代碼"+"交易密碼"+"交易金額") header('Content-Type: text/html; charset=utf-8'); // $url1="https://test.esafe.com.tw/Service/Etopm.aspx"; $url2="https://www.skybni.com/log/esafe_response.php"; //test my reponse $url0="https://www.esafe.com.tw/Service/Etopm.aspx"; // esafe online $mytest=false; // on test mode if($mytest){ $etouch=$url2; }else{ $etouch=$url0; } if($order_pay>"2"){ //1 信用卡線上刷卡 ,2 超商取貨付款,3 臨櫃匯款,4 ATM轉帳 $etouch=$url2; // test mode ,online $url0 } ?> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <form id="form4" method="post" action="<?= $etouch?>"> <input type="hidden" name="web" value="<?=$webA ?>"> <input type="hidden" name="MN" value="<?=$pay_money ?>"> <input type="hidden" name="OrderInfo" value="<?= $pay_title ?>"> <input type="hidden" name="Td" value="<?= $pay_num ?>"> <input type="hidden" name="sna" value="<?= $pay_name ?>"> <input type="hidden" name="sdt" value="<?= $pay_mobile ?>"> <input type="hidden" name="email" value="<?= $mem_mail ?>"> <input type="hidden" name="note1" value="none"> <input type="hidden" name="note2" value="none"> <input type="hidden" name="Card_Type" value="<?= $pay_Card_Type ?>"> <input type="hidden" name="Term" value="<?= $pay_Term ?>"> <input type="hidden" name="ChkValue" value="<?= $CheckValue ?>"> <? if($mytest){?> <input type="hidden" id="testpay" name="testpay" value="<?= $order_pay ?>"> <? } ?> </form> <script type="text/javascript"> form4.submit(); </script> <? } ?>
保存
取消
返回文件列表