<?php include("session.php"); ?>
<html>
<head>
<title>网络考试系统企业版</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../css/css.css" type="text/css">
<style type="text/css">
body {
	background-color: #999;
}
</style>
</head>
<body >

<?php //include("admin_no_url.php") ?>
<?php include("anti_sql2.php") ?>
<?php include("../conn.php") ?>

 <? 
   $get_flag=$_GET["flag"];
 ?>
  
  
<?
 
$read_juan_id=$_GET["juan_id"];
$sql="select  *  from  database_name  where   id=";
$sql=$sql." (select  database_id  from  fenlei   where   id=".$read_juan_id.")";
$rs=$conn->execute($sql);
if (!$rs->EOF)
{

  $read_database_name=$rs->fields["database_name"];
} 

$rs->close;

$sql="select  *  from  fenlei  where   id=".$read_juan_id;
$rs=$conn->execute($sql);
if (!$rs->EOF)
{

  $read_juan_name=$rs->fields["exam_juan_name"];
} 

$rs->close;

?>

 
<? 

$getbanji=$_GET["banji"];

?>
  
  
 

          
<? 

$s_exist=0;
$d_exist=0;
$t_exist=0;
$p_exist=0;
$lunshu_exist=0;

?>


<? 
 

 
$cannot=0;

$sql="select * from  studentanswer  where  juan_id=".$read_juan_id;
$sql=$sql."  and  stuclass='".$getbanji."'";
$sql=$sql."   order  by  stuid  asc ";

$rs=$conn->execute($sql);
if ($rs->EOF)
{

      $msg="【软件提示】：没有该场次的考生成绩！";
      echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />";
      echo "<body>";
      echo "<script language=javascript>";
	  echo "alert('$msg');";
      echo "javascript:history.go(-1);";
      echo "</script>";
      echo "</body>";
      exit;

   
} 
$rs->close;

?>
 
<? 

$sql="select * from  studentanswer  where  juan_id=".$read_juan_id;
$sql=$sql."  and   stuclass='".$getbanji."'";
$sql=$sql."  order by  stuid asc ";
$rs=$conn->execute($sql);

