<?php
    include('loginsession.php');
    error_reporting(E_ALL);
    $filename = basename(__FILE__);
    $save = mysqli_query($conn, "INSERT INTO novia_abc_user_logs (userid,filename) VALUES ('$userini_id','$filename')");
//-------------
$today = date("Y-m-d");
//-------------
?>

<!DOCTYPE html>
<html lang="id">
<head>
    <title>Administrasi - Dashboard</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover, user-scalable=yes">
    <link href="images/balance.ico" rel="icon" type="image/icon" />
    
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome Icons -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap" rel="stylesheet">
    
    <style>
        * {
            font-family: 'Inter', sans-serif;
        }
        
        body {
            background: #F4F0E6;
            padding: 0;
            margin: 0;
            padding-bottom: 20px;
        }
        
        /* Warna tema kecoklatan */
        :root {
            --coklat-1: #8B6914;
            --coklat-2: #A67C52;
            --coklat-3: #C4A27A;
            --coklat-4: #E8DCC6;
            --coklat-5: #F5EFE1;
            --coklat-dark: #5C3E1F;
            --coklat-muda: #DDBB8C;
            --coklat-sage: #B5926A;
        }
        
        /* Header dengan gelombang */
        .header-wave {
            background: linear-gradient(135deg, var(--coklat-dark), var(--coklat-2));
            color: white;
            padding: 25px 20px 40px 20px;
            border-radius: 0 0 30px 30px;
            margin-bottom: 20px;
            position: relative;
        }
        
        .header-wave h1 {
            font-size: 1.6rem;
            font-weight: 700;
            margin: 0;
            letter-spacing: -0.5px;
        }
        
        .header-wave p {
            font-size: 0.8rem;
            opacity: 0.9;
            margin-top: 5px;
            margin-bottom: 0;
        }
        
        .user-badge {
            background: rgba(255,255,255,0.2);
            display: inline-block;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.7rem;
            margin-top: 8px;
        }
        
        /* Card untuk setiap section */
        .section-card {
            background: white;
            border-radius: 24px;
            padding: 16px;
            margin-bottom: 20px;
            box-shadow: 0 4px 12px rgba(92, 62, 31, 0.08);
            border: 1px solid rgba(197, 162, 122, 0.3);
        }
        
        .section-title-card {
            font-size: 1rem;
            font-weight: 700;
            color: var(--coklat-dark);
            padding-bottom: 10px;
            margin-bottom: 15px;
            border-bottom: 2px solid var(--coklat-3);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .section-title-card i {
            font-size: 1.2rem;
            color: var(--coklat-2);
        }
        
        /* Tombol gaya baru - lebih modern */
        .menu-btn {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 10px;
            padding: 12px 10px;
            border-radius: 16px;
            font-weight: 500;
            font-size: 0.8rem;
            transition: all 0.2s ease;
            width: 100%;
            border: none;
            background: var(--coklat-5);
            color: var(--coklat-dark);
            text-align: left;
        }
        
        .menu-btn i {
            width: 28px;
            font-size: 1.1rem;
            text-align: center;
            color: var(--coklat-2);
        }
        
        .menu-btn span {
            flex: 1;
        }
        
        .menu-btn .arrow {
            opacity: 0.5;
            font-size: 0.7rem;
            transition: all 0.2s;
        }
        
        .menu-btn:hover {
            background: var(--coklat-4);
            transform: translateX(3px);
        }
        
        .menu-btn:active {
            transform: scale(0.98);
        }
        
        /* Tombol utama (brown solid) */
        .menu-btn-primary {
            background: linear-gradient(135deg, var(--coklat-dark), var(--coklat-2));
            color: white;
        }
        
        .menu-btn-primary i {
            color: white;
        }
        
        .menu-btn-primary:hover {
            background: linear-gradient(135deg, #4a2e16, #8b5a3a);
            color: white;
        }
        
        /* Tombol warning/logout */
        .menu-btn-logout {
            background: linear-gradient(135deg, #8B3A3A, #B55A5A);
            color: white;
        }
        
        .menu-btn-logout i {
            color: white;
        }
        
        /* Grid untuk menu - 2 kolom di HP */
        .menu-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }
        
        /* Untuk tombol yang ingin full width */
        .menu-grid-full {
            grid-column: span 2;
        }
        
        /* Statistik kecil */
        .stat-badge {
            background: var(--coklat-4);
            border-radius: 12px;
            padding: 8px 12px;
            margin-bottom: 12px;
            font-size: 0.7rem;
            color: var(--coklat-dark);
            text-align: center;
        }
        
        /* Footer */
        .footer-mini {
            text-align: center;
            padding: 15px;
            font-size: 0.65rem;
            color: var(--coklat-sage);
        }
        
        /* Animasi hover untuk desktop */
        @media (min-width: 768px) {
            .menu-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 12px;
            }
            
            .section-card {
                padding: 20px;
            }
            
            .menu-btn {
                padding: 14px 12px;
                font-size: 0.85rem;
            }
            
            .header-wave h1 {
                font-size: 2rem;
            }
            
            .header-wave {
                padding: 30px 25px 45px 25px;
            }
        }
        
        @media (min-width: 1200px) {
            .menu-grid {
                grid-template-columns: repeat(4, 1fr);
            }
        }
        
        /* Menghilangkan default link style */
        a {
            text-decoration: none;
        }
        
        /* Scroll behavior halus */
        html {
            scroll-behavior: smooth;
        }
    </style>
</head>
<body>

<!-- Header dengan Wave Effect -->
<div class="header-wave">
    <h1><i class="fas fa-hospital-user me-2"></i>Klinik Dr Rocky</h1>
    <p>Kelola data pasien dan keuangan dengan mudah</p>
    <div class="user-badge">
        <i class="fas fa-user-circle me-1"></i> <?php echo htmlspecialchars($userini_id); ?>
        <span class="mx-1">•</span>
        <i class="fas fa-calendar-day me-1"></i> <?php echo date("d/m/Y"); ?>
    </div>
</div>

<div class="container px-3">
    
    <!-- QUICK STATS (opsional, memberi info ringkas) -->
    <div class="stat-badge mb-3">
        <i class="fas fa-chart-simple me-1"></i> Dashboard • Selamat datang di panel administrasi
    </div>

    <!-- SECTION 1: DATA PASIEN -->
    <div class="section-card">
        <div class="section-title-card">
            <i class="fas fa-users"></i> DATA PASIEN
        </div>
        <div class="menu-grid">
            <a href="https://www.drrocky.skin">
                <button class="menu-btn menu-btn-primary"><i class="fas fa-globe"></i><span>Website</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="index.php">
                <button class="menu-btn menu-btn-primary"><i class="fas fa-home"></i><span>Home</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="visit-stat.php">
                <button class="menu-btn"><i class="fas fa-chart-line"></i><span>Statistik Pasien</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="cash/cash-stat.php?tanggal=<?php echo $today;?>">
                <button class="menu-btn"><i class="fas fa-chart-bar"></i><span>Statistik Keuangan</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="visit-yearly.php?tanggal=<?php echo date("Y-m-d");?>">
                <button class="menu-btn"><i class="fas fa-calendar-alt"></i><span>Pasien Tahunan</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="visit-monthly.php?tanggal=<?php echo date("Y-m-d");?>">
                <button class="menu-btn"><i class="fas fa-calendar-week"></i><span>Pasien Bulanan</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="visit-daily.php?tanggal=<?php echo date("Y-m-d");?>">
                <button class="menu-btn"><i class="fas fa-calendar-day"></i><span>Pasien Harian</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="_kelurahan.php">
                <button class="menu-btn"><i class="fas fa-database"></i><span>Reset Kelurahan</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="_index_lengkap.php">
                <button class="menu-btn"><i class="fas fa-table-list"></i><span>Data Pasien Lengkap</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="visit-last.php">
                <button class="menu-btn"><i class="fas fa-clock"></i><span>Terakhir Datang</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="administrasi.php">
                <button class="menu-btn"><i class="fas fa-box"></i><span>ADM</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="online_view.php">
                <button class="menu-btn"><i class="fas fa-user-plus"></i><span>Calon Pasien Online</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
        </div>
    </div>

    <!-- SECTION 2: KEUANGAN -->
    <div class="section-card">
        <div class="section-title-card">
            <i class="fas fa-coins"></i> KEUANGAN
        </div>
        <div class="menu-grid">
            <a href="cash/cash-stat.php?tanggal=<?php echo $today;?>">
                <button class="menu-btn menu-btn-primary"><i class="fas fa-chart-pie"></i><span>Statistik</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="cash/cash-piutang.php?userid=1">
                <button class="menu-btn menu-btn-primary"><i class="fas fa-hand-holding-usd"></i><span>Piutang</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="cash/cash-main.php">
                <button class="menu-btn"><i class="fas fa-plus-circle"></i><span>Tambah Belanja</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="cash/cash-view-monthly.php?tanggal=<?php echo date("Y-m-d");?>">
                <button class="menu-btn"><i class="fas fa-chart-line"></i><span>Keuangan Bulanan</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="cash/cash-view-daily.php?tanggal=<?php echo date("Y-m-d");?>">
                <button class="menu-btn"><i class="fas fa-chart-simple"></i><span>Keuangan Harian</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="cash/stock.php">
                <button class="menu-btn"><i class="fas fa-boxes"></i><span>Stock</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
        </div>
    </div>

    <!-- SECTION 3: PENGEMBANGAN DIRI -->
    <div class="section-card">
        <div class="section-title-card">
            <i class="fas fa-leaf"></i> PENGEMBANGAN DIRI
        </div>
        <div class="menu-grid">
            <a href="aero/meditation.php">
                <button class="menu-btn"><i class="fas fa-spa"></i><span>Meditasi</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="aero/aero_main.php">
                <button class="menu-btn"><i class="fas fa-heartbeat"></i><span>Anaerobik</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <?php if($userini_id == "3"){ ?>
            <a href="diary/index.php?check=1">
                <button class="menu-btn"><i class="fas fa-book"></i><span>Catatan Harian</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <?php } else { ?>
            <a href="diary/index.php?check=0">
                <button class="menu-btn"><i class="fas fa-book"></i><span>Catatan Harian</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <?php } ?>
            <a href="todo/routine.php">
                <button class="menu-btn"><i class="fas fa-check-circle"></i><span>Rutinitas Harian</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="todo/todo.php">
                <button class="menu-btn"><i class="fas fa-tasks"></i><span>Rencana</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="counter/counter.php?item=1">
                <button class="menu-btn"><i class="fas fa-smoking-ban"></i><span>Smoking</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
        </div>
    </div>

    <?php if($userini_id == 3){ ?>
    <!-- SECTION 4: ADMIN AREA (khusus admin) -->
    <div class="section-card">
        <div class="section-title-card">
            <i class="fas fa-shield-hooded"></i> ADMIN AREA
        </div>
        <div class="menu-grid">
            <a href="todo/routine_edit.php">
                <button class="menu-btn menu-btn-primary"><i class="fas fa-edit"></i><span>PDA Edit</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="coding/coding_main.php">
                <button class="menu-btn menu-btn-primary"><i class="fas fa-code"></i><span>Coding</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="userlog.php">
                <button class="menu-btn"><i class="fas fa-history"></i><span>Activity</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="coding/page.php">
                <button class="menu-btn"><i class="fas fa-file-alt"></i><span>Page</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="coding/page-01.php">
                <button class="menu-btn"><i class="fas fa-file-code"></i><span>Page-01</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="https://scr.drrocky.skin">
                <button class="menu-btn"><i class="fas fa-terminal"></i><span>My Script</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="https://form.drrocky.skin">
                <button class="menu-btn"><i class="fas fa-wpforms"></i><span>Online Form</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="player/index.php">
                <button class="menu-btn"><i class="fas fa-play-circle"></i><span>Player Utama</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="#">
                <button class="menu-btn"><i class="fas fa-hourglass-half"></i><span>Kosong</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
            <a href="player/player_01/index3.html">
                <button class="menu-btn"><i class="fas fa-music"></i><span>Player 01</span><i class="fas fa-chevron-right arrow"></i></button>
            </a>
        </div>
    </div>
    <?php } ?>

    <!-- LOGOUT BUTTON - Full Width -->
    <div class="section-card" style="background: transparent; box-shadow: none; padding: 0;">
        <a href="logout.php">
            <button class="menu-btn menu-btn-logout" style="justify-content: center; text-align: center; gap: 12px;">
                <i class="fas fa-sign-out-alt"></i>
                <span>LOGOUT</span>
                <i class="fas fa-arrow-right-from-bracket arrow"></i>
            </button>
        </a>
    </div>

    <div class="footer-mini">
        <i class="fas fa-heart" style="color: var(--coklat-2);"></i> Sistem Administrasi Klinik 
        <i class="fas fa-heart" style="color: var(--coklat-2);"></i>
        <br>
        <span class="small">v2.0 • Responsive Dashboard</span>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>