查看文件: payment_edit.php
大小: 5.67 KB
类型: application/octet-stream
<?php require('system/login.php'); ?> <?php require_once('../Connections/BE2.php'); ?> <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $upSQL = sprintf("UPDATE order_datam SET dpaydate='%s',dbank='%s',dflag='%s' WHERE did='%s'",date('Y-m-d'), $_POST['dbank'],$_POST['dflag'], $_POST['did']); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($upSQL, $BE2) or die(mysql_error()); if($_POST["old_dflag"]<>$_POST["dflag"]){ $mess='更新交易付款記錄('.$_POST["dcode"].")"; $InsertSQL = sprintf("INSERT INTO rec_step(rdoc,companyid,ostate,rstate,rdate,ruser)VALUES('%s','%s','%s','%s','%s','%s')",$mess,$_POST['companyid'],$_POST["old_dflag"],$_POST["dflag"],date('Y-m-d'),$_SESSION['login_id']); mysql_select_db($database_BE2, $BE2); mysql_query($InsertSQL, $BE2) or die(mysql_error()); } $write='資料已更新...'; $updateGoTo = $_POST["url"]; // header(sprintf("Location: %s", $updateGoTo)); echo "<script>alert('".$write."');location.href='".$updateGoTo."';</script>"; } $colname_Rt2 = "-1"; if (isset($_GET['id'])) { $colname_Rt2 = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']); } mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT a.*,b.atm_code,b.mem_note,d.mem_name,d.mem_mobile FROM order_datam as a,order_express as b,member as d WHERE a.dcode=b.dcode AND a.duser=d.mem_auto ORDER BY a.dcode DESC" ); ;//,$colname_Rt2 $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); $totalRows_Rt2 = mysql_num_rows($Rt2); mysql_select_db($database_BE2, $BE2); $query_Rt3 = sprintf("SELECT a.did,c.company_num,d.company_title FROM order_datam as a,order_datas as b,product_data as c,company as d WHERE a.dcode='%s' AND a.dcode = b.dcode AND b.mem_auto=c.mem_auto AND c.company_num=d.coid",$row_Rt2['dcode']); $Rt3 = mysql_query($query_Rt3, $BE2) or die(mysql_error()); $row_Rt3 = mysql_fetch_assoc($Rt3); $totalRows_Rt3 = mysql_num_rows($Rt3); // echo $query_Rt3; ?> <form method="post" name="form1" action=""> <table width="485" align="center"> <tr valign="baseline"> <td height="36" align="right" nowrap> </td> <td><h3>更新交易記錄</h3></td> <td> </td> </tr> <tr valign="baseline"> <td width="119" align="right" nowrap><span class="s1"><span class="font2">訂單編號</span>:</span></td> <td width="253"> <?= $row_Rt2['dcode']; ?><input type="hidden" name="dcode" id="dcode" value="<?= $row_Rt2['dcode'] ?>" /></td> <td width="97"> </td> </tr> <tr valign="baseline"> <td nowrap align="right"><span class="font2">訂單日期</span>:</td> <td><?= $row_Rt2['ddate']; ?></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"><span class="font2">訂購會員/電話</span>:</td> <td><?= $row_Rt2['mem_name'].'('.$row_Rt2['mem_mobile'].')';?></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"><span class="font2">交易公司:</span> </td> <td><?= $row_Rt3['company_title'] ;?> <input type="hidden" name="companyid" id="companyid" value="<?= $row_Rt3['company_num'] ?>" /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"><span class="font2">付款模式</span>:</td> <td><? $ar1=array("","信用卡線上刷卡","超商取貨付款","臨櫃匯款","ATM轉帳"); echo $ar1[$row_Rt2['dpay']]; ?></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"><span class="font2">商品金額:</span></td> <td><?= $row_Rt2['dmoney']; ?></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"><span class="font2">總金額</span>: </td> <td><?= $row_Rt2['dall']; ?></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td> </td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"><span class="font2">交易完成</span>:</td> <td><select name="dflag" id="dflag"> <option value="Y" <?= ($row_Rt2['dflag']=='Y')?'selected="selected"':'' ?>>Y</option> <option value="N" <?= ($row_Rt2['dflag']=='N')?'selected="selected"':'' ?>>N</option> </select> <input type="hidden" name="old_dflag" id="old_dflag" value="<?= $row_Rt2['dflag'] ?>" /> <input type="hidden" name="did" id="did" value="<?= $row_Rt2['did'] ?>" /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"><span class="font2">入帳銀行</span>:</td> <td><label for="textfield"></label> <input name="dbank" type="text" id="dbank" value="<?= $row_Rt2['dbank']; ?>" /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"><span class="font2">入帳日</span>:</td> <td><input name="dpaydate" type="text" id="dpaydate" value="<?= date("Y-m-d"); ?>" readonly="readonly"/></td> <td><input type="hidden" name="MM_update" value="form1" /> <input name="url" type="hidden" id="url" value="<?php echo $_SERVER['HTTP_REFERER']; ?>" /> <input name="did" type="hidden" id="did" value="<?= $row_Rt2['did']; ?>" /></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><div id="btsubmit" ><input type="submit" value="更新交易記錄"></div></td> <td> </td> </tr> </table> </form> <?php mysql_free_result($Rt2); mysql_free_result($Rt3); ?>
保存
取消
返回文件列表