

<?php $__env->startSection('title', 'Kelola Pengawas - Admin Dinas'); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid">
    <!-- Page Header -->
    <div class="d-flex justify-content-between align-items-center mb-4">
        <div>
            <h1 class="h3 mb-0">Kelola Pengawas</h1>
            <p class="text-muted small mt-1">Kelola daftar pengawas di dinas Anda</p>
        </div>
        <button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addPengawasModal">
            <i class="bi bi-plus-circle"></i> Tambah Pengawas
        </button>
    </div>

    <!-- Statistics Cards -->
    <div class="row mb-4">
        <div class="col-md-3 col-sm-6 mb-3">
            <div class="card stat-card">
                <div class="card-body">
                    <h6 class="card-title text-muted mb-2">Total Pengawas</h6>
                    <h3 class="mb-0">12</h3>
                    <small class="text-success"><i class="bi bi-arrow-up"></i> +2 bulan ini</small>
                </div>
            </div>
        </div>
        <div class="col-md-3 col-sm-6 mb-3">
            <div class="card stat-card success">
                <div class="card-body">
                    <h6 class="card-title text-muted mb-2">Aktif</h6>
                    <h3 class="mb-0">10</h3>
                    <small class="text-success"><i class="bi bi-check-circle"></i> Status aktif</small>
                </div>
            </div>
        </div>
        <div class="col-md-3 col-sm-6 mb-3">
            <div class="card stat-card warning">
                <div class="card-body">
                    <h6 class="card-title text-muted mb-2">KCD Tertugaskan</h6>
                    <h3 class="mb-0">8</h3>
                    <small class="text-warning"><i class="bi bi-info-circle"></i> Dengan mapping</small>
                </div>
            </div>
        </div>
        <div class="col-md-3 col-sm-6 mb-3">
            <div class="card stat-card danger">
                <div class="card-body">
                    <h6 class="card-title text-muted mb-2">Belum Mapping</h6>
                    <h3 class="mb-0">2</h3>
                    <small class="text-danger"><i class="bi bi-exclamation-circle"></i> Perlu tindakan</small>
                </div>
            </div>
        </div>
    </div>

    <!-- Data Table -->
    <div class="card">
        <div class="card-header d-flex justify-content-between align-items-center">
            <h5 class="mb-0">Daftar Pengawas</h5>
            <div class="input-group" style="max-width: 300px;">
                <span class="input-group-text bg-white border-end-0">
                    <i class="bi bi-search"></i>
                </span>
                <input type="text" class="form-control border-start-0" placeholder="Cari pengawas...">
            </div>
        </div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-hover">
                    <thead class="table-light">
                        <tr>
                            <th>Nama</th>
                            <th>NIP</th>
                            <th>Pangkat dan Golongan</th>
                            <th>KCD yang Ditugaskan</th>
                            <th>Email</th>
                            <th>Aksi</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>
                                <div class="d-flex align-items-center">
                                    <div class="avatar avatar-sm bg-primary text-white rounded-circle me-2 d-flex align-items-center justify-content-center" style="width: 36px; height: 36px;">
                                        <strong>AB</strong>
                                    </div>
                                    <span>Ahmad Bambang</span>
                                </div>
                            </td>
                            <td>196905151990031001</td>
                            <td>Pembina Tk. I / IV b</td>
                            <td>
                                <span class="badge bg-info me-2">KCD 01</span>
                                <span class="badge bg-info">KCD 03</span>
                            </td>
                            <td>ahmad.bambang@dinas.go.id</td>
                            <td>
                                <button class="btn btn-sm btn-outline-primary" data-bs-toggle="modal" data-bs-target="#editModal" title="Edit">
                                    <i class="bi bi-pencil"></i>
                                </button>
                                <button class="btn btn-sm btn-outline-danger" title="Hapus">
                                    <i class="bi bi-trash"></i>
                                </button>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="d-flex align-items-center">
                                    <div class="avatar avatar-sm bg-success text-white rounded-circle me-2 d-flex align-items-center justify-content-center" style="width: 36px; height: 36px;">
                                        <strong>SM</strong>
                                    </div>
                                    <span>Siti Maryam</span>
                                </div>
                            </td>
                            <td>196708201992032002</td>
                            <td>Penata / III d</td>
                            <td>
                                <span class="badge bg-info">KCD 02</span>
                            </td>
                            <td>siti.maryam@dinas.go.id</td>
                            <td>
                                <button class="btn btn-sm btn-outline-primary" data-bs-toggle="modal" data-bs-target="#editModal" title="Edit">
                                    <i class="bi bi-pencil"></i>
                                </button>
                                <button class="btn btn-sm btn-outline-danger" title="Hapus">
                                    <i class="bi bi-trash"></i>
                                </button>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="d-flex align-items-center">
                                    <div class="avatar avatar-sm bg-warning text-white rounded-circle me-2 d-flex align-items-center justify-content-center" style="width: 36px; height: 36px;">
                                        <strong>RH</strong>
                                    </div>
                                    <span>Rudi Hartono</span>
                                </div>
                            </td>
                            <td>197103221995031005</td>
                            <td>Penata Muda / III a</td>
                            <td>
                                <span class="badge bg-secondary">Belum Mapping</span>
                            </td>
                            <td>rudi.hartono@dinas.go.id</td>
                            <td>
                                <button class="btn btn-sm btn-outline-primary" data-bs-toggle="modal" data-bs-target="#editModal" title="Edit">
                                    <i class="bi bi-pencil"></i>
                                </button>
                                <button class="btn btn-sm btn-outline-danger" title="Hapus">
                                    <i class="bi bi-trash"></i>
                                </button>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <nav aria-label="Pagination">
                <ul class="pagination justify-content-center mt-4">
                    <li class="page-item disabled"><a class="page-link" href="#">Previous</a></li>
                    <li class="page-item active"><a class="page-link" href="#">1</a></li>
                    <li class="page-item"><a class="page-link" href="#">2</a></li>
                    <li class="page-item"><a class="page-link" href="#">Next</a></li>
                </ul>
            </nav>
        </div>
    </div>
