<!--#include file="down_conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="down_function.asp" -->
<%

dim menu,sql1,rs1,sqls,errword
menu=request.querystring("menu")
Dvbbs.LoadTemplates("")
Dvbbs.Stats="<a href=down_default.asp>下载中心</a> → 申请收费用户"
Dvbbs.Nav()'输出头
Dvbbs.Head_var 2,0,Dvbbs.Stats,""
if not DVBBS.founduser then
FoundErrs  "<font color=red>非会员谢绝进入！</font>请<a href=login.asp>登陆</a>或者同管理员联系。"
ShowErrs(Dvbbs.Stats)

else
	if menu="" then
   		call main()
 		elseif menu=1 then
    	call apply()
		elseif menu=2 then
    	call cancel()
	end if  	
end if
%>

<%sub main()
dim sql1,rs1
sql="select * from [payconfig]"
set rs=conndown.execute(sql)
if not rs.eof then
end if
sql1="select * from [DV_user] where username='"&dvbbs.membername&"'"
set rs1=conn.execute(sql1)
if not rs1.eof then
end if
%>
<table cellspacing=1 align=center class="tableborder1" width="<%= Dvbbs.mainsetting(0) %>" height="228">

<tr width="100%">
<th valign=middle align=center height=21 width="100%" colspan="4">申请说明</td>
</tr>

<tr width="100%">
<td valign=middle align=center height=21 width="100%" class=tablebody1 colspan="4">
  <%if paymod=1 then%>
  <br><font color=red>本下载系统当前采用的是自动添加付费用户模式</font><br>
  如果您当前的条件满足付费用户申请条件，您就可以直接申请成为下载中心的付费用户<br><br>
  <%else%>
  <br><font color=red>本下载系统当前采用的是人工添加付费用户模式</font><br>
  如果您当前的条件满足付费用户申请条件，您就可以申请成为下载中心的付费用户，<br>
您的申请会被提交给管理员审批，一但通过审批即可成为付费用户<br><br>

  <%end if%>
  </td>
</tr>

<tr width="100%">
<td valign=middle align=center height=21 width="100%" class=tablebody1 colspan="4">欢迎<B><%=dvbbs.membername%></B>申请下载中心付费用户<br>
</td>
</tr>

<tr width="100%">
<th valign=middle align=center height=24 width="25%"><b>所需要条件</b></th>
<th valign=middle align=center height=24 width="25%">付费用户<b>条件</b></th>
<th valign=middle align=center height=24 width="25%"><b>您当前的条件</b></th>
<th valign=middle align=center height=24 width="25%"><b>是否满足</b></th>
</tr>
<tr width="100%">
<td valign=middle align=center height=21 width="25%" class=tablebody1>金钱</td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%=rs("wealth")%></td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%=rs1("userwealth")%></td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%if rs("wealth")<=rs1("userwealth") then%>满足<%else%><font color=red>不满足</font><%end if%></td>
</tr>
<tr width="100%">
<td valign=middle align=center height=21 width="25%" class=tablebody1>帖子数</td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%=rs("article")%></td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%=rs1("userpost")%></td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%if rs("article")<=rs1("userpost") then%>满足<%else%><font color=red>不满足</font><%end if%></td>
</tr>
<tr width="100%">
<td valign=middle align=center height=21 width="25%" class=tablebody1>经验值</td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%=rs("userep")%></td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%=rs1("userep")%></td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%if rs("userep")<=rs1("userep") then%>满足<%else%><font color=red>不满足</font><%end if%></td>
</tr>
<tr width="100%">
<td valign=middle align=center height=21 width="25%" class=tablebody1>魅力值</td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%=rs("usercp")%></td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%=rs1("usercp")%></td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%if rs("usercp")<=rs1("usercp") then%>满足<%else%><font color=red>不满足</font><%end if%></td>
</tr>
<tr width="100%">
<td valign=middle align=center height=21 width="25%" class=tablebody1>威望值</td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%=rs("power")%></td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%=rs1("userpower")%></td>
<td valign=middle align=center height=21 width="25%" class=tablebody1><%if rs("power")<=rs1("userpower") then%>满足<%else%><font color=red>不满足</font><%end if%></td>
</tr>
<tr width="100%">
<td valign=middle align=center height=21 width="25%" class=tablebody1>
</td>
<td valign=middle align=center height=21 width="50%" colspan="2" class=tablebody1>
<% if rs("wealth")>rs1("userwealth") or rs("article")>rs1("userpost") or rs("userep")>rs1("userep") or rs("usercp")>rs1("usercp") or rs("power")>rs1("userpower") then
response.write "<br><br><font color=red>您至少有一项条件不满足，您暂时还无法申请成为下载中心付费会员</font><br><br>"
else
	set rss=conndown.execute("select * from [user] where username='"&dvbbs.membername&"'")
		if rss.eof and rss.bof then
		response.write "<br><font color=red>您可以申请下载中心付费会员</font><br>"%>
		<form name="form2" method="post" action="?menu=1">
		<INPUT type=submit value=申请 name=submit>
		</form>
		<%
		else
			if rss("apply")=2 then
			response.write "<br><font color=red>您的申请还未审批</font><br>"
			elseif rss("apply")=1 then
			response.write "<br><font color=red>您已是下载中心的付费会员</font><br>"
			end if
		end if
end if
%><br>
</td>

<td valign=middle align=center height=21 width="25%" class=tablebody1></td>
</tr>
</table>

<%end sub%>


<% sub apply()
sql="select * from [payconfig]"
set rs=conndown.execute(sql)
sql1="select * from [DV_user] where username='"&dvbbs.membername&"'"
set rs1=conn.execute(sql1)
set rss = server.CreateObject ("Adodb.recordset")
sqls="select * from [user] where username='"&dvbbs.membername&"'"
rss.open sqls,conndown,1,3

if rs("wealth")>rs1("userwealth") or rs("article")>rs1("userpost") or rs("userep")>rs1("userep") or rs("usercp")>rs1("usercp") or rs("power")>rs1("userpower") then
errword="您至少有一项条件不满足，您暂时还无法申请成为"&Forum_info(0)&"下载中心的付费用户"
elseif not(rss.eof and rss.bof) then
errword="您已递交过申请或是您已经是付费会员了，请不要重复申请"
%>
<table cellspacing=1 align=center class="tableborder1" width="<%= Dvbbs.mainsetting(0) %>" >
<tr width="100%">
<th valign=middle align=center height=21 width="100%">申请付费用户
</tr><tr width="100%">
<td valign=middle align=center height=21 width="100%" class=tablebody1>
<br><font color=red><%=errword%></font><br><br><a href=down_default.asp>返回下载中心首页</a><br></td></tr></table>
<%
else
	rss.addnew
	rss("username")=dvbbs.membername
	rss("regtime")=date()
	rss("allpoint")=0
	rss("lockuser")=1
	if paymod=1 then
	rss("apply")=1 
	elseif paymod=2 then
	rss("apply")=2 
	end if
	rss.update
%>
<table cellspacing=1 align=center class="tableborder1" width="<%= Dvbbs.mainsetting(0) %>" >
<tr width="100%">
<th valign=middle align=center height=21 width="100%">申请付费用户
</tr><tr width="100%">
<td valign=middle align=center height=21 width="100%" class=tablebody1>
<br><font color=red>您申请成功，恭喜您成为本站下载中心付费用户</font><br><br><a href=down_default.asp>返回下载中心首页</a><br><br></td></tr></table>
<%
end if
end sub
Dvbbs.footer()
%>



