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

📄 rp_xj_rs.asp

📁 Very good-xuan yen Student Information Management System [Senior Edition].
💻 ASP
字号:
<!--#include file="Inc/Check.asp"-->
<!--#include file="Inc/oConn.asp"-->
<!--#include file="Inc/Public.asp"-->
<!--#include file="Inc/Info.asp"-->
<%
On Error Resume Next 
Call CheckAdmin(",1,",","&Session("JB")&",")
Dim lg
lg = RQuery("action")
If lg&""<>"" Then
	lg = UCase(lg)
	If lg = "DC" Then
		Call DC()
	End If 
Else
	Call mainFace()
End If 
If Err Then
	Call ShowErrs()
End If 

Sub mainFace()
	Call PHead("生成各班级在校生人数统计")
	Print "<div align='center'>"
	Print "<div style='text-align:left;' class='lface'>"
	Print "<div class='thetitle'>各班级在校生人数统计</div>"
	Print "<hr size='1' color='#b8b8b8'/>"
	Print BJList()&" "
	Print "<input id='btn' type='button' value='生成人数统计' onclick=""toDC()"">"
	Print "<hr size='1' color='#b8b8b8'/>"
	Print "<ol>提示:"
	Print "<li>你可以选择年级来查询。"
	Print "<li>打印报表时自动按每页40条记录分页;"
	Print "<li>此操作可能需要时间较长,请耐心等待...</ol>"
	Print "<div align='left' class='footcopy'>&copy;2007 XMSky</div>"
	Print "</div>"
	Print "</div>"
	%>
	<script language="JavaScript">
	<!--
	function toDC()
	{
		var s = document.all.bj.options[document.all.bj.selectedIndex].value;
		if (s!="")
		{
			w();
			location.href="?Action=dc&bj="+s+"";
			document.all.btn.value="正在生成,暂时不要进行其他的操作...";
			document.all.btn.disabled=true;
			document.all.bj.disabled=true;
		} 
		else
		{
			location.href="?Action=dc";
			document.all.btn.value="正在生成,暂时不要进行其他的操作...";
			document.all.btn.disabled=true;
			document.all.bj.disabled=true;
		}
	}
	//-->
	</script>
	<%
	Call PFoot()
End Sub 

Sub DC()
	Dim strSQL,objRs,sB,sF,i,cC,cN,cV
	sB = RQuery("bj")
	cC = 0
	cN = 0
	cV = 0
	strSQL = "SELECT 班级,性别,Count(*) As 人数 FROM sTable Where 在册 Not Like '%1%'"
	If sB&""<>"" Then strSQL = strSQL & " And 年级='"&sB&"'"
	strSQL = strSQL & " group by 班级,性别"

	Set objRs = oConn.Execute(strSQL)
	Set sF = objRs.Fields

	Call PHead("人数统计")
	If Not objRs.Eof Then
		Print "<table align='center' width='80%' cellspacing='1' cellpadding='4' class='table1'>"
		Print "<thead style='display:table-header-group;'>"
		Print "<tr><td class='thetitle' style='text-align:center;background:#fff' colspan='"&sF.Count+1&"'>"
		Print ""&CopyRight&" 各班级人数统计"
		Print "</td></tr>"
		Print "<tr class='thead'>"
		For i = 0 To sF.Count-1
			Print "<td>"&sF(i).Name&"</td>"
		Next 
		Print "</tr>"
		Print "</thead>"
		Print "<tbody>"
		Do While Not objRs.Eof
			If cC Mod 40 = 0 And cC>0 Then 
				Print "<tr style='page-break-before:always' class='tbody' onmouseout=""this.style.background='#ffffff'"" onmouseover=""this.style.background='#f5f5f5'"">"
			Else 
				Print "<tr class='tbody' onmouseout=""this.style.background='#ffffff'"" onmouseover=""this.style.background='#f5f5f5'"">"
			End If 
			For i = 0 To sF.Count-1
				If i = 0 Then 
					If cC Mod 2 = 0 Then
						Print "<td rowspan='2' class='thead'>"&sF(i).Value&"</td>"
					End If 
				Else 
					Print "<td>"&sF(i).Value&"</td>"
				End If 
			Next 
			Print "</tr>"
			cC = cC + 1
			If Trim(objRs("性别"))="女" Then 
				cV = cV + objRs("人数")
			Else
				cN = cN + objRs("人数")
			End If 
			objRs.MoveNext
			If objRs.Eof Then Exit Do
		Loop 
		Print "</tbody>"
		Print "<tfoot style='display:table-footer-group;'>"
		Print "<tr><td class='tbody' colspan='"&sF.Count+1&"'>"
		If sB&""<>"" Then
			Print sB & "级"
		Else
			Print "全校"
		End If 
		Print " 共有 "&cN+cV&" 人,其中男生 "&cN&" 人,女生 "&cV&" 人。</td></tr>"
		Print "</tfoot>"
		Print "</table>"
		Print "<div align='center' class='np'>"
		Print "<hr size='1' color='#b8b8b8'/>"
		Print "<input type='button' value='返回继续查询' onclick=""location.href='?'"">"
		Print "<input type='button' value='打印人数明细' onclick=""window.print()"">"
		Print "</div>"
	End If 
	Set sF = Nothing
	Set objRs = Nothing
	Call SaveLog(Session("XM"),"导出数据","生成"&sB&"级人数统计")
	Call HWaiting()
	Call PFoot()
End Sub

Function BJList()
	Dim tmpHtml,objRs,strSQL
	tmpHtml = "<select name='bj'>"
	tmpHtml = tmpHtml & "<option value=''>选择年级</option>"
	strSQL = "Select sTable.年级 From sTable Group by sTable.年级 Order by sTable.年级 ASC"
	Set objRs = oConn.Execute(strSQL)
	If Not objRs.Eof Then
		Do While Not objRs.Eof
			tmpHtml = tmpHtml & "<option value='"&objRs(0)&"'>"&objRs(0)&"</option>"
			objRs.MoveNext
			If objRs.Eof Then Exit Do
		Loop
	End If
	Set objRs = Nothing
	tmpHtml = tmpHtml & "</select>"

	BJList = tmpHtml
End Function 
%>

⌨️ 快捷键说明

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