<script src="./script/modal_window.js"></script>
<html>
<head>
<title>考试系统前台</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Refresh" content="300; url=index.php">

<meta name="keywords" content="在线考试系统 网络考试系统 通用网络考试 网络考试软件 计算机能力考试  电力安全工作规程考试系统 " />
<meta name="description" content="乐学网  乐考网 考易网 ">
<meta name="Author" content="电气信息研究所">
<meta name="Robots" contect= "all"> 
<Meta name="Copyright" Content="电气信息研究所">

<style type="text/css">
a {
	font-size: 14.8px;
	color: #009933;
}
a:link {
	color: #009933;
	text-decoration: none;
}
a:visited {
	color: #000000;
	text-decoration: none;
}
a:hover {
	color: #ffffff;
	text-decoration: none;
	background-color:#009933;	
}
a:active {
	text-decoration: none;
	color: #000000;
	font-weight:bold;
}

</style>

<link href="css/css_z.css" rel="stylesheet" type="text/css">

</head>

<?php include("css/firstpage.css") ?>

<?php include("css/tip.css") ?>

<script src="script/blur.js"></script>

<script src="script/autosec.js"></script>

<?php  //' -----------正式考试模式  -------------  ?>
<script src="script/first_page_check.js" charset="utf-8"></script>   
 <?php  //' -----------练习模式----顺序试题--------  ?>
<script src="script/first_shunxu_process.js" charset="utf-8"></script>
<?php  //' -----------练习模式----随机试题--------  ?>
<script src="script/first_lianxi_random.js" charset="utf-8"></script>

<?php //'onMouseOver="window.status='';return true" ?>

<script src="./script/radio_next.js"></script>

<script src="./script/button_next.js"></script>

<body bgcolor="#999999">

<?php include("anti_sql2.php") ?>

<?php include("conn.php") ?>


<?php 

    $read_studentid=$_SESSION["studentid"]; 

?>

<?php 
                  
	     $flag_value="999";
	     $sql="select *  from  examinfo  where  flag='".$flag_value."'";
		 $rs=$conn->execute($sql);
						  
	     if (!$rs->EOF)
	     {
			$read_mode=$rs->fields["exam_mode"];
		 }
                           
		 $rs->close;

				
		 //'----------------------------------------------------------------
		 $sql="select  *  from  studentanswer_xi  where  stuid='".$read_studentid."'";
		 mysql_query('set names utf8');
		 $gresult=mysql_query($sql);
		 $getcount=mysql_num_rows($gresult);
		 mysql_free_result($gresult);
		  //'----------------------------------------------------------------
		 $sql="select  *  from  studentinfo  where  studentid='".$read_studentid."'";
		 $rs=$conn->execute($sql);
         $read_chinese_name=$rs->fields["name"];
		 $read_chinese_name="姓名:".$read_chinese_name;
		 $rs->close;
		 
		 
			
    ?>
	
	
	<table width="800" border="00" align="center" cellpadding="0" cellspacing="0">
	  <tr>
	    <td height="26" align="center" bgcolor="#999999">&nbsp;</td>
      </tr>
	  <tr>
	    <td height="56" align="center" bgcolor="#FFFFFF">&nbsp;</td>
      </tr>
   </table>
<table width="800" border="00" align="center" cellpadding="0" cellspacing="0">
	  <tr>
	    <td height="54" align="center" bgcolor="#3366FF"><img src="images/logo3.jpg" width="685" height="56"></td>
      </tr>
</table>
<table width="800" border="00" align="center" cellpadding="0" cellspacing="0">
	  <tr>
	    <td height="19" align="center" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" style="word-break:break-all">