?>
 <table width="760"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
   <tr>
     <td height="36">&nbsp;</td>
   </tr>
   <tr>
     <td height="471" align="center" valign="top"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#999999">
       <tr>
         <td height="27"><div align="center"><font color="#666666" size="+2"><b><u>成绩一览表</u></b></font></div></td>
       </tr>
       <tr>
         <td height="51"><div align="left"> <font color="#009933"><u><b>课程:<? echo $read_juan_name;?></b></u></font> <font color="#009933"><u><b>场次：<? echo $getbanji;?></b></u></font> </div></td>
       </tr>
     </table>
       <table width="95%"  border="1" align="center" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#96c2f1" >
         <tr>
           <td width="12%" bgcolor="#eff7ff"><div align="center">准考证号</div></td>
           <td width="15%" bgcolor="#eff7ff"><div align="center">姓名</div></td>
           <td width="12%" height="28" bgcolor="#eff7ff"><div align="center">单项选择题</div></td>
           <td width="13%" height="28" bgcolor="#eff7ff"><div align="center">多项选择题</div></td>
           <td width="11%" height="28" bgcolor="#eff7ff"><div align="center">判断题</div></td>
           <td width="10%" height="28" bgcolor="#eff7ff"><div align="center">填空题</div></td>
           <td width="10%" height="28" bgcolor="#eff7ff"><div align="center">论述题</div></td>
           <td width="8%" height="28" bgcolor="#eff7ff"><div align="center">总分</div></td>
           <td width="9%" bgcolor="#eff7ff"><div align="center">状态1</div></td>
         </tr>


         <? 
  
  
  $uuu=0;
  $sql="select * from  studentanswer  where  juan_id=".$read_juan_id;
  $sql=$sql."  and  stuclass='".$getbanji."'";
  $sql=$sql."   order  by  stuid  asc ";
  $rs=$conn->execute($sql);
  while(!$rs->EOF)
  {

    $uuu=$uuu+1;
    $get_id=$rs->fields["stuid"];
    $get_name=$rs->fields["stuname"];

   $unfinish_flag=0;  
   $ss=0;
   $s_exist=0;
   if ($rs->fields["rom_s"]!='' || $rs->fields["rom_s"]!=NULL)
   {
      $s_exist=1;
	  if  ($rs->fields["haspingyue_k"]!='1')
	  {
		 $ss_display="<font color=#0000FF size=-1>未评</font>";
         $unfinish_flag=1; 
	  }
	  else
	  {
		  $ss_display=$rs->fields["sscore"]; 
		  $ss=1;
	  }
  } 
  else
  {
	  $ss_display="*";
  }



  $dd=0;
  $d_exist=0;
  if ($rs->fields["rom_d"]!='' || $rs->fields["rom_d"]!=NULL)
  {
      $d_exist=1;
	  if  ($rs->fields["haspingyue_k"]!='1')
	  {
		 $dd_display="<font color=#0000FF size=-1>未评</font>"; 
		 $unfinish_flag=1;
	  }
	  else
	  {
		  $dd_display=$rs->fields["dscore"]; 
		  $dd=1;
	  }
  } 
  else
  {
	  $dd_display="*";
  }


  $pp=0;
  $p_exist=0;
  if ($rs->fields["rom_p"]!='' || $rs->fields["rom_p"]!=NULL)
  {
      $p_exist=1;
	  if  ($rs->fields["haspingyue_k"]!='1')
	  {
		 $pp_display="<font color=#0000FF size=-1>未评</font>"; 
		 $unfinish_flag=1;
	  }
	  else
	  {
		  $pp_display=$rs->fields["pscore"]; 
		  $pp=1;
	  }
  } 
  else
  {
	  $pp_display="*";
  }
  
  

  $tt=0;
  $t_exist=0;
  if ($rs->fields["rom_t"]!='' || $rs->fields["rom_t"]!=NULL)
  {   
      $t_exist=1;
      if  ($rs->fields["haspingyue_j"]!='1')
	  {
		
		 $tt_display="<font color=#0000FF size=-1>未评</font>"; 
		 $unfinish_flag=1;
	  }
	  else
	  {
		  $tt_display=$rs->fields["tscore"];
		  $tt=1;
		   
	  }
  } 
 else
  {
	  $tt_display="*";
  }

  $lunshu=0;
  $lunshu_exist=0;
  if ($rs->fields["rom_lunshu"]!='' || $rs->fields["rom_lunshu"]!=NULL)
  {
	   $lunshu_exist=1;
       if  ($rs->fields["haspingyue_h"]!='1')
	  {
		 $lunshu_display="<font color=#0000FF size=-1>未评</font>"; 
		 $unfinish_flag=1;
	  }
	  else
	  {
		  $lunshu_display=$rs->fields["lunscore"]; 
		  $lunshu=1;
	  }
  }
  else
  {
	  $lunshu_display="*";
  }


   //----------------------------------------------------------
  $get_stu_score=$rs->fields["stuscore"];
  
  if ($get_stu_score!='' || $get_stu_score!=NULL)
  {
    $get_stu_score=$get_stu_score;
	if  ($get_stu_score<60)
	{
		$score_display="<font color=#ff0000 size=-1>".$get_stu_score."</font>";
	}
	if  (($get_stu_score>=60) and (($get_stu_score<=80 )))
	{
		$score_display="<font color=#000000 size=-1>".$get_stu_score."</font>";
	}
	
	if  (($get_stu_score>80) and (($get_stu_score<=90 )))
	{
		$score_display="<font color=#FF00CC size=-1>".$get_stu_score."</font>";
	}
	
	if  (($get_stu_score>90) and (($get_stu_score<=100 )))
	{
		$score_display="<font color=#6600CC size=-1>".$get_stu_score."</font>";
	}
	
  }
    else
  {
     $score_display="<font color=#ff0000 size=-1>未阅</font>";
  } 
  
 

?>
         <tr backupcolor="" onMouseOut="this.style.backgroundColor=backupcolor" onMouseOver="this.backupcolor=this.style.backgroundColor;this.style.backgroundColor='#eeeeee'" >
           <td height="25"><div align="center">
             <?     echo $get_id;?>
           </div></td>
           <td height="25"><div align="center">
             <?     echo $get_name;?>
           </div></td>
           <? //----------------------------------------------  ?>
           <td height="25"><div align="center"><?php echo $ss_display; ?></div></td>
           <? //-----------------------------------------------------  ?>
           <td height="25"><div align="center"><?php echo $dd_display; ?></div></td>
           <? //-----------------------------------------------------------------------------------------------  ?>
           <td height="25"><div align="center"><?php echo $pp_display; ?></div></td>
           <td height="25"><div align="center"><?php echo $tt_display; ?></div></td>
           <? //-----------------------------------------------------------------------------------------------  ?>
           <td height="25"><div align="center"><?php echo $lunshu_display; ?></div></td>
           <? //-----------------------------------------------------------------  ?>
           <td width="8%" height="25"><div align="center"><font color="#000000"><?php echo $score_display; ?></font></div></td>
           <? //-----------------------------------------------------------  ?>
           <td width="9%" height="25"><? 
       if ($unfinish_flag==0)
    {

?>
             <div align="center"><font color="#666666">■已阅</font></div>
             <? 
    }
      else
    {

?>
             <div align="center"><font color="#ff0000">■未阅</font></div>
             <? 
    } 

?></td>
         </tr>
         <? 

    $rs->MoveNext();
  } 
  $rs->close;



?>
       </table>
       <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
         <tr>
           <td height="32">共有<font color=#0000ff> <? echo $uuu;?></font> 名考生。</td>
         </tr>
     </table>
       <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
         <tr>
           <td height="23">&nbsp;</td>
         </tr>
         <tr>
           <td height="76"><div align="center"><a href="admin_pingyue_list.php?juan=<? echo $read_juan_id;?>&banji=<? echo urlencode($getbanji);?>&switch=off">返回试卷评阅</a></div></td>
         </tr>
     </table>
       <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
         <tr>
           <td height="23">&nbsp;</td>
         </tr>
         <tr>
           <td height="33">&nbsp;</td>
         </tr>
     </table></td>
   </tr>
 </table>
</body>
</html>

