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

📄 printc.asp

📁 公共选修课报名及成绩查询管理系统。ASP.NET+ACCESS的组合
💻 ASP
字号:
<!--#include file="config.asp"-->
<!--#include file="Session.asp"-->
<%
'初始化Session变量,方便操作
If Request("pl")<>"" Then Session("Pl_Name")=Request("pl")
If Request("menu")="del" Then
	dim F:F=0
	for each X_H in (Request("X_S_XH"))
		Conn.Execute("delete * From [T_Stu] Where xhao='"&X_H&"' ")
		Conn.Execute("delete * From [T_GBooK] Where G_Xhao='"&X_H&"' ")
		Conn.Execute("delete * From [T_Class] Where C_Xhao='"&X_H&"' ")
		F=F+1
	next
	Response.write"<script language='javascript'>alert(""删除成功!\n\n返回刷新即可!"");location.href=""StuD.asp"";</script>"
End If
%>
<%
   dim MaxPerPage
   dim sql 
   dim rs
   dim gstBookID
   dim totalPut   
   dim CurrentPage
   dim TotalPages
   dim i,j
   if request("se")="" then
      se=request.form("se")
   else
      se=request("se")
   end if
   if not isEmpty(request("pl")) then
	pl=request("pl")
   else
	pl="xhao"
   end if
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
%>
<html><head>
<title><%response.write  webname%>-----栏目:学生资料中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="images/vpei.css">
</head>
<body topmargin=10 leftmargin=5>
<% Call top() %>
<br>
<table width="100%" align="center" cellspacing="1" cellpadding="1" border="0" bgcolor="#000000">
<form name="searchtitle" method="POST" action="Print.asp" target=_blank>
<tr><td bgcolor="#FFFFFF" background="images/cent.gif" height="25">&nbsp;打印设置
</td></tr>
<tr>
<td bgcolor="#FFFFFF" height="25">&nbsp;&nbsp;
专业:<select name="xy">
<option value="">请选择专业</option>
<%
Set Rs_Yz=Conn.Execute("select * from T_Yz where Yz_FollowId=0 order by Yz_SortNum")
do until Rs_Yz.eof
'	Response.Write "<option value="&Rs_Yz("Yz_Id")&" "
'	If Rs_Yz("Yz_Id")=Session("xy") Then Response.Write " selected"
'	Response.Write ">"&Rs_Yz("Yz_Name")&"</option>"
	Set Rs_YzF=Conn.Execute("Select * from T_Yz where Yz_FollowId="&Rs_Yz("Yz_Id")&" order by Yz_SortNum")
	do until Rs_YzF.eof
		Response.Write "<option value="&Rs_YzF("Yz_Id")&" "
		'If Rs_YzF("Yz_Id")=Session("xy") Then Response.Write " selected"
		Response.Write ">"&Rs_YzF("Yz_Name")&"</option>"
		'Response.Write ">|-"&Rs_YzF("Yz_Name")&"</option>"
	Rs_YzF.movenext
	loop
	Rs_YzF.close
	set Rs_YzF=nothing
Rs_Yz.movenext
loop
Rs_Yz.close
Set Rs_Yz=nothing
%></select>

班级:
<select name="Ke_Id" size="1">
<option value="">请选择科目</option>
<%
Set Rs_XClass=Conn.Execute("Select * from T_Ke order by C_Id")
do until Rs_XClass.eof
	Response.Write "<option value="&Rs_XClass("C_Id")&" "
'	If Rs_XClass("C_Id")=Session("X_C_Id") Then Response.Write " selected"
	Response.Write ">"&Rs_XClass("C_Name")&"("&Rs_XClass("C_Class")&")</option>"
Rs_XClass.movenext
loop
Rs_XClass.close
set Rs_XClass=nothing
%>    
</select>    

上课时间:
<select name="X_Year">
<%dim X_Year,i_Y:i_Y=0
Do until i_Y=int(XX_A_ZGXZ)
	X_Year=DatePart("yyyy",now())-i_Y
	Response.Write "<option value="&DatePart("yyyy",now())-i_Y
'	If X_Year=Session("X_Year") Then Response.Write " selected"
	Response.Write ">"&DatePart("yyyy",now())-i_Y&"</option>"
	i_Y=i_Y+1
