查看文件: user_edit.php
大小: 3.88 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")) { $updateSQL = sprintf("UPDATE `user` SET name=%s, passwd=%s, stat=%s, level=%s WHERE id=%s", GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['passwd'], "text"), GetSQLValueString($_POST['stat'], "text"), GetSQLValueString($_POST['level'], "int"), GetSQLValueString($_POST['id'], "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 `user` WHERE id = %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="37%" align="center"> <tr valign="baseline"> <th width="5%" height="33" align="right" valign="top" nowrap="nowrap">帳 號:</th> <td width="95%" valign="baseline"><input name="name" type="text" id="name" value="<?php echo $row_Rt2['name']; ?>" size="32" /></td> </tr> <tr valign="baseline"> <th height="31" align="right" valign="top" nowrap="nowrap">密 碼:</th> <td valign="baseline"><input name="passwd" type="text" id="passwd" value="<?php echo $row_Rt2['passwd']; ?>" size="32" /></td> </tr> <tr valign="baseline"> <td height="30" align="center" valign="middle" nowrap="nowrap">GROUP:</td> <td height="30" align="left" valign="middle" nowrap="nowrap"><label for="stat"></label> <select name="stat" id="stat"> <option value="A" <?php if (!(strcmp("A", $row_Rt2['stat']))) {echo 'selected="selected"';} ?>>A</option> <option value="B" <?php if (!(strcmp("B", $row_Rt2['stat']))) {echo 'selected="selected"';} ?>>B</option> <option value="C" <?php if (!(strcmp("C", $row_Rt2['stat']))) {echo 'selected="selected"';} ?>>C</option> </select></td> </tr> <tr valign="baseline"> <td height="30" align="center" valign="middle" nowrap="nowrap">L V :</td> <td height="30" align="left" valign="middle" nowrap="nowrap"><select name="level" id="level"> <option value="1" <?php if (!(strcmp("1", $row_Rt2['level']))) {echo 'selected="selected"';} ?>>1</option> <option value="2" <?php if (!(strcmp("2", $row_Rt2['level']))) {echo 'selected="selected"';} ?>>2</option> <option value="3" <?php if (!(strcmp("3", $row_Rt2['level']))) {echo 'selected="selected"';} ?>>3</option> <option value="4" <?php if (!(strcmp("4", $row_Rt2['level']))) {echo 'selected="selected"';} ?>>4</option> <option value="5" <?php if (!(strcmp("5", $row_Rt2['level']))) {echo 'selected="selected"';} ?>>5</option> <option value="6" <?php if (!(strcmp("6", $row_Rt2['level']))) {echo 'selected="selected"';} ?>>6</option> <option value="7" <?php if (!(strcmp("7", $row_Rt2['level']))) {echo 'selected="selected"';} ?>>7</option> </select> <label for="radio"></label></td> </tr> <tr valign="baseline"> <td height="40" colspan="2" align="center" valign="middle" nowrap="nowrap"><input type="submit" value="修改資料" /></td> </tr> </table> <input name="id" type="hidden" id="id" value="<?php echo $row_Rt2['id']; ?>" /> <input type="hidden" name="MM_update" value="form1" /> <input name="url" type="hidden" id="url" value="<?= $_SERVER['HTTP_REFERER']; ?>" /> </form> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表