<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-bell"></i>


            <?php 
              $isread=0;
              $sql = "SELECT id from attendance where isread=:isread";
              $query = $dbh -> prepare($sql);
              $query->bindParam(':isread',$isread,PDO::PARAM_STR);
              $query->execute();
              $results=$query->fetchAll(PDO::FETCH_OBJ);
              $attendance=$query->rowCount();
            ?>
            
              <span class="label label-danger"><?php echo htmlentities($attendance);?></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">Attendance</li>

                    <?php 
                      $isread=0;
                      $sql = "SELECT attendance.id as aid,employees.firstname,employees.lastname,employees.employee_id,attendance.isread,attendance.date,attendance.time_in from attendance join employees on attendance.employee_id=employees.id where attendance.isread=:isread ORDER BY attendance.date DESC, attendance.time_in DESC";
                      $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="attendance.php?aid=<?php echo htmlentities($result->aid);?>">
                      <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> Submit Attendance</p>
                                <span>at <?php echo htmlentities($result->date.", ".$result->time_in);?>
                            </b>
                                </span>
                      </div>
                      </div>
                      </a>
                    </li>
                <?php }} ?>


                  </li>
                </ul>


              </li> 
            </ul>


    </li>
</ul>