<!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.0" />
    <link rel="shortcut icon" href="<?= logo() ?>" type="image/x-icon" />
    <title><?= $page_title ?? "APP NAME" ?></title>
    <meta name="google" content="notranslate" />

    <?= $this->renderSection('fcss') ?>
    <!-- ========== All CSS files linkup ========= -->
    <!-- <link rel="stylesheet" href="<?= base_url() ?>/vendors/intro.js/minified/introjs.min.css"> -->
    <link rel="stylesheet" href="<?= base_url() ?>/vendors/plainadmin/assets/css/bootstrap.min.css" />
    <link rel="stylesheet" href="<?= base_url() ?>/vendors/plainadmin/assets/css/lineicons.css" />
    <link rel="stylesheet" href="<?= base_url() ?>/vendors/plainadmin/assets/css/materialdesignicons.min.css" />
    <link rel="stylesheet" href="<?= base_url() ?>/vendors/fontawesome-free-5.15.4-web/css/all.min.css" />
    <link rel="stylesheet" href="<?= base_url() ?>/vendors/plainadmin/assets/css/fullcalendar.css" />
    <link rel="stylesheet" href="<?= base_url() ?>/vendors/plainadmin/assets/css/main.css" />
    <link rel="stylesheet" href="<?= base_url() ?>/panel/assets/css/main.css" />
    <link rel="stylesheet" href="<?= base_url() ?>/panel/assets/css/chat-tp.css">
    <link rel="stylesheet" type="text/css" href="<?= base_url() ?>/vendors/DataTables/datatables.min.css" />
    <link rel="stylesheet" type="text/css" href="<?= base_url() ?>/vendors/jquery-ui/jquery-ui.min.css" />

    <link rel="manifest" href="<?= base_url() ?>/manifest.json?v=<?= versioningjs() ?>">
    <?= $this->renderSection('css') ?>
    <script>
        function gaem(err, errMsg = "Ada masalah saat menghubungi server") {
            if (!err) return errMsg;
            try {
                if (typeof err.data.message == 'string') errMsg = err.data.message;
            } catch (error) {

            }
            try {
                if (typeof err.response.data.messages.message == 'string') errMsg = err.response.data.messages.message;
            } catch (error) {}
            try {
                if (typeof err.response.data.messages.error == 'string') errMsg = err.response.data.messages.error;
            } catch (error) {

            }
            try {
                if (typeof err.response.data.message == 'string') errMsg = err.response.data.message;
                if (typeof err.response.data.file == 'string') errMsg += " | " + err.response.data.file;
                if (typeof err.response.data.line == 'number') errMsg += " | " + err.response.data.line;
            } catch (error) {

            }
            return errMsg;
        }
    </script>

</head>