<tr>
	    <td  align="center" valign="top" bgcolor="#FFFFFF">
       
          <?php if ($read_mode==0) {  ?>
         
          <table width="94%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolordark="#999999" bordercolorlight="999999">
            <tr>
              <td height="184" align="center" valign="top" bgcolor="#FFFFFF"><table width="99%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="140" align="center" valign="middle"><table width="99%" border="1" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" bordercolorlight="#CCCCCC">
                    <tr>
                      <td height="113" align="center"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                          <td height="23"><font color="#333333">公告：目前是<strong><font color="#FF0000"><u>学习模式</u></font></strong>状态，准考证号和密码由系统自动生成，学员直接选择相应的试题即可登陆，</font></td>
                        </tr>
                        <tr>
                          <td height="23"><font color="#333333">考试完毕，可客观题计算机自动评分，主观题对照答案评分，适应于IE浏览器，使用<strong>360安全浏览器</strong>最好</font></td>
                        </tr>
                        <tr>
                          <td height="23"><font color="#333333">提示：直接点击试题类型旁边的分割试题符号，如S1，S2 即可直接登陆.</font></td>
                        </tr>
                      </table></td>
                    </tr>
                  </table></td>
                </tr>
                <tr>
                  <td  align="center" valign="middle"><?php if  (($read_studentid!='') || ($read_studentid!=NULL)) { ?>
                    <table width="99%" border="0" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" bordercolorlight="#CCCCCC" style="border-style:dashed; border-width:1px; border-color:#000000;">
                      <tr>
                        <td width="122" height="35"  align="center"><table width="80%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="25" align="center" bgcolor="#eeeeee" onMouseOut="this.style.backgroundColor=backupcolor" onMouseOver="this.backupcolor=this.style.backgroundColor;this.style.backgroundColor='#ff6633'" style="cursor:hand;"><div><font size="-1" color="#000000"><?php echo $read_studentid;?></font></div></td>
                          </tr>
                        </table></td>
                        <td width="122" align="center">
                        <table width="80%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="25" align="center" bgcolor="#EEEEEE" onMouseOut="this.style.backgroundColor=backupcolor" onMouseOver="this.backupcolor=this.style.backgroundColor;this.style.backgroundColor='#ff6633'" style="cursor:hand;"  ><div ><font size="-1" color="#000000"><?php echo $read_chinese_name;?></font></div></td>
                          </tr>
                        </table></td>
                        <td width="83" align="center"  ><table width="80%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="25" align="center" bgcolor="#EEEEEE" onMouseOut="this.style.backgroundColor=backupcolor" onMouseOver="this.backupcolor=this.style.backgroundColor;this.style.backgroundColor='#ff6633'" style="cursor:hand;"  ><div  onClick="javascript:gotourl('stu_query_shijuan.php?stuid=<?php echo $read_studentid; ?>');" ><font color="#000000" size="-1">我的试卷</font></div></td>
                          </tr>
                        </table></td>
                        <td width="84" height="25" align="center"  >
                        
                        <table width="80%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="25" align="center" bgcolor="#EEEEEE" onMouseOut="this.style.backgroundColor=backupcolor" onMouseOver="this.backupcolor=this.style.backgroundColor;this.style.backgroundColor='#ff6633'" style="cursor:hand;"  ><div  onClick="javascript:gotourl('stu_score_query.php');" ><font size="-1" color="#000000">成绩查询</font></div></td>
                          </tr>
                        </table>
                        
                        </td>
                        <td width="84" align="center">
                        
                        <table width="80%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="25" align="center" bgcolor="#EEEEEE" onMouseOut="this.style.backgroundColor=backupcolor" onMouseOver="this.backupcolor=this.style.backgroundColor;this.style.backgroundColor='#ff6633'" style="cursor:hand;"  ><div  onClick="javascript:gotourl('my_cang_shiti.php');"><font size="-1" color="#000000">我的收藏</font></div></td>
                          </tr>
                        </table>
                        
                        </td>
                        <td width="83" align="center"><table width="80%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="25" align="center" bgcolor="#EEEEEE" onMouseOut="this.style.backgroundColor=backupcolor" onMouseOver="this.backupcolor=this.style.backgroundColor;this.style.backgroundColor='#ff6633'" style="cursor:hand;"  ><div  onClick="javascript:gotourl('stu_change_password.php');"><font size="-1" color="#000000">修改密码</font></div></td>
                          </tr>
                        </table></td>
                        <td width="82" align="center" ><table width="80%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="25" align="center" bgcolor="#EEEEEE" onMouseOut="this.style.backgroundColor=backupcolor" onMouseOver="this.backupcolor=this.style.backgroundColor;this.style.backgroundColor='#ff6633'" style="cursor:hand;"  ><div  onClick="javascript:gotourl('recordlog_display.php');"><font size="-1" color="#000000">学习日志</font></div></td>
                          </tr>
                        </table></td>
                        <td width="75" align="center"><table width="80%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="25" align="center" bgcolor="#EEEEEE" onMouseOut="this.style.backgroundColor=backupcolor" onMouseOver="this.backupcolor=this.style.backgroundColor;this.style.backgroundColor='#ff6633'" style="cursor:hand;"  ><div  onClick="javascript:gotourl('session_destroy.php');"><font size="-1" color="#000000">注销</font></div></td>
                          </tr>
                        </table></td>
                      </tr>
                    </table>
                    <?php  } ?>
                    <?php if  (($read_studentid=='') || ($read_studentid==NULL)) { ?>
                    <table width="99%" border="0" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" bordercolorlight="#CCCCCC">
                      <tr>
                        <td width="119" height="28" align="center">&nbsp;</td>
                        <td width="119" align="center">&nbsp;</td>
                        <td width="327" align="center">&nbsp;</td>
                       
                        <td width="65" align="center" bgcolor="#eeeeee"
                        onMouseOut="this.style.backgroundColor=backupcolor" onMouseOver="this.backupcolor=this.style.backgroundColor;this.style.backgroundColor='#ff6633'" style="cursor:hand;" 
                        ><div id="loginx" onClick="javascript:gotourl('login.php');">
                        <font color="#000000">登录</font></div></td>
                        
                        <td width="9" align="center" bgcolor="#FFFFFF">&nbsp;</td>
                        <td width="65" align="center" bgcolor="#eeeeee" 
                        onMouseOut="this.style.backgroundColor=backupcolor" onMouseOver="this.backupcolor=this.style.backgroundColor;this.style.backgroundColor='#ff6633'" style="cursor:hand;" 
                        >
                        <div id="regx" onClick="javascript:gotourl('admin_stu_reg_input.php');"><font color="#000000">注册</font></div></td>
                        <td width="33" align="center" >&nbsp;</td>
                      </tr>
                    </table>
                    <?php  } ?></td>
                </tr>
                <tr>
                  <td width="91%"  valign="top"><form name="form1" method="post" action="">
                    <?php 
	    
		//练习模式下，要检查 数据库是否已经被选择------------------------
		
		$sql="select  * from database_name where  status=1 ";
		$rs=$conn->execute('set names utf8');
		$rs=$conn->execute($sql);
		if ($rs->EOF)
		{
			$msg="[软件提示]：没有指定要练习的试题库，请教师到后台页面<a href=admin/admin_login.php><font color=#0000FF size=-1>【试卷管理】</font></a>进行选择.";
			echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />";
            ///已经有<body>标签-----------------------------------
            echo "<script language=javascript>";
            echo "modal_window('$msg','index.php');";
            echo "</script>";
			exit;	
		}
		$rs->close;
		
		
		
		
		$ku_count=0;
		$sql="select *  from  database_name   where  status=1";
		$sql=$sql."   order by   database_name  asc  ";
		$result=mysql_query($sql);
		$ku_count=mysql_num_rows($result); 
				
		$database_name_str=array($ku_count);
		$database_id_id=array();
		$read_lognum=array();
		$fenlei_num_num=array();
				
		mysql_free_result($result);  
		
		
		
		$sql="select *  from  database_name   where  status=1";
		$sql=$sql."   order by   database_name  asc  ";
		$rs=$conn->execute($sql);
		$gg=0;
				
		while(!$rs->EOF)
		{
			$database_name_str[$gg]=$rs->fields["database_name"];
			$database_id_id[$gg]=$rs->fields["id"];
			//echo $database_name_str[$gg]."<br>";
			$read_lognum[$gg]=$rs->fields["lognum"];
			
			///--------------------------------------------------
			$sql="select  *  from  fenlei  where   database_id=".$database_id_id[$gg];
			$re=mysql_query($sql);
	  		$fenlei_num_num[$gg]=mysql_num_rows($re);
	  		mysql_free_result($re);
      		
			
			$gg=$gg+1;
			$rs->MoveNext();
			
		}
		$rs->close;
		
		
		    
    ?>
                    <table width="100%" border="00" align="center" cellpadding="0" cellspacing="0">
                      <tr>
                        <td height="28" colspan="2" align="left" bgcolor="#FFFFFF"><table width="95%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="30%" height="25" align="left">请选择要练习的数据库: </td>
                              <td width="70%" align="left"><div id="displayinfo"></div></td>
                            </tr>
                        </table></td>
                      </tr>
                      <?php 
				    $sql="select *  from  database_name   where  status=1";
					$sql=$sql."   order by   database_name  asc  ";
					$rs=$conn->execute($sql);
					$gg=0;
				
					while(!$rs->EOF)
					{
						$zong_database_name=$rs->fields["database_name"];
						$access_lognum=$rs->fields["lognum"];
						$zong_id=$rs->fields["id"];
						$gg=$gg+1;
						
					?>
                      <tr>
                        <td width="54%" height="26" align="left" bgcolor="#FFFFFF"><input type="radio" name="zong_database"  value="<?php echo $zong_id; ?>"  onClick="radio_next(this.value);">
                          <?php echo $zong_database_name; ?></td>
                        <td width="46%" height="26" align="right" bgcolor="#FFFFFF">&nbsp;</td>
                      </tr>
                      <?php
					
				       $rs->MoveNext();
					}
					$rs->close;
		
 			     ?>
                      <tr>
                        <td height="28" colspan="2" align="left" bgcolor="#FFFFFF"><div id=mydis1></div></td>
                      </tr>
                    </table>
                  </form></td>
                </tr>
                <tr>
                  <td height="36" align="left" valign="middle"><div  align="left" id="displayinfo2"></div></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td height="19" align="center" bgcolor="#FFFFFF">&nbsp;</td>
            </tr>
          </table>
          <table width="800" border="00" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="54" align="center" bgcolor="#3366FF">版权所有 2010-2014</td>
            </tr>
          </table>
          <?php } ?>
          
          <table width="90%" border="00" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="20" align="center" bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
        </table>
        
        
         <?php     if ($read_mode ==1)  {    ?>
        
         <table width="90%" border="2" align="center" cellpadding="0" cellspacing="0" bordercolordark="#cccccc" bordercolorlight="#cccccc">
           <tr>
             <td height="433" align="center" valign="middle" bgcolor="#FFFFFF"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="00716b">
               <tr>
                 <td height="19" align="center" bgcolor="#FFFFFF">&nbsp;</td>
                 <td align="center" bgcolor="#FFFFFF">&nbsp;</td>
               </tr>
               <tr>
                 <td height="47" colspan="2" align="center" bgcolor="#ffffff"><table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                   <tr>
                     <td height="26" bgcolor="#FFFFFF">&nbsp;</td>
                     <td height="26" bgcolor="#FFFFFF"><font color="#333333">考生注意事项</font><font color="#333333">：目前是<strong><font color="#FF0000"><u>正式考试</u></font></strong>状态，准考证号由考场教师发放，密码请点击[查询密码]链接查询，本</font></td>
                   </tr>
                   <tr>
                     <td width="30" height="26" bgcolor="#FFFFFF">&nbsp;</td>
                     <td width="636" height="26" bgcolor="#FFFFFF"><font color="#333333">系统可同时考不同的试题，请选择所要考试的试题,之后点击[登录进入]按钮登录。考试中</font></tt>不得关闭浏览</td>
                   </tr>
                   <tr>
                     <td height="26" bgcolor="#FFFFFF">&nbsp;</td>
                     <td height="26" bgcolor="#FFFFFF">器，若不慎关闭，举手示意考场教师二次登录；交卷请点击交卷按钮，若不交卷，时间到系统可自动交</td>
                   </tr>
                   <tr>
                     <td height="26" bgcolor="#FFFFFF">&nbsp;</td>
                     <td height="26" bgcolor="#FFFFFF">卷，甚至直接关闭浏览器直接交卷。</td>
                   </tr>
                 </table></td>
               </tr>
               <tr>
                 <td width="58%" height="293" align="right" valign="top" bgcolor="#FFFFFF" ><table width="95%" border="00" align="center" cellpadding="0" cellspacing="0">
                   <tr>
                     <td height="28" align="center" bgcolor="#FFFFFF">&nbsp;</td>
                   </tr>
                 </table>
                   <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="word-break:break-all">
                     <tr>
                       <td  valign="top"><form name="form1" method="post" action="">
                         <table width="99%" border="00" align="center" cellpadding="0" cellspacing="0" >
                           <tr>
                             <td   valign="top"></td>
                             <td valign="top"><table width="98%" border="00" align="center" cellpadding="0" cellspacing="0">
                               <tr>
                                 <td width="100%"  colspan="2" align="left" valign="middle" bgcolor="#FFFFFF"><table width="95%" border="00" cellspacing="0" cellpadding="0">
                                   <tr>
                                     <td width="79" height="33"><div align="right"><font color="#333333">准考证号：</font></div></td>
                                     <td width="162"><input name="studentid" type="text" class="me_input" id="studentid" onFocus=getFocus(this) onBlur=getBlur(this) value="<?php echo $userid; ?>" size="20" maxlength="9"></td>
                                     <td width="73" align="center"><div id="b_link2"><a href="query_pass.php" target="_blank" >查询密码</a></div></td>
                                   </tr>
                                   <tr>
                                     <td height="40"><div align="right"><font color="#333333">密 码：</font></div></td>
                                     <td><input name="password" type="text" class="me_input" id="password"  onFocus=getFocus(this) onBlur=getBlur(this) value="<?php echo $password; ?>" size="20" maxlength="16"></td>
                                     <td align="center"><div id="b_link"><a href="help.php" target="_blank">登录帮助</a></div></td>
                                   </tr>
                                 </table></td>
                               </tr>
                             </table></td>
                           </tr>
                           <tr>
                             <td width="4%"  valign="top"></td>
                             <td width="96%" valign="top">
	<?php       
							
				$ff=0;
							   
				$sql="select juan_id  from  random_shiti   group  by  coursename   " ;
				$result=mysql_query($sql);
				$juan_num=mysql_num_rows($result);
				
				
				if ($juan_num==0)
				{
					$msg="[软件提示]：试题库中未装入任何试题，请考场教师通过后台【试卷管理】生成试题.";
					echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />";
                    ///已经有<body>标签-----------------------------------
                    echo "<script language=javascript>";
                    echo "modal_window('$msg','index.php');";
                    echo "</script>";
					exit;	
					
				}	
				mysql_free_result($result);
				
				
				
				
					   
				$sql="select id,juan_id,coursename  from    random_shiti   group  by  coursename   " ;	
				$rs=$conn->execute($sql);
				while ((!$rs->EOF) && ($juan_num>0))
				{		   
					
					$flag=0;
						        
				    if ($flag==0)  
					{	$bg_color="#FFFFFF";
						$flag=1;
					}
					else
					{	$bg_color="#f9f9f9";
					    $flag=0;
					} 
						   
				   $juan_name_str=$rs->fields["coursename"];
				   $juan_id_int=$rs->fields["juan_id"]; 
				   
				   $db_id_int=$rs->fields["id"]; 						  
				
					
								
	 ?>
                               <table width="96%" border="0" cellspacing="0" cellpadding="0">
                                 <tr bgcolor="<?php echo $bg_color;  ?>">
                                   <td width="25%" height="32" align="right"><input name="radio_juan" type="radio" value="<?php echo $juan_id_int; ?>" onClick="return first_page_check(<?php echo $juan_id_int; ?>,<?php echo $db_id_int; ?>);"></td>
                                   <td width="2%" align="left">&nbsp;</td>
                                   <td width="73%" height="32" align="left"><font color="#333333"><?php echo $juan_name_str; ?></font></td>
                                 </tr>
                               </table>
                               <?php
				   
				$rs->MoveNext();  
				}
					  
				   $rs->close;
					
			?></td>
                           </tr>
                           <tr>
                             <td height="10" valign="top"></td>
                             <td valign="top"></td>
                           </tr>
                           <tr>
                             <td height="54"  valign="top">&nbsp;</td>
                             <td valign="middle"><table width="96%" border="0" cellspacing="0" cellpadding="0">
                               <tr>
                                 <td width="12%" align="left">&nbsp;</td>
                                 <td width="75%" align="left"><div align="left" id="login" style="line-height:24px"></div></td>
                                 <td width="13%" height="28" colspan="2">&nbsp;</td>
                               </tr>
                             </table></td>
                           </tr>
                         </table>
                         <table width="98%" border="00" align="center" cellpadding="0" cellspacing="0">
                           <tr>
                             <td>&nbsp;</td>
                           </tr>
                         </table>
                       </form></td>
                     </tr>
                   </table></td>
                 <td width="42%" align="center" valign="top" bgcolor="#FFFFFF"><img src="images/kb.jpg" width="283" height="293"></td>
               </tr>
             </table></td>
           </tr>
          </table>
         <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="word-break:break-all">
           <tr>
             <td height="19" colspan="2" align="center" bgcolor="#FFFFFF">&nbsp;</td>
           </tr>
         </table>
         <table width="800" border="00" align="center" cellpadding="0" cellspacing="0">
           <tr>
             <td height="54" align="center" bgcolor="#3366FF">版权所有 2010-2014</td>
           </tr>
         </table>
        
        
        <?php } ?>
        
        
        <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="word-break:break-all">
          <tr>
            <td height="34" colspan="2" bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
          <tr>
            <td height="28" colspan="2" align="center" bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
        </table></td>
  </tr>
</table>

<table width="800" border="00" align="center" cellpadding="0" cellspacing="0">
  <tr>
<td height="42" align="center" bgcolor="#999999">&nbsp;</td>
</tr>
</table>
<?php  
	     $rs->close;
		 $conn->close;
		
?>

</body>
</html>
