Mini Shell
<!doctype html>
<html lang="en">
<!-- head -->
<?php include 'head.php'; ?>
<?php include 'db/database.php'; ?>
<body>
<div class="wrapper">
<!-- เมนูด้านซ้าย -->
<?php include 'leftside.php'; ?>
<div class="main-panel">
<!-- ส่วนหัว -->
<?php include 'header.php'; ?>
<div class="content">
<div class="container-fluid">
<div class="col-md-12">
<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">จัดการสูตรปุ๋ยผสม</li>
</ol>
</nav>
<a href="addformula.php">
<button type="button" class="btn btn-primary"><i class="material-icons"><i class="fas fa-folder-plus"></i></i> เพิ่มสูตรปุ๋ยผสม</button>
</a>
<?php
$sql = "SELECT * FROM formula ORDER BY formulaID DESC";
$result = mysqli_query($link, $sql);
?>
<div class="card">
<div class="card-header card-header-icon" data-background-color="rose">
<i class="material-icons"><i class="fas fa-calendar-week"></i></i>
</div>
<h4 class="card-title">จัดการสูตรปุ๋ยผสม</h4>
<div class="card-content">
<div class="table-responsive">
<table id="pui" class="table table-striped table-no-bordered table-hover" cellspacing="0" width="100%" style="width:100%">
<thead>
<tr>
<th class="text-center">ลำดับ</th>
<th>ชื่อสูตรปุ๋ยผสม</th>
<th>แม่ปุ๋ย(46-0-0)</th>
<th>แม่ปุ๋ย(18-46-0)</th>
<th>แม่ปุ๋ย(0-0-60)</th>
<th class="text-right">จัดการ</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
while ($row = mysqli_fetch_array($result)) { ?>
<tr>
<td class="text-center"><?php echo $i; ?></td>
<td><?php echo $row['name_formula']; ?> </td>
<td><?php echo $row['46-0-0']; ?> </td>
<td><?php echo $row['18-46-0']; ?></td>
<td> <?php echo $row['0-0-60']; ?></td>
<td class="td-actions text-right">
<a href="frm_editformula.php?formulaID=<?php echo $row['formulaID']; ?>" title="แก้ไขข้อมูล" type="button" rel="tooltip" class="btn btn-success btn-round">
<i class="material-icons"><i class="far fa-edit"></i></i>
</a>
<button id="<?php echo $row['formulaID']; ?>" title="ลบข้อมูล" rel="tooltip" class="btn btn-danger btn-round">
<i class="material-icons"><i class="far fa-times-circle"></i></i>
</button >
</td>
</tr>
<?php $i++; } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- footer1 -->
<?php include 'footer1.php'; ?>
</div>
</div>
<!-- footer2 -->
<?php include 'footer2.php'; ?>
<script>
$(document).ready(function(){
$(".btn-danger").on("click",function(e) {
//delete confirm
var uid = $(this).attr('id');
swal({
title: "คุณแน่ใจหรือไม่ว่าต้องการลบข้อมูล?",
text: "คุณจะไม่สามารถกู้คืนข้อมูลนี้ได้อีก!",
type: "warning",
showCancelButton: true,
confirmButtonColor: '#d33',
confirmButtonText: "ตกลง, ลบข้อมูล!",
cancelButtonText: "ยกเลิก..",
closeOnConfirm: false,
closeOnCancel: false
},
function(isConfirm) {
if (isConfirm) {
$.get("del_formula.php", {id : uid})
.done(function (data) {
if (data.status === "success") {
$.smkAlert({text: data.message, type: data.status});
} else {
$.smkAlert({text: data.message, type: data.status});
}
location.reload();
});
} else {
swal("ยกเลิก", "ข้อมูลของคุณยังไม่ถูกลบ :)", "error");
}
});
e.preventDefault();
});
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#pui').DataTable({
"pagingType": "full_numbers",
"lengthMenu": [
[10, 25, 50, -1],
[10, 25, 50, "All"]
],
responsive: true,
language: {
search: "_INPUT_",
"emptyTable": "ไม่มีข้อมูลในตาราง",
"info": "แสดง _START_ ถึง _END_ จาก _TOTAL_ แถว",
"infoFiltered": "(กรองข้อมูล _MAX_ ทุกแถว)",
"infoThousands": ",",
"lengthMenu": "แสดง _MENU_ แถว",
"loadingRecords": "กำลังโหลดข้อมูล...",
"processing": "กำลังดำเนินการ...",
"zeroRecords": "ไม่พบข้อมูล",
"paginate": {
"first": "หน้าแรก",
"previous": "ก่อนหน้า",
"next": "ถัดไป",
"last": "หน้าสุดท้าย"
},
"aria": {
"sortAscending": ": เปิดใช้งานการเรียงข้อมูลจากน้อยไปมาก",
"sortDescending": ": เปิดใช้งานการเรียงข้อมูลจากมากไปน้อย"
},
"autoFill": {
"cancel": "ยกเลิก",
"fill": "กรอกทุกช่องด้วย",
"fillHorizontal": "กรอกตามแนวนอน",
"fillVertical": "กรอกตามแนวตั้ง"
},
"buttons": {
"collection": "ชุดข้อมูล",
"colvis": "การมองเห็นคอลัมน์",
"colvisRestore": "เรียกคืนการมองเห็น",
"copy": "คัดลอก",
"copyKeys": "กดปุ่ม Ctrl หรือ Command + C เพื่อคัดลอกข้อมูลบนตารางไปยัง Clipboard ที่เครื่องของคุณ",
"copySuccess": {
"_": "คัดลอกช้อมูลแล้ว จำนวน %ds แถว",
"1": "คัดลอกข้อมูลแล้ว จำนวน 1 แถว"
},
"copyTitle": "คัดลอกไปยังคลิปบอร์ด",
"csv": "CSV",
"excel": "Excel",
"pageLength": {
"_": "แสดงข้อมูล %d แถว",
"-1": "แสดงข้อมูลทั้งหมด"
},
"pdf": "PDF",
"print": "สั่งพิมพ์",
"createState": "สร้างสถานะ",
"removeAllStates": "ลบสถานะทั้งหมด",
"removeState": "ลบสถานะ",
"renameState": "เปลี่ยนชื่อสถานะ",
"savedStates": "บันทึกสถานะ",
"stateRestore": "คืนค่าสถานะ",
"updateState": "แก้ไขสถานะ"
},
"infoEmpty": "แสดงทั้งหมด 0 to 0 of 0 รายการ",
"thousands": ",",
"datetime": {
"amPm": [
"เที่ยงวัน",
"เที่ยงคืน"
],
"hours": "ชั่วโมง",
"minutes": "นาที",
"months": {
"0": "มกราคม",
"1": "กุมภาพันธ์",
"10": "พฤศจิกายน",
"11": "ธันวาคม",
"2": "มีนาคม",
"3": "เมษายน",
"4": "พฤษภาคม",
"5": "มิถุนายน",
"6": "กรกฎาคม",
"7": "สิงหาคม",
"8": "กันยายน",
"9": "ตุลาคม"
},
"next": "ถัดไป",
"seconds": "วินาที",
"unknown": "ไม่ทราบ",
"weekdays": [
"วันอาทิตย์",
"วันจันทร์",
"วันอังคาร",
"วันพุธ",
"วันพฤหัส",
"วันศุกร์",
"วันเสาร์"
],
"previous": "ก่อนหน้า"
},
"editor": {
"close": "ปิด",
"create": {
"button": "สร้าง",
"submit": "สร้างข้อมูล",
"title": "สร้างข้อมูลใหม่"
},
"edit": {
"button": "แก้ไข",
"submit": "บันทึก",
"title": "แก้ไขข้อมูล"
},
"error": {
"system": "เกิดข้อผิดพลาดของระบบ (<a target=\"\\\" rel=\"nofollow\" href=\"\\\">ดูข้อมูลเพิ่มเติม)."
},
"remove": {
"button": "ลบ",
"submit": "ลบข้อมูล",
"title": "ลบข้อมูล",
"confirm": {
"_": "คุณแน่ใจที่จะลบข้อมูล %d รายการนี้ หรือไม่?",
"1": "คุณแน่ใจที่จะลบข้อมูลรายการนี้ หรือไม่?"
}
},
"multi": {
"restore": "ยกเลิกการแก้ไข",
"title": "หลายค่า",
"info": "รายการที่เลือกมีค่าที่แตกต่างกันสำหรับอินพุตนี้ หากต้องการแก้ไขและตั้งค่ารายการทั้งหมดสำหรับการป้อนข้อมูลนี้เป็นค่าเดียวกัน ให้คลิกหรือแตะที่นี่ มิฉะนั้น รายการเหล่านั้นจะคงค่าแต่ละรายการไว้",
"noMulti": "อินพุตนี้สามารถแก้ไขทีละรายการได้ แต่ไม่สามารถแก้ไขเป็นส่วนหนึ่งของกลุ่มได้"
}
},
"searchBuilder": {
"add": "เพิ่มเงื่อนไข",
"clearAll": "ยกเลิกทั้งหมด",
"condition": "เงื่อนไข",
"data": "ข้อมูล",
"deleteTitle": "ลบเงื่อนไขการกรอง",
"logicAnd": "และ",
"logicOr": "หรือ",
"button": {
"0": "สร้างการค้นหา",
"_": "ตัวสร้างการค้นหา (%d)"
},
"conditions": {
"date": {
"after": "ก่อน",
"before": "ก่อน",
"between": "ระหว่าง",
"equals": "เท่ากับ",
"not": "ไม่",
"empty": "ค่าว่าง",
"notBetween": "ไม่ใช่ระหว่าง",
"notEmpty": "ไม่ใช่ค่าว่าง"
},
"number": {
"between": "ระหว่าง",
"equals": "เท่ากับ",
"gt": "มากกว่า",
"gte": "มากกว่าเท่ากับ",
"lt": "น้อยกว่า",
"lte": "น้อยกว่าเท่ากับ",
"not": "ไม่",
"notBetween": "ไม่ใช่ระหว่าง",
"empty": "ค่าว่าง",
"notEmpty": "ไม่ใช่ค่าว่าง"
},
"string": {
"contains": "ประกอบด้วย",
"endsWith": "ลงท้ายด้วย",
"equals": "เท่ากับ",
"not": "ไม่",
"startsWith": "เริ่มต้นด้วย",
"notContains": "ไม่มี",
"notStartsWith": "ไม่เริ่มต้นด้วย",
"notEndsWith": "ไม่ลงท้ายด้วย",
"empty": "ค่าว่าง",
"notEmpty": "ไม่ใช่ค่าว่าง"
},
"array": {
"equals": "เท่ากับ",
"contains": "เงื้อนไข",
"not": "ไม่",
"empty": "ค่าว่าง",
"notEmpty": "ไม่ใช่ค่าว่าง",
"without": "ไม่มี"
}
},
"title": {
"0": "สร้างการค้นหา",
"_": "ตัวสร้างการค้นหา (%d)"
},
"value": "ค่า"
},
"select": {
"cells": {
"1": "เลือก 1 cell",
"_": "เลือก %d cells"
},
"columns": {
"1": "เลือก 1 column",
"_": "เลือก %d columns"
}
},
"stateRestore": {
"duplicateError": "มีข้อมูลที่ใช้ชื่อนี้แล้ว",
"emptyError": "ชื่อต้องไม่เป็นค่าว่าง",
"emptyStates": "ไม่มีสถานะที่บันทึกไว้",
"removeConfirm": "คุณแน่ใจหรือไม่ว่าต้องการลบ %s",
"removeError": "ไม่สามารถลบสถานะ",
"creationModal": {
"button": "สร้าง",
"name": "ชื่อ:"
},
"removeJoiner": "และ",
"removeSubmit": "ลบ",
"removeTitle": "ลบสถานะ",
"renameButton": "เปลี่ยนชื่อ",
"renameLabel": "ชื่อใหม่สำหรับ %s:",
"renameTitle": "เปลี่ยนชื่อสถานะ"
},
"decimal": "Empty string",
"search": "ค้นหา:"
}
});
var table = $('#pui').DataTable();
// Edit record
table.on('click', '.edit', function() {
$tr = $(this).closest('tr');
var data = table.row($tr).data();
alert('You press on Row: ' + data[0] + ' ' + data[1] + ' ' + data[2] + '\'s row.');
});
// Delete a record
table.on('click', '.remove', function(e) {
$tr = $(this).closest('tr');
table.row($tr).remove().draw();
e.preventDefault();
});
//Like record
table.on('click', '.like', function() {
alert('You clicked on Like button');
});
$('.card .material-datatables label').addClass('form-group');
});
</script>
<!-- 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>
Zerion Mini Shell 1.0