<body>
    <div id="app">
        <!-- ======== sidebar-nav start =========== -->
        <?php if (!isset($no_sidebar)) : ?>
            <sidebar ref="sidebar" :hide="sidebar_hide"></sidebar>
            <div class="overlay" :class="sidebar.overlay?'active':''"></div>
            <!-- ======== sidebar-nav end =========== -->
        <?php endif; ?>
        <!-- ======== main-wrapper start =========== -->
        <main class="main-wrapper" :class="sidebar_hide?'active':''">
            <!-- ========== header start ========== -->
            <?php if (!isset($no_header)) : ?>
                <header id="header" class="header">
                    <?= $this->include('Panel/Layouts/Header') ?>
                </header>
            <?php endif; ?>
            <!-- ========== header end ========== -->

            <!-- ========== signin-section start ========== -->
            <section class="section">
                <div class="row m-1">
                    <!-- <div class="col-6">
                    </div> -->
                    <?php if (!isset($no_date)) : ?>
                        <div style="text-align: end;" class="col-12">
                            <div class="btn btn-sm rounded-md btn-primary my-1">{{$store.state.config.rdate}}</div>
                            &nbsp;
                            <div class="btn btn-sm rounded-md btn-success">{{$store.state.config.rtime}}</div>
                        </div>
                    <?php endif; ?>
                    <?php if (!(strpos(current_url(), "install") !== false)) : ?>
                        <?php if (!(options('licensekey') ?? "")) : ?>
                            <div class="alert-box danger-alert ">
                                <div class="alert">
                                    <p class="text-medium">
                                        Kode Lisensi Tidak Valid
                                    </p>
                                </div>
                            </div>
                        <?php elseif ((options('eat') ?? 0) < time()) : ?>
                            <div class="alert-box danger-alert ">
                                <div class="alert">
                                    <p class="text-medium">
                                        Kode Lisensi Kedaluwarsa
                                    </p>
                                </div>
                            </div>
                        <?php endif ?>
                    <?php endif ?>
                </div>
                <?= $this->renderSection('content') ?>
                <?php if (options('chat') == '1') : ?>
                    <chat-tp></chat-tp>
                <?php endif ?>

            </section>
            <!-- ========== signin-section end ========== -->

            <!-- ========== footer start =========== -->
            <footer class="footer">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-md-6 order-last order-md-first">
                            <div class="copyright text-center text-md-start">
                                <p class="text-sm">
                                    CopyRight <i class="fa fa-copyright" aria-hidden="true"></i>
                                    <?= date('Y') ?> Candy School
                                </p>
                            </div>
                        </div>
                        <!-- end col-->
                        <div class="col-md-6">
                            <div class="terms d-flex justify-content-center justify-content-md-end">
                                <a href="javascript:void(0)" class="text-sm"><?= 'PHP version: ' . phpversion(); ?></a>
                                <a href="javascript:void(0)" class="text-sm ml-15">App Version : <?= APP_VERSION_NAME ?></a>
                            </div>
                        </div>
                    </div>
                    <!-- end row -->
                </div>
                <!-- end container -->
            </footer>
            <!-- ========== footer end =========== -->
        </main>
    </div>
    <!-- ======== main-wrapper end =========== -->

    <script>
        var myVueMixin = [];
        var base_url = '<?= base_url() ?>';
        var altAvatar = base_url + "/assets/img/users/profile-photo.png";
    </script>
    <script id="cxaedm">
        var xaedm = {
            'name': '<?= csrf_token() ?>',
            'value': '<?= csrf_hash() ?>'
        };
    </script>
    <?= $this->renderSection('fjs') ?>
    <?php $bu = base_url();
    $vjs = versioningjs() ?>

    <!-- ========= All Javascript files linkup ======== -->
    <!-- <script src="<?= $bu ?>/vendors/intro.js/minified/intro.min.js"></script> -->

    <script type="text/javascript" src="<?= $bu ?>/vendors/DataTables/jQuery-3.6.0/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" src="<?= $bu ?>/vendors/DataTables/datatables.min.js"></script>
    <script type="text/javascript" src="<?= $bu ?>/vendors/jquery-ui/jquery-ui.min.js"></script>
    <script src="<?= $bu ?>/vendors/jquery-blockui/jquery.blockui.js?v=<?= $vjs ?>"></script>
    <script src="<?= $bu ?>/vendors/plainadmin/assets/js/loading-bar.min.js?v=<?= $vjs ?>"></script>
    <script src="<?= $bu ?>/vendors/plainadmin/assets/js/bootstrap.bundle.min.js?v=<?= $vjs ?>"></script>
    <script src="<?= $bu ?>/vendors/plainadmin/assets/js/moment-with-locales.min.js?v=<?= $vjs ?>"></script>
    <script src="<?= $bu ?>/vendors/plainadmin/assets/js/moment-timezone-with-data.min.js?v=<?= $vjs ?>"></script>
    <script src="<?= $bu ?>/vendors/sweetalert2/11.1.9/sweetalert2.all.min.js?v=<?= $vjs ?>"></script>
    <?php if (ENVIRONMENT == 'production') : ?>
        <script src="<?= $bu ?>/vendors/vue/3.2.47/vue.global.prod.js?v=<?= $vjs ?>"></script>
    <?php else : ?>
        <script src="<?= $bu ?>/vendors/vue/3.2.47/vue.global.js?v=<?= $vjs ?>"></script>
    <?php endif; ?>
    <script src="<?= $bu ?>/vendors/vuex/4.0.0/dist/vuex.global.js?v=<?= $vjs ?>"></script>
    <script src="<?= $bu ?>/vendors/axios/0.23.0/axios.min.js?v=<?= $vjs ?>"></script>
    <?= $this->renderSection('cjs') ?>
    <?php if (is_https()) : ?>
        <script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async=""></script>
        <script>
            window.OneSignal = window.OneSignal || [];
        </script>
    <?php endif; ?>
    <script src="<?= $bu ?>/panel/assets/js/components/onesignal-register.js?v=<?= $vjs ?>"></script>
    <script src="<?= $bu ?>/panel/assets/js/main.js?v=<?= $vjs ?>"></script>
    <script src="<?= $bu ?>/panel/assets/js/init.js?v=<?= $vjs ?>"></script>
    <script src="<?= $bu ?>/panel/assets/js/components/utils/sidebar.js?v=<?= $vjs ?>"></script>
    <script src="<?= $bu ?>/vendors/@tinymce/tinymce-vue/lib/browser/tinymce-vue.min.js?v=<?= $vjs ?>"></script>
    <script src="<?= $bu ?>/mobile/js/pwa.js?v=<?= $vjs ?>"></script>
    <?php if (options('chat') == '1') : ?>
        <script src="<?= $bu ?>/panel/assets/js/components/chat-tp.js?v=<?= $vjs ?>"></script>
    <?php endif ?>
    <?= $this->renderSection('js') ?>
    <script>
        VAPP.use(store)
        VAPP.component(VSidebar.name, VSidebar)
        <?php if (options('chat') == '1') : ?>
            VAPP.component(VPChatTP.name, VPChatTP);
        <?php endif ?>
        VAPP.component('editor', Editor)
        VAPP.mount("#app");
    </script>
    <?= $this->renderSection('ljs') ?>

</body>

</html>