	<?php if($_SESSION['murgibhai']==''){

				if (isset($_COOKIE["user_login"]))
				{
					$_SESSION['murgibhai']=$_COOKIE["user_login"];
				}else{

					header("Location:login.php");


				}

		}
		//logged in company details
		$loggedin_company = $_SESSION['company'];
		
				$csadded=$_SESSION['murgibhai'];
				$getlog=f(q("SELECT * FROM tbl_login WHERE l_uid='$csadded'"));
				$ltype=$getlog['l_type'];
				$custid=$getlog['user_id'];
				$pagename=basename($_SERVER['PHP_SELF']);
				//echo "<script>alert('".$pagename."')</script>";
				$getpage=f(q("SELECT * FROM tbl_pages WHERE pagename='$pagename'"));
				$pgid=$getpage['id'];
				$getperm=f(q("SELECT * FROM tbl_access WHERE utype='$ltype' AND pageid='$pgid'"));
				$pview=$getperm['pview'];
				$psave=$getperm['psave'];
				$pupdate=$getperm['pupdate'];
				$pdelete=$getperm['pdelete'];

				//echo "<script>alert('".$pdelete."')</script>";

				if($pview==""){
					$pview=1;
				}

				if($psave==""){
					$psave=1;
				}

				if($pupdate==""){
					$pupdate=1;
				}
				if($pdelete==""){
					$pdelete=1;
				}


				if($pview==0){
					echo "<script>alert('You have no permission to access this page');</script>";
					echo "<script>window.location.href='index.php'</script>";
					exit;
				}


	?>
	<!-- <div class="pre-loader"></div> -->
	<div class="header clearfix">
		<div class="header-right">
			<div class="brand-logo">
				<a href="index.php">
					<!-- <img src="vendors/images/logo.png" alt="" class="mobile-logo"> -->
					<h4><?php echo $loggedin_company['c_name']?></h4> 
				</a>
			</div>
			<div class="menu-icon">
				<span></span>
				<span></span>
				<span></span>
				<span></span>
			</div>
			<div class="user-info-dropdown">
				<div class="dropdown">
					<a class="dropdown-toggle" href="#" role="button" data-toggle="dropdown">
						<span class="user-icon" ><i class="fa fa-user-o" style="color:red;"></i></span>
						<span class="user-name"><?=$getlog['l_name']?></span>
					</a>
					<div class="dropdown-menu dropdown-menu-right">
						<!-- <a class="dropdown-item" href="profile.php"><i class="fa fa-user-md" aria-hidden="true"></i> Profile</a>
						<a class="dropdown-item" href="profile.php"><i class="fa fa-cog" aria-hidden="true"></i> Setting</a> -->
						<a class="dropdown-item" href="customer-payments.php"><i class="fa fa-user-md" aria-hidden="true"></i> Add Payment</a>
						<a class="dropdown-item" href="generatebill.php"><i class="fa fa-cog" aria-hidden="true"></i> Generate Bill</a>
						<a class="dropdown-item" href="billlists.php"><i class="fa fa-question" aria-hidden="true"></i> Bill List</a>
						<a class="dropdown-item" href="changepass.php"><i class="fa fa-lock" aria-hidden="true"></i> Change Password</a>
						<a class="dropdown-item" href="logout.php"><i class="fa fa-sign-out" aria-hidden="true"></i> Log Out</a>
					</div>
				</div>
			</div>
			<?php if($ltype=='1'){ ?>
			<!-- <div class="user-notification">
				<div class="dropdown">
					<a class="dropdown-toggle" href="#" role="button" data-toggle="dropdown">
						<span class="user-icon" style="font-size: 16px;"><i class="fa fa-cog"></i></span>
						<span class="user-name" style="font-size: 16px;">Quick Links</span>
					</a>
					<div class="dropdown-menu dropdown-menu-right">
						
						<a class="dropdown-item" href="customer-payments.php"><i class="fa fa-user-md" aria-hidden="true"></i> Add Payment</a>
						<a class="dropdown-item" href="generatebill.php"><i class="fa fa-cog" aria-hidden="true"></i> Generate Bill</a>
						<a class="dropdown-item" href="billlists.php"><i class="fa fa-question" aria-hidden="true"></i> Bill List</a>
						<a class="dropdown-item" href="logout.php"><i class="fa fa-sign-out" aria-hidden="true"></i> Log Out</a>
					
					</div>
				</div>
			</div> -->
			<?php } ?>
			<?php if($ltype=='3'){ ?>
			<div class="user-notification">
				<div class="dropdown">
					<form action="paynow.php?action=pay&custid=<?php echo $custid?>" method="POST">
						<button type="submit" class="btn btn-danger">Pay Now</button>
					</form>
				</div>
			</div>
			<?php } ?>
			<!-- <?php if($ltype=='1'){ ?>
			
			<?php } ?> -->
		</div>
	</div>