<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Klinik Mobil | Aplikasi Bengkel mMbil</title>

    <!-- Font Awesome Icons -->
    <link rel="stylesheet" href="<?= base_url() ?>/assets/plugins/fontawesome-free/css/all.min.css">
    <!-- overlayScrollbars -->
    <link rel="stylesheet" href="<?= base_url() ?>/assets/plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<?= base_url() ?>/assets/dist/css/adminlte.min.css">
    <!-- summernote -->
    <link rel="stylesheet" href="<?= base_url() ?>/assets/plugins/summernote/summernote.min.css">

    <!-- setting tanggal -->
    <link rel="stylesheet" href="<?= base_url() ?>/assets/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css">
    <!-- daterange picker -->
    <link rel="stylesheet" href="<?= base_url() ?>/assets/plugins/daterangepicker/daterangepicker.css">
    <link rel="stylesheet" href="<?= base_url() ?>/assets/plugins/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>/assets/plugins/bootstrap-datepicker/css/bootstrap-datepicker3.css">
    <link rel="stylesheet" href="<?= base_url() ?>/assets/dist/sweetalert2/sweetalert2.css">

    <!-- data table -->
    <link rel="stylesheet" href="<?= base_url() ?>/assets/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>/assets/plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
    <!--
    <link href="<?= base_url() ?>/assets/img/km.png" rel="icon">
 
    <script>
        function launchIntoFullscreen(element) {
            if (element.requestFullscreen) {
                element.requestFullscreen();
            } else if (element.mozRequestFullScreen) {
                element.mozRequestFullScreen();
            } else if (element.webkitRequestFullscreen) {
                element.webkitRequestFullscreen();
            } else if (element.msRequestFullscreen) {
                element.msRequestFullscreen();
            }
        }

        // Launch fullscreen for browsers that support it!
        launchIntoFullscreen(document.documentElement); // the whole page
        launchIntoFullscreen(document.getElementById("videoElement")); // any individual element
    </script>
-->
</head>

