⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 app.asp

📁 进入后台
💻 ASP
字号:
<!--#include file="config.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!--#include file="head.asp"-->
<%bid=clng(request("bid"))
if bid="" or bid<1 then ShowError("访问的班级不存在")
rs.open "select * from bj where id="&bid&"",conn,1,1
	If Rs.eof Then ShowError("访问的班级不存在")
	if rs("isopen")=1 and session("xyluserid")="" then ShowError("你访问的班级禁止游客访问")
	if rs("isopen")=2 then
	if session("xyluserid")="" then ShowError("你访问的班级禁止非班级成员访问")
	if obj.inbj(session("xyluserid"),bid,SiteDatabase)<>1 then ShowError("你访问的班级禁止非班级成员访问")
	end if
	bjname=rs("bjname")
	rs.close
	rs.open "select * from app where datediff('d',adddate,now())>5",conn,1,1
	If not Rs.eof then
	Set rs2 = Server.CreateObject("Adodb.Recordset")
	do while not rs.eof
	if obj.inbj(rs("userid"),rs("bjid"),SiteDatabase)=1 then
	rs2.open "delete from app2 where appid="&rs("id")&"",conn,1,3
rs2.open "delete from app where id="&rs("id")&"",conn,1,3
else
	if obj.joinbj(rs("userid"),rs("bjid"),SiteDatabase)=1 then
rs2.open "delete from app2 where appid="&rs("id")&"",conn,1,3
rs2.open "delete from app where id="&rs("id")&"",conn,1,3
end if
end if
rs.movenext
loop
	end if
	rs.close%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=Sitename%>-<%=bjname%>-申请加入班级</title>
<LINK href="css.css" type=text/css rel=stylesheet>
</head>
<body>
<%call bjhead(bid,bjname)%>
<table width="760"  border="0" align="center" cellpadding="0" cellspacing="0" class="border">
        <tr>
          <td height="291" valign="top">
            <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0" class="border">
        <tr>
          <td height="25">  <img src="skins/1/xb3.gif">&nbsp;当前位置:<a href="bjindex.asp?bid=<%=bid%>">班级首页</a> &gt;&gt; <a href="app.asp?bid=<%=bid%>">申请加入班级</a></td>
          </tr>
      </table>
	  <%select case request("type2")
			case "ok"
			call ok
			case "no"
			call no
			case else
			call show
			end select
			sub show%>
            <div align="center"><br>
   当“同意”或“反对”的人数达到2位时,就可以批准或拒绝加入;5天内此请求没得到批准和拒绝时自动被批准。<br>
            </div>
            <table width="95%" border="0" align="center" cellpadding="1" cellspacing="2" class="border">
<tr bgcolor="#FFCFCE">
<td width="6%"><div align="center">ID</div></td>
    <td width="18%" height="20"><div align="center">申请人</div></td>
    <td width="9%"><div align="center">同意</div></td>
    <td width="14%"><div align="center">反对</div></td>
	<td width="22%"><div align="center">申请时间</div></td>
	<td width="31%"><div align="center">操作</div></td>
  </tr>
<%rs.open "select * from app where bjid="&bid&" order by id desc",conn,1,1
	If Rs.eof and Rs.bof Then
	Response.Write("<tr><td colspan=8>暂无请求</td></tr>")
	else
	dim strFileName,i,j,totalPut,CurrentPage,TotalPages
					totalPut=rs.recordcount
					const MaxPerPage=30
					strFileName="?bid="&bid&""
					if request("page")<>"" then
						currentPage=cint(request("page"))
					else
						currentPage=1
					end if
					if currentPage<>1 and (currentPage-1)*MaxPerPage<totalPut then
					rs.move (currentPage-1)*MaxPerPage
					else
					currentPage=1
					end if
					i=0
	do while not rs.eof%>
  <tr bgcolor="#F7F7F7">
    <td height="20"><div align="center"><%=rs("id")%></div></td>
    <td><div align="center"><a href="datum.asp?userid=<%=rs("userid")%>" title="点击查看资料" target="_blank"><%=obj.getname(rs("userid"),1,SiteDatabase)%></a></div></td>
    <td><div align="center"><%Set rs2 = Server.CreateObject("Adodb.Recordset")
	rs2.open "select count(*) from app2 where appid="&rs("id")&" and isok=1",conn,1,3
response.write rs2(0)
rs2.close%></div></td>
	<td><div align="center"><%rs2.open "select count(*) from app2 where appid="&rs("id")&" and isok=0",conn,1,3
