<?php
include 'session.php';
date_default_timezone_set("Asia/Kolkata");
$current_date=date('Y-m-d');
$current_page=basename($_SERVER['PHP_SELF']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title><?php echo web_constant::COMP_NAME;?></title>
	<link rel="shortcut icon" type="image/png" href="favicon.png" />
  <!-- Google Font: Source Sans Pro -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
<?php
if($current_page=="remark-report.php"){
?>
  <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css">

<!-- DataTables -->
<link rel="stylesheet" href="plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
<?php
}
?>
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
  <link rel="stylesheet" href="dist/css/my-css.css">
<style>
.xcrud-list table td {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
</style>


</head>
<body class="hold-transition sidebar-mini">
<!-- Loader Overlay -->
<div id="loader-overlay" class="loader-overlay" style="display: none;">
    <div class="loader"></div>
</div>

<div class="wrapper">
  <!-- Navbar -->
  <nav class="main-header navbar navbar-expand navbar-white navbar-light">
    <!-- Left navbar links -->
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
      </li>
      
    </ul>

    <!-- Right navbar links -->
    <ul class="navbar-nav ml-auto">
      <!-- Navbar Search -->
      
      <li class="nav-item">
        <a class="nav-link" data-widget="fullscreen" href="#" role="button">
          <i class="fas fa-expand-arrows-alt"></i>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#" role="button">
          <i class="fas fa-th-large"></i>
        </a>
      </li>
    </ul>
  </nav>
  <!-- /.navbar -->

  <!-- Main Sidebar Container -->
  <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="home" class="brand-link">
      <img src="dist/img/logo.png" alt="Scanner" class="brand-image img-circle elevation-3" style="opacity: .8">
      <span class="brand-text font-weight-light"><?php echo web_constant::APP_NAME;?></span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
      

      <!-- Sidebar Menu -->
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
          <!-- Add icons to the links using the .nav-icon class
               with font-awesome or any other icon font library -->
			<li class="nav-item"><a href="home" class="nav-link"><i class="nav-icon fas fa-th"></i><p>Home</p></a></li>
<?php
if($_SESSION['user_type']=='admin'){
?>
		  <li class="nav-item">
            <a href="#" class="nav-link"><i class="nav-icon fas fa-list"></i><p>Master<i class="right fas fa-angle-left"></i></p></a>
            <ul class="nav nav-treeview">
              <li class="nav-item"><a href="branch" class="nav-link"><i class="far fa-circle nav-icon"></i><p>Branch</p></a></li>
			  <li class="nav-item"><a href="city" class="nav-link"><i class="far fa-circle nav-icon"></i><p>City</p></a></li>
			  <li class="nav-item"><a href="products" class="nav-link"><i class="far fa-circle nav-icon"></i><p>Products</p></a></li>
			  <li class="nav-item"><a href="financer" class="nav-link"><i class="far fa-circle nav-icon"></i><p>Financer</p></a></li>
			  <li class="nav-item"><a href="institute" class="nav-link"><i class="far fa-circle nav-icon"></i><p>Institute</p></a></li>
              <li class="nav-item"><a href="lost-reason" class="nav-link"><i class="far fa-circle nav-icon"></i><p>Lost Reason</p></a></li>
			  <li class="nav-item"><a href="timeslot" class="nav-link"><i class="far fa-circle nav-icon"></i><p>Time Slot</p></a></li>
            </ul>
          </li>
<?php
}

if (!empty($_SESSION['permissions']['services']['view'])) {
	echo '<li class="nav-item"><a href="services" class="nav-link"><i class="nav-icon fas fa-tools"></i><p>Service</p></a></li>';
}

if (!empty($_SESSION['permissions']['service-followup']['view'])) {
?>
		<li class="nav-item">
			<a href="#" class="nav-link"><i class="nav-icon fas fa-share-square"></i><p>Follow Up<i class="right fas fa-angle-left"></i></p></a>
            <ul class="nav nav-treeview">
				<li class="nav-item"><a href="service-followup" class="nav-link"><i class="far fa-circle nav-icon"></i><p>All Follow Up</p></a></li>
				<li class="nav-item"><a href="service-followup?status=pending" class="nav-link"><i class="far fa-circle nav-icon"></i><p>All Pending Follow Up</p></a></li>
				<li class="nav-item"><a href="service-followup?status=today_pending" class="nav-link"><i class="far fa-circle nav-icon"></i><p>Today Pending</p></a></li>
				<li class="nav-item"><a href="service-followup?status=backdate_pending" class="nav-link"><i class="far fa-circle nav-icon"></i><p>Backdeate Pending</p></a></li>
				<li class="nav-item"><a href="service-followup?status=today_taken" class="nav-link"><i class="far fa-circle nav-icon"></i><p>Today's Taken</p></a></li>
			</ul>
		</li>
<?php } 
echo '<!--<li class="nav-item"><a href="" class="nav-link"><i class="nav-icon fas fa-comments"></i><p>Feedback</p></a></li>-->';
if (!empty($_SESSION['permissions']['upload-data']['view'])) {
	echo '<li class="nav-item"><a href="upload-data" class="nav-link"><i class="nav-icon fas fa-upload"></i><p>Upload Data</p></a></li>';
}
if (!empty($_SESSION['permissions']['upload-job-card']['view'])) {
	echo '<li class="nav-item"><a href="upload-job-card" class="nav-link"><i class="nav-icon fas fa-upload"></i><p>Upload Job Card</p></a></li>';
}
if (!empty($_SESSION['permissions']['remark-report']['view'])) {
	echo '<li class="nav-item">
            <a href="#" class="nav-link"><i class="nav-icon fas fa-file-alt"></i><p>Report<i class="right fas fa-angle-left"></i></p></a>
            <ul class="nav nav-treeview">
				<li class="nav-item"><a href="remark-report" class="nav-link"><i class="nav-icon fas fa-file-alt"></i><p>Remark Report</p></a></li>
				<li class="nav-item"><a href="remark-report?status=lost" class="nav-link"><i class="nav-icon fas fa-file-excel"></i><p>Lost Report</p></a></li>
			</ul>
			</li>';
}
if (!empty($_SESSION['permissions']['appointment']['view'])) {
	echo '<li class="nav-item"><a href="appointment" class="nav-link"><i class="nav-icon fas fa-calendar-check"></i><p>Appointment</p></a></li>';
}
if (!empty($_SESSION['permissions']['bulk-home']['view'])) {
	echo '<li class="nav-item"><a href="bulk-home" class="nav-link"><i class="nav-icon fas fa-layer-group"></i><p>Bulk Service</p></a></li>';
}
?>
		<!--<li class="nav-item">
            <a href="#" class="nav-link"><i class="nav-icon fas fa-layer-group"></i><p>Bulk<i class="right fas fa-angle-left"></i></p></a>
            <ul class="nav nav-treeview">
              <li class="nav-item"><a href="bulk-services" class="nav-link"><i class="fas fa-tools nav-icon"></i><p>Service</p></a></li>
			  <li class="nav-item"><a href="bulk-service-followup" class="nav-link"><i class="fas fa-share-square nav-icon"></i><p>Follow Up</p></a></li>
			  <li class="nav-item"><a href="bulk-upload-data" class="nav-link"><i class="fas fa-upload nav-icon"></i><p>Upload Data</p></a></li>
            </ul>
		</li>-->
		  
		<li class="nav-item"><a href="users" class="nav-link"><i class="nav-icon far fa-user"></i><p>Users</p></a></li>
<?php
if($_SESSION['user_type']=='admin'){
	//echo '<li class="nav-item"><a href="zreset" class="nav-link"><i class="nav-icon far fa-close"></i><p>*Reset DB*</p></a></li>';
}
?>
		  

        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
  </aside>