📄 mng_analyse_score.php
字号:
<?php session_start(); if(!$_SESSION['teacher']) {echo '<SCRIPT LANGUAGE="JavaScript">location.replace(\'mng.php\');</script>';exit;}?>
<html>
<head>
<title>EasyTeacher信息技术课堂教学助手(ItAssis)教师端-学生积分分析</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="et.css" rel="stylesheet" type="text/css">
<style type="text/css">
body,td,th {font-size: 14px;}
</style>
<script language="javascript" src="ItAssisJS/java.js"></script>
</head>
<body>
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30" background="images/top_bg.jpg"><div align="left"> 位于:<strong class="red">学生积分分析 </strong> <a href="mng_analyse_task.php">学生作业分析</a> <a href="mng_analyse_express.php">学生表现分析</a></div></td>
<td width="100" background="images/top_bg.jpg"><div align="left">[<a href="#explain">说明</a>]</div></td>
</tr>
</table>
<?php
include "config.inc.php";
include "conn.inc.php";
include "ItAssisFC/FLib.php";
include "ItAssisFC/CLib.php";
$db=Connect_db($CFG_DB_ADDRESS,$CFG_DB_PORT,$CFG_DB_NAME,$CFG_DB_OWNER,$CFG_DB_PWD);
if(isset($_GET['page']) ) $page=$_GET['page']; else $page=0;
if(isset($_GET['per_page'])) $per_page=$_GET['per_page']; else $per_page=5;
if(isset($_GET['sid'])) $sid=trim($_GET['sid']); else $sid="姓名";
if(isset($_GET['g_c']) ) $g_c=trim($_GET['g_c']); else $g_c="all";
if(isset($_GET['relation']) ) $relation=trim($_GET['relation']); else $relation="";
if(isset($_GET['score']) ) $score=trim($_GET['score']); else $score=null;
//构造导航条班级信息
$g_c_item_msg="";
$sql="
select grade,class,count(*) as total
from stu
group by grade,class";
$result = mysql_query($sql,$db) or die("<b>$sql</b><br>" . mysql_error());
if(isset($_GET['g_c']) && $_GET['g_c']!="all"){
list($g,$c)=split(",",$_GET['g_c']);
$g_c_item_msg.="<option value=\"{$_GET['g_c']}\">$g($c)班</option>";
}
$g_c_item_msg.="<option value=\"all\">所有班级</option>";
while($array=mysql_fetch_array($result)){
$g=$array['grade'];
$c=$array['class'];
$g_c_item_msg.="<option value=\"$g,$c\">$g($c)班[{$array['total']}人]</option>";
}
//查询
if(isset($_GET['search'])){
$record_from=$page*$per_page;
$sql ="select sid,pic,grade,class,score from stu";
$condition[0]="";
if($sid!="" && $sid!="姓名")
array_push($condition,"sid like \"%$sid%\"");
if($g_c!="all" ){
list($g,$c)=split(",",$_GET['g_c']);
array_push($condition,"grade=$g and class=$c");
$g_c="$g,$c";
}
if(isset($_GET['score']) && $score!=""){
$relation=$relation;
array_push($condition,"score $relation $score");
}
array_shift($condition);
$condition=implode(" and ", array_values($condition));
if($condition)
$sql.=" where $condition";
$result2 = mysql_query($sql,$db) or die("<b>$sql</b><br>" . mysql_error());
$num=mysql_num_rows($result2);
$sql.=" order by sid";
$sql.=" limit $record_from,$per_page";
$result = mysql_query($sql,$db) or die("<b>$sql</b><br>" . mysql_error());
}
?>
<form name="form1" method="GET" action="">
<table width="740" height="20" border="0" align="center" cellpadding="0" cellspacing="0" background="images/top_bg.jpg" bgcolor="#DEEBF7">
<tr>
<td width="620" height="20">
<input name="sid" type="text" id="sid" value="<?php if(isset($_GET['sid'])) echo $_GET['sid'];else echo "姓名";?>" size="8" maxlength="8">
<select name="g_c">
<?php echo $g_c_item_msg?>
</select>
<select name="relation">
<?php if(isset($_GET['relation'])) echo $_GET['relation'];?>
<option value=">=">积分≥</option>
<option value="=">积分=</option>
<option value="<=">积分≤</option>
</select>
<input name="score" type="text" size="4" value="<?php if(isset($_GET['score'])) echo $_GET['score'];?>" maxlength="4">
<input name="imageField" type="image" src="images/search.gif" alt="默认搜索全体学生" width="25" height="17" border="0">
<input name="search" type="hidden" id="search" value="1"></td>
<td width="120"><input name="per_page" type="text" id="per_page" size="2" value="<?php echo $per_page; ?>">
个/页</td>
</tr>
</table>
<br>
</form>
<table width="740" border="2" align="center" cellspacing="0" bordercolor="#A5B2CE">
<tr bgcolor="#DEE3EF">
<td width="9%"><div align="center">姓名</div></td>
<td width="9%"><div align="center">班级</div></td>
<td width="9%"><div align="center">积分</div></td>
<td width="73%"><div align="center">详情</div></td>
</tr>
<?php
if(isset($_GET['search'])){
$image_msg="";
while($array=mysql_fetch_array($result)){
if(!$array['pic']) $array['pic']="none.jpg";
if(isset($_SESSION['image']) && $_SESSION['image']=="on")
$image_msg="<a href=$CFG_STU_PHOTO_DIR/".$array['pic']." target=_blank><img src=$CFG_STU_PHOTO_DIR/".$array['pic']." width=50 height=60 border=0 alt=点击看大图></a><br>";
$base_url="mng_analyse_score_detail.php?sid=".urlencode($array['sid']);
echo "
<tr>
<td><div align=center>$image_msg".$array['sid']."</div></td>
<td><div align=center>".$array['grade']."(".$array['class'].")班</div></td>
<td><div align=center>".$array['score']."</div></td>
<td><div align=center><a href=$base_url target=_blank title=点击查看得分明细>查看得分明细</a></div></td>
</tr>";
}//end while
}//end if
?>
</table>
<p> </p>
<p align="center">
<?php
if(isset($_GET['search'])){
$CC=new Page();
$CC->setCurrentpage($page);
$CC->setTotalpage($num/$per_page);
$CC->setStride(5);
echo "共<strong>".(floor($num/$per_page)+1)."</strong>页 ";
$CC->Pageprint("search=1&sid=$sid&g_c=$g_c&relation=$relation&score=$score&per_page=$per_page");
}
?>
<br>
</p>
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#F7F3F7"><p align="left"> 说明:</p>
<ul>
<li>默认搜索结果为全体学生。</li>
<li>支持姓名模糊搜索。</li>
</ul></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -