<!--#include file=down_conn.asp-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="down_function.asp" -->
<head>
<title>--管理页面</title>

<meta NAME=GENERATOR Content="Microsoft FrontPage 4.0" CHARSET=GB2312>
<base target="footer">
</head>

<BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0">
<%
dim rs,sql
Dvbbs.LoadTemplates("")
Dvbbs.Head()
	dim admin_flag,MaxPerPage,title,currentPage,totalPut,idlist1,rsl,user,uid,rs1,sql1,MemberName,mess,rs2,sql2,rs3,sql3,j,menu,rs_f,rs_u,lastmoney,npoint
	dim idlist,id1
	admin_flag="22"
	if not Dvbbs.master or instr(session("flag"),admin_flag)=0 then
		response.write "<BR><li>本页面为管理员专用，请<a href=admin_login.asp target=_top>登陆</a>后进入。<br><li>您没有管理本页面的权限。"
		response.end
	else
uid=request("uid")
menu=request("menu")
		if menu=1 or menu="" then
		call main()
		elseif menu=2 then
		call addpayuser()
		end if
end if
sub main()%>

<table width="462" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder">
	<form method="post" action="?menu=2" name="form1"  onsubmit="javascript:return check();">
	<tr>
	<th width="448" colspan="2">增加新付费用户
	</th>
	</tr>
	<tr>
	<td class=forumrow width="448" colspan="2">注意事项： 请仔细填写下面的相关信息！
	</td>
	</tr>
	<tr>
	<td class=forumrow width="98">用户名：</td>
	<td class=forumrow width="340"><input maxLength=20 name=username size=20></td>
	</tr>
<tr>
	<td class=forumrow width="98"></td>
	<td class=forumrow width="340"><input type="submit" name="Submit" value="确定"></td>
	</tr>
</form>	
</table>

<%
response.write "<br><br><div align=center><a href=admin_down_payuser.asp>返回上页</a></div>" 
end sub

sub addpayuser()
user=request("username")

set rs_f=conndown.execute("select * from [User] where username='"&user&"'")
if not(rs_f.eof and rs_f.bof) then
 Response.Write "<font color=red><div align=center><br><br>此用户已经是付费用户了</div></font><br><br>"
   response.write "<div align=center><a href=javascript:history.go(-1)>返回上页</a></div>" 
   rs_f.Close
   Set rs_f=Nothing
   Response.End 
end if

set rs_u=conn.execute("select * from [DV_user] where username='"&user&"'")
if rs_u.eof and rs_u.bof then
   Response.Write "<font color=red><div align=center><br><br>此用户不是论坛用户</div></font><br><br>"
   response.write "<div align=center><a href=javascript:history.go(-1)>返回上页</a></div>" 
   rs_u.Close
   Set rs_u=Nothing
   Response.End 
elseif not isnumeric(lastmoney) then
 Response.Write "<font color=red><div align=center><br><br>付费金额只能为数字</div></font><br><br>"
 response.write "<div align=center><a href=javascript:history.go(-1)>返回上页</a></div>" 
    Response.End 
elseif not isnumeric(npoint) then
 Response.Write "<font color=red><div align=center><br><br>当前点数只能为数字</div></font><br><br>"
 response.write "<div align=center><a href=javascript:history.go(-1)>返回上页</a></div>" 
  Response.End 
else
sql="select * from [user]"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conndown,1,3
rs.addnew
rs("username")=user
rs("allpoint")=0
rs("regtime")=date()
rs("lockuser")=1
rs("apply")=1
rs.update
set rs1=server.createobject("adodb.recordset")
sql1="select * from events"
rs1.open sql1,conndown,1,3
mess=""&membername&"添加了付费用户“"&user&"”"	
rs1.addnew
rs1("event")=mess
rs1("addtime")=date()
rs1.update
rs1.close
end if
set rs2=server.createobject("adodb.recordset")      
sql2="select * from [dv_message]"      
rs2.open sql2,conn,1,3      
rs2.addnew      
rs2("sender")="下载中心"      
rs2("incept")=user     
rs2("title")="您的付费下载用户账号已经开通！"      
rs2("content")="您的付费下载用户账号已经开通！请妥善保管您的密码！"      
rs2("flag")=0      
rs2("issend")=1      
rs2.update      
rs2.close
response.write "<div align=center><br><br>新的付费用户添加成功！<br></div>"
response.write "<div align=center><a href=admin_down_payuser.asp><font color=red>返回付费用户管理页面！</font></a></div>"  
 
end sub
%>