
         <div class="dlabnav">
            <div class="dlabnav-scroll">
               <div class="dropdown header-profile2 ">
                  <a class="nav-link " href="javascript:void(0);" role="button" data-bs-toggle="dropdown">
                     <div class="header-info2 d-flex align-items-center">
                        <img src="assets/images/profile/pic1.jpg" alt="">
                        <div class="d-flex align-items-center sidebar-info">
                           <div>
          <?php
 $username = isset($_SESSION['username']) ? $_SESSION['username'] : 'Not set';
 $userid   = isset($_SESSION['userid']) ? $_SESSION['userid'] : 'Not set';
 
$totalResult = $conn->query("SELECT COUNT(*) AS total FROM segments");
$totalRow = $totalResult->fetch_assoc();
$totalsegment = $totalRow['total'];

$totalcatResult = $conn->query("SELECT COUNT(*) AS total FROM categories");
$totalcatRow = $totalcatResult->fetch_assoc();
$totalcat = $totalcatRow['total'];

$totaltelResult = $conn->query("SELECT COUNT(*) AS total FROM teledata where staff='$userid'");
$totaltelRow = $totaltelResult->fetch_assoc();
$totaltel = $totaltelRow['total'];

$totalleadResult = $conn->query("SELECT COUNT(*) AS total FROM tb_leads where staff='$userid'");
$totalleadRow = $totalleadResult->fetch_assoc();
$totalleads = $totalleadRow['total'];

$totalptvleadResult = $conn->query("SELECT COUNT(*) AS total FROM tb_positiveleads where staff='$userid'");
$totalptvleadRow = $totalptvleadResult->fetch_assoc();
$totalptvleads = $totalptvleadRow['total'];

$totalMOResult = $conn->query("SELECT COUNT(*) AS total FROM marketing_order where staff='$userid'");
$totalMORow = $totalMOResult->fetch_assoc();
$totalMO = $totalMORow['total'];


?>

                              


                              
   
                              <span class="font-w400 d-block"><?php echo $username?></span>
                              <!-- <small class="text-end font-w400">Superadmin</small> -->
                           </div>
                           <!-- <i class="fas fa-chevron-down"></i> -->
                        </div>
                     </div>
                  </a>
                
               </div>
               <ul class="metismenu" id="menu">
                  <!-- <li><a href="dashboard.php" class="" aria-expanded="false">
                     <i class="flaticon-025-dashboard"></i>
                     <span class="nav-text">Dashboard</span>
                     </a>
                  </li> -->
                  <li><a href="add-segment.php" class="" aria-expanded="false">
                     <i class="flaticon-025-dashboard"></i>
                     <span class="nav-text">Add Segment <span class="badge badge-xs style-1 new-badge"><?php echo $totalsegment;?></span> </span>
                     </a>
                  </li><li><a href="add-category.php" class="" aria-expanded="false">
                     <i class="flaticon-025-dashboard"></i>
                     <span class="nav-text">Add Category  <span class="badge badge-xs style-1 new-badge"><?php echo $totalcat;?></span></span>
                     </a>
                  </li>
                  <li><a href="teledata.php" class="" aria-expanded="false">
                     <i class="flaticon-041-graph"></i>
                     <span class="nav-text">Teledata <span class="badge badge-xs style-1 new-badge"><?php echo $totaltel;?></span></span>
                     </a>
                  </li>
                  <li><a href="positives.php" class="" aria-expanded="false">
                     <i class="flaticon-041-graph"></i>
                     <span class="nav-text">Positives  <span class="badge badge-xs style-1 new-badge"><?php echo $totalptvleads;?></span></span>
                     </a>
                  </li>
                  <li><a href="leads.php" class="" aria-expanded="false">
                     <i class="flaticon-041-graph"></i>
                     <span class="nav-text">Leads  <span class="badge badge-xs style-1 new-badge"><?php echo $totalleads;?></span>
                     </a>
                  </li>
                  <li><a href="marketingdata.php" class="" aria-expanded="false">
                     <i class="flaticon-041-graph"></i>
                     <span class="nav-text">Marketing Order  </span>
                     <span class="badge badge-xs style-1 new-badge"><?php echo $totalMO;?></span>
                     </a>
                  </li>
                  <!--<li><a href="crm.php" class="" aria-expanded="false">-->
                  <!--   <i class="flaticon-041-graph"></i>-->
                  <!--   <span class="nav-text">CRM  </span>-->
                  <!--   <span class="badge badge-xs style-1 new-badge"><?php echo $totalMO;?></span>-->
                  <!--   </a>-->
                  <!--</li>-->
                  <!-- <li><a href="customers.php" class="" aria-expanded="false">
                     <i class="flaticon-381-user-4"></i>
                     <span class="nav-text">Customers</span>
                     </a>
                  </li> -->
                  <li><a href="widget-basic.html" class="" aria-expanded="false">
                     <i class="flaticon-381-user-4"></i>
                     <span class="nav-text">Log Out</span>
                     </a>
                  </li>
               </ul>
               <!-- <div class="plus-box">
                  <p class="fs-14 font-w600 mb-2">Let Jobick Managed<br>Your Resume Easily<br></p>
                  <p class="plus-box-p">Lorem ipsum dolor sit amet</p>
                  </div> -->
            </div>
         </div>
         <!--**********************************
            Sidebar end
            ***********************************-->