📄 manage_stu.asp
字号:
<%option explicit%>
<!--#include file="Conn.asp"-->
<!--#include file="include/md5.asp"-->
<!--#include file="include/ReplaceHtml.asp"-->
<!--#include file="include/PublicFunction.asp"-->
<!--#include file="include/TeacherSession.asp"-->
<%' call CheckOuterUrl()
'强制浏览器重新访问服务器下载页面
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
'***************************
Dim Action
Action=request.QueryString("Action")
Select Case Action
Case "addTeacher"
Call addTeacher()
Case "showlist"
Call TeacherList(0)'0代表是显示默认的教师列表,1代表是显示搜索结果的教师列表
Case "Dlel_teacher"
Call Dlel_teacher()
Case "EditTeacher"
Call Edit_Teacher()
Case "InputTeacher"
Call ShowSearchForm()
Case "ShowSearchResult"
Call TeacherList(1) '1代表是显示搜索结果的教师列表
Case Else
Call Main(0)
End Select
Sub Main(Add_Or_Edit)
Dim Form_State 'Add_Or_Edit
'说明,0代表添加数据,1代表编辑现有数据
If Add_Or_Edit=0 then Form_State=0
If Add_Or_Edit=1 then
Form_State=1
Dim Edit_Teacher_sql,Edit_Teacher_rs
'Call OpenConn()
Edit_Teacher_sql="select [student_id],[student_no],[student_name],[stu_sex],[department_id],[teacher_id],[class_id] from [student] where student_id='"&request("teacher_id")&"'"
Set Edit_Teacher_rs=server.CreateObject("adodb.recordset")
Edit_Teacher_rs.open Edit_Teacher_sql,Initialize_Conn,1,3
End if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>思燕Seayan成绩查询系统SQL版本v1.0----现代教学管理信息系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="gb2312">
<meta content="all" name="robots">
<meta content="websvc@163.com" name="author">
<meta content="版权所有:Seagreen 2005-2008" name="Copyright">
<meta content="思燕Seayan成绩查询系统SQL版本v1.0, 由 赵海 先生模仿方正教务管理系统开发。" name="description">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" rev="stylesheet" href="images/main.css" type="text/css" media="all">
<SCRIPT language="javascript" src="images/Menu.js"></SCRIPT>
<link href="images/my_style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.STYLE1 {
border-bottom: #8ab105 1px solid;
border-left: #8ab105 1px solid;
border-right: #8ab105 1px solid;
border-top: #8ab105 1px solid;}
-->
</style>
<script language="javascript">
function CheckMyForm()
{
if(theForm.teacher_name.value == '') {
alert('请输入学生的姓名!');
theForm.teacher_name.focus();
return false;
}
if (theForm.student_no.value == '')
{
alert("请输入学生的学号!");
theForm.student_no.focus();
return false;
}
if (theForm.class_id.value == '')
{
alert("数据不完整,无法提交数据!");
return false;
}
}
//-->
</script>
</head>
<body background="axhucj/images/admin_MainBg.gif">
<iframe src="images/head.htm" frameborder="0" scrolling="no" width="100%" height="59"></iframe>
<div id="menu" STYLE='width:100%'><!--#include file="menu.asp"--></div>
<div id="welcome">
<span id="xhxm"><font color="red"> </font></span>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="16%" height="44"> </td>
<td width="34%"> </td>
<td width="28%"> </td>
<td width="22%"> </td>
</tr>
<tr>
<td height="28"> </td>
<td align="center" colspan="2"><%call showTeacherMenu()%></td>
<td> </td>
</tr>
<tr>
<td height="62"> </td>
<td align="center" colspan="2" rowspan="2">
<form name="theForm" id="demo" onSubmit="return CheckMyForm()" method="post" action="Manage_stu.asp?action=addTeacher">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="35"><div align="right">当前班级是:</div></td>
<td align="left"><div align="left"> <font color="red"><%=request.QueryString("class_name")%></font></div></td>
<td> </td>
</tr>
<tr>
<td width="31%" height="35"><div align="right">学生姓名:</div></td>
<td align="left" width="28%"><input value="<% if Form_State=1 then response.Write(Edit_Teacher_rs("student_name"))%>" type="text" name="teacher_name" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" onkeyup="value=value.replace(/[ -~]/g,'')" onkeydown="if(event.keyCode==13)event.keyCode=9"/></td>
<td width="41%"><div align="left"><font color="red">*</font> 必填项目,只允许使用中文</div></td>
</tr>
<tr>
<td height="32"> <div align="right">学生学号:</div></td>
<td align="left"><input value="<% if Form_State=1 then response.Write(Edit_Teacher_rs("student_no"))%>" type="text" name="student_no" onkeydown="if(event.keyCode==13)event.keyCode=9" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/></td>
<td><div align="left"><font color="red">*</font> 必填项目,只允许使用数字</div></td>
</tr>
<tr>
<td height="26"><div align="right">学生性别:</div></td>
<td align="center">帅哥<input type="radio" name="stu_sex" value="男" checked="checked"s />
美女<input type="radio" name="stu_sex" value="女" /></td>
<td><div align="left"></td>
</tr>
<tr>
<td height="14"> </td>
<td align="left"><input type="hidden" name="department_id" value="<%=request.Cookies("department_id")%>" />
<input type="hidden" name="teacher_id" value="<%=request.Cookies("teacher_id")%>"/>
<input type="hidden" name="class_id" value="<%=request.QueryString("class_id")%>"/>
<input type="hidden" name="class_name" value="<%=request.QueryString("class_name")%>"/></td>
<td> </td>
</tr>
<tr>
<td height="31"><div align="right">
<% if Form_State=1 then
response.Write("<input type=""submit"" name=""Submit"" value=""完成编辑"" /></div></td>")
response.Write("<input type=""hidden"" name=""Edit_model"" value=""1"">")
response.Write("<input type=hidden name=student_id value="""&Edit_teacher_rs(0)&""">")
else
response.Write("<input type=""submit"" name=""Submit"" value=""确定添加""/></div></td>")
end if
%>
<td align="center"><input type="reset" name="Submit2" value="重新填写" /></td>
<td align="center"> </td>
</tr>
</table>
</form>
</td>
<td> </td>
</tr>
<tr>
<td height="129"> </td>
<td> </td>
</tr>
<tr>
<td height="153"> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</body>
</html>
<%end sub
sub TeacherList(Is_SearchMode)
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>思燕Seayan成绩查询系统SQL版本v1.0----现代教学管理信息系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="gb2312">
<meta content="all" name="robots">
<meta content="websvc@163.com" name="author">
<meta content="版权所有:Seagreen 2005-2008" name="Copyright">
<meta content="思燕Seayan成绩查询系统SQL版本v1.0, 由 赵海 先生模仿方正教务管理系统开发。" name="description">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" rev="stylesheet" href="images/main.css" type="text/css" media="all">
<SCRIPT language="javascript" src="images/Menu.js"></SCRIPT>
<link href="images/my_style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.STYLE1 {
border-bottom: #8ab105 1px solid;
border-left: #8ab105 1px solid;
border-right: #8ab105 1px solid;
border-top: #8ab105 1px solid;}
-->
</style>
</head>
<body background="axhucj/images/admin_MainBg.gif">
<iframe src="images/head.htm" frameborder="0" scrolling="no" width="100%" height="59"></iframe>
<div id="menu" STYLE='width:100%'><!--#include file="menu.asp"--></div>
<div id="welcome">
<span id="xhxm"><font color="red"> </font></span>
<%
Response.Write "<br>"
Response.Write "<br>"
Response.Write "<br>"
'作用 显示院系的列表
Call showTeacherMenu() '显示页面顶部的菜单
Dim TeacherList_rs,TeacherList_sql,page,epage,Class_id
Class_id=request("Class_id")'根据传递过来的Class_id来进行搜索
Set TeacherList_rs=server.CreateObject("adodb.recordset")
IF Is_SearchMode=1 then '此时是显示搜索结果的列表***************************
Dim SearchKey:SearchKey=HtmlEncode(request("teacher_name"))
TeacherList_sql="select [student_id],[student_no],[student_name],[stu_sex],[department_id],[teacher_id],[class_id] from [student] where [student_no] like '%"&SearchKey&"%' and Class_id='"&Class_id&"' order by [student_no] asc"
else
TeacherList_sql="select [student_id],[student_no],[student_name],[stu_sex],[department_id],[teacher_id],[class_id] from [student] where class_id='"&class_id&"' order by student_no asc"
End if
TeacherList_rs.open TeacherList_sql,Initialize_Conn,1,1
'*****************分页代码**********************************
TeacherList_rs.pagesize=30
page=HtmlEncode(request("page"))
if page <> "" then
if isnumeric(page)=false then
response.write "<script>alert('非法参数!');history.go(-1);</script>"
'response.Write page
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -