<?php
session_start();
date_default_timezone_set('Asia/Jakarta');
include '../koneksi.php';

// if (!isset($_SESSION['admin'])) {
//     echo "<script>alert('Anda Harus Masuk Terlebih Dahulu');</script>";
//     echo "<script>location='../login.php';</script>";
//     exit();
// }


function tanggal($tgl)
{
    $tanggal = substr($tgl, 8, 2);
    $bulan = getBulan(substr($tgl, 5, 2));
    $tahun = substr($tgl, 0, 4);
    return $tanggal . ' ' . $bulan . ' ' . $tahun;
}
function getBulan($bln)
{
    switch ($bln) {
        case 1:
            return "Januari";
            break;
        case 2:
            return "Februari";
            break;
        case 3:
            return "Maret";
            break;
        case 4:
            return "April";
            break;
        case 5:
            return "Mei";
            break;
        case 6:
            return "Juni";
            break;
        case 7:
            return "Juli";
            break;
        case 8:
            return "Agustus";
            break;
        case 9:
            return "September";
            break;
        case 10:
            return "Oktober";
            break;
        case 11:
            return "November";
            break;
        case 12:
            return "Desember";
            break;
    }
}
function rupiah($angka)
{
    if ($angka != "") {
        $angkafix = $angka;
    } else {
        $angkafix = 0;
    }
    $hasilrupiah = "Rp " . number_format($angkafix, 2, ',', '.');
    return $hasilrupiah;
}

?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<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">
    <title>Sikar Tembakau - Admin</title>
    <link href="css/css/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">

    <link href="css/css//sb-admin-2.min.css" rel="stylesheet">
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
    <link href="css/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <script src="assets/ckeditor/ckeditor.js"></script>
    <link rel="icon" type="image/x-icon" href="../foto/logo.jpg">

    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
    <link href="https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400..700;1,400..700&display=swap" rel="stylesheet">
    <link href="assets/css/custom.css" rel="stylesheet">
    <!-- <link href="css/custom.css" rel="stylesheet"> -->
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css">

</head>




