| 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 : /Inetpub/www/news/elearning/ |
Upload File : |
<?php
require './configs/app_top.php';
$title = "ยินดีต้อนรับสู่แบบทดสอบออนไลน์";
include './includes/header.php';
?>
<style type="text/css">
footer {
position: relative;
bottom: 0;
left: 0;
right: 0;
height:90px;
}
</style>
<div class="preload">
<img src="loading_spinner.gif" /></div>
<div class="content">
<div class="container mainbody">
<div class="col-12">
<div class="clearfix"></div>
<div class="clearfix"></div>
</div>
<div class="padding5 clearfix"></div>
<div class="col-12">
<div class="center">
<div class="panel-body">
<div class="margin2">
<?php
$idsubject=$_GET["s"];
$sql1 = "select count(*) as count FROM " . TBL_USERS . " u "
. "INNER JOIN " . TBL_TEST_RESULTS . " tt ON u.user_id = tt.tr_user_id "
. "INNER JOIN " . TBL_SUBJECTS . " s ON tt.tr_subject_id = s.sb_id "
. "WHERE tr_subject_id=$idsubject ORDER BY number_no ASC";
try {
$stmt = $DB->prepare($sql1);
$stmt->execute();
$results = $stmt->fetchAll();
$total = $results[0]["count"];
$pagination = new Pagination($total, $_GET["pagenum"], 30);
$total_pages = $pagination->total_pages();
if ($total_pages > 0) {
$sql2 = "select u.user_fullname, u.user_email,u.user_class, s.sb_name, tt.tr_total_question, tt.tr_correct_answer, tt.tr_exam_date, tt.tr_time_taken"
. " FROM " . TBL_USERS . " u "
. "INNER JOIN " . TBL_TEST_RESULTS . " tt ON u.user_id = tt.tr_user_id "
. "INNER JOIN " . TBL_SUBJECTS . " s ON tt.tr_subject_id = s.sb_id "
. "WHERE tr_subject_id=$idsubject ORDER by u.user_class ASC " . " LIMIT " . $pagination->get_lower_limit() . " , " . 30 . "";
$stmt = $DB->prepare($sql2);
$stmt->execute();
$results = $stmt->fetchAll();
}
} catch (Exception $ex) {
echo $ex->getMessage();
}
?>
<?php if ($ERROR_TYPE <> "") { ?>
<div class="col-12">
<div class="alert alert-<?php echo $ERROR_TYPE; ?>">
<button data-dismiss="alert" class="close" type="button">×</button>
<?php echo $ERROR_MSG; ?>
</div>
</div>
<?php } ?>
<div class="clearfix"></div>
<div class="row">
<div class="col-12">
<?php
include './configs/host.php';
$chk_num="select * from exp_subjects WHERE sb_id='$idsubject' ";
$result2=mysql_query($chk_num);
$record2 = mysql_fetch_array($result2);
$sbname1=$record2['sb_name'];
?>
<div class="padding5 clearfix"><b><h3>ผลการสอบรายวิชา <?php echo "$sbname1"; ?></h3></b><br>
<a href="exls.php?idsubject=<?php echo $idsubject ?>">
<button class="btn btn-sm btn-success" type="button"><span class="glyphicon glyphicon-floppy-disk"></span> ส่งออกเป็น Excel</button>
</a>
<button class="btn btn-sm btn-warning" type="button"><span class="glyphicon glyphicon-edit"></span> ห้อง1</button>
<button class="btn btn-sm btn-warning" type="button"><span class="glyphicon glyphicon-edit"></span> ห้อง2</button>
<button class="btn btn-sm btn-warning" type="button"><span class="glyphicon glyphicon-edit"></span> ห้อง3</button>
<button class="btn btn-sm btn-warning" type="button"><span class="glyphicon glyphicon-edit"></span> ห้อง4</button>
<button class="btn btn-sm btn-warning" type="button"><span class="glyphicon glyphicon-edit"></span> ห้อง5</button>
<button class="btn btn-sm btn-warning" type="button"><span class="glyphicon glyphicon-edit"></span> ห้อง6</button>
</div>
<?php if ($total_pages > 0) { ?>
<table class="table table-hover table-datatable table-striped table-bordered">
<thead>
<tr>
<th style="text-align: center;" width="50px">ที่</th>
<th style="text-align: center;" width="100px">เลขประจำตัว</th>
<th style="text-align: center;">ชื่อ-นามสกุล</th>
<th style="text-align: center;">ชั้น</th>
<th style="text-align: center;">คะแนน</th>
<th style="text-align: center;">ร้อยละ</th>
<th style="text-align: center;">เวลา</th>
<th style="text-align: center;" width="240px">วันสอบ</th>
</tr>
</thead>
<tbody>
<?php if($_GET["pagenum"]=="") {$_GET["pagenum"]=1;}?>
<?php $i = ($_GET["pagenum"]*30)-30; ?>
<?php foreach ($results as $r) { ?>
<?php $i++ ?>
<tr>
<td style="text-align: center;"><?php echo "$i"; ?></td> <td style="text-align: center;"><?php echo safe_output($r["user_email"]) ?></td>
<td style="text-align: left;"><?php echo safe_output($r["user_fullname"]) ?></td>
<td style="text-align: center;"> <?php echo safe_output($r["user_class"]) ?> </td>
<td style="text-align: center;"><?php echo safe_output($r["tr_correct_answer"]) ?></td>
<td style="text-align: center;">
<?php
$k = 0;
if ($r["tr_correct_answer"] != 0) {
$k = ($r["tr_correct_answer"]/$r["tr_total_question"]) * 100;
}
echo $k = number_format($k, 2);
?>%</td>
<td style="text-align: center;"><?php echo safe_output($r["tr_time_taken"]) ?></td>
<td style="text-align: left;"><?php echo date("jS F Y, h:i:s A", strtotime(safe_output($r["tr_exam_date"]))); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<div class="col-12 center">
<ul class="pagination">
<?php $pagination->display_links($PAGE_NAME); ?>
</ul>
</div><center>ทั้งหมด <?php echo $total; ?> รายการ</center>
<?php } else { ?>
<h3>ไม่พบข้อมูล</h3>
<?php } ?>
</div>
</div>
<script>
jQuery(function() {
jQuery('#confirm-delete').on('show.bs.modal', function(e) {
jQuery(this).find('.danger').attr('href', jQuery(e.relatedTarget).data('href'));
});
});
</script>
</div>
</div>
</div>
</div>
<div class="padding30 clearfix"></div>
<div class="padding30 clearfix"></div>
<?php
include './includes/footer.php';
require './configs/app_bottom.php';
?>
<script>
$(function() {
$(".preload").fadeOut(2000, function() {
$(".content").fadeIn(1000);
});
});
</script>
</div>