<?php
header("Expires: 0");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

require_once 'ResourcesHolder/core/CoreSystem.php';
$index = new CoreSystem();


if ($index->checkState()) {
    require_once 'ResourcesHolder/core/ApplicationSystem.php';
    $app = new ApplicationSystem(@$_REQUEST);
    $app->run();
    exit();
} else { ?>
    <!DOCTYPE html>
    <html>
    <!--<IfModule mod_headers.c>
        Header set Cache-Control "no-cache, no-store, must-revalidate"
        Header set Pragma "no-cache"
        Header set Expires 0
    </IfModule>-->
    <head>
        <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
        <meta http-equiv="Pragma" content="no-cache"/>
        <meta http-equiv="Expires" content="0"/>
        <?php
        $index->publicLoadPlugin(
            array('meta 1', 'meta 2', 'meta 3')
        );
        ?>
        <title><?php echo $index->Title(); ?></title>
        <?php
        $index->publicLoadPlugin(
            array(
                'Google Fonts Roboto',
                'Google Fonts Material',
                'fav 1',
                'Bootstrap Core Css',
                'Waves Effect Css',
                'Animation Css',
                'font awesome',
                'Custom Css',
                'Farsi Font',
                'AdminBSB Themes',
                'Jquery Core Js',
                'Main Script',
                'Sweet Alert Css',
                'Select Plugin Css',
                'Bootstrap Tags Input Plugin Css',
                'TimePicker Css',
                'JQuery DataTable Css',
                'Jquery Spinner Plugin Css',
                'Multi Select Css',
                'JQuery Nestable Css',
                'Light Gallery Plugin Css',
                'Bootstrap Toggle Css',
                'Security',
                'Dropzone CSS',
                'selectize css',
            )
        );
        ?>
    </head>


    <?php
    if ($index->Login() OR $index->PageRequest()){
    ?>
    <body class="theme-red">
    <?php
    if ($index->PageRequest()) {
        $index->ProcessPage();
    } else {
        $index->content(
            array(
                'Page Loader',
                'Overlay For Sidebars',
                /*  'Search Bar',*/
                'Top Bar',
                'Sidebar',
                'content'
            )
        );
    }
    $index->publicLoadPlugin(
        array(
            'Jquery CountTo Plugin Js',
            'Bootstrap Core Js ',
            'Select Plugin Js ',
            'Slimscroll Plugin Js ',
            'Waves Effect Plugin Js ',
            'Custom Js admin',
            'Demo Js',
            'Second Script',
            'Jquery Touch Events',
            'tooltips popovers',
            'Bootstrap Notify Plugin Js',
            'Jquery Validation Plugin Css',
            'JQuery Steps Plugin Js',
            'Copy Clip Bord',//for test
            'Sweet Alert Plugin Js',
            'Input Mask Plugin Js',
            'Select Plugin Js',
            'Bootstrap Tags Input Plugin Js',
            'Google Api Kay',
            'TimePicker Js',
            'Jquery DataTable Plugin Js',
            'Jquery Spinner Plugin Js',
            'Multi Select Js',
            'JQuery Nestable Js',
            'Light Gallery Plugin Js',
            'Bootstrap Toggle Js',
            'jQuery qr js',
            'TinyMC js',
            'SOAP',
            'Dropzone js',
        )
    );
    } else {
        require_once 'ResourcesHolder/resource/php/page/login/Sign-in.php';
    }
    ?>
    </body>
    </html>
<?php } ?>