<%@ page contentType="text/html;charset=GBK" %>
<%@ page language="java" import="java.sql.*"%>
<%@ page import="java.lang.Math.*" %>
<%@ page import="java.util.*" %>
<jsp:useBean id="conn" scope="page" class="test.ConnOracle"/>
<%@ include file="/public/checkvalidadmin.jsp"%>

<%!
ResultSet rs = null;
ResultSet rsTmp = null;
String sql = "";
String classid    = "";
String examtime   = "";
int mianshi_flag  = 0;
%>

<%
classid  = request.getParameter("classid");
examtime = request.getParameter("examtime"); 
if(classid==null || examtime==null) {
    out.println("无法得到班级信息及考试日期信息！");
	return;
}
sql = "select * from test_result_info where classid=" + classid;
sql+= " and to_char(starttime,'YYYY/MM/DD')='" + examtime + "'";

try {
	   rs = conn.executeQuery( sql );
}catch(Exception e) {
	   out.println("访问考试结果信息数据出错！");
	   return;
}
%>

<html>

<head>
	<title>察看试卷</title>
    <link rel="stylesheet" href="../public/style.css">
	<Script language="JavaScript">
	//打开新窗口函数openwin
	function openwin(id)
	{
	   window.open('studentinterview.jsp?id='+id,'infoWin', 'height=600,width=800,scrollbars=yes,resizable=yes');
	}
	</Script>
</head>

<body  class="ss">
<center>

<table class=dbt2 width=640 cellSpacing=1 cellPadding=3 border=0>
	<tr class=dbt3 align=middle>
		<TH>编号</TH>
		<TH>学生编号</TH>
		<TH>学生姓名</TH>
		<TH>毕业院校</TH>
		<TH>学历</TH>
		<TH>测试分数</TH>
		<TH>面试</TH>
	</TR>
<%
int k=1;
int tmpstudentid=0;
while(rs.next()) {
%>
<TR class=dbt4 align=center>
	<TD><%=k%></TD>
    <TD><%=rs.getInt("studentid")%>
	</TD>
    <TD><%=rs.getString("name")%>
    <TD><%=rs.getString("school")%>
    <TD><%=rs.getString("degree")%>
    <TD><%=rs.getInt("score")%>
	<%
	mianshi_flag = rs.getInt("mianshij");
    if(mianshi_flag==1) {
    %>      
		<TD>已通过面试</TD>
	<%}else if(mianshi_flag==-1) {%>
          <TD>未通过面试</TD>
    <%}else {%>
		  <TD><%="<a href=javascript:openwin('"+rs.getInt("testid")+"')>面试</a>"%></TD>
	<%}%>
</TR>
<%
k++;
}	
%>
</table>
</center>
<hr>
</body>
</html>
