查看文件: mempoint_edit.php
大小: 4.5 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_point SET euid='%s' WHERE eid='%s'", $_POST['euid'], $_POST['eid']); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($upSQL, $BE2) or die(mysql_error()); $upSQL2 = sprintf("UPDATE member SET mem_num='%s' WHERE mem_auto='%s'", $_POST['euid'], $_POST['emem_num']); mysql_select_db($database_BE2, $BE2); $Result2 = mysql_query($upSQL2, $BE2) or die(mysql_error()); ////////////////////// $write='資料已更新...'; $updateGoTo = $_POST["url"]; // echo $upSQL; // echo $upSQL2; // 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.scode as bscode,c.scode as cscode FROM order_point as a, member as b , member as c where a.emem_num=b.mem_auto AND a.euid=c.mem_auto AND a.eccid=0 AND a.e_type=6 AND a.eid ='%s' ",$colname_Rt2); $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); $totalRows_Rt2 = mysql_num_rows($Rt2); ?> <form method="post" name="form1" action=""> <table width="559" align="center"> <tr valign="baseline"> <td height="26" align="right" nowrap> </td> <td> </td> <td> </td> </tr> <tr valign="baseline"> <td width="98" align="right" nowrap><span class="s1"><span class="font2">被招募者</span>:</span></td> <td width="392"> <?= $row_Rt2['emem_num']; ?></td> <td width="53"> </td> </tr> <tr valign="baseline"> <td nowrap align="right"><span class="font2"><span class="s1">ID</span></span>:</td> <td><?= $row_Rt2['bscode']; ?></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"><span class="font2">原招募者</span>:</td> <td><?= $row_Rt2['cscode'];?></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"><span class="font2">招募者<span class="s1">ID</span>:</span> </td> <td><input type="text" name="euid" id="euid" value="<?= $row_Rt2['euid'] ?>" /> </td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td> </td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td> </td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="更新記錄" /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="hidden" name="eid" id="eid" value="<?= $row_Rt2['eid'] ?>" /> <input type="hidden" name="emem_num" id="emem_num" value="<?= $row_Rt2['emem_num']; ?>" /> <input type="hidden" name="MM_update" value="form1" /> <input name="url" type="hidden" id="url" value="<?= isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:''; ?>" /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td> </td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right">搜尋 ID:</td> <td><div id="pname" ></div></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap align="right">搜尋 ID:</td> <td><input type="text" name="mem_code" id="mem_code" value="8888888" /> <input type="button" value="搜尋" onclick="foundmember()" /></td> <td> </td> </tr> </table> </form> <script> function foundmember(){ var memcode = $("#mem_code").val(); //.find(':selected')[0].id; $("#bid").val("1"); if(memcode == "") { return 0; }; $.ajax({ type: 'POST', url: 'CkmemberApi.php', data: { 'memcode': memcode}, success: function (data) { response = JSON.parse(data); if(response.err==1){ $("#pname").html(response.id); } else{ $("#pname").html("");} } }); } </script> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表