| 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/news/edu2018/admin/ |
Upload File : |
<style>
th { font-size: 15px; }
td { font-size: 15px; }
</style>
<?php if($userlevel=="admin") { ?>
<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">
<div class="box">
<div class="box-header">
<h3 class="box-title">เพิ่ม-ตัดคะแนนความประพฤติ </h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<?php
$SQL1 = $mysqli->query("SELECT * FROM student where `active`='yes'");
?>
<table id="example1" class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th width="20">NO</th>
<th align='center' width="100">รหัส</th>
<th align='center'>ชื่อ-นามสกุล</th>
<th align='center' width="70">ชื่อเล่น</th>
<th align='center' width="50">ชั้น</th>
<th width="80"><center>เพิ่มคะแนน</center></th>
<th width="75"><center>ตัดคะแนน</center></th>
<th width="150"><center>จัดการ</center></th>
</tr>
</thead>
<tbody>
<?php
$s=0;
while($R=mysqli_fetch_array($SQL1)) {
$s++
?>
<tr>
<td align="center"><?=$s;?></td>
<td align="center"><?=$R["code"];?></td>
<td align='left'><?=$R["prefix"];?><?=$R["name"];?> <?=$R["sname"];?></td>
<td><?=$R["nicname"];?></td>
<td align='center'><?=$R["class"];?></td>
<td align='center'>
<?php
$SQL5 = $mysqli->query("SELECT
`score`.`code`,
`score`.`date`,
`score`.`detail`,
`score`.`teacher`,
`catscore`.`status`,
`catscore`.`title`,
`catscore`.`score`,
SUM(score) AS totalscore
FROM
`score`
INNER JOIN `catscore` ON `score`.`idcat` = `catscore`.`Id` where code='$R[code]' AND status='add'");
while($Row5=mysqli_fetch_array($SQL5)) {
$sum5 = $Row5['totalscore'];
$SQL51= $mysqli->query("SELECT * FROM score INNER JOIN `catscore` ON `score`.`idcat` = `catscore`.`Id` where code='$R[code]' AND `catscore`.`status`='add'");
$total51=mysqli_num_rows($SQL51);
}
if ($total51==""){}else{
echo "<font color='#00b300'>+$sum5</font>";
}
?>
</td>
<td align='center'>
<?php
$SQL6 = $mysqli->query("SELECT
`score`.`code`,
`score`.`date`,
`score`.`detail`,
`score`.`teacher`,
`catscore`.`status`,
`catscore`.`title`,
`catscore`.`score`,
SUM(score) AS totalscore
FROM
`score`
INNER JOIN `catscore` ON `score`.`idcat` = `catscore`.`Id` where code='$R[code]' AND status='rem'");
while($Row6=mysqli_fetch_array($SQL6)) {
$sum6 = $Row6['totalscore'];
$SQL61= $mysqli->query("SELECT * FROM score INNER JOIN `catscore` ON `score`.`idcat` = `catscore`.`Id` where code='$R[code]' AND `catscore`.`status`='rem'");
$total61=mysqli_num_rows($SQL61);
}
if ($total61==""){}else{
echo "<font color='#e60000'>-$sum6</font>";
}
?>
</td>
<td align="center">
<a href="index.php?dash=<?=md5("10");?>&code=<?=$R['code'];?>&op=spread&m=7"><button type="button" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon glyphicon-stats"></span> ข้อมูล</button></a>
<button type="button" class="btn btn-info btn-xs" data-toggle = "modal" data-target="#sc<?=$R["code"];?>"> เพิ่ม-ตัดคะแนน</button>
<div class="modal fade" id="sc<?=$R['code'];?>" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">เลือกประเภทพฤติกรรม </h4>
</div>
<div class="modal-body">
<?php
$SQL2 = $mysqli->query("SELECT * FROM catscore ");
?>
<table id="txt<?=$s;?>" class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th width="20">NO</th>
<th><center>พฤติกรรม</center></th>
<th width="70" align='center'>เลือก</th>
</tr>
</thead>
<?php
$i=0;
while($R2=mysqli_fetch_array($SQL2)) {
$i++
?>
<tr>
<td align="center" width="20"><?=$i;?></td>
<td style="width:98%"><?=$R2["title"];?></td>
<td width="70" align="center">
<?php if($R2["status"]=="add"){?>
<a href="index.php?dash=<?=md5("17");?>&code=<?=$R['code'];?>&idcat=<?=$R2["Id"];?>&update=adduscore&op=spread&m=7"><button type="button" class="btn btn-success btn-xs">เพิ่มคะแนน </button></a>
<?php }else if ($R2["status"]=="rem") {?>
<a href="index.php?dash=<?=md5("17");?>&code=<?=$R['code'];?>&idcat=<?=$R2["Id"];?>&update=remuscore&op=spread&m=7"><button type="button" class="btn btn-danger btn-xs">ตัดคะแนน </button></a>
<?php } ?>
</td>
</tr>
<?php } ?>
</table> <br><font color="#53c653"><?=$R["prefix"];?><?=$R["name"];?> <?=$R["sname"];?></font>
<script>
$(function () {
$('#txt<?=$s;?>').DataTable({
'paging' : true,
'pageLength' : 6
})
})
</script>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">ยกเลิก</button>
<button class="btn btn-info" type="submit" name="submit">ตกลง</button>
</div>
</div>
</div>
</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
</section>
<?php } ?>
<br><br><br><br><br><br><br><br><br>