<body id="page-top">
    <div id="wrapper">
        <ul class="navbar-nav sidebar  accordion" id="accordionSidebar">
            <a class="sidebar-brand d-flex align-items-center justify-content-center" href="index.php?halaman=beranda">

                <div class="sidebar-brand-text mx-3">
                    <h5><b>Admin</b></h5>
                </div>
            </a>
            <hr class="sidebar-divider">
            <li class="nav-item">
                <a class="nav-link" href="index.php?halaman=beranda">
                    <i class="fas fa-fw fa-home"></i>
                    <span>Dashboard</span>
                </a>
            </li>
            <hr class="sidebar-divider">
            <li class="nav-item">
                <a class="nav-link" href="index.php?halaman=gejaladaftar">
                    <i class="fas fa-fw fa-list"></i>
                    <span>Data Gejala</span>
                </a>
            </li>
            <hr class="sidebar-divider">
            <li class="nav-item">
                <a class="nav-link" href="index.php?halaman=penyakitdaftar">
                    <i class="fas fa-fw fa-table"></i>
                    <span>Data Penyakit</span>
                </a>
            </li>
            <hr class="sidebar-divider">
            <li class="nav-item">
                <a class="nav-link" href="index.php?halaman=ruledaftar">
                    <i class="fas fa-fw fa-pen"></i>
                    <span>Data Rule</span>
                </a>
            </li>
            <hr class="sidebar-divider">
            <li class="nav-item">
                <a class="nav-link" href="index.php?halaman=nilaifuzzydaftar">
                    <i class="fas fa-fw fa-book"></i>
                    <span>Nilai Interpretasi</span>
                </a>
            </li>
            <hr class="sidebar-divider">
            <li class="nav-item">
                <a class="nav-link" href="index.php?halaman=nilaigejalapenyakitdaftar">
                    <i class="fas fa-fw fa-user"></i>
                    <span>Nilai Interprestasi Gejala Penyakit</span>
                </a>
            </li>
            <hr class="sidebar-divider">
        </ul>
        <div id="content-wrapper" class="d-flex flex-column">
            <div id="content">
                <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">
                    <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
                        <i class="fa fa-bars"></i>
                    </button>

                    <ul class="navbar-nav ml-auto">
                        <li class="nav-item dropdown no-arrow">
                            <a onclick="return confirm('Apakah Anda Yakin Ingin Keluar ?');" class="nav-link" href="index.php?halaman=logout">
                                <span class="mr-2 d-none d-lg-inline text-gray-600 small"> Keluar</span>
                            </a>
                        </li>
                    </ul>
                </nav>
                <div class="container-fluid">
                    <div id="page-inner">
                        <?php
                        if (isset($_GET['halaman'])) {
                            if ($_GET['halaman'] == "beranda") {
                                include 'beranda.php';
                            } elseif ($_GET['halaman'] == "gejaladaftar") {
                                include 'gejaladaftar.php';
                            } elseif ($_GET['halaman'] == "gejalatambah") {
                                include 'gejalatambah.php';
                            } elseif ($_GET['halaman'] == "gejalaedit") {
                                include 'gejalaedit.php';
                            } elseif ($_GET['halaman'] == "gejalahapus") {
                                include 'gejalahapus.php';
                            } elseif ($_GET['halaman'] == "penyakitdaftar") {
                                include 'penyakitdaftar.php';
                            } elseif ($_GET['halaman'] == "penyakittambah") {
                                include 'penyakittambah.php';
                            } elseif ($_GET['halaman'] == "penyakitedit") {
                                include 'penyakitedit.php';
                            } elseif ($_GET['halaman'] == "penyakithapus") {
                                include 'penyakithapus.php';
                            } elseif ($_GET['halaman'] == "ruledaftar") {
                                include 'ruledaftar.php';
                            } elseif ($_GET['halaman'] == "ruletambah") {
                                include 'ruletambah.php';
                            } elseif ($_GET['halaman'] == "ruleedit") {
                                include 'ruleedit.php';
                            } elseif ($_GET['halaman'] == "rulehapus") {
                                include 'rulehapus.php';
                            } elseif ($_GET['halaman'] == "nilaifuzzydaftar") {
                                include 'nilaifuzzydaftar.php';
                            } elseif ($_GET['halaman'] == "nilaifuzzytambah") {
                                include 'nilaifuzzytambah.php';
                            } elseif ($_GET['halaman'] == "nilaifuzzyedit") {
                                include 'nilaifuzzyedit.php';
                            } elseif ($_GET['halaman'] == "nilaifuzzyhapus") {
                                include 'nilaifuzzyhapus.php';
                            } elseif ($_GET['halaman'] == "nilaigejalapenyakitdaftar") {
                                include 'nilaigejalapenyakitdaftar.php';
                            } elseif ($_GET['halaman'] == "nilaigejalapenyakittambah") {
                                include 'nilaigejalapenyakittambah.php';
                            } elseif ($_GET['halaman'] == "nilaigejalapenyakitedit") {
                                include 'nilaigejalapenyakitedit.php';
                            } elseif ($_GET['halaman'] == "nilaigejalapenyakithapus") {
                                include 'nilaigejalapenyakithapus.php';
                            } elseif ($_GET['halaman'] == "riwayatdaftar") {
                                include 'riwayatdaftar.php';
                            } elseif ($_GET['halaman'] == "riwayatdetail") {
                                include 'riwayatdetail.php';
                            } elseif ($_GET['halaman'] == "riwayathapus") {
                                include 'riwayathapus.php';
                            } elseif ($_GET['halaman'] == "laporangejala") {
                                include 'laporangejala.php';
                            } elseif ($_GET['halaman'] == "laporanpenyakit") {
                                include 'laporanpenyakit.php';
                            } elseif ($_GET['halaman'] == "laporanpasien") {
                                include 'laporanpasien.php';
                            } elseif ($_GET['halaman'] == "logout") {
                                include 'logout.php';
                            }
                        } else {
                            include 'beranda.php';
                        }
                        ?>
                    </div>
                </div>
            </div>
            <!-- <script src="assets/js/jquery-1.10.2.js"></script> -->
            <script src="assets/js/jquery.metisMenu.js"></script>
            <script src="assets/js/morris/raphael-2.1.0.min.js"></script>
            <script src="assets/js/morris/morris.js"></script>
            <script src="css/js/sb-admin-2.min.js"></script>
            <script src="assets/js/jquery.min.js"></script>
            <script src="https://code.jquery.com/jquery-3.7.1.js"></script>

            <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>

            <!-- Link JS DataTables -->
            <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>

            <script>
                $(document).ready(function() {
                    $('.select2').select2({
                        placeholder: "--Pilih--",
                        allowClear: true,
                        closeOnSelect: false
                    });
                    $('#tabel').DataTable();
                });
            </script>

</body>

</html>