<?php
//ob_start();  // Output buffering start karo
session_start();
if(!isset($_SESSION["sess_user"])){
  echo "<script>window.location.href='index.php';</script>";
    //header("Location: index.php"); 
    exit();
}
else
?>
<!DOCTYPE html>
<html>
    

<head>
  <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
   <!-- <meta http-equiv="refresh" content="5" />-->
  <title>Madina Construction Dashboard</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <!-- Tempusdominus Bbootstrap 4 -->
  <link rel="stylesheet" href="plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
  <!-- iCheck -->
  <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css">
  <!-- JQVMap -->
  <link rel="stylesheet" href="plugins/jqvmap/jqvmap.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
  <!-- overlayScrollbars -->
  <link rel="stylesheet" href="plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
  <!-- Daterange picker -->
  <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css">
  <!-- summernote -->
  <link rel="stylesheet" href="plugins/summernote/summernote-bs4.css">
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

    <!-- 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">
  
  
    <!-- Select2 -->
  <link rel="stylesheet" href="plugins/select2/css/select2.min.css">
  <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
  
 
  <!-- Bootstrap4 Duallistbox -->
  <link rel="stylesheet" href="plugins/bootstrap4-duallistbox/bootstrap-duallistbox.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>       
  <script src="https://cdn.datatables.net/plug-ins/1.10.15/api/fnReloadAjax.js"></script>      
    <link rel="shortcut icon" href="images/logos/soft-lg-1-withname copy.png" type="image/x-icon" >

    <style>
        .form-hidden {
  display: none;
}
.layout-fixed .main-sidebar {
    bottom: 0;
    float: none;
    height: 100vh;
    left: 0;
    position: fixed;
    top: 0;
    background-color: firebrick;
}

.page-item.active .page-link {
    z-index: 3;
    color: #fff;
       background-color: #dc3545;
    border-color: #dc3545
}
.sidebar-dark-primary .nav-sidebar>.nav-item>.nav-link.active, .sidebar-light-primary .nav-sidebar>.nav-item>.nav-link.active {
    background-color: rgba(255,255,255,.9);
    color: #000;
}

.nav-treeview>.nav-item>.nav-link.active:hover {
       background-color: #e35b5b;
    color: #343a40;
}

a {
    color: black;
    text-decoration: none;
    background-color: transparent;
}


   .container {
        position: relative;
        width: 50%; /* Adjust the width of the container */
        margin: 0 auto; /* Center the container */
        padding: 20px;
        border: 1px solid #ddd; /* Optional: Add a border to the container */
    }

    .custom-alert {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background-color: #f44336;
        color: white;
        text-align: center;
        padding: 15px;
        z-index: 9999;
    }


    </style>
 
 
</head>
<body class="hold-transition sidebar-mini layout-fixed  sidebar-collapse">
<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>
      <!--<li class="nav-item d-none d-sm-inline-block">
        <a href="index3.html" class="nav-link">Home</a>
      </li>
      <li class="nav-item d-none d-sm-inline-block">
        <a href="#" class="nav-link">Contact</a>
      </li>-->
    </ul>

    <!-- SEARCH FORM -->
    <!--<form class="form-inline ml-3">
      <div class="input-group input-group-sm">
        <input class="form-control form-control-navbar" type="search" placeholder="Search" aria-label="Search">
        <div class="input-group-append">
          <button class="btn btn-navbar" type="submit">
            <i class="fas fa-search"></i>
          </button>
        </div>
      </div>
    </form>-->

    <!-- Right navbar links -->
    <ul class="navbar-nav ml-auto">
      <!-- Messages Dropdown Menu -->
   
   
      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <!-- User Account Menu -->
          <li class="dropdown user user-menu">
            <!-- Menu Toggle Button -->
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <!-- The user image in the navbar-->
        
               <!--<img src="dist/img/user2-160x160.jpg" class="user-image" alt="User Image">-->
               <img src="images/logos/madinaconst-lgnew.png" class="user-image" alt="User Image">
              <!-- hidden-xs hides the username on small devices so only the image appears. -->
              <span class="hidden-xs"><?= $_SESSION['sess_user'];  ?>

              </span>
            </a>
            <ul class="dropdown-menu">
              <!-- The user image in the menu -->
              <li class="user-header">
                <!-- <img src="dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">-->
                <img src="images/logos/madinaconst-lgnew.png" class="img-circle elevation-2" alt="User Image">
               
                <p>
                  Hi
                    <?= $_SESSION['sess_user'];  ?><br>
               
                </p>
              </li>
              <!-- Menu Footer-->
              <li class="user-footer">
             
                 <div class="row">
                     <div class="col">
                <div class="pull-left">
                     <?php $role = $_SESSION['sess_role'];  ?>
                     <?php if($role =='Admin') { ?>
                    <a class="btn btn-danger btn-flat" href="admin_profile.php">
                    Profile
                </a>
                <?php } ?>
                </div>
                </div>
                 <div class="col">
                 </div>
                <div class="col">
                 <div class="pull-right">
                    <a class="btn btn-danger btn-flat" href="logout.php">
                    Logout
                    </a>
                 </div>
                 </div>
                 </div>
               
             
              </li>
            </ul>
          </li>
        </ul>
      </div>
    </ul>
  </nav>
  <!-- /.navbar -->
<?php 
//}
?>