<?php
$user_data = get_session_userdata();
$design_setting = get_design_setting();
$user = $this->user_model->get_by_id($user_data['user_id']);
$permission = unserialize($user->master_permissions);
if ((!empty($design_setting->favicon)) && (file_exists(DIR_FAVICON . $design_setting->favicon))) {
    $favicon = base_url() . DIR_FAVICON . $design_setting->favicon;
}
else {
    $favicon = base_url() . DEFAULT_FAVICON;
}

if( !defined('BASE_URL') ) :
    define( 'BASE_URL', base_url() );
endif;

$keybrd_clr = !empty( $user_data['keyboard_clr'] ) ? $user_data['keyboard_clr'] : '#1ba';  

?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>
            <?php echo (defined('PAGE_TITLE_PREFIX')) ? PAGE_TITLE_PREFIX : '';?>
            <?php echo (!empty($page_title)) ? ' :: ' . $page_title : '';?>
        </title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
        <link rel="icon" href="<?php echo $favicon;?>" sizes="16x16" />
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/bootstrap.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/font-awesome.min.css" />
        <!-- DATA TABLES -->
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/dataTables.bootstrap.css" />
        <!-- Theme style -->
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/AdminLTE.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/daterangepicker-bs3.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/datepicker3.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/bootstrap-timepicker.min.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/prism.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/chosen.min.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>style.css" />
        <!--<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/jquery-ui.css">-->
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/bootstrap-dialog.min.css">
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/bootstrap-colorpicker.min.css" />

        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/bootstrap-material-datetimepicker.css" />
        
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>fonts/Amudham.ttf" />
        
        <!--<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/smartadmin-production.min.css">
        <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/smartadmin-skins.min.css">-->

        <!--<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL.'assets/css/'; ?>library/select2.min.css" />--> 
        
        <script type="text/javascript" src="<?php echo BASE_URL.'assets/js/'; ?>library/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="<?php echo BASE_URL.'assets/js/'; ?>library/jquery.chosen.js"></script>
        <script type="text/javascript" src="<?php echo BASE_URL.'assets/js/'; ?>library/prism.js"></script>
        <script type='text/javascript' src="<?php echo BASE_URL.'assets/js/'; ?>library/jquery.validate.min.js"></script>
        <script type='text/javascript' src="<?php echo BASE_URL.'assets/js/'; ?>extend_validator_methods.js"></script>
        
        <script type="text/javascript" src="<?php echo BASE_URL.'assets/js/'; ?>library/jquery-ui.js"></script>
        
        
        <!-- Tamil Keyboard -->
        <link href="<?php echo base_url();?>assets/css/library/keyboard.css" rel="stylesheet">
        <link href="<?php echo base_url();?>assets/css/library/keyboard-previewkeyset.css" rel="stylesheet">

        <script type="text/javascript" src="<?php echo BASE_URL.'assets/js/'; ?>library/jquery.keyboard.js"></script>
        <script type="text/javascript" src="<?php echo BASE_URL.'assets/js/'; ?>library/jquery.mousewheel.js"></script>
        <script type="text/javascript" src="<?php echo BASE_URL.'assets/js/'; ?>library/jquery.keyboard.extension-typing.js"></script>
        <script type="text/javascript" src="<?php echo BASE_URL.'assets/js/'; ?>library/jquery.keyboard.extension-previewkeyset.js"></script>
        <script type="text/javascript" src="<?php echo BASE_URL.'assets/js/'; ?>library/keyboard-layouts-combined.js" charset="utf-8"></script>
        <script type="text/javascript" src="<?php echo BASE_URL.'assets/js/'; ?>library/colorpicker/bootstrap-colorpicker.min.js"></script>
        <!--<script type="text/javascript" src="<?php echo BASE_URL.'assets/js/'; ?>library/select2.min.js"></script>-->
        
        
        <script type="text/javascript">
            var base_url    = baseURL = '<?php echo base_url();?>';
            var controller  = '<?php echo $this->uri->segments[1]; ?>'; 
            var method      = '<?php echo $this->uri->segments[2]; ?>';
            var isKskBill   = <?php echo IS_KSK_BILL ? 'true' : 'false'; ?>;
            var pStatus     = "<?php echo $this->session->flashdata( REMOTE_ADDR . '_flag'); ?>";
            var keybrdClr   = "<?php echo $keybrd_clr; ?>";
            var isNumpad    = <?php echo $user_data['numpad'] ? 'true' : 'false'; ?>;
            var isTamil     = <?php echo $this->session->userdata( $user_data['user_id'] . '_tamil') ? 'true' : 'false'; ?>;
            
            // Short Link Permissions
            var perExpenses = '<?php echo ((!empty($permission['expenses'])) && (in_array('ALL', $permission['expenses']))) ? '1' : '0';?>';
            var perFormDownload = '<?php echo ((!empty($permission['form_download'])) && (in_array('ALL', $permission['form_download']))) ? '1' : '0';?>';
            
            window.onload = function(){
                if( isKskBill ) {
                    $('aside.right-side').addClass('strech bg-img');
                    $('body').addClass('bg-img');
                }
            };
        </script>
        
        <style>
            
            .dtp div.dtp-date, .dtp div.dtp-time, .dtp table.dtp-picker-days tr > td > a.selected, .dtp > .dtp-content > .dtp-date-view > header.dtp-header, .dtp .dtp-actual-meridien a.selected{
                background: <?php echo $keybrd_clr; ?>;
            }
            .dtp .p10 > a{
                color: <?php echo $keybrd_clr; ?>;
            }
            .list-btn i, .sub-title, .modal .details th, .resp-table .form-group div.lbl, .multi-select-expand .fa.tick-ok,.tabs > div.active #curve, .multi-select-preview .active, .date-preview .option, #days-plot table th {
                background: <?php echo $design_setting->login_page_color; ?>;
            }
            .modal .details .ctrl, .resp-table .form-group div:first-child .fa, #days-wrapper .ctrls .add-btn, .innr-table .ctrls .fa, .heading_lbl,.tabs > div.active, .fa-calendar, .fa-envelope, .fa-phone, #days-plot table tfoot{
                color: <?php echo $design_setting->login_page_color; ?>;
            }
            .modal .details {
                border-bottom: 3px solid <?php echo $design_setting->login_page_color; ?>;
            }
            .tabs > div.active{
                border: 1px solid <?php echo $design_setting->login_page_color; ?>;
                border-left: 8px solid <?php echo $design_setting->login_page_color; ?>;
            }
            /* .tabs {
                border-bottom: 1px solid <?php echo $design_setting->login_page_color; ?>;
            } */
            .tab.active {
                border-left: 1px solid <?php echo $design_setting->login_page_color; ?>;
            }
            .tabs > div {
                box-shadow: 0px 1px 2px <?php echo $design_setting->login_page_color; ?>;
            }
            #dev-childs .ctrls .add-btn {
                color: <?php echo $design_setting->login_page_color;?>;
            }
        </style>
    </head>
    
    <body class="skin-black pace-done" style="min-height: 917px;">
        <div class="over-lay"></div>
        <noscript>
            <div class="alert alert-warning">
                <a href="http://enable-javascript.com/" target="_blank">
                    <h4 class="alert-heading">Warning!</h4>
                    <p>You need to have JavaScript enabled to use this site.</p>
                </a>
            </div>
        </noscript>
        <div class="page_loader"></div>