loop
%>
</select>

学期:
<select name="XQ" size="1">   
<option value="上"<%'If Session("Pl_Name")="上" Then Response.Write " Selected"%>>第一学期</option> 
<option value="下"<%'If Session("Pl_Name")="下" Then Response.Write " Selected"%>>第二学期</option>  
</select>&nbsp;&nbsp;
<input type="submit" value=" 提交 " name="title" style="font-family: 宋体; font-size: 9pt; background-color: #FFFFFF; border-style: solid; border-width: 1">
</td></tr></form></table>
<br>
<table width="100%" align="center" cellspacing="1" cellpadding="1" border="0" bgcolor="#000000">
<tr>
<td bgcolor="#FFFFFF" background="images/cent.gif" height="25">
<form name="searchtitle" method="POST" action="PrintC.asp">
 <font color="#000000">关键词语:<input type="text" name="se" size="40" style="font-family: 宋体; font-size: 9pt; color: #0000FF; border: 1 solid #000000">
 搜索范围:
<select name="pl" size="1">   
<option value="xhao"<%If Session("Pl_Name")="xhao" Then Response.Write " Selected"%>>学----号</option> 
<option value="name"<%If Session("Pl_Name")="name" Then Response.Write " Selected"%>>姓----名</option> 
<option value="S_Rschool"<%If Session("Pl_Name")="S_Rschool" Then Response.Write " Selected"%>>入学时间</option>
<option value="S_Email"<%If Session("Pl_Name")="S_Email" Then Response.Write " Selected"%>>电子邮件</option>    
</select>                     
<input type="submit" value=" 搜索 " name="title" style="font-family: 宋体; font-size: 9pt; background-color: #FFFFFF; border-style: solid; border-width: 1">
</td></tr></form></table>
<br>
<table width="100%" align="center" cellspacing="1" cellpadding="1" border="0" bgcolor="#000000">
<form name="searchtitle" method="POST" action="PrintC.asp">
<tr><td bgcolor="#FFFFFF" background="images/cent.gif" height="25">&nbsp;打印设置
</td></tr>
<tr>
<td bgcolor="#FFFFFF" height="25">&nbsp;&nbsp;
专业:<select name="xy">
<option value="">请选择专业</option>
<%
Set Rs_Yz=Conn.Execute("select * from T_Yz where Yz_FollowId=0 order by Yz_SortNum")
do until Rs_Yz.eof
'	Response.Write "<option value="&Rs_Yz("Yz_Id")&" "
'	If Rs_Yz("Yz_Id")=Session("xy") Then Response.Write " selected"
'	Response.Write ">"&Rs_Yz("Yz_Name")&"</option>"
	Set Rs_YzF=Conn.Execute("Select * from T_Yz where Yz_FollowId="&Rs_Yz("Yz_Id")&" order by Yz_SortNum")
	do until Rs_YzF.eof
		Response.Write "<option value="&Rs_YzF("Yz_Id")&" "
		'If Rs_YzF("Yz_Id")=Session("xy") Then Response.Write " selected"
		Response.Write ">"&Rs_YzF("Yz_Name")&"</option>"
		'Response.Write ">|-"&Rs_YzF("Yz_Name")&"</option>"
	Rs_YzF.movenext
	loop
	Rs_YzF.close
	set Rs_YzF=nothing
Rs_Yz.movenext
loop
Rs_Yz.close
Set Rs_Yz=nothing
%></select>

上课时间:
<select name="X_Year">
<%
i_Y=0
Do until i_Y=int(XX_A_ZGXZ)
	X_Year=DatePart("yyyy",now())-i_Y
	Response.Write "<option value="&DatePart("yyyy",now())-i_Y
'	If X_Year=Session("X_Year") Then Response.Write " selected"
	Response.Write ">"&DatePart("yyyy",now())-i_Y&"</option>"
	i_Y=i_Y+1
loop
%>
</select>

班级:
<select name="Ke_Id" size="1">
<option value="">请选择科目</option>
<%
Set Rs_XClass=Conn.Execute("Select * from T_Ke order by C_Id")
do until Rs_XClass.eof
	Response.Write "<option value="&Rs_XClass("C_Id")&" "
