<ul class="nav navbar-nav">
        <!-- Notifications: style can be found in dropdown.less -->
    <li class="dropdown notifications-menu">
            <a href="javascript:void(0)" data-activates="dropdown1" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-envelope"></i>


            <?php 
              $isread=0;
              $sql = "SELECT id from tblleaves where IsRead=:isread";
              $query = $dbh -> prepare($sql);
              $query->bindParam(':isread',$isread,PDO::PARAM_STR);
              $query->execute();
              $results=$query->fetchAll(PDO::FETCH_OBJ);
              $unreadcount=$query->rowCount();
            ?>
              <span class="label label-danger"><?php echo htmlentities($unreadcount);?></span>
            </a>


            <ul class="dropdown-menu" id="dropdown1">
              <li>
                <!-- inner menu: contains the actual data -->

                <ul class="menu">
                  <li>
                    <li style="text-align: center; padding: 5px; font-size: 16px; color: white" class="user-header">Leave Applications</li>

                    <?php 
                      $isread=0;
                      $sql = "SELECT tblleaves.id as lid,employees.firstname,employees.lastname,employees.employee_id,tblleaves.postingdate from tblleaves join employees on tblleaves.employee_id=employees.id where tblleaves.isread=:isread";
                      $query = $dbh -> prepare($sql);
                      $query->bindParam(':isread',$isread,PDO::PARAM_STR);
                      $query->execute();
                      $results=$query->fetchAll(PDO::FETCH_OBJ);
                      if($query->rowCount() > 0)
                      {
                      foreach($results as $result)
                      {    ?>  


                    <li>
                      <a href="leave-details.php?leaveid=<?php echo htmlentities($result->lid);?>">
                      <div class="notification">
                      <!-- <div class="notification-icon circle cyan"><i class="material-icons">done</i></div> -->
                      <div class="notification-text">
                        <p>
                            <b>
                                <?php echo htmlentities($result->firstname." ".$result->lastname);?> (<?php echo htmlentities($result->employee_id);?>)</b> applied for leave</p>
                                <span>at <?php echo htmlentities($result->postingdate);?>
                            </b>
                                </span>
                      </div>
                      </div>
                      </a>
                    </li>
                <?php }} ?>


                  </li>
                </ul>


              </li> 
            </ul>


    </li>
</ul>