Mini Shell
<?php
include 'head.php';
if ($s_status_user == 3) {
header("Location: login.php");
}
?>
<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<!-- Main Header -->
<?php include 'header.php'; ?>
<!-- Left side column. contains the logo and sidebar -->
<?php include 'leftside.php'; ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
ข้อมูลประวัติการลา
<small>จัดการข้อมูลประวัติการลา</small>
</h1>
<ol class="breadcrumb">
<li><a href="index.php"><i class="fa fa-dashboard"></i> เมนูหลัก</a></li>
<li class="active">ข้อมูลประวัติการลา</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<!-- Your Page Content Here -->
<br><br>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">ข้อมูลประวัติการลา</h3>
<div class="box-tools pull-right">
<!-- Buttons, labels, and many other things can be placed here! -->
<!-- Here is a label for example -->
<?php
$sql_teacher = "SELECT COUNT(*) AS COUNTTH FROM teacher WHERE status_user = 1 or status_user = 2 or status_user = 3";
$result_teacher = mysqli_query($link, $sql_teacher);
$count_teacher = mysqli_fetch_assoc($result_teacher);
?>
<span class="label label-primary">ทั้งหมด <?php echo $count_teacher['COUNTTH'];?> รายการ</span>
</div><!-- /.box-tools -->
</div><!-- /.box-header -->
<div class="box-body">
<table id="table" data-toggle="table" data-locale="th-TH" data-url="la_json.php"
data-pagination = "true"
data-page-size="10"
data-page-list ="[5,10,15,ALL]"
data-search ="true"
data-show-refresh ="true"
data-show-toggle ="true"
data-show-columns ="true"
data-show-export="true"
data-toolbar="#toolbar"
data-id-field="teacherID"
>
<thead>
<tr>
<th data-formatter="runningFormatter" data-align="center">ลำดับที่</th>
<th data-field="teacherID" data-align="center" data-sortable="true">รหัสบุคลากร</th>
<th data-field="titleName" data-sortable="true">คำนำหน้า</th>
<th data-field="name" data-sortable="true">ชื่อ</th>
<th data-field="lastName" data-sortable="true">นามสกุล</th>
<th data-field="year" data-sortable="true">ปีการศึกษา</th>
<th data-field="lasick" data-sortable="true">ลาป่วย</th>
<th data-field="laerrand" data-sortable="true">ลากิจ</th>
<th data-field="operate" data-align="center" data-events="operateEvents" data-formatter="operateFormatter">เครื่องมือ</th>
</tr>
</thead>
</table>
</div><!-- /.box-body -->
</div><!-- /.box -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<!-- Main Footer -->
<?php include 'footer.php'; ?>
</div>
<!-- ./wrapper -->
<!-- REQUIRED JS SCRIPTS -->
<!-- jQuery 2.2.3 -->
<script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="bootstrap/js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/app.min.js"></script>
<script src="bootstrap/js/sweetalert.min.js"></script>
<script src="bootstrap/js/smoke.min.js"></script>
<script src="bootstraptable/bootstrap-table.min.js"></script>
<script src="bootstraptable/extensions/export/bootstrap-table-export.min.js"></script>
<script src="bootstraptable/extensions/export/tableExport.js"></script>
<script src="bootstraptable/locale/bootstrap-table-th-TH.min.js"></script>
<script>
var $table = $('#table'),
$remove = $('#remove');
$(function () {
$table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table', function () {
$remove.prop('disabled', !$table.bootstrapTable('getSelections').length);
});
$remove.click(function () {
$.smkConfirm({text: 'แน่ใจว่าต้องการลบข้อมูล ?', accept: 'ตกลง', cancel: 'ยกเลิก'}, function (e) {
if (e) {
var ids = $.map($table.bootstrapTable('getSelections'), function (row) {
return row.teacherID;
});
//alert(ids);
//ajax delete
$.get("del_teacher.php", {"teacherID[]": ids})
.done(function (data) {
if (data.status === "success") {
$.smkAlert({text: data.message, type: data.status});
} else {
$.smkAlert({text: data.message, type: data.status});
}
$table.bootstrapTable('refresh');
});
$remove.prop('disabled', true);
//uncheck
$table.bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination');
}
});
});
});
function priceFormatter(value) {
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
;
}
function operateFormatter(value, row, index) {
return [
'<a class="btn btn-warning btn-xs view" href="javascript:void(0)" title="ดูรายละเอียด">',
'<i class="fa fa-eye"></i></a>',
'</a> ',
' <a class="btn bg-maroon btn-xs edit" href="javascript:void(0)" title="เพิ่มข้อมูล">',
'<i class="fa fa-plus"></i>',
'</a> '
].join('');
}
window.operateEvents = {
'click .edit': function (e, value, row, index) {
var teacherID = [row.teacherID];
//alert('You click like action, row: ' + row.prodID);
$(location).attr('href', 'frm_la.php?teacherID='+teacherID); //redirect to your url
},
'click .view': function (e, value, row, index) {
var teacherID = [row.teacherID];
//alert('You click like action, row: ' + row.prodID);
$(location).attr('href', 'show_la.php?teacherID='+teacherID); //redirect to your url
}
};
//ลำดับ1,2,3
function runningFormatter(value, row, index) {
return 1+index;
}
</script>
<!-- Optionally, you can add Slimscroll and FastClick plugins.
Both of these plugins are recommended to enhance the
user experience. Slimscroll is required when using the
fixed layout. -->
</body>
</html>
Zerion Mini Shell 1.0