<?php
/*
 * Copyright (c) 2018 Earworks.
 * Codeigniter Project Template Modification
 * Please contact our email for more information :
 * contact@earworks.co.id
 */
defined('BASEPATH') OR exit('No direct script access allowed');
/*
 * Website template
 * All content on this file will allways appear on all page
 * 
 * @var $render_css string rendered css
 * @var $render_js string rendered js
 * @var $render_meta string rendered meta
 * @var $render_maps array list of breadcrumbs map
 * @var $title string if not set will display CI_NAME constant value
 * @var $content string view content
 */
$min = (ENVIRONMENT == 'development') ? null : '.min';
$user = $this->session->userdata(CI_NAME .'log');
?>
<!DOCTYPE html>
<html lang="id">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <?php echo $render_meta ?>
        <link rel="shortcut icon" href="<?php echo base_url('assets/img/logo.png')?>" />
        <title><?php echo $title ?></title>
        <!-- BEGIN GLOBAL MANDATORY STYLES -->
        <link type="text/css" rel="stylesheet" href="<?php echo base_url('assets/backoffice/css/fonts.css') ?>" />
        <link type="text/css" rel="stylesheet" href="<?php echo base_url("assets/plugins/font-awesome/css/font-awesome" . $min . ".css") ?>" />
        <link type="text/css" rel="stylesheet" href="<?php echo base_url("assets/plugins/simple-line-icons/simple-line-icons" . $min . ".css") ?>" />
        <link type="text/css" rel="stylesheet" href="<?php echo base_url("assets/plugins/bootstrap/css/bootstrap" . $min . ".css") ?>" />
        <link type="text/css" rel="stylesheet" href="<?php echo base_url("assets/plugins/bootstrap-switch/css/bootstrap-switch" . $min . ".css") ?>" />
        <!-- END GLOBAL MANDATORY STYLES -->
        <!-- BEGIN PAGE LEVEL PLUGINS -->
        <link rel="stylesheet" type="text/css" href="<?php echo base_url("assets/plugins/datatables/datatables.min.css") ?>"/>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url("assets/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css") ?>"/>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url("assets/plugins/cubeportfolio/css/cubeportfolio.min.css") ?>"/>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url("assets/plugins/ladda/ladda-themeless.min.css") ?>"/>
        <!-- END PAGE LEVEL PLUGINS -->
        <!-- BEGIN THEME GLOBAL STYLES -->
        <link type="text/css" rel="stylesheet" href="<?php echo base_url("assets/backoffice/css/components" . $min . ".css") ?>" />
        <link type="text/css" rel="stylesheet" href="<?php echo base_url("assets/backoffice/css/plugins" . $min . ".css") ?>" />
        <link type="text/css" rel="stylesheet" href="<?php echo base_url("assets/backoffice/css/portfolio.min.css") ?>" />
        <!-- END THEME GLOBAL STYLES -->
        <!-- BEGIN THEME LAYOUT STYLES -->
        <link type="text/css" rel="stylesheet" href="<?php echo base_url("assets/backoffice/css/layout" . $min . ".css") ?>" />
        <link type="text/css" rel="stylesheet" href="<?php echo base_url("assets/backoffice/css/darkblue" . $min . ".css") ?>" />
        <!-- END THEME LAYOUT STYLES -->
        <!-- BEGIN SPECIAL CUSTOM STYLES -->
        <?php echo $render_css ?>
        <link type="text/css" rel="stylesheet" href="<?php echo base_url("assets/backoffice/css/style.css?v=1") ?>" />
        <!-- END SPECIAL CUSTOM STYLES -->
        <?php if(!in_array($user['roleid'], array(1,2)))  : ?>
        
        <?php endif; ?>
    </head>

    <body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white page-sidebar-fixed">
        <div class="page-wrapper">
            <?php echo $this->load->partials('layouts/header', array('user' => $user)) ?>
            <!-- BEGIN HEADER & CONTENT DIVIDER -->
            <div class="clearfix"> </div>
            <!-- END HEADER & CONTENT DIVIDER -->
            <!-- BEGIN CONTAINER -->
            <div class="page-container">
                <?php echo (in_array($user['roleid'], array(1,2,3,4,5))) ? $this->load->partials('layouts/sidebar', array()) : null ?>
                <!-- BEGIN CONTENT -->
                <div class="page-content-wrapper">
                    <!-- BEGIN CONTENT BODY -->
                    <div class="page-content">
                        <!-- BEGIN PAGE HEADER-->
                        <!-- BEGIN PAGE BAR -->
                        <div class="page-bar">
                            <ul class="page-breadcrumb">
                                <li>
                                    <a href="<?php echo base_url('/backoffice/dashboard/index') ?>">Home</a>
                                </li>
                                <?php foreach ($render_maps as $map) : ?>
                                    <li>
                                        <i class="fa fa-circle"></i>
                                        <?php if ($map['url']) : ?>
                                            <?php echo anchor($map['url'], $map['title']) ?>
                                        <?php else : ?>
                                            <span><?php echo $map['title'] ?></span>
                                        <?php endif; ?>
                                    </li>
                                <?php endforeach; ?>
                            </ul>
                        </div>
                        <!-- END PAGE BAR -->
                        <?php echo show_alert(); ?>
                        <!-- BEGIN PAGE TITLE-->
                        <h1 class="page-title"> 
                            <?php echo $title ?>
                        </h1>
                        <!-- END PAGE TITLE-->
                        <!-- END PAGE HEADER-->
                        <?php echo $content ?>
                    </div>
                    <!-- END CONTENT BODY -->
                </div>
                <!-- END CONTENT -->
                <?php echo $this->load->partials('layouts/quick_sidebar', array('user' => $user)) ?>
            </div>
            <!-- END CONTAINER -->
            <?php echo $this->load->partials('layouts/footer', array()) ?>

        </div>
        <!-- BEGIN CORE PLUGINS -->
        <script src="<?php echo base_url("assets/plugins/jquery/jquery.min.js") ?>"></script>
        <script src="<?php echo base_url("assets/plugins/bootstrap/js/bootstrap" . $min . ".js") ?>"></script>
        <script src="<?php echo base_url("assets/backoffice/js/js.cookie.min.js") ?>"></script>
        <script src="<?php echo base_url("assets/plugins/jquery-slimscroll/jquery.slimscroll" . $min . ".js") ?>"></script>
        <script src="<?php echo base_url("assets/backoffice/js/jquery.blockui.min.js") ?>"></script>
        <script src="<?php echo base_url("assets/plugins/bootstrap-switch/js/bootstrap-switch" . $min . ".js") ?>"></script>
        <!-- END CORE PLUGINS -->
        <!-- BEGIN PAGE LEVEL PLUGINS -->
        <script src="<?php echo base_url("assets/backoffice/js/datatable" . $min . ".js") ?>"></script>
        <script src="<?php echo base_url("assets/plugins/datatables/datatables.min.js") ?>"></script>
        <script src="<?php echo base_url("assets/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js") ?>"></script>
        <script src="<?php echo base_url("assets/plugins/ckeditor/ckeditor.js") ?>"></script> 
        <script src="<?php echo base_url("assets/plugins/flot/jquery.flot.min.js") ?>"></script> 
        <script src="<?php echo base_url("assets/plugins/flot/jquery.flot.resize.min.js") ?>"></script> 
        <script src="<?php echo base_url("assets/plugins/flot/jquery.flot.categories.min.js") ?>"></script>
        <script src="<?php echo base_url("assets/plugins/ladda/spin.min.js") ?>"></script>  
        <script src="<?php echo base_url("assets/plugins/ladda/ladda.min.js") ?>"></script>
        <script src="<?php echo base_url("assets/backoffice/js/ui-buttons-spinners.min.js") ?>"></script>
        <script src="<?php echo base_url("assets/plugins/cubeportfolio/js/jquery.cubeportfolio.min.js") ?>"></script>
        <!-- END PAGE LEVEL PLUGINS -->
        <!-- BEGIN THEME LAYOUT SCRIPTS -->
        <script src="<?php echo base_url("assets/backoffice/js/app" . $min . ".js") ?>"></script>
        <script src="<?php echo base_url("assets/backoffice/js/layout" . $min . ".js") ?>"></script>
        <script src="<?php echo base_url("assets/backoffice/js/demo" . $min . ".js") ?>"></script>
        <script src="<?php echo base_url("assets/backoffice/js/quick-sidebar" . $min . ".js") ?>"></script>
        <script src="<?php echo base_url("assets/backoffice/js/quick-nav" . $min . ".js") ?>"></script>
        <script src="<?php echo base_url("assets/backoffice/js/portfolio-1.min.js") ?>"></script>
        <!-- END THEME LAYOUT SCRIPTS -->
        <script>
            var msg_emptyTable = "<?php echo $this->lang->line('datatable_emptyTable') ?>";
            var msg_info = "<?php echo $this->lang->line('datatable_info') ?>";
            var msg_infoEmpty = "<?php echo $this->lang->line('datatable_infoEmpty') ?>";
            var msg_infoFiltered = "<?php echo $this->lang->line('datatable_infoFiltered') ?>";
            var msg_lengthMenu = "<?php echo $this->lang->line('datatable_lengthMenu') ?>";
            var msg_search = "<?php echo $this->lang->line('datatable_search') ?>";
            var msg_zeroRecords = "<?php echo $this->lang->line('datatable_zeroRecords') ?>";
        </script>
        <?php echo $render_js ?>
        <script src="<?php echo base_url("assets/backoffice/js/script.js?v=1") ?>"></script>
        
    </body>
</html>
