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

169 lines
7.2 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= $school_info['school_name']; ?> | Hostel Management | Dashboard</title>
<link rel="icon" type="image/x-icon" href="<?php echo base_url(); ?>assets-hms/fav.png">
<!--styles links-->
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-hms/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-hms/css/font-family.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-hms/css/all.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-hms/css/style.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-hms/css/responsive.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-hms/css/jquery.dataTables.min.css">
<script src="<?php echo base_url(); ?>assets-hms/js/jquery-3.4.1.min.js" ></script>
<script src="<?php echo base_url(); ?>assets-hms/js/jquery.validate.js"></script>
<style>
.logo-wrap img {
width: 140px !important;
}
</style>
</head>
<body>
<div class="container">
<!--left side content-->
<aside id="mySidebar" class="sideMenu" >
<div class="hidesidebar">
<img class="close-img" src="<?php echo base_url(); ?>assets-hms/images/dashboard/close.png">
</div>
<div class="logo-wrap">
<img src="<?php echo base_url(); ?>assets-hms/<?php echo $school_info['logo']; ?>">
<div class="logo-name">
<!-- <h3>Erisn</h3>
<p>Classrooms</p> -->
</div>
</div>
<ul>
<?php
$linSessData = $_SESSION['hmsAULoginData'];
if(!isset($linSessData['hms_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('HmsAdmin_Model');
$adminMenuHere = $CI->HmsAdmin_Model->get_admin_menu();
//echo '<pre>'; print_r($adminMenuHere);exit;
$theRoleIds = '';
$adminRolesHere = $CI->HmsAdmin_Model->get_admin_details('', "SELECT admin_role_ids FROM hms_admin WHERE id = ".$linSessData['hms_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->HmsAdmin_Model->get_hms_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-hms/images/dashboard/<?php echo $menuData['inactive_icon'];?>" class="icon-inactive">
<img src="<?php echo base_url();?>assets-hms/images/dashboard/<?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-hms/images/dashboard/<?php echo $menuData['inactive_icon'];?>" class="icon-inactive">
<img src="<?php echo base_url();?>assets-hms/images/dashboard/<?php echo $menuData['active_icon'];?>" class="icon-active">
<span><?php echo $menuData['menu_name'];?></span>
</a>
</li>
<?php
}
}
}
}
}
?>
</ul>
<!--<ul class="side-list">
<li class="list active">
<a href="dashboard.html">
<img src="<?php echo base_url(); ?>assets-hms/images/dashboard/dashboard-1.svg" class="icon-inactive">
<img src="<?php echo base_url(); ?>assets-hms/images/dashboard/dashboard-2.svg" class="icon-active">
<span>Dashboard</span>
</a>
</li>
<li class="list ">
<a href="manage-rooms.html">
<img src="<?php echo base_url(); ?>assets-hms/images/dashboard/room-1.svg" class="icon-inactive">
<img src="<?php echo base_url(); ?>assets-hms/images/dashboard/room-2.svg" class="icon-active">
<span>Manage Rooms</span>
</a>
</li>
<li class="list ">
<a href="students.html">
<img src="<?php echo base_url(); ?>assets-hms/images/dashboard/student-1.svg" class="icon-inactive">
<img src="<?php echo base_url(); ?>assets-hms/images/dashboard/student-2.svg" class="icon-active">
<span>Students</span>
</a>
</li>
<li class="list">
<a href="javascript:void(0)" id="btn-1" class="dropdown-toggle collapsed" data-toggle="collapse" data-target="#Authorization-submenu" aria-expanded="true">
<img src="http://localhost/erisn-classroom/assets_admin/images/subadmin1.png" class="icon-inactive">
<img src="http://localhost/erisn-classroom/assets_admin/images/subadmin2.png" class="icon-active">
<span>Authorization</span>
</a>
<div class="nav collapse" id="Authorization-submenu" role="menu" aria-labelledby="btn-1" >
<a class="dropdown-item " href="https://ezydemo.com/erisn-hostel-management/assign-rooms.html">Roles</a>
<a class="dropdown-item " href="https://ezydemo.com/erisn-hostel-management/assign-rooms.html">Users</a>
</div>
</li>
</ul>-->
</aside>
<!--End left side content-->