📄 kq_tongji.jsp
字号:
<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.sql.*" %>
<%@ page errorPage="/public/errorBusy.jsp" %>
<%@ include file="/public/check_admin.jsp" %>
<jsp:useBean id="conn" scope="page" class="SQLBean.DBConn"/>
<%!
ResultSet rs=null;
String sql="";
%>
<%
sql="select * from specialty";
rs=conn.executeQuery(sql);
%>
<script language="javascript">
subcat=new Array();
<%
int count=0;
while(rs.next()){
%>
subcat[<%= count %>]=new Array("<%= rs.getString("sp_id") %>","<%= rs.getString("sp_name") %>","<%= rs.getString("college_id") %>");
<%
count++;
}
conn.close();
%>
var one_count=<%= count %>;
function changlocation(id){
college_id=id;
document.form1.sp_id.length = 0;
document.form1.sp_id.options[0]=new Option("=======请选择=======","");
for(j=0;j<one_count;j++)
{
if(subcat[j][2]==college_id)
{
document.form1.sp_id.options[document.form1.sp_id.length]=new Option(subcat[j][1],subcat[j][0]);
}
}
}
function formCheck(theForm)
{
if(theForm.college_id.value=="")
{
alert("请选择院系!");
theForm.college_id.focus();
return false;
}
if(theForm.year_id.value=="")
{
alert("请选择学年!");
theForm.year_id.focus();
return false;
}
if(theForm.grade_name.value=="")
{
alert("请选择年级!");
theForm.grade_name.focus();
return false;
}
if(theForm.sp_id.value=="")
{
alert("请选择专业!");
theForm.sp_id.focus();
return false;
}
}
</script>
<html>
<head>
<title>考勤管理首页</title>
<link rel="stylesheet" href="../../public/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">
</style>
</head>
<body class="ss">
<a href="javascript:window.location.reload();" class="a">刷新</a>
<a href="javascript:history.back();" class="a">返回</a>
<hr></hr>
<center>
<h3>全校考勤统计信息</h3>
<form action="class_kaoqin_tongji.jsp" method="post" name="form1" onsubmit="return formCheck(this)">
<table width="40%">
<tr>
<td>学年:</td>
<td><select name="year_id">
<option value="" selected>=======请选择=======</option>
<%
ResultSet rs_y=null;
rs_y=conn.executeQuery("select * from year order by year_id DESC");
while(rs_y.next())
out.println("<option value="+rs_y.getString("year_id")+">"+rs_y.getString("year_name")+"</option>");
conn.close();
%>
</select></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td>院系:</td>
<td><select name="college_id" onchange="changlocation(document.form1.college_id.options[document.form1.college_id.selectedIndex].value)">
<option value="" selected>=======请选择=======</option>
<%
ResultSet rs_c=null;
rs_c=conn.executeQuery("select * from college");
while(rs_c.next())
out.println("<option value="+rs_c.getString("college_id")+">"+rs_c.getString("college_name")+"</option>");
conn.close();
%>
</select></td>
</tr>
<td colspan="2"> </td>
</tr>
<tr>
<td>年级:</td>
<td><select name="grade_name">
<option value="" selected>=======请选择=======</option>
<%
ResultSet rs_g=null;
rs_g=conn.executeQuery("select * from grade");
while(rs_g.next())
out.println("<option value="+rs_g.getString("grade_name")+">"+rs_g.getString("grade_name")+"</option>");
conn.close();
%>
</select></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td>专业:</td>
<td width="60%"><select name="sp_id">
<option value="" selected>=======请选择=======</option>
</select></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><div align="center"><input type="submit" value="查看"></div></td>
</tr>
</table>
</form>
</center>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -