| Server IP : 172.67.187.206 / Your IP : 172.71.28.155 Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586 User : SYSTEM ( 0) PHP Version : 5.6.30 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : E:/Inetpub/www/myschool/triamudom/check/webadmin/ |
Upload File : |
<?php
session_start();
$path = "../";
include ($path.'include/config_db.php');
include ($path.'include/class_db.php');
include ($path.'include/class_display.php');
include ($path.'include/function.php');
include ($path.'include/permission_denied.php');
$CLASS['db'] = new db();
$CLASS['db']->connect();
$CLASS['disp'] = new display();
$db = $CLASS['db'];
$disp = $CLASS['disp'];
$date_day = date("Y-m-d");
$tb_room_id = $_REQUEST['tb_room_id'];
$tb_room_class = $_REQUEST['tb_room_class'];
//----------------------------ค่าพื้นฐานระบบเว็บไซต์-----------------------------//
$fetch_public = $db->fetch_array($db->query("select * from tb_public"));
//----------------------------ค่าพื้นฐานระบบเว็บไซต์-----------------------------//
//--------------------ส่วนบนใช้สำหรับประกาศตัวแปรและ Config เท่านั้น----------------------------//
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php print $fetch_public['tb_public_title_admin'];?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<SCRIPT type="text/javascript" src="js/format.js"></SCRIPT>
<SCRIPT type="text/javascript" src="js/global.js" ></SCRIPT>
<SCRIPT type="text/javascript" src="js/dtree.js" ></SCRIPT>
<link href="css/style_admin.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {font-size: 24px}
.style4 {font-size: 14px}
-->
</style>
</head>
<body>
<TABLE width=100% height="100%" border=0 cellPadding=0 cellSpacing=0>
<tbODY>
<TR>
<TD width=100% height=100 align="left" vAlign=top ><?php include_once('header_admin.php'); ?></TD>
</TR>
<TR height="100%" >
<TD width="100%" height="100%" vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 >
<tbODY>
<TR>
<TD width=200 rowSpan=2 vAlign=top id=nav><?php include_once('left_nav.php'); ?></TD>
<TD width=3 height=1 bgcolor="#f1f1f1"><img src="images/spacer.gif" width="3" height="1"></TD>
<TD width="100%" rowSpan=2 align="left" vAlign=top style="PADDING-LEFT: 3px; PADDING-RIGHT: 0px;">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td rowspan="2"><img
src="images/i_setup.gif" width="65" height="44" border="0"></td>
<td width="100%" height="24"> </td>
<td> </td>
</tr>
<tr>
<td align="left" width="100%"
background="images/bg_part.gif"><B><font color="#000000">เข้าระบบโดย : <?php print $_SESSION['sessionadmin_name'];?> <?php print $_SESSION['sessionadmin_sername'];?></font></B></td>
<td><img
src="images/end_part.gif" width="25" height="20"></td>
</tr>
</tbody>
</table>
<br>
<form action="#" method="post" name="form1" id="form1">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666" class="km_bgtable">
<tr>
<td width="100%" align="center" valign="middle" bgcolor="#FFFFCC" class="b-texthead"><p class="bigone style1"> ข้อมูลการบันทึกข้อมูล SDQ ของนักเรียนประเมินตนเอง ตามระดับ ม.<?php print $tb_room_class;?></p>
</td>
</tr>
<tr>
<td height="30" align="center" valign="middle" bgcolor="#FFFFFF" class="b-texthead"><table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#5E9829">
<tr class="headTable_mpt">
<td width="10%" height="30" align="center" nowrap="nowrap" ><span class="style4">ลำดับที่</span></td>
<td width="31%" nowrap="nowrap" >ระดับชั้น </td>
<td width="14%" align="center" nowrap="nowrap" >จำนวน นร. ทั้งหมด </td>
<td width="7%" align="center" nowrap="nowrap" >จำนวน นร. ที่ประเมิน </td>
<td width="8%" align="center" nowrap="nowrap" >นร.ที่ไม่ได้ประเมิน</td>
<td width="10%" align="center" nowrap="nowrap" >ปกติ</td>
<td width="10%" align="center" nowrap="nowrap" >เสี่ยง</td>
<td width="10%" align="center" nowrap="nowrap" >มีปัญหา</td>
</tr>
<?php
$query_disall = $db->query("select * FROM tb_rooms WHERE tb_room_class='".$tb_room_class."' and tb_room_status='1' and tb_room_id !='69' and tb_room_id !='70' and tb_room_id !='71' and tb_room_id !='72' and tb_room_id !='73' and tb_room_id !='74' order by tb_room_id asc ");
$numrow_disall = $db->num_rows($query_disall);
if($numrow_disall >0){
$i = 1;
$sum_scoretotal=0;
$totlestu=0;
while($fetch_disall = $db->fetch_array($query_disall)){
if($i%2=="1"){
$bg="rowone";
}else{
$bg="rowtwo";
}
$sqd_score ="select * FROM tb_sdq_student INNER JOIN tb_rooms ON tb_sdq_student.tb_room_id = tb_rooms.tb_room_id WHERE tb_sdq_student.tb_room_id='".$fetch_disall['tb_room_id']."' ";
$query_score = $db->query($sqd_score);
$numrow_stu = $db->num_rows($query_score);
$numa = 0;
$numb = 0;
$numc = 0;
$suma = 0;
$sumb = 0;
$sumc = 0;
$totlestu = 0;
$sum_stu = 0;
while($fetch_display_score = $db->fetch_array($query_score)){
$score_total1 = $fetch_display_score['tb_sdq_student_q3']+$fetch_display_score['tb_sdq_student_q8']+$fetch_display_score['tb_sdq_student_q13']+$fetch_display_score['tb_sdq_student_q16']+$fetch_display_score['tb_sdq_student_q24'];
$score_total2 = $fetch_display_score['tb_sdq_student_q5']+$fetch_display_score['tb_sdq_student_q7']+$fetch_display_score['tb_sdq_student_q12']+$fetch_display_score['tb_sdq_student_q18']+$fetch_display_score['tb_sdq_student_q22'];
$score_total3 = $fetch_display_score['tb_sdq_student_q2']+$fetch_display_score['tb_sdq_student_q10']+$fetch_display_score['tb_sdq_student_q15']+$fetch_display_score['tb_sdq_student_q21']+$fetch_display_score['tb_sdq_student_q25'];
$score_total4 = $fetch_display_score['tb_sdq_student_q6']+$fetch_display_score['tb_sdq_student_q11']+$fetch_display_score['tb_sdq_student_q14']+$fetch_display_score['tb_sdq_student_q19']+$fetch_display_score['tb_sdq_student_q23'];
$score_total5 = $fetch_display_score['tb_sdq_student_q1']+$fetch_display_score['tb_sdq_student_q4']+$fetch_display_score['tb_sdq_student_q9']+$fetch_display_score['tb_sdq_student_q17']+$fetch_display_score['tb_sdq_student_q20'];
$sum_scoretotal = $score_total1+$score_total2+$score_total3+$score_total4+$score_total5;
if($sum_scoretotal>="0" && $sum_scoretotal<="15"){
$suma += $numa+1;
}
if($sum_scoretotal>="16" && $sum_scoretotal<="17"){
$sumb += $numb+1;
}
if($sum_scoretotal>="18" && $sum_scoretotal<="40"){
$sumc += $numc+1;
}
$sum_stu =$fetch_num_check['num_check']; //นับจำนวน นร ทั้งหมด
}
$totle_stu +=$sum_stu;
$totle_suma +=$suma;
$totle_sumb +=$sumb;
$totle_sumc +=$sumc;
?>
<tr class="<?php echo $bg;?>">
<td height="25" align="center" nowrap="nowrap" ><?php print $i;?>.</td>
<td nowrap="nowrap" >ระดับชั้นมัธยมศึกษาปีที่ <?php print $fetch_disall['tb_room_name'];?></td>
<td align="center" nowrap="nowrap" ><?php
$fetch_num_allstu = $db->fetch_array($db->query("SELECT COUNT(tb_student_id) AS num_check FROM tb_students WHERE tb_student_degree='".$fetch_disall['tb_room_id']."' "));
echo $fetch_num_allstu['num_check'];
?></td>
<td align="center" nowrap="nowrap" ><?php
$fetch_num_check = $db->fetch_array($db->query("SELECT COUNT(tb_student_id) AS num_check FROM tb_sdq_student WHERE tb_room_id='".$fetch_disall['tb_room_id']."' "));
echo $fetch_num_check['num_check'];
?></td>
<td align="center" nowrap="nowrap" ><?php print $fetch_num_allstu['num_check']-$fetch_num_check['num_check'];?></td>
<td align="center" nowrap="nowrap" ><?php print $suma;?></td>
<td align="center" nowrap="nowrap" ><?php print $sumb;?></td>
<td align="center" nowrap="nowrap" ><?php print $sumc;?></td>
</tr>
<?php
$i++;
$sum_stunone +=$fetch_num_allstu['num_check']-$fetch_num_check['num_check'];
}
?>
<tr bgcolor="#FFCCCC">
<td height="30" colspan="3" align="right" bgcolor="#FFCFCE" class="bigone"><strong>สรุปผล</strong></td>
<td height="30" align="center" bgcolor="#FFCFCE" class="bigone"><strong><?php echo $totle_suma+$totle_sumb+$totle_sumc;?></strong></td>
<td height="30" align="center" bgcolor="#FFCFCE" class="bigone"><?php echo $sum_stunone;?></td>
<td align="center" bgcolor="#FFCFCE" class="bigone"><strong>
<?php if($totle_suma>0){echo $totle_suma;}else{echo "-";}?>
</strong></td>
<td align="center" bgcolor="#FFCFCE" class="bigone"><strong>
<?php if($totle_sumb>0){echo $totle_sumb;}else{echo "-";}?>
</strong></td>
<td align="center" bgcolor="#FFCFCE" class="bigone"><strong>
<?php if($totle_sumc>0){echo $totle_sumc;}else{echo "-";}?>
</strong></td>
</tr>
<?php
}else{
?>
<tr class="alertred">
<td colspan="8" align="center" bgcolor="#FFFFFF">ไม่พบข้อมูล</td>
</tr>
<?php
}
?>
</table></td>
</tr>
<?php
$page_size = 100;
if ($PAGE =="" || $PAGE =="0" ) {
$PAGE=1;
}
$goto = ($PAGE-1)*$page_size;
$limit = "limit $goto , $page_size";
if($keyword){
$sql_search =" and tb_room_name like '%".$keyword."%' ";
}
$sql = "select * from tb_rooms where tb_room_status='1' and tb_room_id !='69' and tb_room_id !='70' and tb_room_id !='71' and tb_room_id !='72' and tb_room_id !='73' and tb_room_id !='74' $sql_search order by tb_room_id asc ".$limit;
$sql_all="select * from tb_rooms where tb_room_status='1' and tb_room_id !='69' and tb_room_id !='70' and tb_room_id !='71' and tb_room_id !='72' and tb_room_id !='73' and tb_room_id !='74' $sql_search order by tb_room_id asc";
$query_dis = $db->query($sql);
$queryall = $db->query($sql_all);
$numrows = $db->num_rows($queryall);
if($numrows >0){
$i=1;
while($fetch_dis = $db->fetch_array($query_dis)){
if($i%2=="1"){
$bg="rowone";
}else{
$bg="rowtwo";
}
?>
<?php
$i++;
}
?>
<?php
}else{
?>
<?php
}
?>
</table>
</form>
</TD>
</TR>
<TR>
<TD height=100% vAlign=top background="images/vline.gif">
<IMG src="images/h1_.gif" width="8" height="100" id=ctrlMnu style="CURSOR: hand" onClick="ShowHidePanel('nav', 'ctrlMnu')" onMouseOver="this.style.filter='alpha(opacity=65);'" onMouseOut="this.style.filter='alpha(opacity=100);'"></TD>
</TR>
</tbODY>
</TABLE> </TD>
</TR>
<TR height="100%" >
<TD height="30" vAlign=bottom><?php include_once('footer.php'); ?></TD>
</TR>
</tbODY>
</TABLE>
</body>
</html>