<?php 
$priveleges = $db->get_col ( "users", array ("email" => $uemail ), 'privilege' );
$usertype = $db->get_col ( "users", array ("email" => $uemail ), 'type' );
$total = explode ( ',', $priveleges [0] );
?>
<div class="sidebar" id="sidebar">
	<div class="sidebar-shortcuts" id="sidebar-shortcuts">
		<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
<?php if ($usertype[0] == 0)
{?>
			<a href="<?php echo $link->link('employee_details', Admin);?>"><button
					class="btn btn-small btn-success">
					<i class="icon-book"></i>
				</button></a>
<?php }if ($usertype[0] == 0)
{?>				 
				<a href="<?php echo $link->link('employee_awards', Admin);?>"><button
					class="btn btn-small btn-info">
					<i class="icon-trophy"></i>
				</button></a> 
<?php }if($usertype[0] == 0)
{?>				
				<a href="<?php echo $link->link('singaporetable', Admin);?>"><button
					class="btn btn-small btn-warning">
					<i class="icon-credit-card"></i>
				</button></a>
<?php }if($usertype[0] == 0)
{?>				 
				<a href="<?php echo $link->link('attendence', Admin);?>"><button
					class="btn btn-small btn-danger">
					<i class="icon-calendar"></i>
				</button></a>
<?php }?>				
		</div>

		<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
			<span class="btn btn-success"></span> <span class="btn btn-info"></span>

			<span class="btn btn-warning"></span> <span class="btn btn-danger"></span>
		</div>
	</div>
	<!--#sidebar-shortcuts-->


												<?php
												if (LOGO == '') {
													echo '<h6>No Image</h6>';
												} else {
													$logo = $db->get_col ( 'setting', array ('id' => 1 ), 'c_logo' );
													
													?>
									      		<img
		src="<?php echo SITE_URL.'/uploads/image/'.$logo[0];?>">
									      		
									      		<?php } ?>
								      	
								<!-- vicky -->


	<!-- choose -->




	<ul class="nav nav-list">
<?php

// $db->debug();

// print_r($total);

