| Server IP : 127.0.0.1 / Your IP : 192.168.99.1 Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9 System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64 User : Administrator ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/bpkd/admin/ |
Upload File : |
<!-- Add Modal -->
<div class="modal fade" id="addModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<form method="POST">
<div class="modal-header">
<h5 class="modal-title">
<i class="fas fa-plus-circle me-2"></i>Tambah Laporan Baru
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label class="form-label">Judul Laporan <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="title" required>
</div>
<div class="mb-3">
<label class="form-label">Deskripsi</label>
<textarea class="form-control" name="description" rows="3"></textarea>
</div>
<div class="mb-3">
<label class="form-label">File <span class="text-danger">*</span></label>
<select class="form-control" name="file_id" required>
<option value="">Pilih File</option>
<?php
$media_files->data_seek(0);
while($file = $media_files->fetch_assoc()):
?>
<option value="<?php echo $file['id']; ?>">
<?php echo htmlspecialchars($file['filename']); ?>
</option>
<?php endwhile; ?>
</select>
<small class="text-muted">
<a href="media_manager.php" target="_blank">Upload file baru</a> jika belum ada
</small>
</div>
<div class="mb-3">
<label class="form-label">Kategori</label>
<input type="text" class="form-control" name="category" placeholder="Contoh: Laporan Tahunan, Laporan Keuangan">
</div>
<div class="row">
<div class="col-md-6 mb-3">
<label class="form-label">Urutan</label>
<input type="number" class="form-control" name="report_order" value="0">
</div>
<div class="col-md-6 mb-3">
<label class="form-label">Status</label>
<select class="form-control" name="status">
<option value="active">Aktif</option>
<option value="inactive">Tidak Aktif</option>
</select>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
<button type="submit" name="add" class="btn btn-primary">
<i class="fas fa-save me-2"></i>Simpan
</button>
</div>
</form>
</div>
</div>
</div>
<!-- Edit Modal -->
<?php if ($edit_report): ?>
<div class="modal fade" id="editModal" tabindex="-1" data-bs-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<form method="POST">
<div class="modal-header">
<h5 class="modal-title">
<i class="fas fa-edit me-2"></i>Edit Laporan
</h5>
<a href="reports.php" class="btn-close"></a>
</div>
<div class="modal-body">
<input type="hidden" name="id" value="<?php echo $edit_report['id']; ?>">
<div class="mb-3">
<label class="form-label">Judul Laporan <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="title" value="<?php echo htmlspecialchars($edit_report['title']); ?>" required>
</div>
<div class="mb-3">
<label class="form-label">Deskripsi</label>
<textarea class="form-control" name="description" rows="3"><?php echo htmlspecialchars($edit_report['description']); ?></textarea>
</div>
<div class="mb-3">
<label class="form-label">File <span class="text-danger">*</span></label>
<select class="form-control" name="file_id" required>
<option value="">Pilih File</option>
<?php
$media_files->data_seek(0);
while($file = $media_files->fetch_assoc()):
?>
<option value="<?php echo $file['id']; ?>" <?php echo $file['id'] == $edit_report['file_id'] ? 'selected' : ''; ?>>
<?php echo htmlspecialchars($file['filename']); ?>
</option>
<?php endwhile; ?>
</select>
</div>
<div class="mb-3">
<label class="form-label">Kategori</label>
<input type="text" class="form-control" name="category" value="<?php echo htmlspecialchars($edit_report['category']); ?>">
</div>
<div class="row">
<div class="col-md-6 mb-3">
<label class="form-label">Urutan</label>
<input type="number" class="form-control" name="report_order" value="<?php echo $edit_report['report_order']; ?>">
</div>
<div class="col-md-6 mb-3">
<label class="form-label">Status</label>
<select class="form-control" name="status">
<option value="active" <?php echo $edit_report['status'] == 'active' ? 'selected' : ''; ?>>Aktif</option>
<option value="inactive" <?php echo $edit_report['status'] == 'inactive' ? 'selected' : ''; ?>>Tidak Aktif</option>
</select>
</div>
</div>
</div>
<div class="modal-footer">
<a href="reports.php" class="btn btn-secondary">Batal</a>
<button type="submit" name="edit" class="btn btn-primary">
<i class="fas fa-save me-2"></i>Update
</button>
</div>
</form>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
new bootstrap.Modal(document.getElementById('editModal')).show();
});
</script>
<?php endif; ?>