<!--#include file = "../LieHuo_inc/dbconn.asp"-->
<!--#include file = "../LieHuo_inc/md5.asp"-->
<!--#include file = "../LieHuo_inc/function.asp"-->
<% call dbconn %>
<%
'=======================================================================
'LieHuo Wms 2.5.0  允许转载和复制 请保留版权 否则后果自负 www.liehuo.net 
'=======================================================================
dim tmp_Type:tmp_Type=""
	dim rs,sql
	set rs = server.createobject (G_liehuo_RS)
if gqv("do") = "add" then
	if gfv("uname") = "" then
		call alertbox("[用户名称]不能为空!",2)
	elseif gfv("pass1") = "" then
		call alertbox("[用户密码]不能为空!",2)
	elseif gfv("pass2") = "" then
		call alertbox("[确认密码]不能为空!",2)
	elseif gfv("pass1") <> gfv("pass2") then
		call alertbox("两次输入密码不一致!",2)
	elseif gfv("scode") = "" then
		call alertbox("[安全密码]不能为空!",2)
	end if
	set rs = server.createobject (G_liehuo_RS)
	sql = "select * from DH_liehuo_admin where uname='" & gfv("uname") & "'"
	rs.open sql,conn,1,3
	if not rs.eof then		
        rs.update
	    rs.close:set rs = nothing
		call alertbox("抱歉!该用户名存在，请换用其他名字吧!",2)
	end if	
    dim rsn,nsql
	set rsn = server.createobject(G_liehuo_RS)
	    nsql = "select top 1 * from DH_liehuo_Admin"
	    rsn.open nsql,conn,1,3
	    rsn.addnew
	    rsn("uname") = gfv("uname")
	    rsn("upass") = md5(gfv("pass2"),32)
	    rsn("scode") = gfv("scode")
	    rsn("addtime") = dateformat(now(),1)
	    rsn("Admin_Is_Locked") = gfv("Admin_Is_Locked")
	    rsn("Admin_Pop_List") = gfv("Admin_Pop_List")
        rsn.update
	    rsn.close:set rsn = nothing
	response.write "<script>alert('管理员添加成功，自动跳转下一页！');window.location='finished.asp';</script>"
	
end if
select case gqv("do")
	case "adduser"
	  Call adduser
end select
sub adduser
	LINE "<title>Liehuo! Wms 程序安装 - Powered By LieHuo.org</title>"
	LINE "<link rel=""stylesheet"" href=""style.css"" type=""text/css"" media=""all"" />"
	LINE "<meta content=""Liehuo Team."" name=""Copyright"" />"
	LINE "</head>"
	LINE "<div class=""container"">"
	LINE "	<div class=""header"">"
	LINE "		<h1>Liehuo! Wms 程序安装</h1>"
	LINE "	<span>V2.5.0_Final 简体中文版 20090718</span>	<div class=""setup step3"">"
	LINE "		<h2>添加系统管理员</h2>"
	LINE "		<p>请添加后台管理员，也可说明文件中的默认系统帐号。</p>"
	LINE "	</div>"
	LINE "	<div class=""stepstat"">"
	LINE "		<ul>"
	LINE "			<li class="""">1</li>"
	LINE "			<li class="""">2</li>"
	LINE "			<li class=""current"">3</li>"
	LINE "			<li class=""unactivated last"">4</li>"
	LINE "		</ul>"
	LINE "		<div class=""stepstatbg stepstat1""></div>"
	LINE "	</div>"
	LINE "</div>"
	LINE "<div class=""main"">"
	LINE "<div class=""desc"">"

	LINE "<a name=""adduser""></a>"
	LINE "<form name=""form"" action=""?do=add"" method=""post"">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" border=""0"">"
	LINE "<tr>"
	LINE "<td align=""center"" valign=""middle"">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" class=""maintable"" id=tbl>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">用户名称:</td>"
	LINE "<td bgcolor=""#F6FBFE"" width=""75%""><input name=""uname"" type=""text"" value="""" style=""width:200px;""> 请以英文或者数字表示，至少3位字节。</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">用户密码:</td>"
	LINE "<td bgcolor=""#F6FBFE"" width=""75%""><input name=""pass1"" type=""password"" value="""" style=""width:200px;""> 请输入您密码，建议用数字+字母组合。</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">确认密码:</td>"
	LINE "<td bgcolor=""#F6FBFE"" width=""75%""><input name=""pass2"" type=""password"" value="""" style=""width:200px;""> 请再输入一次上面的密码。</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">安全密码:</td>"
	LINE "<td bgcolor=""#F6FBFE"" width=""75%""><input name=""scode"" type=""password"" value="""" style=""width:200px;""><font color=#0000ff>请填写0-9纯数字的数字，否则会出错！！</a></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td style=""display:none""><input name=""Admin_Is_Locked"" type=""text"" value=""1""></td>"
	LINE "<td style=""display:none""><input name=""Admin_Pop_List"" type=""text"" value=""LieHuo_DH_liehuo""></td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "<br />"
	LINE "<div class=""btnbox marginbot"">"
	LINE "<a href=""install_2.asp?do=editsetup""><img src=""images/back.gif"" border=""0""></a>&nbsp;&nbsp;&nbsp;&nbsp;"
	LINE "<a href=""finished.asp"" title=""如不设置管理员，可按说明中的默认用户登录后台。""><img src=""images/skip.gif"" border=""0""></a>&nbsp;&nbsp;&nbsp;&nbsp;"
	LINE "<input name=""submit1"" type=""image"" src=""images/next.gif"" style=""padding: 2px"" onclick=""this.disabled=true;document.form.submit();"">"
	LINE "</div>"
	LINE "<div class=""footer"">我们只对<a href=""http://bbs.liehuo.net/viewthread.php?tid=2367"" title=""查看商业付费用户价格及服务体系"" target=""_blank"">商业用户</a>提供QQ在线支持,免费版用户请到论坛寻求帮助:<a title=""进入烈火论坛"" href=""http://bbs.liehuo.net/?setup"" target=""_blank"">http://bbs.liehuo.net/</a></div>"
	LINE "</div>"
	LINE "</div>"
	LINE "</form>"
end sub%>
<% LOADING_ADMIN_FOOT %>