response.write rs2(0)
rs2.close:set rs2=nothing%></div></td>
	<td><div align="center"><%=rs("adddate")%></div></td>
	<td><div align="center"><a href="datum.asp?userid=<%=rs("userid")%>" title="点击查看资料" target="_blank">查看资料</a> <a href="app.asp?type2=ok&bid=<%=bid%>&id=<%=rs(0)%>">同意</a> <a href="app.asp?type2=no&bid=<%=bid%>&id=<%=rs(0)%>">反对</a></div></td>
  </tr>
<%i=i+1
if i>=MaxPerPage then exit do
rs.movenext
			loop
			end if%>
</table>
<br>
<table width="95%" align="center" cellpadding="1" cellspacing="1" bordercolor="#CCCCCC" class="border">
  <tr>
    <td height="25" bgcolor="#f9f8f2"><div align="center"><%=obj.showpage(strFileName,totalput,MaxPerPage,true,true,"条",currentPage)%></div></td>
  </tr>
</table>
		<%rs.close:set rs=nothing
		end sub
sub ok
if session("xyluserid")="" then ShowError("非班级成员不可进行此项操作")
if obj.inbj(session("xyluserid"),bid,SiteDatabase)<>1 then ShowError("非班级成员不可进行此项操作")
id=clng(request("id"))
if id="" or id<1 then ShowError("缺少参数")
rs.open "select * from app where id="&id&" and bjid="&bid&"",conn,1,1
if rs.eof then ShowError("没有找到此请求,或非不属于本班请求")
userid=rs("userid")
rs.close
rs.open "select * from app2 where appid="&id&" and userid="&session("xyluserid")&"",conn,1,3
if not rs.eof then
rs.close
ShowError("你已经对此申请操作过。")
end if
rs.close
rs.open "select * from app2 where appid="&id&" and isok=1",conn,1,3
if rs.eof then
rs.addnew
rs("userid")=session("xyluserid")
rs("isok")=1
rs("appid")=id
rs("appuserid")=userid
rs.update
rs.close
else
rs.close
if obj.joinbj(userid,bid,SiteDatabase)<>1 then ShowError("在批准该会员进入本班时出现错误,请联系站长")
rs.open "delete from app2 where appid="&id&"",conn,1,3
rs.open "delete from app where id="&id&"",conn,1,3
end if
a=obj.gourl(" 页面三秒后将自动返回申请加入班级栏目,可以继续选择以下操作:<br><br> 返回<A href='bjindex.asp?bid="&bid&"'>[班级首页]</a><br><br> 到<A href='app.asp?bid="&bid&"'>[申请加入班级]栏目</a>","app.asp?bid="&bid&"")
end sub
sub no
if session("xyluserid")="" then ShowError("非班级成员不可进行此项操作")
if obj.inbj(session("xyluserid"),bid,SiteDatabase)<>1 then ShowError("非班级成员不可进行此项操作")
id=clng(request("id"))
if id="" or id<1 then ShowError("缺少参数")
rs.open "select * from app where id="&id&" and bjid="&bid&"",conn,1,1
if rs.eof then ShowError("没有找到此请求,或非不属于本班请求")
userid=rs("userid")
rs.close
rs.open "select * from app2 where appid="&id&" and userid="&session("xyluserid")&"",conn,1,3
if not rs.eof then
rs.close
ShowError("你已经对此申请操作过。")
end if
rs.close
rs.open "select * from app2 where appid="&id&" and isok=0",conn,1,3
if rs.eof then
rs.addnew
rs("userid")=session("xyluserid")
rs("isok")=0
rs("appid")=id
rs("appuserid")=userid
rs.update
rs.close
else
rs.close
rs.open "delete from app2 where appid="&id&"",conn,1,3
rs.open "delete from app where id="&id&"",conn,1,3
rs.open "select * from mail where 1=2",conn,1,3
rs.addnew
rs("toid")=userid
rs("title")="你的申请没有通过"
rs("content")="你所申请加入"&bjname&"的请求被同学们拒绝。请确认你是否是该班成员,且个人资料中的姓名正确。<br>此为系统自动发信,请别要回复。"
rs("fromid")=session("xyluserid")
rs.update
rs.close
end if
a=obj.gourl(" 页面三秒后将自动返回申请加入班级栏目,可以继续选择以下操作:<br><br> 返回<A href='bjindex.asp?bid="&bid&"'>[班级首页]</a><br><br> 到<A href='app.asp?bid="&bid&"'>[申请加入班级]栏目</a>","app.asp?bid="&bid&"")
end sub%>
</td></tr>
</table>
<%closeconn
sitebottom%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -