
<?php 
    include('../../../../db_connect.php');
    $sq = "SELECT COUNT(*) as num FROM gatepass WHERE status = '1' AND end_date >= NOW() AND reported IS NULL"; 
    $pgs = mysql_fetch_array(mysql_query($sq));
    $count = $pgs['num'];
    
    $sq1 = "SELECT COUNT(*) as num FROM gatepass WHERE status = '1' AND end_date < NOW() AND reported IS NULL"; 
    $pgs1 = mysql_fetch_array(mysql_query($sq1));
    $count1 = $pgs1['num'];
    
    $counted = $count+$count1;
    if($counted <= 0){echo '';}else {echo $counted;}
?>

