| 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 : /Inetpub/www/work/ |
Upload File : |
<?php include 'header.php'; ?>
<?php
if($_SESSION['type'] != 'admin'){ header("Location: user_dashboard.php"); exit(); }
$res_groups = mysqli_query($conn, "SELECT * FROM groups ORDER BY g_id ASC");
?>
<div class="row">
<div class="col-md-6 mx-auto">
<div class="card">
<div class="card-header bg-white py-3 d-flex justify-content-between align-items-center">
<h5 class="mb-0 fw-bold">จัดการกลุ่มงาน (11 กลุ่ม)</h5>
<button class="btn btn-sm btn-success" data-bs-toggle="modal" data-bs-target="#addGroupModal">
<i class="fas fa-plus"></i> เพิ่มกลุ่ม
</button>
</div>
<div class="card-body">
<table class="table table-bordered align-middle">
<thead class="table-light">
<tr>
<th width="10%">ID</th>
<th>ชื่อกลุ่มงาน</th>
<th width="20%" class="text-center">จัดการ</th>
</tr>
</thead>
<tbody>
<?php while($row = mysqli_fetch_assoc($res_groups)): ?>
<tr>
<td><?php echo $row['g_id']; ?></td>
<td><?php echo $row['g_name']; ?></td>
<td class="text-center">
<a href="process.php?action=del_group&id=<?php echo $row['g_id']; ?>"
class="btn btn-sm btn-danger" onclick="return confirm('ยืนยันการลบกลุ่ม?');">
<i class="fas fa-trash"></i>
</a>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="modal fade" id="addGroupModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form action="process.php" method="post">
<input type="hidden" name="action" value="add_group">
<div class="modal-header">
<h5 class="modal-title">เพิ่มกลุ่มงาน</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<input type="text" name="g_name" class="form-control" placeholder="ชื่อกลุ่มงาน..." required>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success">บันทึก</button>
</div>
</form>
</div>
</div>
</div>
<?php include 'footer.php'; ?>