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

📄 infoprint2.asp

📁 很好的学籍管理系统代码
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/StudentConn.asp" -->
<%
Dim Recordset1__MMColParam, strStudentNum, strName, strGrade, strClass,strTitle
Dim Repeat1__numRows

intPageSize=Request("PageSize")
if intPageSize="" then intPageSize=30

set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_StudentConn_STRING

strStudentNum= Request("StudentNum")
strName=Request("Name")
strGrade=Request("Grade")
strClass=Request("ClassSelect")
if strStudentNum <> "" then
  Recordset1__MMColParam =strStudentNum
  Recordset1.Source = "SELECT *  FROM StudentInfo  WHERE StudentNum like '%" & Recordset1__MMColParam & "%'  ORDER BY StudentNum"
end if
if strName<>"" then
  Recordset1__MMColParam =strName
  Recordset1.Source = "SELECT *  FROM StudentInfo  WHERE Name like '%" & Recordset1__MMColParam & "%'  ORDER BY StudentNum"
end if
if strGrade<>"" and strClass<>"" then
  If len(Year(Now()))<=2 Then
    NewYear="20" & Year(Now())
  Else
    NewYear=Year(Now())
  End If
  If len(Month(Now()))<=1 Then
    NewMonth="0" & Month(Now())
  Else
    NewMonth=Month(Now())
  End If
  if NewMonth<9 then
    strStudentNum=NewYear-strGrade-1
  else
    strStudentNum=NewYear-strGrade
  end if
  if strClass="All" then strClass=""
  if Len(strClass)=1 then
    strClass="0" & strClass
  end if
  Recordset1__MMColParam =strStudentNum & strClass
  Recordset1.Source = "SELECT *  FROM StudentInfo  WHERE StudentNum like '" & Recordset1__MMColParam & "%'  ORDER BY StudentNum"
end if

Recordset1.CursorType = 1
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>学生信息打印预览</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2600.0" Name=GENERATOR>
<style type="text/css">
<!--
TABLE {
	font-size: 12px;
	line-height: 15px;
	text-decoration: none;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</HEAD>
<BODY text=#000000 bgColor=#ffffff leftMargin=5 topMargin=5>
<table border="0" cellpadding="0" cellspacing="0"><tr><td align="center">
<%
if Request("StudentNum")<>"" then
	strTitle = "学号中含有“" & strStudentNum & "”"
elseif strName<>"" then
	strTitle = "姓名中含有“" & strName & "”"
else
	if strClass<>"" then strClass=strClass & "班" 
	strTitle = "高" & strGrade+1 & "级" & strClass
end if
strTitle = strTitle & "的学生名单"
If Recordset1.EOF And Recordset1.BOF Then 
	response.write "<br><BR><BR><BR><font color='#FF3399'>抱歉!找不到您所寻找的学生记录!</font><BR><BR><BR>"
Else
	Recordset1.MoveFirst
	While Not Recordset1.EOF
		response.write "<p align='center'><br><font size='6'><b>" & strTitle & "</b></font></p>"
		Repeat1__numRows = intPageSize
%>
    	<table border=1 cellpadding="1" cellspacing=0 bordercolor="#999999">
          <tr valign="middle"> 
            <% If request("chkStudentNum")="True" Then %><td width="60" height="30" align="center" nowrap><strong><font color="#000000"> 
              学 号</font></strong></td><% End If %>
            <% If request("chkName")="True" Then %>
          <td width="50" height="30" align="center" nowrap><strong><font color="#000000"> 
            姓 名</font></strong></td>
          <% End If %>
            <% If request("chkSex")="True" Then %><td width="30" height="30" align="center" nowrap><strong><font color="#000000"> 
              性别</font></strong></td><% End If %>
            <% If request("chkFolk")="True" Then %><td width="50" height="30" align="center" nowrap><strong><font color="#000000"> 
              民族</font></strong></td><% End If %>
            <% If request("chkPlace")="True" Then %><td width="50" height="30" align="center" nowrap><strong><font color="#000000"> 
              籍贯</font></strong></td><% End If %>
            <% If request("chkPolitics")="True" Then %><td width="60" height="30" align="center" nowrap><strong><font color="#000000"> 
              政治面貌</font></strong></td><% End If %>
            <% If request("chkBirth")="True" Then %><td width="60" height="30" align="center" nowrap><strong><font color="#000000"> 
              出生日期</font></strong></td><% End If %>
            <% If request("chkEnrollment")="True" Then %><td width="60" height="30" align="center" nowrap><strong><font color="#000000"> 
              入学时间</font></strong></td><% End If %>
            <% If request("chkHousemaster")="True" Then %><td width="60" height="30" align="center" nowrap><strong><font color="#000000"> 
              家长姓名</font></strong></td><% End If %>
            <% If request("chkTelnum")="True" Then %><td width="80" height="30" align="center" nowrap><strong><font color="#000000"> 
              联系电话</font></strong></td><% End If %>
            <% If request("chkHouseAddress")="True" Then %><td width="150" height="30" align="center" nowrap><strong><font color="#000000"> 
              家庭住址</font></strong></td><% End If %>
            <% If request("chkRemark")="True" Then %><td width="40" height="30" align="center" nowrap><strong><font color="#000000"> 
              备注</font></strong></td><% End If %>
          </tr>
          <% 
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) 
%>
          <%
  txtStudentNum=Recordset1.Fields.Item("StudentNum").Value & ""
  txtName=replace(Recordset1.Fields.Item("Name").Value & ""," ","&nbsp;")
  if txtName="" then txtName="&nbsp;"
  txtSex=replace(Recordset1.Fields.Item("Sex").Value & ""," ","&nbsp;")
  if txtSex="" then txtSex="&nbsp;"
  txtFolk=replace(Recordset1.Fields.Item("Folk").Value & ""," ","&nbsp;")
  if txtFolk="" then txtFolk="&nbsp;"
  txtplace=replace(Recordset1.Fields.Item("place").Value & ""," ","&nbsp;")
  if txtplace="" then txtplace="&nbsp;"
  txtPolitics=replace(Recordset1.Fields.Item("politics").Value & ""," ","&nbsp;")
  if txtPolitics="" then txtPolitics="&nbsp;"
  txtBirth=replace(Recordset1.Fields.Item("Birthday").Value & ""," ","&nbsp;")
  if txtBirth="" then txtBirth="&nbsp;"
  txtEnrollment=replace(Recordset1.Fields.Item("enrollment").Value & ""," ","&nbsp;")
  if txtEnrollment="" then txtEnrollment="&nbsp;"
  txtHousemaster=replace(Recordset1.Fields.Item("housemaster").Value & ""," ","&nbsp;")
  if txtHousemaster="" then txtHousemaster="&nbsp;"
  txtTelnum=replace(Recordset1.Fields.Item("TelNum").Value & ""," ","&nbsp;")
  if txtTelnum="" then txtTelnum="&nbsp;"
  txtHouseAddress=replace(Recordset1.Fields.Item("HouseAddress").Value & ""," ","&nbsp;")
  if txtHouseAddress="" then txtHouseAddress="&nbsp;"
