<?php $user_data = get_session_userdata();?>
<?php #$general_setting = get_general_setting();?>
<?php $basic_setting = get_basic_setting();?>
<?php $design_setting = get_design_setting();?>
<?php 
    $font_size = $design_setting->font_size . 'px';
    if($user_data['role'] == 2) {
        $menu_bg = (!empty($design_setting->admin_menu_bg)) ? 'url(' . base_url() . 'uploads/settings/admin_menu_bg/'. $design_setting->admin_menu_bg .') !important' : '#EBEBEB'; 
    } elseif($user_data['role'] == 1) {
        $menu_bg = (!empty($design_setting->user_menu_bg)) ? 'url(' . base_url() . 'uploads/settings/user_menu_bg/'. $design_setting->user_menu_bg .') !important' : '#EBEBEB';
    } else {
        $menu_bg = '#EBEBEB';
    }
?>
<div class="over-lay"></div>
<header class="header">
    <style>
        *{
            font-family: <?php echo $design_setting->font_family; ?>;
            font-size: <?php echo $font_size; ?>;
        }
        .form-control, .btn {
            font-size: <?php echo $font_size . '!important'; ?>;
        }
        
        .skin-black .logo img {
            /*background: <?php #echo $menu_bg;?>*/
            background: #fefefe;
        }
        
        
    </style>
    <a href="<?php echo base_url();?>" class="logo" style="margin: 0px; padding: 0px; background: #fefefe;    border-right: 1px solid #eee;">
        <?php
        if ((!empty($design_setting->logo)) && (file_exists(FCPATH . DIR_COMPANY_LOGO . $design_setting->logo))) {
            $image_url = base_url() . DIR_COMPANY_LOGO . $design_setting->logo;
            $alt = $basic_setting->temple_name;
        }
        else {
            $image_url = base_url() . 'assets/images/logo.png';
            $alt = 'Logo not found!';
        }
        ?>
        <img src="<?php echo $image_url;?>" alt="<?php echo $alt;?>" height="100%" />
    </a>
    
    <nav class="navbar navbar-static-top" role="navigation">
        <!-- Sidebar toggle button -->
        <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>
        
        <div class="navbar-left project_title" style="padding-top: 30px; padding-left: 40px;">
            <?php echo (!empty($basic_setting->tamil_name)) ? $basic_setting->tamil_name : $basic_setting->temple_name;?>
        </div>
        
        <div class="navbar-right">
            <ul class="nav navbar-nav">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <i class="glyphicon glyphicon-user"></i>
                        <span>Welcome <?php echo $user_data['name'];?> <i class="caret"></i></span>
                    </a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="<?PHP echo base_url(); ?>user/profile/<?php echo $user_data['user_id']; ?>" >Edit Profile</a>
                        </li>
                        <li>
                            <a href="<?PHP echo base_url(); ?>admin/logout" >Logout</a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
</header>
<div class="wrapper row-offcanvas row-offcanvas-left">
<?php
$menu_data = array();
$menu_data['permissions'] = $all_permissions;
$menu_data['menu'] = (empty($menu)) ? $current_controller : $menu;
$this->load->view('templates/left_menu', $menu_data);
?>