'	If Rs_XClass("C_Id")=Session("X_C_Id") Then Response.Write " selected"
	Response.Write ">"&Rs_XClass("C_Name")&"("&Rs_XClass("C_Class")&")</option>"
Rs_XClass.movenext
loop
Rs_XClass.close
set Rs_XClass=nothing
%>    
</select>
学期:
<select name="XQ" size="1">   
<option value="上"<%'If Session("Pl_Name")="上" Then Response.Write " Selected"%>>第一学期</option> 
<option value="下"<%'If Session("Pl_Name")="下" Then Response.Write " Selected"%>>第二学期</option>  
</select>&nbsp;&nbsp;
</td></tr>
<tr>
<td bgcolor="#FFFFFF" height="25">
<form name="searchtitle" method="POST" action="PrintC.asp">
 <font color="#000000">已选课数:<input type="text" name="se" size="40" style="font-family: 宋体; font-size: 9pt; color: #0000FF; border: 1 solid #000000">
 搜索范围:
<select name="pl" size="1">   
<option value="xhao"<%If Session("Pl_Name")="xhao" Then Response.Write " Selected"%>>学----号</option> 
<option value="name"<%If Session("Pl_Name")="name" Then Response.Write " Selected"%>>姓----名</option> 
<option value="S_Rschool"<%If Session("Pl_Name")="S_Rschool" Then Response.Write " Selected"%>>入学时间</option>
<option value="S_Email"<%If Session("Pl_Name")="S_Email" Then Response.Write " Selected"%>>电子邮件</option>    
</select>                     
<input type="submit" value=" 搜索 " name="title" style="font-family: 宋体; font-size: 9pt; background-color: #FFFFFF; border-style: solid; border-width: 1">
</td></tr></form></table>
<br>
<%
set rs=server.createobject("adodb.recordset")  
If Request("se")="" Then    
	sql="select * from T_Stu order by xy,xhao"
ElseIf Request("pl")="xy" Then
	sql="select * from T_Stu where "&pl&" = "&int(se)&" order by xhao"
Else
	sql="select * from T_Stu where "&pl&" like '%"&se&"%' order by xhao"  
End If  
rs.open sql,conn,1,3  
if rs.eof and rs.bof then %>  
<p align="center">没有或没找到任何记录!</p>
<%
else
   rs.pagesize=60  '每页显示条数
   totalPut=rs.recordcount '记录总数
   totalPage=rs.pagecount
   MaxPerPage=rs.pagesize
      if currentpage<1 then
          currentpage=1
      end if
      if currentpage>totalPage then
          currentpage=totalPage
      end if
   if currentPage=1 then
         showpages
         showContent
         showpages
    else
         if (currentPage-1)*MaxPerPage<totalPut then
         rs.move  (currentPage-1)*MaxPerPage
         dim bookmark
         bookmark=rs.bookmark '移动到开始显示的记录位置
         showpages
         showContent
         showpages
		end if
   end if
end if

sub showContent
    dim i
    dim k
    k=(totalPut-MaxPerPage*(currentPage-1))+1
    i=0
%>

<table width="100%" cellspacing="1" cellpadding="3" bgcolor="#000000" align="center">
<form method="POST" action="StuD.asp?menu=del">
<tr bgcolor=#FFFFFF>
<td width=4% background=images/cent.gif height=25><center><font color="#000000">删除</font></td>
<td width=12% background=images/cent.gif><center><font color="#000000">所在系院</font></td>
<td width=8% background=images/cent.gif><center><font color="#000000">学&nbsp;&nbsp;&nbsp;&nbsp;号</font></td>
<td width=8% background=images/cent.gif><center><font color="#000000">姓&nbsp;&nbsp;&nbsp;&nbsp;名</font></td>
<td width=3% background=images/cent.gif><center><font color="#000000">小班</font></td>
<td width=58% background=images/cent.gif><font color="#000000">其他信息资料</td>
<td width=4% background=images/cent.gif><center><font color="#000000">修</font></td>
</tr>
<%do while not (rs.eof or err)
k=k-1
%>
<TR bgcolor=#FFFFFF>
<td align=center><font color=red><input type=checkbox value="<%=Rs("xhao")%>" name="X_S_XH" style="font-family: 宋体; font-size: 9pt; background-color: #FFFFFF; border-style: solid; border-width: 0"></font></a></td>
<td align=center><a href=Stud.asp?pl=xy&se=<%=Rs("xy")%>><%=Conn.Execute("Select * From T_Yz Where Yz_Id="&int(Rs("xy"))&" ")("Yz_Name")%></a></td>
<td align=center><%=Rs("xhao")%></td>
<td align=center><a href=./StuD_E.asp?X_Id=<%=Rs("id")%>><%=Rs("Name")%></a></td>
<td align=center><%=Rs("S_XClass")%></td>
<td>&nbsp;入学时间:<%=Rs("S_Rschool")%><%If Rs("S_Tel")<>"" Then Response.Write "&nbsp;&nbsp;电话:"&Rs("S_Tel")%><%If Rs("S_Tel")<>"" Then Response.Write "&nbsp;&nbsp;邮件:"&Rs("S_Email")%></td>
<td align=center><a href="StuD_E.asp?X_Id=<%=Rs("id")%>" title="资料修改"><font color=red>改</font></a></td>
</tr>

