<?php
  $pageName =substr($_SERVER['SCRIPT_NAME'], strrpos($_SERVER['SCRIPT_NAME'],"/")+1) ;
?>


<aside class="sidenav navbar navbar-vertical navbar-expand-xs border-0 border-radius-xl my-3 fixed-start ms-3 " id="sidenav-main">
    <div class="sidenav-header">
        <a class="navbar-brand m-0" href="index.php">
            <img src="/12.png" alt="Logo" style="max-width: 180px;">
        </a>
    </div>

    <hr class="horizontal dark mt-0">
    <div class="collapse navbar-collapse  w-auto " id="sidenav-collapse-main">

      <ul class="navbar-nav">
        <li class="nav-item">
          <a class="nav-link  
          <?= $pageName == 'index.php' ? 'active':''; ?>
          " href="index.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
              <i class="fas fa-home <?= $pageName == 'index.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Dashboard</span>
          </a>
        </li>

        <li class="nav-item mt-3">
          <h6 class="ps-4 ms-2 text-uppercase text-xs font-weight-bolder opacity-6">Pages</h6>
        </li>
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'users.php' ? 'active':''; ?>
          <?= $pageName == 'users-create.php' ? 'active':''; ?>
          <?= $pageName == 'users-edit.php' ? 'active':''; ?>
          " href="users.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-users <?= $pageName == 'users.php' || $pageName == 'users-create.php' || $pageName == 'users-edit.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Users</span>
          </a>
        </li>

        <li class="nav-item">
          <a class="nav-link
          <?= $pageName == 'clients.php' ? 'active':''; ?>
          <?= $pageName == 'clients-create.php' ? 'active':''; ?>
          <?= $pageName == 'clients-edit.php' ? 'active':''; ?>
          " href="clients.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-handshake <?= $pageName == 'clients.php' || $pageName == 'clients-create.php' || $pageName == 'clients-edit.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Clients</span>
          </a>
        </li>

        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'projects.php' ? 'active':''; ?>
          <?= $pageName == 'projects-create.php' ? 'active':''; ?>
          <?= $pageName == 'projects-edit.php' ? 'active':''; ?>
          " href="projects.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-project-diagram <?= $pageName == 'projects.php' || $pageName == 'projects-create.php' || $pageName == 'projects-edit.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Projects</span>
          </a>
        </li>
        
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'resource-plan.php' ? 'active':''; ?>
          <?= $pageName == 'add-resource-plan.php' ? 'active':''; ?>
          <?= $pageName == 'edit-resource-plan.php' ? 'active':''; ?>
          <?= $pageName == 'resource-plan-view.php' ? 'active':''; ?>
          " href="resource-plan.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-people-arrows <?= $pageName == 'resource-plan.php' || $pageName == 'add-resource-plan.php' || $pageName == 'edit-resource-plan.php' || $pageName == 'resource-plan-view.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Resource Plan</span>
          </a>
        </li>

        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'milestones.php' ? 'active':''; ?>
          " href="milestones.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-flag-checkered <?= $pageName == 'milestones.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Project Milestones</span>
          </a>
        </li>

        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'timesheet.php' ? 'active':''; ?>
          " href="timesheet.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-clock <?= $pageName == 'timesheet.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Timesheet</span>
          </a>
        </li>
        
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'percentCompletion.php' ? 'active':''; ?>
          " href="percentCompletion.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-percentage <?= $pageName == 'percentCompletion.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Percentage Completion</span>
          </a>
        </li>
        
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'costing.php' ? 'active':''; ?>
          " href="costing.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-dollar-sign <?= $pageName == 'costing.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Salaries and Fixed Costs</span>
          </a>
        </li>
        
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'contracts.php' ? 'active':''; ?>
          <?= $pageName == 'contracts-view.php' ? 'active':''; ?>
          " href="contracts.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-file-contract <?= $pageName == 'contracts.php' || $pageName == 'contracts-view.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Contracts</span>
          </a>
        </li>
        
        <li class="nav-item mt-3">
          <h6 class="ps-4 ms-2 text-uppercase text-xs font-weight-bolder opacity-6">Reports</h6>
        </li>
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'costing-report.php' ? 'active':''; ?>
          " href="costing-report.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-file-invoice-dollar <?= $pageName == 'costing-report.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Costing Report</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'timesheet_report.php' ? 'active':''; ?>
          " href="timesheet_report.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-business-time <?= $pageName == 'timesheet_report.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Timesheet Report</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'misIncome.php' ? 'active':''; ?>
          " href="misIncome.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-chart-line <?= $pageName == 'misIncome.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">MIS Income</span>
          </a>
        </li>
        
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'misIncomeMonth.php' ? 'active':''; ?>
          " href="misIncomeMonth.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-calendar-alt <?= $pageName == 'misIncomeMonth.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">MIS Income Month</span>
          </a>
        </li>
        
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'projectDL.php' ? 'active':''; ?>
          " href="projectDL.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-tasks <?= $pageName == 'projectDL.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Project-Wise DL</span>
          </a>
        </li>
        
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'projectDLmonth.php' ? 'active':''; ?>
          " href="projectDLmonth.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-calendar-week <?= $pageName == 'projectDLmonth.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Project-Wise DL Month</span>
          </a>
        </li>
        
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'projectContribution.php' ? 'active':''; ?>
          " href="projectContribution.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-funnel-dollar <?= $pageName == 'projectContribution.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Project Contribution</span>
          </a>
        </li>
        
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'VarianceReport.php' ? 'active':''; ?>
          " href="VarianceReport.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-chart-bar <?= $pageName == 'VarianceReport.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">RGL Variance Report</span>
          </a>
        </li>
        
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'netProfit.php' ? 'active':''; ?>
          " href="netProfit.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-hand-holding-usd <?= $pageName == 'netProfit.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Net Profit</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'order-book.php' ? 'active':''; ?>
          " href="order-book.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-book <?= $pageName == 'order-book.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Order Book Report</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'receivables-report.php' ? 'active':''; ?>
          " href="receivables-report.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-file-invoice <?= $pageName == 'receivables-report.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Receivables Report</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'billing-report.php' ? 'active':''; ?>
          " href="billing-report.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-file-invoice-dollar <?= $pageName == 'billing-report.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Billing Report</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link 
          <?= $pageName == 'receipt-report.php' ? 'active':''; ?>
          " href="receipt-report.php">
            <div class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center">
            <i class="fas fa-receipt <?= $pageName == 'receipt-report.php' ? 'text-white':'text-dark'; ?> text-lg"></i>
            </div>
            <span class="nav-link-text ms-1">Receipt Report</span>
          </a>
        </li>
      </ul>
    </div>
    <div class="sidenav-footer mx-3 ">
      <a class="btn bg-gradient-primary mt-3 w-100" href="../logout.php">Logout</a>
    </div>
  </aside>