</div>

<!-- Add Pengawas Modal -->
<div class="modal fade" id="addPengawasModal" tabindex="-1">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header border-bottom">
                <h5 class="modal-title">Tambah Pengawas Baru</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
            </div>
            <div class="modal-body">
                <form id="addPengawasForm">
                    <div class="mb-3">
                        <label class="form-label">Nama Lengkap <span class="text-danger">*</span></label>
                        <input type="text" class="form-control" placeholder="Masukkan nama lengkap" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">NIP <span class="text-danger">*</span></label>
                        <input type="text" class="form-control" placeholder="NIP 18 digit" pattern="\d{18}" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Pangkat dan Golongan <span class="text-danger">*</span></label>
                        <input type="text" class="form-control" placeholder="contoh: Pembina / IV b" required>
                    </div>
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Email <span class="text-danger">*</span></label>
                            <input type="email" class="form-control" placeholder="email@dinas.go.id" required>
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">No. HP</label>
                            <input type="tel" class="form-control" placeholder="08xxxxxxxxxx">
                        </div>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Alamat <span class="text-danger">*</span></label>
                        <textarea class="form-control" rows="2" placeholder="Jalan, No., Kelurahan, Kecamatan, Kota" required></textarea>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">KCD yang Ditugaskan <span class="text-danger">*</span></label>
                        <select class="form-select" name="kcd_ids[]" multiple required>
                            <?php $__currentLoopData = $kcds; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kcd): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($kcd->id); ?>"><?php echo e($kcd->code); ?> - <?php echo e($kcd->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                        <small class="text-muted">Tahan Ctrl untuk memilih lebih dari satu KCD</small>
                    </div>
                </form>
            </div>
            <div class="modal-footer border-top">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
                <button type="button" class="btn btn-primary">Simpan Pengawas</button>
            </div>
        </div>
    </div>
</div>

<!-- Edit Modal -->
<div class="modal fade" id="editModal" tabindex="-1">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header border-bottom">
                <h5 class="modal-title">Edit Data Pengawas</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
            </div>
            <div class="modal-body">
                <form id="editForm">
                    <div class="mb-3">
                        <label class="form-label">Nama Lengkap <span class="text-danger">*</span></label>
                        <input type="text" class="form-control" value="Ahmad Bambang" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">NIP <span class="text-danger">*</span></label>
                        <input type="text" class="form-control" value="196905151990031001" pattern="\d{18}" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Pangkat dan Golongan <span class="text-danger">*</span></label>
                        <input type="text" class="form-control" value="Pembina Tk. I / IV b" required>
                    </div>
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Email <span class="text-danger">*</span></label>
                            <input type="email" class="form-control" value="ahmad.bambang@dinas.go.id" required>
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">No. HP</label>
                            <input type="tel" class="form-control" placeholder="08xxxxxxxxxx">
                        </div>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Alamat <span class="text-danger">*</span></label>
                        <textarea class="form-control" rows="2" required>Jln. Merdeka No. 45, Kota A</textarea>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">KCD yang Ditugaskan <span class="text-danger">*</span></label>
                        <select class="form-select" name="kcd_ids[]" multiple required>
                            <?php $__currentLoopData = $kcds; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kcd): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($kcd->id); ?>"><?php echo e($kcd->code); ?> - <?php echo e($kcd->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                        <small class="text-muted">Tahan Ctrl untuk memilih/membatalkan KCD</small>
                    </div>
                </form>
            </div>
            <div class="modal-footer border-top">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
                <button type="button" class="btn btn-primary">Simpan Perubahan</button>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\appsuper\resources\views/admin-dinas/pengawas.blade.php ENDPATH**/ ?>