查看文件: tb6edit.php
大小: 2.94 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE tb6 SET fg1=%s, fg2=%s, fg3=%s, fg4=%s WHERE fgid=%s", GetSQLValueString($_POST['fg1'], "text"), GetSQLValueString($_POST['fg2'], "int"), GetSQLValueString($_POST['fg3'], "text"), GetSQLValueString($_POST['fg4'], "text"), GetSQLValueString($_POST['fgid'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $updateGoTo =$_POST['url'];// "main.php?act=user"; header(sprintf("Location: %s", $updateGoTo)); } $colname_Rt2 = "-1"; if (isset($_GET['id'])) { $colname_Rt2 = $_GET['id']; } mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT * FROM tb6 WHERE fgid = %s", GetSQLValueString($colname_Rt2, "int")); $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); $totalRows_Rt2 = mysql_num_rows($Rt2); ?> <form action="" method="post" name="form1" id="form1"> <table width="549" align="center"> <tr valign="baseline"> <td nowrap="nowrap" align="right"><span class="font2">分類說明:</span></td> <td><input name="fg1" type="text" id="fg1" value="<?php echo htmlentities($row_Rt2['fg1'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"><span class="font2">啟用</span>:</td> <td><label for="fg4"></label> <select name="fg3" id="fg3"> <option value="Y" <? if ($row_Rt2['fg3']=='Y'){?> selected="selected" <? }?>>Y</option> <option value="N" <? if ($row_Rt2['fg3']=='N'){?> selected="selected" <? }?>>N</option> </select></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"><span class="font2">租車業使用</span>:</td> <td><label for="fg2"></label> <select name="fg4" id="fg4"> <option value="Y" <? if ($row_Rt2['fg4']=='Y'){?> selected="selected" <? }?>>Y</option> <option value="N" <? if ($row_Rt2['fg4']=='N'){?> selected="selected" <? }?>>N</option> </select></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"><span class="font2">排列值</span>:</td> <td><input name="fg2" type="text" id="fg2" value="<?= $row_Rt2['fg2']; ?>" size="12" maxlength="5" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td><input type="submit" value="更新記錄" /></td> </tr> </table> <input type="hidden" name="MM_update" value="form1" /> <input name="fgid" type="hidden" id="fgid" value="<?php echo $row_Rt2['fgid']; ?>" /> <input name="url" type="hidden" id="url" value="<?= $_SERVER['HTTP_REFERER']; ?>" /> </form> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表