| Server IP : 104.21.80.248 / 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/edu2018/admin/ |
Upload File : |
<?php
$x1= $mysqli->query("SELECT * FROM student where class='ปวช1' AND active='yes' AND prefix='เด็กชาย' OR prefix='นาย'");
$r1=mysqli_num_rows($x1);
$x2= $mysqli->query("SELECT * FROM student where class='ปวช2' AND active='yes' AND prefix='เด็กชาย' OR prefix='นาย'");
$r2=mysqli_num_rows($x2);
$x3= $mysqli->query("SELECT * FROM student where class='ปวช3' AND active='yes' AND prefix='เด็กชาย' OR prefix='นาย'");
$r3=mysqli_num_rows($x3);
$m1= $mysqli->query("SELECT * FROM student where class='ปวช1' AND active='yes' AND prefix='เด็กหญิง' OR prefix='นางสาว'");
$f1=mysqli_num_rows($m1);
$m2= $mysqli->query("SELECT * FROM student where class='ปวช2' AND active='yes' AND prefix='เด็กหญิง' OR prefix='นางสาว'");
$f2=mysqli_num_rows($m2);
$m3= $mysqli->query("SELECT * FROM student where class='ปวช3' AND active='yes' AND prefix='เด็กหญิง' OR prefix='นางสาว'");
$f3=mysqli_num_rows($m3);
?>
<style>
th { font-size: 15px; }
td { font-size: 14px; }
</style>
<section class="content-header">
<h1>
ฐานข้อมูลนักเรียน
<small>Version 2.0</small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Dashboard</li>
</ol>
</section>
<section class="content">
<!-- Info boxes -->
<div class="row">
<div class="col-lg-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<?php
$sql2= $mysqli->query("SELECT * FROM student where prefix='เด็กหญิง' OR prefix='นางสาว' AND active='yes'");
$total2=mysqli_num_rows($sql2);
?>
<h3><?=number_format($total2);?> คน</h3>
<p>นักเรียนหญิง</p>
</div>
<div class="icon">
<i class="ion-stats-bars"></i>
</div>
<a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<?php
$sql1= $mysqli->query("SELECT * FROM student where prefix='เด็กชาย' OR prefix='นาย' AND active='yes'");
$total1=mysqli_num_rows($sql1);
?>
<h3><?=number_format($total1);?> คน</h3>
<p>นักเรียนชาย</p>
</div>
<div class="icon">
<i class="ion ion-person"></i>
</div>
<a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<?php
$sql= $mysqli->query("SELECT * FROM student where active='yes'");
$total=mysqli_num_rows($sql);
?>
<h3><?=number_format($total);?> คน</h3>
<p>นักเรียนทั้งหมด</p>
</div>
<div class="icon">
<i class="ion ion-person"></i>
</div>
<a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<!-- /.row -->
<!-- Main row -->
<div class="row">
<!-- Left col -->
<div class="col-md-8">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">กราฟข้อมูลนักเรียน</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="col-md-6">
<div class="row">
<canvas id="barChart" style="height:140px"></canvas>
</div>
<div class="row">
<center><img src="../img/01.png"> นักเรียนชาย <img src="../img/02.png"> นักเรียนหญิง</center>
</div>
<script src="../bower_components/chart.js/Chart.js"></script>
<script>
$(function () {
/* ChartJS
* -------
* Here we will create a few charts using ChartJS
*/
//--------------
//- AREA CHART -
//--------------
// Get context with jQuery - using jQuery's .get() method.
//var areaChartCanvas = $('#areaChart').get(0).getContext('2d')
// This will get the first returned node in the jQuery collection.
//var areaChart = new Chart(areaChartCanvas)
var areaChartData = {
labels : ['ปวช1', 'ปวช2', 'ปวช3'],
datasets: [
{
label : 'ชาย',
fillColor : 'rgba(210, 214, 222, 1)',
strokeColor : 'rgba(210, 214, 222, 1)',
pointColor : 'rgba(210, 214, 222, 1)',
pointStrokeColor : '#c1c7d1',
pointHighlightFill : '#fff',
pointHighlightStroke: 'rgba(220,220,220,1)',
data : [<?=$r1;?>, <?=$r2;?>, <?=$r3;?>]
},
{
label : 'หญิง',
fillColor : 'rgba(60,141,188,0.9)',
strokeColor : 'rgba(60,141,188,0.8)',
pointColor : '#3b8bba',
pointStrokeColor : 'rgba(60,141,188,1)',
pointHighlightFill : '#fff',
pointHighlightStroke: 'rgba(60,141,188,1)',
data : [<?=$f1;?>, <?=$f2;?>, <?=$f3;?>]
}
]
}
//-------------
//- BAR CHART -
//-------------
var barChartCanvas = $('#barChart').get(0).getContext('2d')
var barChart = new Chart(barChartCanvas)
var barChartData = areaChartData
barChartData.datasets[1].fillColor = '#00a65a'
barChartData.datasets[1].strokeColor = '#00a65a'
barChartData.datasets[1].pointColor = '#00a65a'
var barChartOptions = {
//Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
scaleBeginAtZero : true,
//Boolean - Whether grid lines are shown across the chart
scaleShowGridLines : true,
//String - Colour of the grid lines
scaleGridLineColor : 'rgba(0,0,0,.05)',
//Number - Width of the grid lines
scaleGridLineWidth : 1,
//Boolean - Whether to show horizontal lines (except X axis)
scaleShowHorizontalLines: true,
//Boolean - Whether to show vertical lines (except Y axis)
scaleShowVerticalLines : true,
//Boolean - If there is a stroke on each bar
barShowStroke : true,
//Number - Pixel width of the bar stroke
barStrokeWidth : 2,
//Number - Spacing between each of the X value sets
barValueSpacing : 5,
//Number - Spacing between data sets within X values
barDatasetSpacing : 1,
//String - A legend template
legendTemplate : '<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].fillColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>',
//Boolean - whether to make the chart responsive
responsive : true,
maintainAspectRatio : true
}
barChartOptions.datasetFill = false
barChart.Bar(barChartData, barChartOptions)
})
</script>
</div>
<div class="col-md-6">
<table class="table table-bordered table-striped table-hover">
<?php
$SQLin= $mysqli->query("SELECT * FROM `student` GROUP BY `student`.`rsroom`");
while($Rowin=mysqli_fetch_array($SQLin)) {
?>
<tr>
<td> <?=$Rowin['rsroom'];?></td>
<?php
$inroom= $mysqli->query("SELECT * FROM student where rsroom='$Rowin[rsroom]' and status='in' AND active='yes'");
$in1=mysqli_num_rows($inroom);
$outroom= $mysqli->query("SELECT * FROM student where rsroom='$Rowin[rsroom]' and status='out' AND active='yes'");
$out1=mysqli_num_rows($outroom);
?>
<td align="center">อยู่ <?=$in1;?> คน</td>
<td align="center">กลับ <?=$out1;?> คน</td>
</tr>
<?php } ?>
</table>
</div>
<!-- /.table-responsive -->
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
<div class="col-md-4">
<!-- Info Boxes Style 2 -->
<div class="info-box bg-red">
<span class="info-box-icon"><i class="ion ion-ios-people"></i></span>
<div class="info-box-content">
<span class="info-box-text"><b>ปวช.1</b></span>
<span class="info-box-number">ทั้งหมด <?php $sclass1=number_format(($r1+$f1)); echo "$sclass1";?> คน </span>
<div class="progress">
<?php $per1=($sclass1*100)/100;?>
<div class="progress-bar" style="width: <?=$per1;?>%"></div>
</div>
<span class="progress-description">
ชาย <?=$r1;?> คน | หญิง <?=$f1;?> คน
</span>
</div>
</div>
<div class="info-box bg-yellow">
<span class="info-box-icon"><i class="ion ion-ios-people"></i></span>
<div class="info-box-content">
<span class="info-box-text"><b>ปวช.2</b></span>
<span class="info-box-number">ทั้งหมด <?php $sclass2=number_format(($r2+$f2)); echo "$sclass2";?> คน </span>
<div class="progress">
<?php $per2=($sclass2*100)/100;?>
<div class="progress-bar" style="width: <?=$per2;?>"></div>
</div>
<span class="progress-description">
ชาย <?=$r2;?> คน | หญิง <?=$f2;?> คน
</span>
</div>
<!-- /.info-box-content -->
</div>
<div class="info-box bg-aqua">
<span class="info-box-icon"><i class="ion ion-ios-people"></i></span>
<div class="info-box-content">
<span class="info-box-text"><b>ปวช.3</b></span>
<span class="info-box-number">ทั้งหมด <?php $sclass3=number_format(($r3+$f3)); echo "$sclass3";?> คน </span>
<div class="progress">
<?php $per3=($sclass3*100)/100;?>
<div class="progress-bar" style="width: <?=$per3;?>%"></div>
</div>
<span class="progress-description">
ชาย <?=$r3;?> คน | หญิง <?=$f3;?> คน
</span>
</div>
</div>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>