| Direktori : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/sp/admin_gard_new/ |
| Current File : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/sp/admin_gard_new/descending.php |
<!doctype html>
<html lang="en">
<!-- head -->
<?php
include 'head.php';
?>
<body>
<div class="wrapper">
<!-- เมนูด้านซ้าย -->
<?php include 'leftside.php'; ?>
<div class="main-panel">
<!-- ส่วนหัว -->
<?php include 'header.php'; ?>
<?php
include 'function_date.php';
?>
<div class="content">
<div class="container-fluid">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="home.php">หน้าหลัก</a></li>
<li class="breadcrumb-item active" aria-current="page">รายงานผลการเรียนจากมากไปหาน้อยของระดับชั้นเรียน</a></li>
</ol>
</nav>
<div class="col-md-4">
<div class="card">
<div class="card-header card-header-icon" data-background-color="rose">
<i class="fad fa-sort-up fa-2x"></i>
</div>
<form class="form-horizontal" id="form_report1" action="descending.php" method="get" >
<div class="card-content">
<h4 class="card-title">กรุณาเลือก</h4>
<?php
$Query_1 = mysqli_query($link2,'SELECT * FROM level_class') or die('Error query #12');
?>
<div class="form-group">
<label class="label-control">กรุณาเลือกชั้นเรียน</label>
<select name="level_class" id="level_class" class="form-control" data-style="btn btn-info btn-round" required>
<option value="">กรุณาเลือก...</option>
<?php
while ($Result_1 = mysqli_fetch_array($Query_1)) {
?>
<option value="<?php echo $Result_1['lc_id']; ?>">
<?php echo $Result_1['lc_name']; ?>
</option>
<?php
}
?>
</select>
</div>
</div>
<div class="row">
<label class="col-md-3"></label>
<div class="col-md-9">
<div class="form-group form-button">
<button type="submit" class="btn btn-fill btn-rose"><i class="fad fa-eye fa-lg"></i> แสดง</button>
</div>
</div>
</div>
</form>
</div>
</div>
<?php
$class = isset($_GET['level_class']) ? $_GET['level_class'] : '';
$sql_report = "SELECT * FROM users_dg left JOIN class_room ON users_dg.user_class_id = class_room.class_id left JOIN level_class ON class_room.lc_id = level_class.lc_id WHERE (`year`='$s_year') AND (class_room.`lc_id`='$class') ORDER BY score_sum desc ";
$result_report = mysqli_query($link2, $sql_report);
?>
<div class="col-lg-8 col-md-12">
<div class="card">
<div class="card-header card-header-tabs" data-background-color="rose">
<h4 class="card-title">รายงานผลการเรียนจากมากไปหาน้อยของระดับชั้นเรียน</h4>
<p class="category">ประถมศึกษาปีที่ <?php echo $class; ?></p>
</div>
<div class="card-content table-responsive">
<table id="datatables" class="table table-hover">
<thead class="text-warning">
<th class="text-center">ลำดับที่</th>
<th class="text-center">ห้องเรียน</th>
<th class="text-center">รหัสนักเรียน</th>
<th>ชื่อ</th>
<th>นามสกุล</th>
<th class="text-center">คะแนนรวม</th>
<th class="text-center">เกรดเฉลี่ย</th>
</thead>
<?php
$i=1;
while ($row_report = mysqli_fetch_array($result_report)) { ?>
<tbody>
<?php
$title_name = $row_report['sex'];
if ($title_name == 1) {
$title_name = "เด็กชาย";
} else {
$title_name = "เด็กหญิง";
}
?>
<tr>
<td class="text-center"><?php echo $i; ?></td>
<td class="text-center"><?php echo $row_report['class_name']; ?></td>
<td class="text-center"><?php echo $row_report['username']; ?></td>
<td><?php echo $title_name.$row_report['name_peple']; ?></td>
<td><?php echo $row_report['sname_peple']; ?></td>
<td class="text-center"><?php echo $row_report['score_sum']; ?></td>
<?php $averg_1 = $row_report['averg']; ?>
<?php
$averg = $row_report['averg'];
if (($averg == "")or ( $averg == 0)) {
$averg_full = "ยังไม่ประเมินผล";
} else {
$averg_full = number_format($averg_1, 2) . "";
}
?>
<td class="text-center"><?php echo $averg_full; ?> </td>
</tr>
<?php $i++; } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- footer1 -->
<?php include 'footer1.php'; ?>
</div>
</div>
<!-- footer2 -->
<?php include 'footer2.php'; ?>
<!-- Mirrored from demos.creative-tim.com/material-dashboard-pro/examples/dashboard.html by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 20 Mar 2017 21:32:16 GMT -->
</html>