%>
          <tr valign="middle"> 
            <% If request("chkStudentNum")="True" Then %><td width="60" height="28" align="center" nowrap><%=txtStudentNum%></td><% End If %>
            <% If request("chkName")="True" Then %><td width="50" height="28" align="center" nowrap><%=txtName%></td><% End If %>
            <% If request("chkSex")="True" Then %><td width="30" height="28" align="center" nowrap><%=txtSex%></td><% End If %>
            <% If request("chkFolk")="True" Then %><td width="50" height="28" align="center" nowrap><%=txtFolk%></td><% End If %>
            <% If request("chkPlace")="True" Then %><td width="50" height="28" align="center"><%=txtplace%></td><% End If %>
            <% If request("chkPolitics")="True" Then %><td width="60" height="28" align="center" nowrap><%=txtPolitics%></td><% End If %>
            <% If request("chkBirth")="True" Then %><td width="60" height="28" align="left" nowrap><%=txtBirth%></td><% End If %>
            <% If request("chkEnrollment")="True" Then %><td width="60" height="28" align="center" nowrap><%=txtEnrollment%></td><% End If %>
            <% If request("chkHousemaster")="True" Then %><td width="60" height="28" align="center" nowrap><%=txtHousemaster%></td><% End If %>
            <% If request("chkTelnum")="True" Then %><td width="80" height="28" align="center" nowrap><%=txtTelnum%></td><% End If %>
            <% If request("chkHouseAddress")="True" Then %><td width="150" height="28" align="left"><%=txtHouseAddress%></td><% End If %>
            <% If request("chkRemark")="True" Then %><td width="40" height="28" align="left"><%=txtRemark%></td><% End If %>
          </tr>
          <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  Recordset1.MoveNext()
Wend
%>
</table>
<%
	Wend
End If
%>
      </td></tr></table>
</BODY>
</HTML>
<%
Recordset1.Close()
%>

⌨️ 快捷键说明

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