  <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="111"
	dir="../err.asp" 
  %>
  <!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../../inc/md5.asp"-->
<!--#include file="menu.asp"-->
<!--#include file="../rolecheck.asp"-->
<%
Response.Expires = 0
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "cache-control", "no-store"
%>
<script LANGUAGE="JavaScript">
function check()
{
if (document.Form1.username.value=="")
{
alert("请输入登陆名！")
document.Form1.username.focus()
document.Form1.username.select()
return
}
if (document.Form1.password.value=="")
{
alert("请输入密码！")
document.Form1.password.focus()
document.Form1.password.select() 
return
}
document.Form1.submit()
}
</SCRIPT>
<LINK href="../css/style.css" rel=stylesheet type=text/css> 
<body marginheight=0 marginwidth=0 leftmargin=0>
<%
 
call main()
set rs=nothing
conn.close
set conn=nothing
 
sub main()
%>
<center>
<table cellpadding=0 cellspacing=0 border=0 width=100% align=center>
<tr>
<td>
<table cellpadding=4 cellspacing=1 border=0 width=100%>
<tr>
<td width="100%" valign=top>
<%
if request("action")="editsave" then 
call editsave()
elseif request("action")="add" then 
call add2()
elseif request("action")="addsave" then 
call addsave()
else
call manager()
end if
%>
<p><%=body%></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
end sub
sub manager()
dim sql
dim rs
dim id
id=Replace_Text(request("id"))
sql="select * from Websen_worldec_master where id="&cstr(id)
  Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
%>
<script language="JavaScript">
<!--
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked; 
}
}
//-->
</script>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TR>
<TD align="center">
<FORM action="?action=editsave&id=<%=id%>" method="post" name="Form1">
<TABLE width=100% border="0" cellPadding=2 cellSpacing=1 class="tableBorder">
  <tr> 
     <th height=25 colspan="2" class="tableHeaderText">管理员管理－－修改管理员 </th> 
  </tr>
<TR> 
<TD width="17%" height="28" align="right" class=forumRow>用&nbsp;户&nbsp;名：</td>
<TD width="83%"><font color="#FFFFFF">&nbsp;&nbsp;<input type=text name=username size="35" class="smallInput" value=<%=rs("username")%>></font></TD>
</TR>
<TR>
<TD align="right" height="28" class=forumRow>密&nbsp;&nbsp;&nbsp;&nbsp;码：</TD>
<TD><font color="#FFFFFF">&nbsp;&nbsp;<input type=password name=password size="40" class="smallInput" value=<%=rs("password")%>>
</font></TD>
</TR>
<TR>
<TD colspan=2>&nbsp;</TD>
</TR>
<TR>
<TD colspan=2 height="28" align="center" class="forumRowHighlight"> 
  <input type="button" value="修 改" class="smallInput" onclick=check()>&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
</FORM>
</TD>
</TR>
</TABLE>
<%
rs.close
set rs=nothing
end sub
sub editsave()
set rs=server.createobject("adodb.recordset")
sql="select * from Websen_worldec_master where id="&Replace_Text(request("id"))
rs.open sql,conn,3,3
oldpassword=rs("password")
'rs("username")=request("username")
'rs("flag")=request("flag")
if request("password")<>oldpassword then
rs("password")=md5(Replace_Text(request("password")),16)
end if
rs.update
response.write "<script language='javascript'>"
response.write "alert('管理员信息修改成功！');"
response.write"this.location.href='../admin_setting.asp';</SCRIPT>"
response.end
end sub
sub add2()
%>
<script language="JavaScript">
<!--
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked; 
}
}
//-->
</script>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TR>
<TD align="center">&nbsp;</TD>
</TR>
</TABLE>
<%
end sub
sub addsave()
set rs=server.createobject("adodb.recordset")
sql="select * from Websen_worldec_master"
rs.open sql,conn,3,3
rs.addnew
'rs("username")=request("username")
rs("password")=md5(request("password"),16)
rs.update
response.write "<script language='javascript'>"
response.write "alert('管理员信息添加成功！');"
response.write"this.location.href='../admin_setting.asp';</SCRIPT>"
response.end
end sub
%>
<!--#include file="../copy.asp" -->