📄 inf_modify_student_login_all.asp
字号:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%
var StudentInTime;
var StudentPro;
var StudentClass;
var StudentNum;
var StuRs;
var i;
var j;
var start;
var end;
var flag;
StudentInTime=Request("StuInTime");
StudentPro=Request("StuPro");
StudentClass=Request("StuClass");
Session("flag")=20;
Session("StuRs")=Server.CreateObject("ADODB.Recordset");
Session("StuRs").ActiveConnection=Conn;
var sql = createSql(StudentInTime,StudentPro,StudentClass);
Session("StuRs").Source="SELECT s.studentNo,s.name,s.sex,p.name FROM student s,profession p "+sql;
Session("StuRs").CursorLocation=3;
Session("StuRs").Open();
/*此方法用于构造where的查询条件*/
function createSql(StuInTime,StuPro,StuClass){
var sqlString = "where ";
if(StuInTime!=""){
sqlString+="s.ruxuenianfen='"+StudentInTime+"'";
}
if(StuPro!=""){
if(sqlString=="where "){
sqlString+=" p.name='"+StudentPro+"'";
}else{
sqlString+=" AND p.name='"+StudentPro+"'";
}
}
if(StuClass!=""){
if(sqlString=="where "){
sqlString+=" s.classId='"+StudentClass+"'";
}else{
sqlString+=" AND s.classId='"+StudentClass+"'";
}
}
if(sqlString=="where "){
sqlString=="";
}
return sqlString;
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>学生信息修改查找显示</title>
<!--#include file="link.asp"-->
<style type="text/css">
body{
text-align:center;
}
</style>
</head>
<body>
<!--#include file="top.asp"-->
<%
if(!Session("StuRs").EOF)
{
Response.Write("<table border='1' width='760' cellPadding=0 cellSpacing=0 bgcolor='#00ffff' borderColor='#111111' borderColorDark=#0072b3 borderColorLight=#0072b3 style='BORDER-COLLAPSE: collapse'>");
Response.Write("<tr>");
Response.Write("<td width='50' height='20'><div align=center><font size='2' color='#ff0000'>序号</font></div></td>");
Response.Write("<td width='50' height='20'><div align=center><font size='2' color='#ff0000'> 学号</font></div></td>");
Response.Write("<td width='50' height='20'><div align=center><font size='2' color='#ff0000'>姓名</font></div></td>");
Response.Write("<td width='50' height='20'><div align=center><font size='2' color='#ff0000'>学院</font></div></td>");
Response.Write("<td width='50' height='20'><div align=center><font size='2' color='#ff0000'>专业</font></div></td>");
Response.Write("<td width='110' height='20'>"+"<div align=center><font size='2' color='#ff0000'>操作</font></div>"+"</td>");
Response.Write("</tr>");
Session("InfStart")=Session("StuRs").AbsolutePosition;
for(j=0;j<=Session("InfFlag")-1;j++)
{
Response.Write("<tr bgcolor='#ffffff'>");
Response.Write("<td width='50' height='20'><div align=center><font size='2'>"+Session("StuRs").AbsolutePosition+"</font></div></td>");
Session("InfEnd")=Session("StuRs").AbsolutePosition;
for(i=0;i<=Session("StuRs").Fields.Count-1;i++)
{
Response.Write("<td width='150' height='20'><div align=center><font size='2'>"+Session("StuRs")(i).Value+"</font></div></td>");
}
Response.Write("<td width='110' height='20'><div align=center><a target='_blank' href='inf_modify_student.asp?studentmessage="+Session("StuRs")(0).Value+"'><font size='2'>修改</font></a><font size='2'>||</font><a target='_blank' href='inf_delete_student.asp?studentmessage="+Session("StuRs")(0).Value+"'><font size='2'>删除</font></a></div></td>");
Response.Write("</tr>");
Session("StuRs").MoveNext;
if(Session("StuRs").EOF)
{
Session("StuRs").MovePrevious;
break;
}
}
Response.Write("<tr>");
Response.Write("<td width='760' colspan='6' height='20'>");
Response.Write("</td>");
Response.Write("</tr>");
Response.Write("</table>");
Session("StuRs").MoveFirst;
%>
<!--#include file="inf_modify_student_login_turnpage.asp"-->
<%
}
else
{
Response.Write("<div align=center><font size=6 color='#ff0000'>对不起!数据库中没找到您所需要的数据!</font></div>");
Session("StuRs").Close();
Conn.Close();
Session("StuRs")=null;
Conn=null;
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -