📄 qureyscore.jsp
字号:
<%@page contentType="text/html; charset=gb2312" errorPage=""%>
<%@page import="java.sql.*,sms.db.*,sms.bean.*,java.util.*"%>
<%!
private String isSelected(String value1, String value2) {
if (value1 != null && value2 != null && value1.equals(value2))
return "selected";
else
return "";
}
%>
<%
request.setCharacterEncoding("gb2312");
String commitFlag = request.getParameter("queryButton");
ScoreBean scoreBean = null;
String term = "";
String courseId = "";
String password = "";
String studentId = "00564112";
ArrayList aList = null;
if (commitFlag != null ) {
term = request.getParameter("term");
courseId = request.getParameter("courseId");
password = request.getParameter("pswd");
studentId = request.getParameter("studentId");
StudentBean stuBean = new StudentBean();
if (stuBean.checkPwd(studentId, password) == false) {
%>
<script language="javascript" type="">
alert('您输入的用户名密码不正确!');
</script>
<%
}else{
ScoreBean scoreBean2 = new ScoreBean();
if((term != null && term.equals("")) || (term != null && term.equals("0"))){
term = null;
}
aList = scoreBean2.queryCourseScore(courseId,studentId,term);
}
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>学生成绩</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-color: #CCCCCC;
}
-->
</style></head>
<body>
<form action="" method="post">
<input type="hidden" name="commitFlag" value="submit">
<table width="100%" border="0">
<tr>
<td height="31">学生成绩查询</td>
</tr>
<tr>
<td height="42" bgcolor="#999999">
<table width="100%" border="0">
<tr>
<td width="21%" height="28"> </td>
<td width="37%"> 学期:
<select name="term">
<option id="0" value="0" <%=isSelected(term,"0")%>>全部学期</option>
<option id="1" value="1" <%=isSelected(term,"1")%>>第1学期</option>
<option id="2" value="2" <%=isSelected(term,"2")%>>第2学期</option>
<option id="3" value="3" <%=isSelected(term,"3")%>>第3学期</option>
<option id="4" value="4" <%=isSelected(term,"4")%>>第4学期</option>
<option id="5" value="5" <%=isSelected(term,"5")%>>第5学期</option>
<option id="6" value="6" <%=isSelected(term,"6")%>>第6学期</option>
<option id="7" value="7" <%=isSelected(term,"7")%>>第7学期</option>
<option id="8" value="8" <%=isSelected(term,"8")%>>第8学期</option>
</select>
</td>
<td width="13%" align="right">课程号:
</td>
<td width="19%">
<input name="courseId" type="text" class="text1" value="<%=courseId%>">
</td>
<td width="10%">
<input name="queryButton" type="submit" class="button1" value="查询">
</td>
</tr>
<tr>
<td height="24">请您提供密码</td>
<td> 学号:
<input name="studentId" type="text" class="text1" value="<%=studentId%>">
</td>
<td width="13%" align="right"> 密码:</td>
<td>
<input name="pswd" type="password" class="text1">
</td>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="171" align="center" valign="top">
<table width="100%" border="1" bordercolorlight= #C1A4F4 borderColorDark=#ffffff cellPadding=0 cellSpacing=0 >
<tr>
<th width="15%" scope="col">课程号</th>
<th width="36%" scope="col">课程名</th>
<th width="11%" scope="col">课程类型</th>
<th width="14%" scope="col">教师</th>
<th width="12%" scope="col">学期</th>
<th width="12%" scope="col">分数</th>
</tr>
<%
if(aList != null && aList.size() > 0){
ScoreBean scoreBean2 = new ScoreBean();
for(int i = 0;i<aList.size();i++){
scoreBean2 = (ScoreBean)aList.get(i);
%>
<tr>
<td align="center"><%=scoreBean2.getCourseId()%></td>
<td align="center"><%=scoreBean2.getCourseName()%></td>
<td align="center"><%=scoreBean2.getCourseType()%></td>
<td align="center"><%=scoreBean2.getTeachName()%></td>
<td align="center"><%=scoreBean2.getTerm()%></td>
<td align="center"><%=scoreBean2.getScore()%></td>
</tr>
<%
}
}
%>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -