================================================================================
ANALISIS DETAIL INTEGRASI SIDEBAR - ADMIN DASHBOARD
================================================================================
Project: FLS3N - Sistem Penilaian Karya Siswa
Tanggal: 09 April 2026
Status: ANALISIS SELESAI (BELUM IMPLEMENTASI)
================================================================================

RINGKASAN EKSEKUTIF:
Total file yang perlu diupdate: 11 files
File yang di-SKIP (sudah selesai): 2 files (admin_kelola_peserta, admin_kelola_sekolah)
Total perubahan yang diperlukan: 33 perubahan (3 per file × 11 files)

================================================================================
STRUKTUR UMUM PERUBAHAN:
================================================================================

Untuk SETIAP file, ada 3 jenis perubahan:

1. CSS SIDEBAR EXTRACTION
   - Hapus semua CSS related to .sidebar, .sidebar a, .sidebar a:hover, etc.
   - Pertahankan CSS page-specific
   - Catatan: CSS sidebar akan dipindahkan ke sidebar.php

2. HTML SIDEBAR REPLACEMENT
   - Ganti <div class="col-md-3 col-lg-2 px-0 sidebar"> ... </div>
   - Dengan: <?php include '../sidebar.php'; ?>
   - Range berkisar antara 50-130 lines tergantung kompleksitas sidebar content

3. BOOTSTRAP SCRIPT REPLACEMENT
   - Ganti: <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
   - Dengan: <?php include '../sidebar-footer.php'; ?>
   - Lokasi: Sebelum closing </body> tag

================================================================================
DETAIL FILE-BY-FILE ANALYSIS:
================================================================================

---
FILE 1: admin_admin/index.php
---
Lokasi: admin/admin_dashboard/admin_admin/index.php
Opening: Line ~100 (PHP logic begin)
HTML Start: Line 227 (<!DOCTYPE html>)

CSS SIDEBAR STYLES LOCATION:
  - Baris: 196-216 (dalam section <style>)
  - Styles to REMOVE:
    .sidebar { min-height: 100vh; background-color: #212529; color: white; position: sticky; top: 0; }
    .sidebar a { color: rgba(255, 255, 255, 0.8); text-decoration: none; transition: color 0.3s; }
    .sidebar a:hover { color: white; }
    .sidebar .nav-link.active { background-color: rgba(255, 255, 255, 0.1); color: white; }
    .sidebar .nav-item { margin-bottom: 5px; }
    .content { padding: 20px; }
  - CSS to KEEP:
    .custom-file-label::after { content: "Browse"; }
    .text-uppercase { text-transform: uppercase; }

HTML SIDEBAR LOCATION:
  - Opening: Line 227 (<div class="col-md-3 col-lg-2 px-0 sidebar">)
  - Content: Lines 228-314 (Admin Panel header, nav items, dropdown, closing </div>)
  - Closing: Line 315 (</div> - closing row div)
  - REPLACE ENTIRE BLOCK: Lines 227-315 (89 lines DIGANTI dengan 1 line PHP include)

BOOTSTRAP SCRIPT LOCATION:
  - Need to verify - typically at end of file
  - Replace: <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
  - With: <?php include '../sidebar-footer.php'; ?>

---
FILE 2: admin_cabang_lomba/index.php
---
Lokasi: admin/admin_dashboard/admin_cabang_lomba/index.php

CSS SIDEBAR STYLES LOCATION:
  - Baris: 24-40
  - Styles to REMOVE: ALL (same as above)
  - CSS to KEEP: NONE (file ini hanya memiliki sidebar CSS)

HTML SIDEBAR LOCATION:
  - Opening: Line 53 (<div class="col-md-3 col-lg-2 px-0 sidebar">)
  - Content: Lines 54-130
  - Closing: Line 131 (</div>)
  - REPLACE ENTIRE BLOCK: 53-131 (79 lines)

BOOTSTRAP SCRIPT LOCATION:
  - Line 307: <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
  - Replace dengan: <?php include '../sidebar-footer.php'; ?>

---
FILE 3: admin_juri/index.php
---
Lokasi: admin/admin_dashboard/admin_juri/index.php
Catatan: File ini memiliki import CSV functionality

CSS SIDEBAR STYLES LOCATION:
  - Baris: 223-243
  - Styles to REMOVE: Standard sidebar CSS
  - CSS to KEEP:
    .custom-file-label::after { content: "Browse"; }
    .text-uppercase { text-transform: uppercase; }

HTML SIDEBAR LOCATION:
  - Opening: Line 251 (<div class="col-md-3 col-lg-2 px-0 sidebar">)
  - Content: Lines 252-328
  - Closing: Line 329 (</div>)
  - REPLACE ENTIRE: 251-329 (79 lines)

BOOTSTRAP SCRIPT LOCATION:
  - Need to verify exact line
  - Verify at end of file before </html>

---
FILE 4: admin_penilaian/index.php
---
Lokasi: admin/admin_dashboard/admin_penilaian/index.php
KOMPLEKSITAS: HIGH - File ini memiliki banyak CSS custom untuk displaying rankings

CSS SIDEBAR STYLES LOCATION:
  - Perkiraan: Lines 290-360 (HARUS SCAN untuk exact line numbers)
  - Styles to REMOVE: Standard sidebar CSS
  - CSS to KEEP: SEMUA custom styles termasuk:
    .medal-gold, .medal-silver, .medal-bronze
    .peringkat-1, .peringkat-2, .peringkat-3
    .print-only, @media print
    .stats-box
    .nav-tabs .nav-link styles
    (dan semua lainnya kecuali sidebar-related)

HTML SIDEBAR LOCATION:
  - Opening: Line 335 (<div class="col-md-3 col-lg-2 px-0 sidebar">)
  - Need to find exact closing line (kemungkinan ~400)

BOOTSTRAP SCRIPT LOCATION:
  - Need to find at end of file

---
FILE 5: admin_penilaian1/index.php
---
Lokasi: admin/admin_dashboard/admin_penilaian1/index.php
CATATAN: Sama struktur dengan admin_penilaian/index.php

HTML SIDEBAR LOCATION:
  - Opening: Line 324

---
FILE 6: admin_penilaian2/index.php
---
Lokasi: admin/admin_dashboard/admin_penilaian2/index.php
CATATAN: Sama struktur dengan admin_penilaian/index.php

HTML SIDEBAR LOCATION:
  - Opening: Line 334

---
FILE 7: admin_penilaian3/index.php
---
Lokasi: admin/admin_dashboard/admin_penilaian3/index.php
CATATAN: Sama struktur dengan admin_penilaian/index.php

HTML SIDEBAR LOCATION:
  - Opening: Line 334

---
FILE 8: admin_peserta_kabupaten/index.php
---
Lokasi: admin/admin_dashboard/admin_peserta_kabupaten/index.php

HTML SIDEBAR LOCATION:
  - Opening: Line 257

---
FILE 9: admin_peserta_kabupaten_2/index.php
---
Lokasi: admin/admin_dashboard/admin_peserta_kabupaten_2/index.php

HTML SIDEBAR LOCATION:
  - Opening: Line 251

---
FILE 10: admin_peserta_kota/index.php
---
Lokasi: admin/admin_dashboard/admin_peserta_kota/index.php

HTML SIDEBAR LOCATION:
  - Opening: Line 255

---
FILE 11: admin_status_lomba/index.php
---
Lokasi: admin/admin_dashboard/admin_status_lomba/index.php

HTML SIDEBAR LOCATION:
  - Opening: Line 415

---
FILE 12 & 13: SKIP (Sudah Selesai)
---
admin_kelola_peserta/index.php - SUDAH SELESAI
admin_kelola_sekolah/index.php - SUDAH SELESAI

Skip file yang ini dan jangan lakukan perubahan

================================================================================
FILES YANG DIPERLUKAN UNTUK DIBUAT/DIMODIFIKASI:
================================================================================

1. admin/admin_dashboard/sidebar.php
   - File baru yang berisi HTML sidebar untuk semua file
   - Harus berisi complete sidebar structure dengan navigation links
   - Harus mendukung dynamic active link highlighting
   - Harus menampilkan $_SESSION['nama']

2. admin/admin_dashboard/sidebar-footer.php
   - File baru yang berisi Bootstrap script
   - Hanya berisi: <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>

3. admin/admin_dashboard/sidebar-styles.css (OPTIONAL)
   - Bisa menggunakan file CSS terpisah atau langsung di sidebar.php dalam tag <style>
   - Berisi semua CSS sidebar yang diekstrak

================================================================================
COMMON SIDEBAR HTML STRUCTURE (untuk referensi):
================================================================================

<div class="col-md-3 col-lg-2 px-0 sidebar">
    <div class="d-flex flex-column p-3">
        <a href="../../admin_dashboard" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-white text-decoration-none">
            <span class="fs-4">Admin Panel</span>
        </a>
        <hr>
        <ul class="nav nav-pills flex-column mb-auto">
            <li class="nav-item">
                <a href="../../admin_dashboard" class="nav-link">
                    <i class="fas fa-home me-2"></i> Dashboard
                </a>
            </li>
            <!-- Navigation items -->
        </ul>
        <hr>
        <div class="dropdown">
            <a href="#" class="d-flex align-items-center text-white text-decoration-none dropdown-toggle" id="dropdownUser1" data-bs-toggle="dropdown" aria-expanded="false">
                <i class="fas fa-user-circle me-2 fs-5"></i>
                <strong><?php echo $_SESSION['nama']; ?></strong>
            </a>
            <ul class="dropdown-menu dropdown-menu-dark text-small shadow" aria-labelledby="dropdownUser1">
                <li><hr class="dropdown-divider"></li>
                <li><a class="dropdown-item" href="../../logout.php">Logout</a></li>
            </ul>
        </div>
    </div>
</div>

================================================================================
COMMON SIDEBAR CSS (untuk sidebar.php):
================================================================================

.sidebar {
    min-height: 100vh;
    background-color: #212529;
    color: white;
    position: sticky;
    top: 0;
}
.sidebar a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}
.sidebar a:hover {
    color: white;
}
.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}
.sidebar .nav-item {
    margin-bottom: 5px;
}
.content {
    padding: 20px;
}

================================================================================
CHECKLIST IMPLEMENTASI:
================================================================================

PERSIAPAN:
[ ] Buat admin/admin_dashboard/sidebar.php
[ ] Buat admin/admin_dashboard/sidebar-footer.php
[ ] Backup semua file sebelum modifikasi
[ ] Verify exact line numbers untuk setiap file

IMPLEMENTASI FILE 1-4:
[ ] admin_admin/index.php - CSS extract + HTML replace + Script replace
[ ] admin_cabang_lomba/index.php - CSS extract + HTML replace + Script replace
[ ] admin_juri/index.php - CSS extract + HTML replace + Script replace
[ ] admin_penilaian/index.php - CSS extract + HTML replace + Script replace

IMPLEMENTASI FILE 5-7 (Penilaian variants):
[ ] admin_penilaian1/index.php
[ ] admin_penilaian2/index.php
[ ] admin_penilaian3/index.php

IMPLEMENTASI FILE 8-11 (Peserta files):
[ ] admin_peserta_kabupaten/index.php
[ ] admin_peserta_kabupaten_2/index.php
[ ] admin_peserta_kota/index.php
[ ] admin_status_lomba/index.php

TESTING & VERIFICATION:
[ ] Verify semua sidebar links berfungsi
[ ] Verify active link highlighting
[ ] Verify dropdown user menu
[ ] Verify logout functionality
[ ] Test di semua browsers

================================================================================
NOTES PENTING:
================================================================================

1. PERINGATAN: File admin_penilaian*.php sangat kompleks dengan banyak custom CSS
   - Pastikan exact line numbers diverifikasi sebelum replace
   - Test dengan teliti setelah modifikasi

2. INCLUDE PATH: Semua include menggunakan "../sidebar.php" dan "../sidebar-footer.php"
   - Ini valid karena setiap file berada di subdirectory admin_dashboard

3. SESSION VARIABLE: Pastikan $_SESSION['nama'] tersedia di semua halaman
   - Verify di config.php atau auth middleware

4. ACTIVE LINK: Sidebar.php perlu logic untuk menentukan active nav item
   - Bisa menggunakan $_SERVER['PHP_SELF'] atau dari session

5. CSS SPECIFICITY: Pastikan CSS .content padding tidak conflict dengan existing styles

6. TESTING: Setelah semua file dimodifikasi:
   - Check browser console untuk errors
   - Verify responsive design di berbagai ukuran screen
   - Test semua navigation links

================================================================================
END OF ANALYSIS
================================================================================
