269 lines
7.8 KiB
PHP
269 lines
7.8 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="id">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel="icon" type="image/png" href="<?= base_url('assets/img/icon.png'); ?>">
|
|
<title>Halaman Admin</title>
|
|
<!-- Bootstrap 5 CSS -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/js/all.min.js"
|
|
referrerpolicy="no-referrer"></script>
|
|
|
|
<!-- Flatpickr CSS & JS -->
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
|
|
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
|
|
|
|
<style>
|
|
/* Modern form style */
|
|
.form-row-modern {
|
|
display: flex;
|
|
gap: 1rem;
|
|
align-items: flex-end;
|
|
flex-wrap: wrap;
|
|
zoom: 90%;
|
|
}
|
|
|
|
.form-group-modern {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.form-label-modern {
|
|
font-size: 0.85rem;
|
|
font-weight: 500;
|
|
color: #555;
|
|
margin-bottom: 0.25rem;
|
|
}
|
|
|
|
.form-control-modern {
|
|
border-radius: 8px;
|
|
border: 1px solid #ccc;
|
|
padding: 0.5rem 0.75rem;
|
|
transition: border 0.2s, box-shadow 0.2s;
|
|
min-width: 250px;
|
|
}
|
|
|
|
.form-control-modern:focus {
|
|
border-color: #0d6efd;
|
|
box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.25);
|
|
outline: none;
|
|
}
|
|
|
|
.btn-modern {
|
|
height: 40px;
|
|
border-radius: 8px;
|
|
padding: 0 1.2rem;
|
|
}
|
|
|
|
/* ====== STYLE UTAMA UNTUK TABLE ====== */
|
|
.table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
background: #fff;
|
|
}
|
|
|
|
.table th,
|
|
.table td {
|
|
border: 1px solid #dee2e6;
|
|
padding: 8px 12px;
|
|
vertical-align: middle; /* ⬇️ center secara vertikal */
|
|
}
|
|
|
|
/* ====== HEADER TABLE (TH) CENTER HORIZONTAL & VERTIKAL ====== */
|
|
.table thead th {
|
|
text-align: center; /* ⬅️ center horizontal */
|
|
vertical-align: middle; /* ⬇️ center vertikal */
|
|
/*background-color: #f8f9fa;*/
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* ====== BODY TABLE (TD) DEFAULT: CENTER VERTIKAL SAJA ====== */
|
|
.table tbody td {
|
|
vertical-align: middle; /* ⬇️ center vertikal */
|
|
text-align: left; /* default kiri (bisa diubah) */
|
|
}
|
|
|
|
/* ====== OPSIONAL: ALIGN CONTROL ====== */
|
|
/* Pusat horizontal */
|
|
.center-h {
|
|
text-align: center !important;
|
|
}
|
|
|
|
/* Pusat vertikal */
|
|
.center-v {
|
|
vertical-align: middle !important;
|
|
}
|
|
|
|
/* Pusat vertikal + horizontal */
|
|
.center-all {
|
|
text-align: center !important;
|
|
vertical-align: middle !important;
|
|
}
|
|
|
|
.mw-20 {
|
|
max-width: 20px !important;
|
|
}
|
|
|
|
.mw-70 {
|
|
max-width: 70px !important;
|
|
}
|
|
|
|
/* Warna dasar link */
|
|
.navbar-nav .nav-link {
|
|
color: #4b5563 !important; /* abu gelap */
|
|
transition: all 0.25s ease;
|
|
font-weight: 500;
|
|
}
|
|
|
|
/* Hover */
|
|
.navbar-nav .nav-link:hover {
|
|
color: #111827 !important; /* teks gelap */
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
/* Aktif */
|
|
.navbar-nav .nav-link.active {
|
|
color: #0d6efd !important; /* biru modern Bootstrap 5 */
|
|
font-weight: 600;
|
|
border-bottom: 2px solid #0d6efd;
|
|
}
|
|
|
|
/* Hover ikon kanan */
|
|
.navbar-nav.ms-auto .nav-link:hover i {
|
|
color: #0d6efd !important;
|
|
transform: scale(1.1);
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
/* Responsif */
|
|
@media (max-width: 991.98px) {
|
|
.navbar-collapse {
|
|
text-align: left !important;
|
|
}
|
|
|
|
.navbar-nav {
|
|
align-items: flex-start !important;
|
|
}
|
|
|
|
.navbar-nav.ms-auto {
|
|
margin-top: 0.5rem;
|
|
align-items: flex-start !important;
|
|
}
|
|
|
|
.navbar-nav .nav-link.active {
|
|
border: none;
|
|
background: rgba(13, 110, 253, 0.1);
|
|
border-radius: 6px;
|
|
padding-left: 10px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm border-bottom">
|
|
<div class="container">
|
|
<!-- Brand -->
|
|
<a class="navbar-brand fw-bold text-dark" href="<?= base_url('dashboard'); ?>">
|
|
Sistem Panel
|
|
</a>
|
|
|
|
<!-- Toggler -->
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
|
|
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
|
|
<!-- Menu -->
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<!-- Menu kiri -->
|
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
|
<?php
|
|
$current = $this->uri->segment(1);
|
|
$role = $this->session->userdata('role');
|
|
?>
|
|
|
|
<?php if ($role == 'admin'): ?>
|
|
<li class="nav-item">
|
|
<a class="nav-link d-flex align-items-center gap-2 <?= $current == 'dashboard' ? 'active' : '' ?>" href="<?= base_url('dashboard'); ?>">
|
|
<i class="fas fa-home"></i> <span>Dashboard</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link d-flex align-items-center gap-2 <?= $current == 'user_management' ? 'active' : '' ?>" href="<?= base_url('user_management'); ?>">
|
|
<i class="fas fa-users-cog"></i> <span>Manajemen User</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link d-flex align-items-center gap-2 <?= $current == 'device' ? 'active' : '' ?>" href="<?= base_url('device'); ?>">
|
|
<i class="fas fa-plug"></i> <span>Add Device</span>
|
|
</a>
|
|
</li>
|
|
<?php else: ?>
|
|
<li class="nav-item">
|
|
<a class="nav-link d-flex align-items-center gap-2 <?= $current == 'chat' ? 'active' : '' ?>" href="<?= base_url('chat'); ?>">
|
|
<i class="fas fa-comments"></i> <span>Chat</span>
|
|
</a>
|
|
</li>
|
|
<?php endif; ?>
|
|
</ul>
|
|
|
|
<!-- Menu kanan -->
|
|
<ul class="navbar-nav ms-auto align-items-lg-center">
|
|
<li class="nav-item me-lg-3">
|
|
<a class="nav-link text-secondary" href="#" data-bs-toggle="modal" data-bs-target="#profileModal">
|
|
<i class="fas fa-user-circle fa-2x"></i>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-danger" href="<?= base_url('auth/logout'); ?>">
|
|
<i class="fas fa-sign-out-alt fa-lg"></i>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Modal Profil User -->
|
|
<div class="modal fade" id="profileModal" tabindex="-1" aria-labelledby="userModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered">
|
|
<div class="modal-content border-0 shadow-lg rounded-3">
|
|
<div class="modal-header bg-light border-0">
|
|
<h5 class="modal-title fw-bold" id="userModalLabel">
|
|
<i class="fas fa-user-circle me-2 text-primary"></i> Profil Pengguna
|
|
</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
|
|
<div class="modal-body text-center">
|
|
<i class="fas fa-user-circle fa-5x text-secondary mb-3"></i>
|
|
<h5 class="fw-semibold mb-1">
|
|
<?= $this->session->userdata('name'); ?>
|
|
</h5>
|
|
<p class="text-muted small mb-3">
|
|
<?= ucfirst($this->session->userdata('role')); ?>
|
|
</p>
|
|
|
|
<div class="text-start px-4">
|
|
<p class="mb-1"><strong>Email:</strong> <?= $this->session->userdata('email'); ?></p>
|
|
<p class="mb-1"><strong>Username:</strong> <?= $this->session->userdata('username'); ?></p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-footer border-0 d-flex justify-content-between px-4 pb-4">
|
|
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
|
|
<i class="fas fa-times me-1"></i> Tutup
|
|
</button>
|
|
<a href="<?= base_url('auth/logout'); ?>" class="btn btn-danger">
|
|
<i class="fas fa-sign-out-alt me-1"></i> Logout
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|