// foreach ($total as $row)
{
	
	if ($usertype [0] == 0) {
		?>
		<li <?php if($query2ans == 'home') {?> class="active" <?php }?>><a
			href="<?php echo $link->link('home', Admin, '');?>"> <i
				class="icon-home"></i> <span class="menu-text"> Home </span>
		</a></li>
		
		<?php
	
	}
	if($usertype[0] == 0 || in_array('attendence1', $total) || in_array('empattend', $total))
	{
		?>
				<li
			<?php if($query2ans == 'attendence' || $query2ans == 'employee_attendence'){?>
			class="active open" <?php }?>><a class="dropdown-toggle" href="#"> <i
				class="icon-book"></i> <span class="menu-text"> Attendence </span> <b
				class="arrow icon-angle-down"></b>
		</a>
			<ul class="submenu">
			<?php if ($usertype[0] == 0 || in_array('attendence1', $total)){?>	
				<li <?php if($query2ans == 'attendence'){?> class="active" <?php }?>><a
					href="<?php echo $link->link('attendence', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Attendence
				</a></li>
			<?php /* }  if ( $usertype[0] == 0 || in_array('empattend', $total)) {?>
				<li <?php if($query2ans == 'employee_attendence'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('employee_attendence', Admin, '');?>">
						<i class="icon-double-angle-right"></i> Employee Attendence
				</a></li>
				<?php */ }?>
			</ul></li>
				
				<?php
	
	}
		if ($usertype [0] == '0' || in_array('displayuser', $total) || in_array('newregister', $total)) {
			?>
		<li
			<?php if($query2ans == 'displayuser' || $query2ans == 'register'){?>
			class="active open" <?php }?>><a class="dropdown-toggle" href="#"> <i
				class="icon-ban-circle"></i> <span class="menu-text"> Employer </span>
				<b class="arrow icon-angle-down"></b>
		</a>
			<ul class="submenu">
			<?php if (in_array('displayuser', $total) || $usertype [0] == '0'){?>	
				<li <?php if($query2ans == 'displayuser'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('displayuser', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Display Employer
				</a></li>
			<?php } if (in_array('newregister', $total) || $usertype [0] == '0'){?>
				<li <?php if($query2ans == 'register'){?> class="active" <?php }?>>
					<a href="<?php echo $link->link('register', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> New Employer
				</a>
				</li>
				<?php }?>
			</ul></li>
		<?php } if (in_array('paymentdetails', $total) || in_array('newpayments', $total)){?>
		<!-- <li
			<?php if($query2ans == 'payment_details' || $query2ans == 'payment'){?>
			class="active open" <?php }?>><a class="dropdown-toggle" href="#"> <i
				class="icon-credit-card"></i> <span class="menu-text"> Payments </span>
				<b class="arrow icon-angle-down"></b>
		</a>
			<ul class="submenu">
			<?php if (in_array('paymentdetails', $total)){?>	
				<li <?php if($query2ans == 'payment_details'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('payment_details', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Payment Lists
				</a></li>
			<?php
		
		}
		if (in_array ( 'newpayments', $total )) {
			?>
				<li <?php if($query2ans == 'payment'){?> class="active" <?php }?>><a
					href="<?php echo $link->link('payment', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> New Payment
				</a></li>
			<?php }?>	
			</ul></li> -->
		<?php }?>
		
		<?php
	if (in_array ( 'mostawarded', $total ) || in_array ( 'earlierawards', $total ) || in_array ( 'giveanawards', $total )|| $usertype[0] == '0') {
		?>
		
		<li
			<?php if($query2ans == 'employee_awards' || $query2ans == 'earlier_awards' || $query2ans == 'give_away'){?>
			class="active open" <?php }?>><a class="dropdown-toggle" href="#"> <i
				class="icon-certificate "></i> <span class="menu-text"> Awards </span>
				<b class="arrow icon-angle-down"></b>
		</a>
			<ul class="submenu">
			<?php
		if (in_array ( 'mostawarded', $total ) || $usertype[0] == '0') {
			?>	
				<li <?php if($query2ans == 'employee_awards'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('employee_awards', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Most Awarded
				</a></li>
			<?php
		}
		if (in_array ( 'earlierawards', $total ) || $usertype[0] == '0'){
			?>	
				<li <?php if($query2ans == 'earlier_awards'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('earlier_awards', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Earlier Awards
				</a></li>
			<?php
		}
		if (in_array ( 'giveanawards', $total ) || $usertype[0] == '0') {
			?>
				<li <?php if($query2ans == 'give_away'){?> class="active" <?php }?>>
					<a href="<?php echo $link->link('give_away', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Give An Award
				</a>
				</li>
			<?php }?>
				
			</ul></li>
		<?php }?>
		<?php
	if ( $usertype[0] == '2' || $usertype[0] == '0' || in_array("employeesdetails", $total) || in_array("newemployees", $total)) {
		?>
		<li
			<?php if($query2ans == 'employee_details' || $query2ans == 'new_employee'){?>
			class="active open" <?php }?>><a class="dropdown-toggle" href="#"> <i
				class="icon-group"></i> <span class="menu-text"> Employees </span> <b
				class="arrow icon-angle-down"></b>
		</a>
			<ul class="submenu">
			<?php if (in_array("employeesdetails", $total) || $usertype[0] == '0'){?>
				<li <?php if($query2ans == 'employee_details'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('employee_details', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Employee Lists
				</a></li>
			<?php }if(in_array("newemployees", $total) || $usertype[0] == '0'){?>
				<li <?php if($query2ans == 'new_employee'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('new_employee', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> New Employee
				</a></li>	
			<?php }?>
			</ul></li>
		<?php }?>
		<?php
	if (in_array ( 'clientdetails', $total ) || in_array ( 'newclient', $total )) {
		?>
		<!-- <li
			<?php if($query2ans == 'client_details' || $query2ans == 'new_client'){?>
			class="active open" <?php }?>><a class="dropdown-toggle" href="#"> <i
				class="icon-heart"></i> <span class="menu-text"> Clients </span> <b
				class="arrow icon-angle-down"></b>
		</a>
			<ul class="submenu">
			<?php if (in_array('clientdetails', $total)) {?>
				<li <?php if($query2ans == 'client_details'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('client_details', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Client Lists
				</a></li>
			<?php
		
		}
		if (in_array ( 'newclient', $total )) {
			?>
				<li <?php if($query2ans == 'new_client'){?> class="active" <?php }?>>
					<a href="<?php echo $link->link('new_client', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> New Client
				</a>
				</li>
			<?php }?>

			</ul></li> -->
		<?php }?>
		<?php
	if (in_array ( 'departments', $total ) || in_array ( 'newdepartments', $total ) || $usertype[0] == '0') {
		?>
		<li
			<?php if($query2ans == 'departments' || $query2ans == 'new_departments'){?>
			class="active open" <?php }?>><a class="dropdown-toggle" href="#"> <i
				class="icon-briefcase "></i> <span class="menu-text"> Departments </span>
				<b class="arrow icon-angle-down"></b>
		</a>
			<ul class="submenu">
			<?php
		if (in_array ( 'departments', $total ) || $usertype[0] == '0') {
			?>
				<li <?php if($query2ans == 'departments'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('departments', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Departments
				</a></li>
			<?php
		
		}
		if (in_array ( 'newdepartments', $total ) || $usertype[0] == '0') {
			?>
				<li <?php if($query2ans == 'new_departments'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('new_departments', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> New Departments
				</a></li>
			<?php }?>

			</ul></li>
		<?php }?>	
		<?php
	// if(in_array('changepasswords', $total)){
	?>
	
	<?php if ($usertype[0]=='3' || $usertype[0] == '0') {?>
		
		<li
			<?php if($query2ans =='singaporetable' || $query2ans =='payslip' || $query2ans =='previous_payslip'){?>
			class="active open" <?php }?>><a href="#" class="dropdown-toggle"> <i
				class="icon-credit-card "></i> <span class="menu-text"> Payroll </span>
				<b class="arrow icon-angle-down"></b>
		</a>

			<ul class="submenu">
				<li <?php if($query2ans == 'singaporetable') {?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('singaporetable', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Payroll Config
				</a></li>
				<li <?php if($query2ans == 'payslip') {?> class="active" <?php }?>>
					<a href="<?php echo $link->link('payslip', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Payslip Generator
				</a>
				</li>
				<li <?php if($query2ans == 'previous_payslip') {?> class="active" <?php }?>>
					<a href="<?php echo $link->link('previous_payslip', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Previous Payslip
				</a>
				</li>
			</ul></li>
		<?php }if ($usertype[0] == '3' || $usertype[0]=='0'){?>
		
		<li <?php if($query2ans == 'incometax_slab') {?> class="active"
			<?php }?>><a
			href="<?php echo $link->link('incometax_slab', Admin, '');?>"> <i
				class="icon-bolt"></i> <span class="menu-text"> Income Tax Slab </span>
		</a></li>
		<?php }?>

		<li <?php if($query2ans == 'change_pass') {?> class="active" <?php }?>>
			<a href="<?php echo $link->link('change_pass', Admin, '');?>"> <i
				class="icon-cogs"></i> <span class="menu-text"> Change Password </span>
		</a>
		</li>
		
<?php }?>






<?php
	if (in_array ( 'addinventory', $total ) || in_array ( 'viewinventory', $total ) 
			|| in_array ( 'addlocation', $total ) || in_array ( 'viewlocation', $total ) || $usertype[0] == '0') {
		?>
<li <?php if($query2ans == 'add_inventory' || $query2ans == 'view_inventory' || $query2ans=='add_location' || $query2ans=='view_location'){?>
			class="active open" <?php }?>><a class="dropdown-toggle" href="#"> <i
				class="icon-gift"></i> <span class="menu-text"> Inventory </span>
				<b class="arrow icon-angle-down"></b>
		</a>
			<ul class="submenu">
				<?php
		if (in_array ( 'addinventory', $total ) || $usertype[0] == '0') {
			?>
				<li <?php if($query2ans == 'add_inventory'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('add_inventory', Admin, '');?>"> 
					<i class="icon-double-angle-right"></i> Add Inventory
				</a></li>
			<?php }
			
			if (in_array ( 'viewinventory', $total ) || $usertype[0] == '0') {
			
			?>
				<li <?php if($query2ans == 'view_inventory'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('view_inventory', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> View Inventory
				</a></li>
				<?php }?>
	   <li <?php if($query2ans=="add_location" || $query2ans=="view_location"){?> class="active open" <?php }?>><a class="dropdown-toggle" href="#"> <i
				class="icon-map-marker"></i> <span class="menu-text"> Location </span>
				<b class="arrow icon-angle-down"></b>
		</a>
		<ul class="submenu">
			     <?php
		if (in_array ( 'addlocation', $total ) || $usertype[0] == '0') {
			?>
				<li <?php if($query2ans == 'add_location'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('add_location', Admin, '');?>"> 
					<i class="icon-double-angle-right"></i> Add Location
				</a></li>
			<?php }
			if (in_array ( 'viewlocation', $total ) || $usertype[0] == '0') {
			?>
				<li <?php if($query2ans == 'view_location'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('view_location', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> View Location
				</a></li>
			<?php }?>

			</ul>	

		</li>
			</ul>
			
			
			
			</li>
<?php }?>

<?php
	if ($usertype[0] == '0') {
		?>			
	<li
			<?php if($query2ans == 'add_loan' || $query2ans == 'view_loan'){?>
			class="active open" <?php }?>><a class="dropdown-toggle" href="#"> <i
				class="icon-money "></i> <span class="menu-text"> Loan Module </span>
				<b class="arrow icon-angle-down"></b>
		</a>
			<ul class="submenu">
			
				<li <?php if($query2ans == 'add_loan'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('add_loan', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> Add Loan
				</a></li>
			
				<li <?php if($query2ans == 'view_loan'){?> class="active"
					<?php }?>><a
					href="<?php echo $link->link('view_loan', Admin, '');?>"> <i
						class="icon-double-angle-right"></i> View Loan
				</a></li>
			
			</ul></li>
				

<?php }?>
	</ul>
	<!--/.nav-list-->

	<div class="sidebar-collapse" id="sidebar-collapse">
		<i class="icon-double-angle-left"></i>
	</div>
	<br><br><br>
</div>
<div class="main-content">

	<div class="breadcrumbs" id="breadcrumbs">
		<ul class="breadcrumb">
			<li><i class="icon-home home-icon"></i> <a href="#">Home</a> <span
				class="divider"> <i class="icon-angle-right arrow-icon"></i>
			</span></li>
			<li class="active">
			<?php
			echo $feature->textstyler ( $query2ans, 1 );
			?>
			</li>
		</ul>
		<!--.breadcrumb-->
	</div>