<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <title>SINARAN | RSU ANANDA PURWOKERTO</title>
    <link href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.min.css" rel="stylesheet">
    <!-- DataTables CSS -->
    <link rel="stylesheet" href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css">
    <link href="<?php echo base_url('assets_/css/styles.css'); ?>" rel="stylesheet" />
    <link rel="shortcut icon" type="image/png" href="<?= base_url('assets_/assets/img/logo-mini.png') ?>">
    <script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <noscript>
        <!-- Pengalihan ke halaman kosong setelah 0 detik -->
        <meta http-equiv="refresh" content="0; url=<?php echo base_url('welcome'); ?>">
    </noscript>
    <style>
        .table-responsive {
            overflow-x: auto;
            /* Memungkinkan scroll horizontal */
        }

        table {
            width: 100%;
            /* Pastikan tabel mengambil lebar penuh */
            min-width: 600px;
            /* Minimum lebar untuk tabel agar tidak terlalu kecil */
        }

        .btn-cb {
            padding: 10px;
        }

        /* Gaya CSS untuk memberikan jarak antar tombol */
        .button-margin {
            margin-right: 5px;
            /* Jarak antara tombol */
        }

        .no-js-warning {
            display: block;
            /* Tampilkan pesan jika JavaScript dinonaktifkan */
            background-color: #ffdddd;
            color: #d8000c;
            padding: 10px;
            margin: 10px 0;
            border: 1px solid #d8000c;
        }


        /* Media query untuk responsif */
        @media (max-width: 1000px) {
            .button-margin {
                margin-right: 10px;
                /* Jarak yang lebih besar di layar kecil */
                margin-bottom: 5px;
                /* Tambahkan margin bawah agar tombol tidak terlalu rapat */
                display: inline-block;
                /* Pastikan tombol tetap dalam satu baris */
            }

            .logout-button {
                font-size: 0.9rem;
                /* Ukuran font lebih kecil di layar kecil */
                padding: 0.4em 0.8em;
                /* Padding lebih kecil di layar kecil */
            }
        }


        /* Media query untuk responsif */
        @media (max-width: 768px) {
            .button-margin {
                margin-right: 10px;
                /* Jarak yang lebih besar di layar kecil */
                margin-bottom: 5px;
                /* Tambahkan margin bawah agar tombol tidak terlalu rapat */
                display: inline-block;
                /* Pastikan tombol tetap dalam satu baris */
            }

            .logout-button {
                font-size: 0.9rem;
                /* Ukuran font lebih kecil di layar kecil */
                padding: 0.4em 0.8em;
                /* Padding lebih kecil di layar kecil */
            }
        }

        @media (max-width: 480px) {

            .button-margin {
                margin-right: 10px;
                /* Jarak yang lebih besar di layar kecil */
                margin-bottom: 5px;
                /* Tambahkan margin bawah agar tombol tidak terlalu rapat */
                display: inline-block;
                /* Pastikan tombol tetap dalam satu baris */
            }

            .logout-button {
                font-size: 0.8rem;
                /* Ukuran font lebih kecil di layar sangat kecil */
                padding: 0.3em 0.6em;
                /* Padding lebih kecil di layar sangat kecil */
            }
        }

        /* Gaya dasar untuk tombol dropdown */
        .dropdown {
            position: relative;
            display: inline-block;
        }

        .dropdown-btn {
            background-color: #d8000c;
            /* Warna tombol */
            color: white;
            padding: 10px 20px;
            font-size: 16px;
            border: none;
            cursor: pointer;
            border-radius: 5px;
        }

        .dropdown-content {
            display: none;
            position: absolute;
            background-color: white;
            min-width: 160px;
            box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);
            z-index: 1;
        }

        .dropdown-content a {
            color: black;
            padding: 12px 16px;
            text-decoration: none;
            display: block;
        }

        .dropdown-content a:hover {
            background-color: #006400;
            color: white;
        }

        .dropdown:hover .dropdown-content {
            display: block;
        }

        .dropdown:hover .dropdown-btn {
            background-color: #8B0000;
            /* Warna saat hover */
        }

        /* Memastikan modal SweetAlert berada di atas elemen lain */
        /* Z-index untuk SweetAlert */
        .swal2-container {
            z-index: 9999 !important;
            /* Pastikan SweetAlert di atas elemen lain */
        }

        /* Z-index untuk Select2 */
        .select2-container {
            z-index: 10000 !important;
            /* Pastikan Select2 juga di atas elemen lain */
        }

        /* Jika ada elemen dengan z-index tinggi, turunkan nilai z-index elemen tersebut */
        .some-high-zindex-element {
            z-index: 1 !important;
            /* Sesuaikan sesuai kebutuhan */
        }

        .parent-element {
            overflow: visible !important;
            /* Pastikan elemen induk tidak menutupi modal */
        }

        .user-profile {
            margin-top: 30px;
            margin-left: 10px;
            text-decoration: none;
            /* Menghilangkan garis bawah jika ada */
            color: inherit;
            /* Menggunakan warna teks yang ada */
            font-size: 18px;
        }

        .user-profile i {
            font-size: 24px;
            /* Ukuran ikon */
            margin-right: 5px;
            /* Jarak antara ikon dan nama */
        }

        /* Tambahkan gaya untuk konten utama */
        #layoutSidenav_content {
            transition: margin-left 0.3s;
            /* Transisi halus saat sidebar di-toggle */
        }

        #layoutSidenav_nav.toggled {
            display: none;
            /* Menyembunyikan sidebar */
        }

        #layoutSidenav_content.full-width {
            margin-left: 0;
            /* Mengatur margin ke 0 saat sidebar disembunyikan */
            width: 100%;
            /* Mengatur lebar konten utama menjadi 100% */
        }
    </style>
    <!-- <script>
        // Mencegah klik kanan
        document.addEventListener('contextmenu', function(e) {
            e.preventDefault(); // Mencegah menu konteks
        });

        // Mencegah kombinasi tombol Ctrl+U, F12, dan Ctrl+Shift+I
        document.addEventListener('keydown', function(e) {
            // Cek jika tombol yang ditekan adalah Ctrl+U
            if (e.ctrlKey && e.key === 'u') {
                e.preventDefault(); // Mencegah tindakan default
            }
            // Cek jika tombol yang ditekan adalah F12
            if (e.key === 'F12') {
                e.preventDefault(); // Mencegah tindakan default
            }
            // Cek jika tombol yang ditekan adalah Ctrl+Shift+I
            if (e.ctrlKey && e.shiftKey && e.key === 'I') {
                e.preventDefault(); // Mencegah tindakan default
            }
        });
    </script> -->
    <style>
        #loadingSpinner {
            display: none;
            /* Hidden by default */
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 1000;
            /* Ensure it appears above other content */
        }

        .logout-button {
            padding: 0.5em 1em;
            /* Menggunakan em untuk padding */
            background-color: #f44336;
            /* Warna latar belakang merah */
            color: white;
            /* Warna teks putih */
            border: none;
            /* Menghilangkan border */
            border-radius: 5px;
            /* Sudut membulat */
            text-decoration: none;
            /* Menghilangkan garis bawah */
            font-size: 1rem;
            /* Menggunakan rem untuk ukuran font */
            transition: background-color 0.3s;
            /* Efek transisi */
            display: inline-flex;
            /* Menggunakan flex untuk penataan */
            align-items: center;
            /* Menyelaraskan ikon dan teks secara vertikal */
        }

        .logout-button i {
            margin-right: 0.5em;
            /* Jarak antara ikon dan teks */
        }

        .logout-button:hover {
            background-color: #d32f2f;
            /* Warna latar belakang saat hover */
        }

        .logout-button i {
            margin-right: 5px;
            /* Jarak antara ikon dan teks */
        }

        #laporanHeading {
            display: flex;
            align-items: center;
            /* Pusatkan ikon dan teks secara vertikal */
            justify-content: space-between;
            /* Beri jarak antara teks dan ikon */
        }

        #laporanDropdownIcon {
            margin-left: 10px;
            /* Jarak antara teks "Laporan" dan ikon dropdown */
            transition: transform 0.3s ease;
            /* Animasi rotasi ikon */
        }

        /* Rotasi ikon saat dropdown terbuka */
        #laporanDropdown:visible~#laporanHeading #laporanDropdownIcon {
            transform: rotate(180deg);
        }

        #laporanDropdown .nav-link {
            padding-top: 5px;
            /* Jarak atas lebih sempit */
            padding-bottom: 5px;
            /* Jarak bawah lebih sempit */
            margin: 0;
            /* Menghapus margin default */
        }

        #laporanHeading {
            cursor: pointer;
            /* Mengubah kursor menjadi pointer saat diarahkan ke teks "LAPORAN" */
        }

        #rekamMedisHeading {
            display: flex;
            align-items: center;
            /* Pusatkan ikon dan teks secara vertikal */
            justify-content: space-between;
            /* Beri jarak antara teks dan ikon */

        }

        #rekamMedisDropdownIcon {
            margin-left: 10px;
            /* Jarak antara teks "Rekam Medis" dan ikon dropdown */
            transition: transform 0.3s ease;
            /* Animasi rotasi ikon */
        }

        /* Rotasi ikon saat dropdown terbuka */
        #rekamMedisDropdown:visible~#rekamMedisHeading #rekamMedisDropdownIcon {
            transform: rotate(180deg);
            padding-top: 5px;

        }

        #rekamMedisDropdown .nav-link {
            padding-top: 5px;
            /* Jarak atas lebih besar */
            padding-bottom: 5px;
            /* Jarak bawah lebih besar */
            margin: 0;
            /* Menghapus margin default */
        }

        #rekamMedisDropdown .nav-link:hover {
            background-color: #f8f9fa;
            /* Warna latar belakang saat hover */
            color: #007bff;
            /* Warna teks saat hover */
        }

        .sb-sidenav::-webkit-scrollbar {
            width: 10px;
            background-color: #f5f5f5;
        }

        .sb-sidenav::-webkit-scrollbar-thumb {
            background-color: #ccc;
            border-radius: 10px;
        }

        .sb-sidenav::-webkit-scrollbar-thumb:hover {
            background-color: #aaa;
        }

        #menu-ikbs-heading {
            display: flex;
            align-items: center;
            /* Pusatkan ikon dan teks secara vertikal */
            justify-content: space-between;
            /* Beri jarak antara teks dan ikon */
        }

        #menu-ikbs-icon {
            margin-left: 10px;
            /* Jarak antara teks "Menu IKBS" dan ikon dropdown */
            transition: transform 0.3s ease;
            /* Animasi rotasi ikon */
        }

        /* Rotasi ikon saat dropdown terbuka */
        #menu-ikbs-dropdown:visible~#menu-ikbs-heading #menu-ikbs-icon {
            transform: rotate(180deg);
        }

        #menu-ikbs-dropdown .nav-link {
            padding-top: 5px;
            /* Jarak atas lebih sempit */
            padding-bottom: 5px;
            /* Jarak bawah lebih sempit */
            margin: 0;
            /* Menghapus margin default */
        }

        #menu-rawat-jalan-heading {
            display: flex;
            align-items: center;
            /* Pusatkan ikon dan teks secara vertikal */
            justify-content: space-between;
            /* Beri jarak antara teks dan ikon */
        }

        #menu-rawat-jalan-icon {
            margin-left: 10px;
            /* Jarak antara teks "Menu Rawat Jalan" dan ikon dropdown */
            transition: transform 0.3s ease;
            /* Animasi rotasi ikon */
        }

        /* Rotasi ikon saat dropdown terbuka */
        #menu-rawat-jalan-dropdown:visible~#menu-rawat-jalan-heading #menu-rawat-jalan-icon {
            transform: rotate(180deg);
        }

        #menu-rawat-jalan-dropdown .nav-link {
            padding-top: 5px;
            /* Jarak atas lebih sempit */
            padding-bottom: 5px;
            /* Jarak bawah lebih sempit */
            margin: 0;
            /* Menghapus margin default */
        }

        #menu-rawat-inap-heading {
            display: flex;
            align-items: center;
            /* Pusatkan ikon dan teks secara vertikal */
            justify-content: space-between;
            /* Beri jarak antara teks dan ikon */
        }

        #menu-rawat-inap-icon {
            margin-left: 10px;
            /* Jarak antara teks "Menu Rawat Inap" dan ikon dropdown */
            transition: transform 0.3s ease;
            /* Animasi rotasi ikon */
        }

        /* Rotasi ikon saat dropdown terbuka */
        #menu-rawat-inap-dropdown:visible~#menu-rawat-inap-heading #menu-rawat-inap-icon {
            transform: rotate(180deg);
        }

        #menu-rawat-inap-dropdown .nav-link {
            padding-top: 5px;
            /* Jarak atas lebih sempit */
            padding-bottom: 5px;
            /* Jarak bawah lebih sempit */
            margin: 0;
            /* Menghapus margin default */
        }

        #menu-igd-heading {
            display: flex;
            align-items: center;
            /* Pusatkan ikon dan teks secara vertikal */
            justify-content: space-between;
            /* Beri jarak antara teks dan ikon */
        }

        #menu-igd-icon {
            margin-left: 10px;
            /* Jarak antara teks "Menu IGD" dan ikon dropdown */
            transition: transform 0.3s ease;
            /* Animasi rotasi ikon */
        }

        /* Rotasi ikon saat dropdown terbuka */
        #menu-igd-dropdown:visible~#menu-igd-heading #menu-igd-icon {
            transform: rotate(180deg);
        }

        #menu-igd-dropdown .nav-link {
            padding-top: 5px;
            /* Jarak atas lebih sempit */
            padding-bottom: 5px;
            /* Jarak bawah lebih sempit */
            margin: 0;
            /* Menghapus margin default */
        }
    </style>
