<?php
require_once("../../global/checkuser1.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改用户</title>
<link rel="stylesheet" href="addmodify.css" />
<script>
function check(){
var name=document.getElementById("name");
var auth=document.getElementById("auth");
if(name.value==""){
alert("姓名不能为空!");
name.focus();
return false;
}
if(auth.value==""){
alert("身份不能为空!");
return false;
}
}
function initselect(){
var ve = document.getElementById("authh").value;
var st = document.getElementById("auth");
for(var i=0;i<st.options.length;i++){
  if(ve==st.options[i].value){
       st.selectedIndex = i;
       break;
  }
}

}
</script>
</head>

<body>
<div class="bigdiv">
<table cellspacing="0" cellpadding="0" style="font-size:14px;"><tr><td style="text-align:left;border-left:none;">您的位置：<a href="index.php">系统配置</a>/<a href="index.php">用户管理</a>/修改用户</td><td style="border-left:none;text-align:right;"><a href="index.php">返回</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr></table>
<div class="list">
<?php
require_once("../../global/connect.php");
$row=mysql_fetch_array(mysql_query("select * from user where id=$_GET[id]"));
?>
<input type="hidden" id="authh" value="<?=$row['auth']?>" />
<form action="function.php?mod=modify" method="post" onsubmit="return check()">
<div class="content">
<ul>
<li>用户ID：<input type="text" id="id" name="id" value="<?=$row['id']?>" class="text"  readonly="readonly"/></li>
<li>帐&nbsp;&nbsp;&nbsp;号：<input type="text" id="username" name="username" value="<?=$row['username']?>" class="text" readonly="readonly" /></li>
<li>密&nbsp;&nbsp;&nbsp;码：<input type="text" id="password" name="password" value="<?=$row['password']?>" class="text" /></li>
<li>姓&nbsp;&nbsp;&nbsp;名：<input type="text" id="name" name="name" value="<?=$row['name']?>" class="text" /></li>
<li>用户组：<select id="auth" name="auth">
<option value="">用户组</option><option value="网站编辑">网站编辑</option><option value="网络推广">网络推广</option>
<option value="市场策划">市场策划</option><option value="管理">管理</option>
</select></li>
<script>initselect();</script></li>
<li style="text-align:center;height:40px;line-height:40px;"><input type="submit" value="提交" class="btn"/>&nbsp;&nbsp;<input type="button" value="取消" class="btn" onclick="window.location.href='index.php';"/></li>
</ul>
</div>
</form>
</div>
</div>
</body>
</html>