<TR bgcolor=#FFFFFF><TD align=left colspan=7>
<%
Response.Write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;最少选修<font color=red>"&int(A_XCount)&"</font>门课程;&nbsp;目前已选修<font color=red>"&Conn.Execute("Select count(C_Id) from [T_Class] Where C_Xhao='"&Rs("xhao")&"' and C_Pass<>0")(0)&"</font>门课程;&nbsp;通过<font color=red>"&Conn.Execute("Select count(C_Id) from [T_Class] Where C_Xhao='"&Rs("xhao")&"' and C_Pass>=60")(0)&"</font>门课程;&nbsp;"

Set Rs_XClass=Conn.Execute("Select * from [T_Class] Where C_Xhao='"&Rs("xhao")&"' and C_Pass=-1")
If not Rs_XClass.EOF Then Response.Write "<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;所选课程如下:"
do until Rs_XClass.eof
	Response.Write "&nbsp;&nbsp;"&Rs_XClass("C_KeName")&"</a>"
Rs_XClass.movenext
loop
Rs_XClass.close
set Rs_XClass=nothing

Set Rs_XClass_Pass=Conn.Execute("Select * from [T_Class] Where C_Xhao='"&Rs("xhao")&"' and C_Pass>=60")
If not Rs_XClass_Pass.EOF Then Response.Write "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;已通过课程如下:"
do until Rs_XClass_Pass.eof
	Response.Write "&nbsp;&nbsp;"&Rs_XClass_Pass("C_KeName")&"</a>"
Rs_XClass_Pass.movenext
loop
Rs_XClass_Pass.close
set Rs_XClass_Pass=nothing
%>
</TD></TR>

<TR bgcolor=#FFFFFF><td align=center colspan=7 height=20></td></tr>
<%
	i=i+1
	if i>=MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出
	rs.movenext
	loop
%>
<tr bgcolor=#FFFFFF><td colspan=8 align=center background=images/cent.gif height=25><input type="submit" value="确定删除"></td></tr></Form>
<%
end sub 
sub showpages()
dim n
n=totalPage
%>
</table>
<%  
end sub  
%>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr><td height=20></td></tr>
<tr><td width="100%" height="30" align=right>
<%   
If currentPage <> 1 Then  
   Response.Write "<A HREF="&filename&"?pl="&pl&"&se="&se&">[第一页]</A> "  
   Response.Write "<A HREF="&filename&"?pl="&pl&"&se="&se&"&Page=" & (currentPage-1) & ">[上一页]</A> "  
End If  
If currentPage <> rs.PageCount Then  
   Response.Write "<A HREF="&filename&"?pl="&pl&"&se="&se&"&Page=" & (currentPage+1) & ">[下一页]</A> "  
   Response.Write "<A HREF="&filename&"?pl="&pl&"&se="&se&"&Page=" & totalPage & ">[最后一页]</A> "  
End If  
%>
<%if se<>"" then%>查找<b><font color="#FF0000"><%=se%></font></b><%end if%> 共找到<font color="#FF0000"><%=totalPut%></font>条记录,第<%=currentPage%>页,共<%=totalPage%>页     
</td></tr></table>
<% Call bottom() %>
</body></html>

⌨️ 快捷键说明

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