<body class="hold-transition sidebar-mini sidebar-collapse">
    <!-- star halaman menu -->
    <div class="wrapper">
        <!-- star menu Navbar -->
        <nav class="main-header navbar navbar-expand navbar-primary navbar-light">
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
                </li>
            </ul>


        </nav>
        <!-- ending menu Navbar -->

        <!-- Main Sidebar Container -->
        <aside class="main-sidebar sidebar-dark-secondary elevation-4">
            <!-- Brand Logo -->
            <a href="." class="brand-link">
                <img src="<?= base_url() ?>/upload/foto/karyawan/<?= $this->fungsi->user_login()->foto ?>" alt="klinikmotor" class="brand-image img-circle elevation-3" style="opacity: .8">
                <span class="brand-text font-weight-light"><?= $this->fungsi->user_login()->nama ?> </span>
            </a>

            <!-- star menu -->
            <div class="sidebar ">
                <!-- star item Menu -->
                <nav class="mt-2">
                    <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                        <?php if ($this->session->userdata('level') == 1) { ?>

                            <li class="nav-item">
                                <a href="<?= site_url('logcab') ?>" <?= $this->uri->segment(1) == 'logcab'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                    <i class="nav-icon fas fa-warehouse"></i>
                                    <p>
                                        Lokasi Usaha
                                    </p>
                                </a>
                            </li>

                            <li class="nav-item">
                                <a href="<?= site_url('supl') ?>" <?= $this->uri->segment(1) == 'supl'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                    <i class="nav-icon fas fa-dolly"></i>
                                    <p>
                                        Supllier
                                    </p>
                                </a>
                            </li>

                            <li class="nav-item">
                                <a href="<?= site_url('mekanikid') ?>" <?= $this->uri->segment(1) == 'mekanikid'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                    <i class="nav-icon fas fa-user"></i>
                                    <p>
                                        Team ID
                                    </p>
                                </a>
                            </li>

                            <li <?= $this->uri->segment(1) == 'kmpart' || $this->uri->segment(1) == 'kmjasa' ? 'class="nav-item menu-open has-treeview"' : 'class="nav-item has-treeview "' ?>>
                                <a href="<?= site_url('kmpart') ?>" <?= $this->uri->segment(1) == 'kmpart'  ? 'class="active nav-link "' : 'class="nav-link"' ?>>
                                    <i class="nav-icon fas fa-tags"></i>
                                    <p>
                                        Daftar Harga
                                        <i class="right fas fa-angle-left"></i>
                                    </p>
                                </a>

                                <ul class="nav nav-treeview">
                                    <li class="nav-item">
                                        <a href="<?= site_url('kmpart') ?>" <?= $this->uri->segment(1) == 'kmpart'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                            <i class="nav-icon fas fa-cog"></i>
                                            <p>Sperpart</p>
                                        </a>
                                    </li>
                                </ul>

                                <ul class="nav nav-treeview">
                                    <li class="nav-item">
                                        <a href="<?= site_url('kmjasa') ?>" <?= $this->uri->segment(1) == 'kmjasa'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                            <i class="nav-icon fas fa-wrench"></i>
                                            <p>Jasa</p>
                                        </a>
                                    </li>
                                </ul>
                            </li>

                            <li class="nav-item">
                                <a href="<?= site_url('kmgpusat') ?>" <?= $this->uri->segment(1) == 'kmgpusat'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                    <i class="nav-icon fas fa-truck-loading"></i>
                                    <p>
                                        Stok Barang
                                    </p>
                                </a>
                            </li>

                            <li <?= $this->uri->segment(1) == 'lapkeucab' || $this->uri->segment(1) == 'lapkeucabinv' || $this->uri->segment(1) == 'lapkeucabner' || $this->uri->segment(1) == 'lapkeucabrl' || $this->uri->segment(1) == 'lapkeucabjur' || $this->uri->segment(1) == 'lapkeucabparthut' || $this->uri->segment(1) == 'lapkeucabpart' || $this->uri->segment(1) == 'lapkeucabpeng' || $this->uri->segment(1) == 'lapKadm' ? 'class="nav-item menu-open has-treeview"' : 'class="nav-item has-treeview "' ?>>
                                <a href="<?= site_url('lapkeucab') ?>" <?= $this->uri->segment(1) == 'lapkeucab'  ? 'class="active nav-link "' : 'class="nav-link"' ?>>
                                    <i class="nav-icon fas fa-money-check-alt"></i>
                                    <p>
                                        Lap Keuangan
                                        <i class="right fas fa-angle-left"></i>
                                    </p>
                                </a>

                                <ul class="nav nav-treeview">
                                    <li class="nav-item">
                                        <a href="<?= site_url('lapKadm') ?>" <?= $this->uri->segment(1) == 'lapKadm'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                            <i class="nav-icon fas fa-file-signature"></i>
                                            <p>Kas Harian</p>
                                        </a>
                                    </li>
                                </ul>


                                <ul class="nav nav-treeview">
                                    <li class="nav-item">
                                        <a href="<?= site_url('lapkeucabpeng') ?>" <?= $this->uri->segment(1) == 'lapkeucabpeng'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                            <i class="nav-icon fas fa-file-import"></i>
                                            <p>Peng. Harian</p>
                                        </a>
                                    </li>
                                </ul>

                                <ul class="nav nav-treeview">
                                    <li class="nav-item">
                                        <a href="<?= site_url('lapkeucabpart') ?>" <?= $this->uri->segment(1) == 'lapkeucabpart'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                            <i class="nav-icon fas fa-file-invoice"></i>
                                            <p>Pemb. Sparepart</p>
                                        </a>
                                    </li>
                                </ul>

                                <ul class="nav nav-treeview">
                                    <li class="nav-item">
                                        <a href="<?= site_url('lapkeucabparthut') ?>" <?= $this->uri->segment(1) == 'lapkeucabparthut'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                            <i class="nav-icon fas fa-file-alt"></i>
                                            <p>Hut. Sparepart</p>
                                        </a>
                                    </li>
                                </ul>

                                <ul class="nav nav-treeview">
                                    <li class="nav-item">
                                        <a href="<?= site_url('lapkeucabjur') ?>" <?= $this->uri->segment(1) == 'lapkeucabjur'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                            <i class="nav-icon fas fa-file-download"></i>
                                            <p>Jurnal Harian</p>
                                        </a>
                                    </li>
                                </ul>

                                <ul class="nav nav-treeview">
                                    <li class="nav-item">
                                        <a href="<?= site_url('lapkeucabrl') ?>" <?= $this->uri->segment(1) == 'lapkeucabrl'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                            <i class="nav-icon fas fa-file-alt"></i>
                                            <p>lap. Rugi / Laba</p>
                                        </a>
                                    </li>
                                </ul>

                                <ul class="nav nav-treeview">
                                    <li class="nav-item">
                                        <a href="<?= site_url('lapkeucabner') ?>" <?= $this->uri->segment(1) == 'lapkeucabner'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                            <i class="nav-icon fas fa-wallet"></i>
                                            <p>Profit</p>
                                        </a>
                                    </li>
                                </ul>

                            </li>

                            <li class="nav-item">
                                <a href="<?= site_url('peldate') ?>" <?= $this->uri->segment(1) == 'peldate'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                    <i class="nav-icon fas fa-user-tag"></i>
                                    <p>
                                        Data Pelangan
                                    </p>
                                </a>
                            </li>



                        <?php } ?>

                        <?php if ($this->session->userdata('level') == 2) { ?>
                            <!--
                            <li class="nav-item">
                                <a href="<?= site_url('kmgpusat') ?>" <?= $this->uri->segment(1) == 'kmgpusat'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                    <i class="nav-icon fas fa-truck-loading"></i>
                                    <p>
                                        Stok Barang
                                    </p>
                                </a>
                            </li>
-->
                            <li class="nav-item">
                                <a href="<?= site_url('ssKasir') ?>" <?= $this->uri->segment(1) == 'ssKasir'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                    <i class="nav-icon fas fa-tools"></i>
                                    <p>
                                        kasir
                                    </p>
                                </a>
                            </li>

                            <li class="nav-item">
                                <a href="<?= site_url('ssKasirprint') ?>" <?= $this->uri->segment(1) == 'ssKasirprint'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                    <i class="nav-icon fas fa-print"></i>
                                    <p>
                                        Print Invoice
                                    </p>
                                </a>
                            </li>

                            <li class="nav-item">
                                <a href="<?= site_url('pesB') ?>" <?= $this->uri->segment(1) == 'pesB'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?> class="nav-link">
                                    <i class="nav-icon fas fa-box-open"></i>
                                    <p>
                                        Pesan Barang
                                    </p>
                                </a>
                            </li>

                            <li <?= $this->uri->segment(1) == 'lapPark' || $this->uri->segment(1) == 'lapK' ? 'class="nav-item menu-open has-treeview"' : 'class="nav-item has-treeview "' ?>>
                                <a href="<?= site_url('lapPark') ?>" <?= $this->uri->segment(1) == 'lapPark'  ? 'class="active nav-link "' : 'class="nav-link"' ?>>
                                    <i class="nav-icon fas fa-file-signature"></i>
                                    <p>
                                        Laporan Harian
                                        <i class="right fas fa-angle-left"></i>
                                    </p>
                                </a>
                                <ul class="nav nav-treeview">
                                    <li class="nav-item">
                                        <a href="<?= site_url('lapPark') ?>" <?= $this->uri->segment(1) == 'lapPark'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                            <i class="nav-icon fas fa-box"></i>
                                            <p>Pembelian Part</p>
                                        </a>
                                    </li>
                                </ul>

                                <ul class="nav nav-treeview">
                                    <li class="nav-item">
                                        <a href="<?= site_url('lapK') ?>" <?= $this->uri->segment(1) == 'lapK'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                            <i class="nav-icon fas fa-file-signature"></i>
                                            <p>Laporan Kas</p>
                                        </a>
                                    </li>
                                </ul>
                            </li>

                        <?php } ?>

                        <?php if ($this->session->userdata('level') == 3) { ?>

                            <li class="nav-item">
                                <a href="<?= site_url('ssProses') ?>" <?= $this->uri->segment(1) == 'ssProses'  ? 'class="active nav-link bg-primary"' : 'class="nav-link"' ?>>
                                    <i class="nav-icon fas fa-tools"></i>
                                    <p>
                                        Service Proses
                                    </p>
                                </a>
                            </li>

                        <?php } ?>

                        <li class="nav-item">
                            <a href="<?= site_url('auth/logout') ?>" id="logout" class="nav-link">
                                <i class="nav-icon fas fa-power-off"></i>
                                <p>
                                    Logout
                                </p>
                            </a>
                        </li>

                    </ul>
                </nav>
                <!-- ending item menu -->
            </div>
            <!-- ending menu -->
        </aside>

        <!-- star halaman -->
        <div class="content-wrapper">
            <?php echo $contents ?>
        </div>
        <!-- ending halaman -->

        <footer class="main-footer">
            <div class="float-right d-none d-sm-block">
                <b>Version</b> 1.0.0
            </div>
            <strong>&copy; <?= date('Y') ?> <a class=" text-primary" href="">KlinikMobil App</a>.</strong> All rights
            reserved.
        </footer>

        <!-- Control Sidebar -->
        <aside class="control-sidebar control-sidebar-dark">
            <!-- Control sidebar content goes here -->
        </aside>
        <!-- /.control-sidebar -->
    </div>
    <!-- ending halaman menu -->



    <script src="<?= base_url() ?>/assets/plugins/jquery/jquery.min.js"></script>
    <script src="<?= base_url() ?>/assets/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
    <!-- overlayScrollbars -->
    <script src="<?= base_url() ?>/assets/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
    <script src="<?= base_url() ?>/assets/dist/js/adminlte.min.js"></script>
    <script src="<?= base_url() ?>/assets/dist/js/demo.js"></script>
    <script src="<?= base_url() ?>/assets/plugins/summernote/summernote.min.js"></script>
    <!-- PAGE PLUGINS -->
    <!-- jQuery Mapael -->
    <script src="<?= base_url() ?>/assets/plugins/jquery-mousewheel/jquery.mousewheel.js"></script>
    <script src="<?= base_url() ?>/assets/plugins/raphael/raphael.min.js"></script>
    <script src="<?= base_url() ?>/assets/plugins/jquery-mapael/jquery.mapael.min.js"></script>
    <script src="<?= base_url() ?>/assets/plugins/jquery-mapael/maps/usa_states.min.js"></script>

    <script src="<?= base_url() ?>/assets/dist/sweetalert2/sweetalert2.min.js"></script>

    <!-- date setting -->
    <script src="<?= base_url() ?>/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <!-- date-range-picker -->
    <script src="<?= base_url() ?>/assets/plugins/moment/moment.min.js"></script>
    <script src="<?= base_url() ?>/assets/plugins/daterangepicker/daterangepicker.js"></script>
    <!-- datatable -->
    <script src="<?= base_url() ?>/assets/plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<?= base_url() ?>/assets/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
    <!-- setting text area -->
    <script>
        $(function() {
            // Summernote
            $('.textarea').summernote()
        })
    </script>

    <!-- setting tanggal -->
    <script>
        //Date range picker
        $('#waktumitra').daterangepicker()

        $("#datepickerth").datepicker({
            format: 'yyyy',
            viewMode: "years",
            minViewMode: "years",
            language: "id",
            autoClose: true
        });

        $("#datepickerbulan").datepicker({
            format: 'mm / yyyy',
            viewMode: "months",
            minViewMode: "months",
            language: "id",
            autoClose: true
        });

        $('#tanggal').datepicker({
            format: 'dd / mm / yyyy',
            clearBtn: true,
            language: "id",
            autoclose: true
        });


        $('#tanggal2').datepicker({
            format: 'dd-mm-yyyy',
            clearBtn: true,
            language: "id",
            autoclose: true
        });

        $('.custom-file-input').on('change', function() {
            let fileName = $(this).val().split('\\').pop();
            $(this).next('.custom-file-label').addClass("selected").html(fileName);
        });
    </script>

    <!-- script alert -->
    <script>
        var flash = $('#flash').data('flash');
        if (flash) {
            Swal.fire({
                icon: 'success',
                title: 'Sucsess',
                text: flash
            })

        }

        $(document).on('click', '#btn-hapus', function(e) {
            e.preventDefault();
            var hapus = $(this).attr('href');

            Swal.fire({
                title: 'Apakah Anda Yakin?',
                text: "Data Ini Akan di Hapus",
                icon: 'primary',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Ya, Hapus!'
            }).then((result) => {
                if (result.isConfirmed) {
                    window.location = hapus;
                }
            })

        })
    </script>

    <!-- script datatable -->
    <script>
        $(function() {
            $("#example1").DataTable({
                "responsive": true,
                "autoWidth": false,
            });
        });
    </script>


</body>

</html>