<% if request("action")="" then %>
<link href="web_jspok.css" rel="stylesheet" type="text/css">

<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#A3BFE8">
  <tr>
    <td height="20" colspan="3" align="center" bgcolor="#E9F1F8">增加管理员</td>
  </tr>
  
  <tr>
    <td height="20" colspan="3" align="center" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <form action="main.asp?adminjob=addadmin&action=save" method="post">
  <tr>
    <td width="33%" height="20" align="center" bgcolor="#E9F1F8">管理员UID：</td>
    <td width="33%" height="20" align="left" bgcolor="#E9F1F8"><label>
      <input name="txt_uid" type="text" id="txt_uid" maxlength="12" class="txtinput">
    </label></td>
    <td width="34%" height="20" align="center" bgcolor="#E9F1F8">&nbsp;</td>
  </tr>
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">管理员PWD：</td>
    <td height="20" align="left" bgcolor="#E9F1F8"><label>
      <input name="txt_pwd" type="password" id="txt_pwd" maxlength="16" class="txtinput">
    </label></td>
    <td height="20" align="center" bgcolor="#E9F1F8">&nbsp;</td>
  </tr>
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">重复PWD：</td>
    <td height="20" align="left" bgcolor="#E9F1F8"><input name="txt_repwd" type="password" id="txt_repwd" maxlength="16" class="txtinput"></td>
    <td height="20" align="center" bgcolor="#E9F1F8">&nbsp;</td>
  </tr>
  <tr>
    <td height="20" colspan="3" align="center" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
  <tr>
    <td height="20" colspan="3" align="center" bgcolor="#E9F1F8"><label>
      <input type="submit" name="Submit" value=" 提 交 ">
    </label></td>
    </tr>
  </form>
</table>
<%else%>
<%
uid=Replace(Request.Form("txt_uid"),"'","''")
pwd=Replace(Request.Form("txt_pwd"),"'","''")
repwd=Replace(Request.Form("txt_repwd"),"'","''")
if pwd="" or uid="" or repwd="" then 
response.write "<script>alert('网站信息提示：\n\n·用户名和密码不能为空！');history.go(-1);</Script>"
elseif pwd<>repwd then 
response.write "<script>alert('网站信息提示：\n\n·两次密码不一致！');history.go(-1);</Script>"
else  
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from system where s_uid='"& uid &"'"
rs.open sql,conn,1,3
if not rs.eof and not rs.bof then 
response.write "<script>alert('网站信息提示：\n\n·此用户名已经存在！');history.go(-1);</Script>"
else
adminpwd=server.HTMLEncode(pwd)
rs.addnew
rs("s_uid")=server.HTMLEncode(uid)
rs("s_pwd")=md5(adminpwd)
rs("s_time")=now()
rs("s_ip")=getip
rs.update
rs.close
set rs=nothing
end if
end if 
%>
<!--#include file="admininfo.asp"-->
<%end if%>
