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

📄 regclass.asp

📁 酷虎网同学录V1.0
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<td>&nbsp;<a target=_blank href=BrowseClass.asp?ClassID=<%=rs(0)%>><%=htmlencode(rs(1))%></a></td>
<td align="center" ><%=rs(4)%></td>
<td>&nbsp;
<%if rs(2)<>"" then response.write "正:<a target=_blank href=Profile.asp?Name="&htmlencode(rs(2))&" onmouseout=""kill()"" onmouseover=""popup('查看"&htmlencode(rs(2))&"的个人信息!','"&tablebodycolor1&"')"">"&htmlencode(rs(2))&"</a>"
if rs(3)<>"" then response.write "&nbsp;副:<a target=_blank href=Profile.asp?Name="&htmlencode(rs(3))&" onmouseout=""kill()"" onmouseover=""popup('查看"&htmlencode(rs(3))&"的个人信息!','"&tablebodycolor1&"')"">"&htmlencode(rs(3))&"</a>"
%></td>
<td align="center" >
		  
<%if rs(5)=0 then 
		  response.write "<img src=images/open.gif width=16 onmouseout=kill() onmouseover=""popup('该班级完全开放,可以自由加入!','"&tablebodycolor1&"')"">"
elseif rs(5)=1 then 
  		  response.write "<img src=images/passwd.gif onmouseout=kill() onmouseover=""popup('加入该班级需要向班级管理员索取班级密码!','"&tablebodycolor1&"')"">"
elseif rs(5)=2 then 
  		  response.write "<img src=images/auditing.gif onmouseout=kill() onmouseover=""popup('你需要通过班级管理员的验证才能加入这个班级!','"&tablebodycolor1&"')"">"
elseif rs(5)=3 then 
  		  response.write "<img src=images/lock1.gif width=14 onmouseout=kill() onmouseover=""popup('该班级已被管理员锁定,不允许其他人加入!','"&tablebodycolor1&"')"">"
end if%></td>
          <td align="center" ><%=rs(6)%></td>
        </tr>
<%total=total+1
rs.movenext
loop
end if
set rs=nothing
%>
</table>

<TABLE width=95% align=center>
<TR><TD width=100%><table width=100% border=0><tr><td align=left width=140 nowrap><%response.write "页 "&currentpage&"&nbsp;/&nbsp;"&maxpages&"&nbsp;&nbsp;&nbsp;去第"%><input type=hidden value="<%=enyear%>" name="selenyear">&nbsp;<input type=text name=targetPage size=2 style="height:16px;width:20px;">&nbsp;页</td><td width=15 align=right style="cursor:hand" onclick="document.location.href='RegClass.asp?enyear='+selenyear.value+'&page='+targetPage.value;"><img src=images/btngo.gif width=13 height=15></td><td align=center><% if currentpage=0 then currentpage=1
if not  (currentpage=1 or maxpages=0) then
	response.write " <a href=?page="&currentpage-1&"&enyear="&enyear&"><img src=images/left.gif border=0>&nbsp;上一页</a>"
end if
		
if not (currentpage=maxpages or maxpages=0) then
	response.write " <a href=?page="&currentpage+1&"&enyear="&enyear&"><img src=images/right.gif border=0>&nbsp;下一页</a>"
end if
%></td><td align=right width=75><input type="submit" value="加入班级"></td></tr></table></TD>
</TR></TABLE>
</form>


<BR>
<form name="selsc" action="RegClass.asp" method="POST" onsubmit="return submitonce(this)">
<input type=hidden name=action value=Create>

<TABLE width=95% align=center>
<TR><TD align=left>2.如果上表中还没有你想要加入的班级,请在下面创建班级:</TD>
</TR></TABLE>

<table border="0" width="95%" bgcolor=<%=tablebordercolor%> cellspacing="1" cellpadding="7">
<tr bgcolor="<%=tablebodycolor2%>">
	<td width="60%" align="center" valign=center>
	&nbsp;&nbsp;班级名:<input name="classname" size="28" maxlength="28">&nbsp;*
	</td>
	<td width="40%" align="center" valign=center>
入学年份:<select
		      name="enyear" size="1"><%
				currentyear=cint(year(date()))
				startyear=currentyear-50
				for i=startyear to currentyear%>
				<option value="<%=i%>" <%if i=currentyear-4 then response.write "selected"%>><%=i%></option>
				<%next%>
				</select>&nbsp;*<br>
	</td>
</tr>

<tr bgcolor="<%=tablebodycolor2%>">
<td colspan=2><table border=0 cellpadding=3><tr><td>为避免出现同一班级多个名称的现象,班级名必须遵守以下规范!<br>
				1.在班级名中尽量写明入学年份,让人一目了然,如"99级1班"<br>
				2.请用中文不要用英文,文字之间不能有空格,班级名称必须在28个字符以内且不能少于五个字符.<BR>
				3.如果发现班级名不规范或者重复,请速与<a href=mailto:<%=SystemEmail%>>管理员联系</a></td></tr></table></td></tr>
</table>

<TABLE width=95% align=center>
<TR><TD align=right><input type="submit" value="创建班级"></TD>
</TR></TABLE>
</form>

</td></tr></table>
<%
end sub


sub add2class()
dim rs,sql
sql="select classid from [joinclass] where userid='"&membername&"' and classid="&scID
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
	errmsg=errmsg+"<br><li>您已经加入这个班级了!"
	call error("Information",errmsg)
	exit sub
end if

sql="update [class] set studcount=studcount+1 where classid="&scID
conn.execute(sql)