</head>

<body class="sb-nav-fixed">

    <nav class="sb-topnav navbar navbar-expand navbar-dark bg-success">
        <a class="navbar-brand ps-3" href="">SINARAN</a>
        <button class="btn btn-link btn-sm order-1 order-lg-0 me-4 me-lg-0" id="sidebarToggle" href="#!"><i class="fas fa-bars"></i></button>
        <ul class="navbar-nav ms-auto ms-md-0 me-3 me-lg-4">
            <li class="nav-item">
                <a class="nav-link logout-button" href="<?php echo base_url() ?>login/keluar">
                    <i class="fas fa-sign-out-alt"></i> Logout
                </a>
            </li>
        </ul>
    </nav>
    <div id="layoutSidenav">
        <div id="layoutSidenav_nav">
            <nav class="sb-sidenav accordion sb-sidenav-green" id="sidenavAccordion">
                <a id="navbarProfile" href="" class="user-profile i">
                    <i class="fas fa-user fa-fw"></i> <?= $this->session->userdata('nm_user') ?>
                </a>
                <div class="sb-sidenav-menu">
                    <div class="nav">

                        <!-- KEUANGAN LEVEL DIREKTUR KD AKSES 1001 : AKT -->

                        <?php if (($akses == '1001' || $akses == '1006') && $app == 'AKT') { ?>
                            <div id="laporanHeading" style="cursor: pointer; margin: 20px 0 2px 15px">
                                <p style="font-size: medium; color:white">
                                    <i style="margin-right: 10px;" class="fas fa-th-list"></i>
                                    Menu Billing
                                    <i style="margin-left: 10px;" class="fas fa-chevron-down" id="laporanDropdownIcon"></i>
                                </p>
                            </div>
                            <div id="laporanDropdown" style="display: none;">
                                <!-- <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/dokumen') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Dokumen
                                </a> -->
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/billing') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Billing Harian
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/radiologi') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Penjualan Radiologi
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/laboratorium') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Penjualan Laboratorium
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/farmasi') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Penjualan Farmasi
                                </a>
                            </div>

                            <!-- MENU IKBS -->
                            <div id="menu-ikbs-heading" style="cursor: pointer; margin: 5px 0 2px 15px">
                                <p style="font-size: medium; color:white">
                                    <i style="margin-right: 10px;" class="fas fa-th-list"></i>
                                    Menu IKBS
                                    <i style="margin-left: 10px;" class="fas fa-chevron-down" id="menu-ikbs-icon"></i>
                                </p>
                            </div>
                            <div id="menu-ikbs-dropdown" style="display: none;">
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/menuikbs') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Pasien IKBS
                                </a>
                            </div>
                            <!-- MENU IKBS -->

                            <!-- MENU RAWATJALAN -->
                            <div id="menu-rawat-jalan-heading" style="cursor: pointer; margin: 5px 0 2px 15px">
                                <p style="font-size: medium; color:white">
                                    <i style="margin-right: 10px;" class="fas fa-th-list"></i>
                                    Menu Rawat Jalan
                                    <i style="margin-left: 10px;" class="fas fa-chevron-down" id="menu-rawat-jalan-icon"></i>
                                </p>
                            </div>
                            <div id="menu-rawat-jalan-dropdown" style="display: none;">
                                <a class="nav-link dropdown-item" href="<?php echo base_url('menurawatjalan/pasienpoliall') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Poli Seluruh
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('menurawatjalan/polibatalkeuangan') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Poli BATAL
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('menurawatjalan/polidilayanikeuangan') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Poli DILAYANI
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/penjaminpolikeuangan') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Penjamin Poli
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('menurawatjalan/polihomecarekeuangan') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Pasien HOME CARE
                                </a>

                            </div>
                            <!-- MENU RAWATJALAN -->

                            <!-- MENU RAWATINAP -->
                            <div id="menu-rawat-inap-heading" style="cursor: pointer; margin: 5px 0 2px 15px">
                                <p style="font-size: medium; color:white">
                                    <i style="margin-right: 10px;" class="fas fa-th-list"></i>
                                    Menu Rawat Inap
                                    <i style="margin-left: 10px;" class="fas fa-chevron-down" id="menu-rawat-inap-icon"></i>
                                </p>
                            </div>
                            <div id="menu-rawat-inap-dropdown" style="display: none;">
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/penjamininap') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Penjamin Inap
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/pasieninaptotal') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Pasien Inap Total
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/penjamindpjp') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Pasien Inap DPJP
                                </a>
                            </div>
                            <!-- MENU RAWATINAP -->


                            <!-- MENU IGD -->
                            <div id="menu-igd-heading" style="cursor: pointer; margin: 5px 0 2px 15px">
                                <p style="font-size: medium; color:white">
                                    <i style="margin-right: 10px;" class="fas fa-th-list"></i>
                                    Menu IGD
                                    <i style="margin-left: 10px;" class="fas fa-chevron-down" id="menu-igd-icon"></i>
                                </p>
                            </div>
                            <div id="menu-igd-dropdown" style="display: none;">
                                <a class="nav-link dropdown-item" href="<?php echo base_url('menuigdkeuangan/pasienigddilayani') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data IGD Dilayani
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('menuigdkeuangan/pasienigdbatal') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data IGD Batal
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('menuigdkeuangan/pasienigdtotal') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data IGD Total
                                </a>
                            </div>
                            <!-- MENU IGD -->

                            <!-- END OFF KEUANGAN -->


                            <!-- REKAM MEDIS/ KD AKSES 112 : DAFTAR -->
                        <?php } else if ($akses == '112' && $app == 'DAFTAR') { ?>
                            <div id="rekamMedisHeading" style="cursor: pointer; margin: 20px 0 2px 15px">
                                <p style="font-size: medium; color:white">
                                    <i style="margin-right: 10px;" class="fas fa-folder-open"></i> <!-- Icon di sebelah kiri -->
                                    Rekam Medis
                                    <i style="margin-left: 10px;" class="fas fa-chevron-down" id="rekamMedisDropdownIcon"></i> <!-- Icon dropdown di sebelah kanan -->
                                </p>
                            </div>
                            <div id="rekamMedisDropdown" style="display: none;">
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/dashboard') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    DASHBOARD LAYANAN
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/dokumen') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Dokumen
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/rujuk') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Rujukan
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/penjaminpoli') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Penjamin Poli
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/penjaminigd') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Penjamin IGD
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/penjamininap') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Penjamin Inap
                                </a>
                            </div>

                            <!-- DEMOGRAFI  -->
                            <div id="laporanHeading" style="cursor: pointer; margin:10px 0 2px 15px">
                                <p style="font-size: medium; color:white">
                                    <i style="margin-right: 10px;" class="fas fa-th-list"></i>
                                    Demografi
                                    <i style="margin-left: 10px;" class="fas fa-chevron-down" id="laporanDropdownIcon"></i>
                                </p>
                            </div>
                            <div id="laporanDropdown" style="display: none;">
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/demografiusia') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Usia
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/demografijeniskelamin') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Jenis Kelamin
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/demografialamat') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Alamat
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/demografipekerjaan') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Pekerjaan
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/demografiasalkeinap') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Asal ke Inap
                                </a>
                            </div>
                            <!-- DEMOGRAFI  -->

                            <!-- FARMASI/ KD AKSES 9999 : FARMASI -->
                        <?php } else if ($akses == '9999' && $app == 'FARMASI') { ?>
                            <div class="sb-sidenav-menu-heading" id="rekamMedisHeading" style="cursor: pointer;">
                                <p style="font-size: medium; color:white">
                                    <i style="margin-right: 10px;" class="fas fa-folder-open"></i> <!-- Icon di sebelah kiri -->
                                    Farmasi
                                    <i style="margin-left: 10px;" class="fas fa-chevron-down" id="rekamMedisDropdownIcon"></i> <!-- Icon dropdown di sebelah kanan -->
                                </p>
                            </div>
                            <div id="rekamMedisDropdown" style="display: none;">
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/dashboard') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    DASHBOARD LAYANAN
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/rujuk') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Rujukan
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/dokumen') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Dokumen
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/farmasiwaktuserah') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Waktu Serah
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/farmasi') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Farmasi Penjualan
                                </a>
                            </div>


                            <!-- RAWAT JALAN /KD AKSES : DIR RMJ-->
                        <?php } else if ($akses == 'DIR' && $app == 'RMJ') { ?>
                            <div id="laporanHeading" style="cursor: pointer; margin:10px 0 2px 15px">
                                <p style="font-size: medium; color:white">
                                    <i style="margin-right: 10px;" class="fas fa-th-list"></i>
                                    Rawat Jalan
                                    <i style="margin-left: 10px;" class="fas fa-chevron-down" id="laporanDropdownIcon"></i>
                                </p>
                            </div>
                            <div id="laporanDropdown" style="display: none;">
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/dashboard') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Dashboard Layanan
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/dokumen') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Dokumen
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/rawatjalanpoli') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data SMF & Poli
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/homecare') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Home Care
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/rawatjalantotal') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Rawat Jalan Total
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/rawatjalanbatal') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Rawat Jalan Batal
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/rawatjalandilayani') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Rawat Jalan Dilayani
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/rawatjalantransfer') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Pasien Transfer RJ-RI
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/penjaminpoli') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Penjamin Poliklinik
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/antreanpoli') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Antrean Poliklinik
                                </a>
                            </div>

                            <!-- RAWAT INAP  /KD AKSES : DIR RMI-->
                        <?php } else if ($akses == 'RMI' && $app == 'RMI') { ?>
                            <div id="laporanHeading" style="cursor: pointer; margin:10px 0 2px 15px">
                                <p style="font-size: medium; color:white">
                                    <i style="margin-right: 10px;" class="fas fa-th-list"></i>
                                    Rawat Inap
                                    <i style="margin-left: 10px;" class="fas fa-chevron-down" id="laporanDropdownIcon"></i>
                                </p>
                            </div>
                            <div id="laporanDropdown" style="display: none;">
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/dashboard') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Dashboard Layanan
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/dokumen') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Dokumen
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/rawatinap') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Pasien Rawat Inap
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/penjamininap') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Penjamin Inap
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/pasieninaptotal') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Total Pasien Inap
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/penjamindpjp') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Pasien Inap DPJP
                                </a>

                            </div>


                            <!-- IGD  /KD AKSES : IGD-->
                        <?php } else if ($akses == 'IGD' && $app == 'IGD') { ?>
                            <div id="laporanHeading" style="cursor: pointer; margin:10px 0 2px 15px">
                                <p style="font-size: medium; color:white">
                                    <i style="margin-right: 10px;" class="fas fa-th-list"></i>
                                    Instalasi Gawat Darurat (IGD)
                                    <i style="margin-left: 10px;" class="fas fa-chevron-down" id="laporanDropdownIcon"></i>
                                </p>
                            </div>
                            <div id="laporanDropdown" style="display: none;">
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/dashboard') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Dashboard Layanan
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/dokumen') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Dokumen
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/igd') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Dashboard Pasien IGD
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/pasienigd') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Pasien IGD Total
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/pasienigdbatal') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Pasien IGD Batal
                                </a>
                                <a class="nav-link dropdown-item" href="<?php echo base_url('dashboard/pasienigddilayani') ?>">
                                    <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                    Data Pasien IGD Dilayani
                                </a>

                            </div>
                        <?php } else { ?>
                            <div class="sb-sidenav-menu-heading">LAPORAN</div>
                            <a class="nav-link" href="<?php echo base_url('dashboard/dokumen') ?>">
                                <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
                                Dokumen
                            </a>
                        <?php } ?>
                    </div>
                </div>
            </nav>
        </div>

        <!-- <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
        <script>
            $(document).ready(function() {
                $('#laporanHeading').click(function() {
                    $('#laporanDropdown').slideToggle(); // Menampilkan atau menyembunyikan dropdown
                });
            });
        </script> -->
        <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
        <script>
            $(document).ready(function() {
                // Cek state dropdown dari localStorage saat halaman dimuat
                const dropdownState = localStorage.getItem('dropdownState');
                if (dropdownState === 'open') {
                    $('#laporanDropdown').show(); // Tampilkan dropdown jika state-nya "open"
                }

                // Toggle dropdown saat "LAPORAN" diklik
                $('#laporanHeading', ).click(function() {
                    $('#laporanDropdown').slideToggle(function() {
                        // Simpan state dropdown ke localStorage
                        if ($('#laporanDropdown').is(':visible')) {
                            localStorage.setItem('dropdownState', 'open');
                        } else {
                            localStorage.setItem('dropdownState', 'closed');
                        }
                    });
                });

                // Mencegah dropdown menutup saat mengklik menu di dalamnya
                $('#laporanDropdown').on('click', '.dropdown-item', function(e) {
                    e.stopPropagation(); // Menghentikan event bubbling agar dropdown tidak menutup
                });
            });
        </script>

        <script>
            $(document).ready(function() {
                // Cek state dropdown dari localStorage saat halaman dimuat
                const dropdownState = localStorage.getItem('dropdownState');
                if (dropdownState === 'open') {
                    $('#laporanDropdown').show(); // Tampilkan dropdown jika state-nya "open"
                }

                // Toggle dropdown saat "LAPORAN" diklik
                $('#laporanHeading', ).click(function() {
                    $('#menuIKBS').slideToggle(function() {
                        // Simpan state dropdown ke localStorage
                        if ($('#menuIKBS').is(':visible')) {
                            localStorage.setItem('dropdownState', 'open');
                        } else {
                            localStorage.setItem('dropdownState', 'closed');
                        }
                    });
                });

                // Mencegah dropdown menutup saat mengklik menu di dalamnya
                $('#laporanDropdown').on('click', '.dropdown-item', function(e) {
                    e.stopPropagation(); // Menghentikan event bubbling agar dropdown tidak menutup
                });
            });
        </script>

        <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
        <script>
            $(document).ready(function() {
                // Cek state dropdown dari localStorage saat halaman dimuat
                const dropdownState1 = localStorage.getItem('dropdownState1');
                if (dropdownState1 === 'open') {
                    $('#laporanDropdown').show(); // Tampilkan dropdown jika state-nya "open"
                }

                // Toggle dropdown saat "LAPORAN" diklik
                $('#laporanHeading', ).click(function() {
                    $('#laporanDropdown1').slideToggle(function() {
                        // Simpan state dropdown ke localStorage
                        if ($('#laporanDropdown1').is(':visible')) {
                            localStorage.setItem('dropdownState1', 'open');
                        } else {
                            localStorage.setItem('dropdownState1', 'closed');
                        }
                    });
                });

                // Mencegah dropdown menutup saat mengklik menu di dalamnya
                $('#laporanDropdown1').on('click', '.dropdown-item', function(e) {
                    e.stopPropagation(); // Menghentikan event bubbling agar dropdown tidak menutup
                });
            });
        </script>

        <script>
            $(document).ready(function() {
                // Cek state dropdown dari localStorage saat halaman dimuat
                const dropdownState = localStorage.getItem('dropdownState');
                if (dropdownState === 'open') {
                    $('#menu-ikbs-dropdown').show(); // Tampilkan dropdown jika state-nya "open"
                }

                // Toggle dropdown saat "MENU IKBS" diklik
                $('#menu-ikbs-heading').click(function() {
                    $('#menu-ikbs-dropdown').slideToggle(function() {
                        // Simpan state dropdown ke localStorage
                        if ($('#menu-ikbs-dropdown').is(':visible')) {
                            localStorage.setItem('dropdownState', 'open');
                        } else {
                            localStorage.setItem('dropdownState', 'closed');
                        }
                    });
                });

                // Mencegah dropdown menutup saat mengklik menu di dalamnya
                $('#menu-ikbs-dropdown').on('click', '.dropdown-item', function(e) {
                    e.stopPropagation(); // Menghentikan event bubbling agar dropdown tidak menutup
                });
            });
        </script>

        <script>
            $(document).ready(function() {
                // Cek state dropdown dari localStorage saat halaman dimuat
                const dropdownState = localStorage.getItem('dropdownState');
                if (dropdownState === 'open') {
                    $('#menu-rawat-jalan-dropdown').show(); // Tampilkan dropdown jika state-nya "open"
                }

                // Toggle dropdown saat "MENU RAWAT JALAN" diklik
                $('#menu-rawat-jalan-heading').click(function() {
                    $('#menu-rawat-jalan-dropdown').slideToggle(function() {
                        // Simpan state dropdown ke localStorage
                        if ($('#menu-rawat-jalan-dropdown').is(':visible')) {
                            localStorage.setItem('dropdownState', 'open');
                        } else {
                            localStorage.setItem('dropdownState', 'closed');
                        }
                    });
                });

                // Mencegah dropdown menutup saat mengklik menu di dalamnya
                $('#menu-rawat-jalan-dropdown').on('click', '.dropdown-item', function(e) {
                    e.stopPropagation(); // Menghentikan event bubbling agar dropdown tidak menutup
                });
            });
        </script>

        <script>
            $(document).ready(function() {
                // Cek state dropdown dari localStorage saat halaman dimuat
                const dropdownState = localStorage.getItem('dropdownState');
                if (dropdownState === 'open') {
                    $('#menu-rawat-inap-dropdown').show(); // Tampilkan dropdown jika state-nya "open"
                }

                // Toggle dropdown saat "MENU RAWAT INAP" diklik
                $('#menu-rawat-inap-heading').click(function() {
                    $('#menu-rawat-inap-dropdown').slideToggle(function() {
                        // Simpan state dropdown ke localStorage
                        if ($('#menu-rawat-inap-dropdown').is(':visible')) {
                            localStorage.setItem('dropdownState', 'open');
                        } else {
                            localStorage.setItem('dropdownState', 'closed');
                        }
                    });
                });

                // Mencegah dropdown menutup saat mengklik menu di dalamnya
                $('#menu-rawat-inap-dropdown').on('click', '.dropdown-item', function(e) {
                    e.stopPropagation(); // Menghentikan event bubbling agar dropdown tidak menutup
                });
            });
        </script>

        <script>
            $(document).ready(function() {
                // Cek state dropdown dari localStorage saat halaman dimuat
                const dropdownState = localStorage.getItem('dropdownState');
                if (dropdownState === 'open') {
                    $('#menu-igd-dropdown').show(); // Tampilkan dropdown jika state-nya "open"
                }

                // Toggle dropdown saat "MENU IGD" diklik
                $('#menu-igd-heading').click(function() {
                    $('#menu-igd-dropdown').slideToggle(function() {
                        // Simpan state dropdown ke localStorage
                        if ($('#menu-igd-dropdown').is(':visible')) {
                            localStorage.setItem('dropdownState', 'open');
                        } else {
                            localStorage.setItem('dropdownState', 'closed');
                        }
                    });
                });

                // Mencegah dropdown menutup saat mengklik menu di dalamnya
                $('#menu-igd-dropdown').on('click', '.dropdown-item', function(e) {
                    e.stopPropagation(); // Menghentikan event bubbling agar dropdown tidak menutup
                });
            });
        </script>

        <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
        <script>
            $(document).ready(function() {
                // Cek state dropdown dari localStorage saat halaman dimuat
                const rekamMedisDropdownState = localStorage.getItem('rekamMedisDropdownState');
                if (rekamMedisDropdownState === 'open') {
                    $('#rekamMedisDropdown').show(); // Tampilkan dropdown jika state-nya "open"
                    $('#rekamMedisDropdownIcon').removeClass('fa-chevron-down').addClass('fa-chevron-up'); // Ubah ikon ke atas
                }

                // Toggle dropdown saat "Rekam Medis" diklik
                $('#rekamMedisHeading').click(function() {
                    $('#rekamMedisDropdown').slideToggle(function() {
                        // Ubah ikon berdasarkan state dropdown
                        if ($('#rekamMedisDropdown').is(':visible')) {
                            $('#rekamMedisDropdownIcon').removeClass('fa-chevron-down').addClass('fa-chevron-up'); // Ikon ke atas
                            localStorage.setItem('rekamMedisDropdownState', 'open');
                        } else {
                            $('#rekamMedisDropdownIcon').removeClass('fa-chevron-up').addClass('fa-chevron-down'); // Ikon ke bawah
                            localStorage.setItem('rekamMedisDropdownState', 'closed');
                        }
                    });
                });

                // Mencegah dropdown menutup saat mengklik menu di dalamnya
                $('#rekamMedisDropdown').on('click', '.dropdown-item', function(e) {
                    e.stopPropagation(); // Menghentikan event bubbling agar dropdown tidak menutup
                });
            });
        </script>