BBnepal-Accounts/bustracking/application/views/bustracking-admin/common/left-menu.php
Sampanna Rimal 9cd05ef3cb commitall
2024-07-10 18:28:19 +05:45

120 lines
4.5 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bustracking | Home</title>
<!--styles links-->
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>assets-bustracking/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>assets-bustracking/css/font-family.css">
<link rel="stylesheet" href="<?php echo base_url();?>assets-bustracking/css/all.css">
<link rel="stylesheet" href="<?php echo base_url();?>assets-bustracking/owl-carousel/css/owl.carousel.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>assets-bustracking/css/style-admin.css">
<link rel="stylesheet" href="<?php echo base_url();?>assets-bustracking/css/style-admin-responsive.css">
<link rel="icon" type="image/x-icon" href="<?php echo base_url(); ?>assets-bustracking/fav.png">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-bustracking/css/nepali.datepicker.v3.7.min.css">
</head>
<body>
<div class="wraper">
<!--left side content-->
<aside id="mySidebar" class="sideMenu">
<div class="logo-wrap">
<img src="<?php echo base_url();?>assets-bustracking/images/blackboard-logo.png">
</div>
<ul>
<?php
$linSessData = $_SESSION['busAULoginData'];
if(!isset($linSessData['bt_lin_login']))
redirect(base_url().'admin');
//echo '<pre>'; print_r($linSessData);exit;
$currentURL = current_url();
$url = explode(base_url(), $currentURL);
//echo $currentURL;
//echo '<pre>';print_r($url);
$CI = &get_instance();
$CI->load->model('BustrackingAdmin_Model');
$adminMenuHere = $CI->BustrackingAdmin_Model->get_admin_menu();
// echo '<pre>'; print_r($adminMenuHere);exit;
$theRoleIds = '';
$adminRolesHere = $CI->BustrackingAdmin_Model->get_admin_details('', "SELECT admin_role_ids FROM bt_admin WHERE id = ".$linSessData['bt_lin_id']);
if(isset($adminRolesHere[0]['admin_role_ids']) && $adminRolesHere[0]['admin_role_ids']!='')
$theRoleIds = $adminRolesHere[0]['admin_role_ids'];
$adminRolePerms = array();
if($theRoleIds!='')
$adminRolePerms = $CI->BustrackingAdmin_Model->get_bt_admin_role_permissions("admin_role_ids IN(".$theRoleIds.")");
if(!empty($adminRolePerms))
{
$arpStr = ''; $arpArr = array();
foreach($adminRolePerms as $arp)
{
if($arpStr=='')
$arpStr = $arp['menu_ids'];
else
$arpStr .= ','.$arp['menu_ids'];
}
$arpArr = array_unique(explode(',', $arpStr));
if(!empty($adminMenuHere))
{
foreach($adminMenuHere as $key=>$menuData)
{
if(in_array($key, $arpArr))
{
if(isset($menuData[$key]) && !empty($menuData[$key]))
{
$smPageLinks = array();
foreach($menuData[$key] as $tmactive){
array_push($smPageLinks, $tmactive['page_link']);
}
//echo '<pre>'; print_r($smPageLinks);
//echo $url[0];
$mmmActive = '';
if(in_array($url[1], $smPageLinks))
$mmmActive = 'active';
?>
<li class="list <?php echo $mmmActive;?>">
<a href="javascript:void(0)" id="btn-1" class="dropdown-toggle" data-toggle="collapse" data-target="#<?php echo $menuData['menu_name'].'-submenu';?>" aria-expanded="false">
<img src="<?php echo base_url();?>assets-bustracking/images/<?php echo $menuData['active_icon'];?>" class="icon-active">
<span><?php echo $menuData['menu_name'];?></span>
</a>
<div class="nav collapse" id="<?php echo $menuData['menu_name'].'-submenu';?>" role="menu" aria-labelledby="btn-1">
<?php
foreach($menuData[$key] as $subMenu)
{
?>
<a class="dropdown-item <?php if($url[1]==$subMenu['page_link']){?>active<?php } ?>" href="<?php echo base_url().$subMenu['page_link'];?>"><?php echo $subMenu['menu_name'];?></a>
<?php
}
?>
</div>
</li>
<?php
}
else
{
?>
<li class="list <?php if($url[1]==$menuData['page_link']){?>active<?php } ?>">
<a href="<?php echo base_url().$menuData['page_link'];?>" class="dropdown">
<img src="<?php echo base_url();?>assets-bustracking/images/<?php echo $menuData['active_icon'];?>" class="icon-active">
<span><?php echo $menuData['menu_name'];?></span>
</a>
</li>
<?php
}
}
}
}
}
?>
</ul>
</aside>