<?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>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Administrasi</title>

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">

    <link href="images/balance.ico" rel="icon" type="image/icon">

    <style>

        body{
            background:
            linear-gradient(rgba(40,25,15,0.80),rgba(40,25,15,0.90)),
            url('../images/Xiaomi1.jpg');

            background-size:cover;
            background-position:center;
            background-attachment:fixed;

            color:#fff;
            min-height:100vh;

            font-family:'Segoe UI',sans-serif;
        }

        .main-container{
            max-width:1200px;
            margin:auto;
            padding:20px;
        }

        .top-image{
            width:100%;
            max-width:600px;
            display:block;
            margin:auto;
            border-radius:20px;
            box-shadow:0 10px 25px rgba(0,0,0,0.4);
        }

        .section-title{
            text-align:center;
            margin-top:35px;
            margin-bottom:20px;
            font-size:32px;
            font-weight:bold;
            letter-spacing:2px;
            color:#F5E6D3;
        }

        .menu-card{
            background:rgba(255,255,255,0.08);
            backdrop-filter:blur(10px);

            border:1px solid rgba(255,255,255,0.1);

            border-radius:20px;

            padding:20px;

            margin-bottom:25px;

            box-shadow:0 8px 20px rgba(0,0,0,0.3);
        }

        .menu-btn{
            width:100%;
            border:none;
            border-radius:15px;

            padding:16px 12px;

            color:white;
            font-weight:bold;

            transition:0.3s;

            margin-bottom:15px;

            min-height:75px;

            font-size:15px;

            box-shadow:0 5px 12px rgba(0,0,0,0.25);
        }

        .menu-btn:hover{
            transform:translateY(-3px) scale(1.02);
            opacity:0.92;
        }

        /* PALETTE COKLAT */

        .c1{ background:#3E2723; }
        .c2{ background:#4E342E; }
        .c3{ background:#5D4037; }
        .c4{ background:#6D4C41; }
        .c5{ background:#795548; }
        .c6{ background:#8D6E63; }
        .c7{ background:#A1887F; }
        .c8{ background:#BCAAA4; color:#2d1b14; }
        .c9{ background:#D7CCC8; color:#2d1b14; }
        .c10{ background:#EFEBE9; color:#2d1b14; }

        .c11{ background:#7B3F00; }
        .c12{ background:#8B4513; }
        .c13{ background:#A0522D; }
        .c14{ background:#CD853F; color:#2d1b14; }
        .c15{ background:#5C4033; }

        a{
            text-decoration:none;
        }

        @media(max-width:768px){

            .section-title{
                font-size:24px;
            }

            .menu-btn{
                font-size:14px;
                padding:14px 10px;
                min-height:68px;
            }

            .main-container{
                padding:12px;
            }

        }

    </style>
</head>

<body>

<div class="main-container">

    <img src="images/page/navigasi_02.png" class="top-image">

    <!-- DATA PASIEN -->

    <div class="section-title">
        DATA PASIEN
    </div>

    <div class="menu-card">

        <div class="row g-3">

            <div class="col-6 col-md-3">
                <a href="https://www.drrocky.skin">
                    <button class="menu-btn c1">
                        WEBSITE
                    </button>
                </a>
            </div>

            <div class="col-6 col-md-3">
                <a href="index.php">
                    <button class="menu-btn c2">
                        HOME
                    </button>
                </a>
            </div>

            <div class="col-6 col-md-3">
                <a href="visit-stat.php">
                    <button class="menu-btn c3">
                        STATISTIK PASIEN
                    </button>
                </a>
            </div>

            <div class="col-6 col-md-3">
                <a href="cash/cash-stat.php?tanggal=<?php echo $today;?>">
                    <button class="menu-btn c4">
                        STATISTIK KEUANGAN
                    </button>
                </a>
            </div>

            <div class="col-6 col-md-4">
                <a href="visit-yearly.php?tanggal=<?php echo date("Y-m-d");?>">
                    <button class="menu-btn c5">
                        PASIEN TAHUNAN
                    </button>
                </a>
            </div>

            <div class="col-6 col-md-4">
                <a href="visit-monthly.php?tanggal=<?php echo date("Y-m-d");?>">
                    <button class="menu-btn c6">
                        PASIEN BULANAN
                    </button>
                </a>
            </div>

            <div class="col-12 col-md-4">
                <a href="visit-daily.php?tanggal=<?php echo date("Y-m-d");?>">
                    <button class="menu-btn c7">
                        PASIEN HARIAN
                    </button>
                </a>
            </div>

            <div class="col-6">
                <a href="_kelurahan.php">
                    <button class="menu-btn c11">
                        RESET DATA KELURAHAN
                    </button>
                </a>
            </div>

            <div class="col-6">
                <a href="_index_lengkap.php">
                    <button class="menu-btn c12">
                        DATA PASIEN LENGKAP
                    </button>
                </a>
            </div>

            <div class="col-12">
                <a href="visit-last.php">
                    <button class="menu-btn c13">
                        TERAKHIR DATANG
                    </button>
                </a>
            </div>

        </div>

    </div>


    <!-- KEUANGAN -->

    <div class="section-title">
        KEUANGAN
    </div>

    <div class="menu-card">

        <div class="row g-3">

            <div class="col-6 col-md-4">
                <a href="cash/cash-stat.php?tanggal=<?php echo $today;?>">
                    <button class="menu-btn c3">
                        STATISTIK
                    </button>
                </a>
            </div>

            <div class="col-6 col-md-4">
                <a href="cash/cash-piutang.php?userid=1">
                    <button class="menu-btn c4">
                        PIUTANG
                    </button>
                </a>
            </div>

            <div class="col-12 col-md-4">
                <a href="cash/cash-main.php">
                    <button class="menu-btn c5">
                        TAMBAH BELANJA
                    </button>
                </a>
            </div>

            <div class="col-6">
                <a href="cash/cash-view-monthly.php?tanggal=<?php echo date("Y-m-d");?>">
                    <button class="menu-btn c6">
                        KEUANGAN BULANAN
                    </button>
                </a>
            </div>

            <div class="col-6">
                <a href="cash/cash-view-daily.php?tanggal=<?php echo date("Y-m-d");?>">
                    <button class="menu-btn c7">
                        KEUANGAN HARIAN
                    </button>
                </a>
            </div>

        </div>

    </div>


    <!-- PENGEMBANGAN DIRI -->

    <div class="section-title">
        PENGEMBANGAN DIRI
    </div>

    <div class="menu-card">

        <div class="row g-3">

            <div class="col-6">
                <a href="aero/meditation.php">
                    <button class="menu-btn c1">
                        MEDITASI
                    </button>
                </a>
            </div>

            <div class="col-6">
                <a href="aero/aero_main.php">
                    <button class="menu-btn c2">
                        AEROBIK
                    </button>
                </a>
            </div>

            <div class="col-6">
                <?php if($userini_id == "3"){ ?>
                    <a href="diary/index.php?check=1">
                <?php } else { ?>
                    <a href="diary/index.php?check=0">
                <?php } ?>

                    <button class="menu-btn c8">
                        CATATAN HARIAN
                    </button>

                </a>
            </div>

            <div class="col-6">
                <a href="todo/routine.php">
                    <button class="menu-btn c9">
                        RUTINITAS HARIAN
                    </button>
                </a>
            </div>

            <div class="col-6">
                <a href="todo/todo.php">
                    <button class="menu-btn c10">
                        RENCANA
                    </button>
                </a>
            </div>

            <div class="col-6">
                <a href="counter/counter.php?item=1">
                    <button class="menu-btn c15">
                        SMOKING
                    </button>
                </a>
            </div>

        </div>

    </div>


    <!-- ADMIN AREA -->

    <?php if($userini_id == 3){ ?>

    <div class="section-title">
        ADMIN AREA
    </div>

    <div class="menu-card">

        <div class="row g-3">

            <div class="col-6 col-md-4">
                <a href="todo/routine_edit.php">
                    <button class="menu-btn c11">
                        PDA EDIT
                    </button>
                </a>
            </div>

            <div class="col-6 col-md-4">
                <a href="coding/coding_main.php">
                    <button class="menu-btn c12">
                        CODING
                    </button>
                </a>
            </div>

            <div class="col-12 col-md-4">
                <a href="userlog.php">
                    <button class="menu-btn c13">
                        ACTIVITY
                    </button>
                </a>
            </div>

            <div class="col-6">
                <a href="player/index.php">
                    <button class="menu-btn c5">
                        PLAYER UTAMA
                    </button>
                </a>
            </div>

            <div class="col-6">
                <a href="player/player_01/index3.html">
                    <button class="menu-btn c6">
                        PLAYER 01
                    </button>
                </a>
            </div>

        </div>

    </div>

    <?php } ?>


    <!-- LOGOUT -->

    <div class="text-center mt-4 mb-5">

        <a href="logout.php">
            <button class="menu-btn c1" style="max-width:350px;">
                LOGOUT
            </button>
        </a>

    </div>

</div>

</body>
</html>