SQL = "select classname from [class] where classid="&scID
set rs=conn.execute(sql)
scname=rs(0)
set rs=nothing

sql="update [student] set classcount=classcount+1,point=point+"&pJoinClass&" where userid='"&membername&"'"
conn.execute(sql)

sql="insert into joinclass (userid,classid,visitcount,jointime,lastvisit,degree,"&_
"isauditing) values('"&membername&"',"&scID&",0,now(),now(),1,false)"
conn.execute(sql)

'if sendmainoption=true then
	call sendjoinmail()
'end if

rURL="myclass.asp?classid="&scID
rtitle="注册班级成功"
rmsg="您已经成功的注册了班级:<font color=brown>"&htmlencode(scname)&"</font>。<br><ul>"&_
		"<li><a href=myclass.asp?classid="&scID&"><font color="&TableContentcolor&">进入班级页面</font></a></li>"&_
		"</ul>"
redirect 3,rurl,rtitle,rmsg

end sub

sub waitpass()

sql="select isauditing from [joinclass] where userid='"&membername&"' and classid="&scID
set rs=conn.execute(sql)
if not rs.eof then
	if rs(0)=false then
		errmsg=errmsg+"<br><li>您已经加入这个班级,无需再申请加入!"
		founderr=true
	else
		errmsg=errmsg+"<br><li>您已经向班级管理员发出加入这个班级的请求,目前仍处于班长审核之中!"
		founderr=true
	end if
end if

if founderr=true then
	call error("Information",errmsg)
	exit sub
end if

sql="update [student] set classcount=classcount+1 where userid='"&membername&"'"
conn.execute(sql)

SQL = "select classname from [class] where classid="&scID
set rs=conn.execute(sql)
scname=rs(0)

sql="insert into joinclass (userid,classid,visitcount,degree,"&_
"isauditing) values('"&membername&"',"&scID&",0,1,true)"
conn.execute(sql)


stitle="发出请求"
smsg="<li>您已经成功的向<font color=brown>"&htmlencode(scname)&"</font>的班级管理员发出加入班级的请求。"
smsg=smsg&"<br>但是在没有通过班级管理员的审核前,你暂时还不能访问这个班级"
call success(stitle,smsg)


end sub

sub pswform()
%><br><br>
<form name="selsc"
    action="RegClass.asp" method="POST">
	<input type=hidden name=action value=passwordjoin>
	<input type=hidden name="scID" value=<%=scID%>>
    <table cellpadding=0 cellspacing=0 border=0 width=90% bgcolor=<%=TableborderColor%> align=center>
        <tr>
            <td>
                <table cellpadding=5 cellspacing=1 border=0 width=100%>
    <tr align="center"> 
      <td width="100%" colspan=2 bgcolor=<%=TabletitleColor%>><font color="<%=TableFontColor%>"><b>班级注册密码验证</b></font></td>
    </tr>
    <tr bgcolor="<%=TablebodyColor2%>"> 
      <td width="40%"  class=mp align=center><font color="<%=TableContentColor%>">请输入班级密码:</font>
      </td><td>&nbsp;&nbsp;<input type=password name=clspwd size=30> </td>
    </tr>
    <tr align="center"> 
      <td width="100%" colspan=2 bgcolor=<%=TabletitleColor%>>
<input type=submit name=submit value="提交">
      </td>
    </tr>  
    </table>   </td></tr></table></form>
<%
end sub

sub chkclspwd()

if chkpost=false then
	ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法。"
	call error("Critical",errmsg)
	exit sub
end if

clspwd=request.form("clspwd")
clspwd=replace(clspwd,"'","")

scID=clng(request.form("scID"))
sql="select classpwd from [class] where classid="&scID
set rs=conn.execute(sql)

if clspwd<>rs("classpwd") then
	errmsg=errmsg+"<br><li>班级密码错误!"
	call error("Exclamation",errmsg)
	exit sub
end if

call add2class()

end sub

sub sendjoinmail()

SQL = "select realname,email from [student] where userid='"&membername&"'"
set rs=conn.execute(sql)
studname=rs(0)
studmail=rs(1)


StrSQL = "select distinct email from [student] where NewMemberFlag=true and userid in (select userid from [joinclass] where classid="&scID&" and userid<>'"&membername&"')"
set rs=conn.execute(StrSQL)

if not rs.eof and EmailFlag<>0 then
mailto=rs("email")
rs.movenext
do until rs.eof
	mailto=mailto&","&rs("email")
	rs.movenext
loop
set rs=nothing


mailfrom=schoolmatename
mailtopic="好消息,贵班又增新成员!--"&SchoolmateName

crlf=chr(13)&chr(10)
mailbody="亲爱的同学,您好!"&crlf&crlf
mailbody=mailbody&"   贵班("&scname&")又有新成员加入:"&crlf&crlf
mailbody=mailbody&"   姓名:"&studname&crlf
mailbody=mailbody&"   EMAIL:"&studmail&crlf&crlf
mailbody=mailbody&"   快快去信给他(她)一声问候吧!"&crlf&crlf
mailbody=mailbody&"                                                  ——"&SchoolmateName&crlf
mailbody=mailbody&SchoolmateURL&crlf

		if EmailFlag=1 then
			call jmail_smtp()		
		elseif EmailFlag=2 then
			call Cdonts()		
		elseif EmailFlag=3 then
			call aspemail()
		elseif EmailFlag=4 then
			call jmail_msg()		
		end if
end if


end sub
%>

<%call footer%>


⌨️ 快捷键说明

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