<?php include("parent/callMe.php"); ?>
<?php  include("sessioncheck.php"); 

$default;
    
    if($_GET["month"]!=NULL ){
      $default= $_GET["month"];
    }
    else{
      $default= date("m");
    }


    $m->where("session_id", $_SESSION['current_session']);
    $sessionname = $m->get("edu_session_config");
    $years=explode("-",$sessionname[0]['session_year']);

    $date=date('m-d');

    $sql1="SELECT * FROM edu_student_details WHERE branch_id='$b' and status='0' and dob like '%-$date'";
    $StudentDOB=$m->query($sql1);

    $sql="SELECT * FROM edu_user_config WHERE branch_id='$b' and status='0' and DOB like '%-$date' order by user_id desc";

    $TeacherDOB=$m->query($sql);


      $total_students=totalStudents($m);
      $total_staff=totalStaff($m);



$branch=$_SESSION['branch'];
$date=date('Y-m-d');

$qr="SELECT count(*) as total FROM eduportal_hrm_emp_attendance WHERE attendance='L'  and branch_Id='$branch' and date='$date'"; 

$result=$m->query($qr);
$leave=$result[0]['total'];


?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <title> Admission & Attendance Stats | EduPortal </title>
    <!-- bootstrap-progressbar -->
    <link href="../vendors/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
    <?php include('RootMe/css_links.php');?>
    <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    <script src="https://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
     <!-- Flaticon CSS -->
    <link rel="stylesheet" href="fonts/flaticon.css">
       
    <link rel="stylesheet" href="stylebox.css">

<style>

@media only screen and (max-width: 768px) {

    /* For mobile phones: */

     .quiklink{
      width: 48%;
      float: left;
    }

}

@media (min-width:801px)  { /* tablet, landscape iPad, lo-res laptops ands desktops */

  .quiklink{
      width: 12%;
      float: left;
      margin-bottom: 10px;
    }

  }

ul.widget_tally .month {
    width: 70%;
    float: left;
    text-align: left;
}
#myChart {
  height:100%;
  width:100%;
  min-height:400px;
}

.zc-ref {
  display: none;
}
zing-grid[loading]{height:450px;}


.tile-stats .icon i{
  font-size: 35px; 
}

.vl {
  border-left: 1px solid lightgray;
  height: 40px;
  position: absolute;
  left: 50%;
  margin-left: -3px;
  margin-top: 24px;
}

</style>

  
  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        <div class="col-md-3 left_col">
     
        <?php include('RootMe/sidebar.php');?>

        <?php include('RootMe/header.php');?>
     
        <!-- page content -->


        <div class="right_col" role="main">
  
          <div class="">

     <a href="<?php echo $_SESSION['dashboard'];?>">Dashboard </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i>  &nbsp; 
    
     
     Attendance Stats

      <br><br>


<div class="row top_tiles">

<div style="background-color: white; margin-bottom: 10px;">

  <!-- <a href="more_statistics.php" class="btn btn-round btn-primary quiklink"style="font-size:12px;">Adm & Attendance Stats</a> -->
  <a href="students_reports.php" class="btn btn-round btn-info quiklink">Students Report</a>
  <a href="mark_attend.php" class="btn btn-round btn-primary quiklink">Mark Attendance</a>
  <a href="new_sms.php" class="btn btn-round btn-success quiklink">New SMS</a>
  <a href="sent_message.php" class="btn btn-round btn-primary quiklink">View Sent SMS</a>
  <a href="view_challan.php" class="btn btn-round btn-info quiklink">View Challan</a>
  <a href="families.php" class="btn btn-round btn-warning quiklink">Families</a>
  <a href="monthly_attendance.php" class="btn btn-round btn-danger quiklink">Emp Attendance</a>
  <a href="cv_bank.php" class="btn btn-round btn-primary quiklink">CV Bank</a>
  <a href="print_daily_income_exp_report.php" class="btn btn-round btn-warning quiklink" >
  Daily Closing</a>
  <a href="add_expenses.php" class="btn btn-round btn-info quiklink">Expenses</a>
  <a href="print_profitloss_report.php" class="btn btn-round btn-dark quiklink">Monthly Closing</a>
  <a href="user_audit_report.php" class="btn btn-round btn-danger quiklink">Users Activities</a>  
  <a href="fee_reporting.php" class="btn btn-round btn-info quiklink">Fee Reports</a>
  <a href="user_access.php" class="btn btn-round btn-success quiklink">User Access</a>  
  <a href="parents_id.php" class="btn btn-round btn-info quiklink">View Parents IDs</a>
  <a href="old_student_profile.php" class="btn btn-round btn-dark quiklink">Old Students</a>
  
  

</div>

      



            <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                 <a href="view_emp_attendance.php?todayPresent=present">
                        <div class="dashboard-summery-one" style="border: 1px solid lightgray;">
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="item-icon bg-light-green">
                                        <i class="flaticon-user text-green"></i>
                                    </div>
                                </div>
                                <div class="col-md-8">
                                    <div class="item-content">
                                        <div class="item-title">Today Present Staff</div>
                                        <div class="item-number"><span></span><span class="counter" data-num=""></span>
                                        <?php echo todayPresentStaff($m,$total_staff); ?></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                     
                 </a>  
            </div>

            <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                 <a href="view_emp_attendance.php?todayAbsent=absent">
                  <div class="dashboard-summery-one" style="border: 1px solid lightgray;">
                      <div class="row">
                          <div class="col-md-4">
                              <div class="item-icon bg-light-red">
                                  <i class="flaticon-user text-red"></i>
                              </div>
                          </div>
                          <div class="col-md-8">
                              <div class="item-content">
                                  <div class="item-title">Today Absent Staff</div>
                                  <div class="item-number"><span></span><span class="counter" data-num=""></span>
                                  <?php echo todayAbsentEmployees($m,$total_staff); ?></div>
                              </div>
                          </div>
                      </div>
                  </div>
                     
                 </a>  
            </div>

            <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                 <a href="view_emp_attendance.php?todayLate=late">
                        <div class="dashboard-summery-one" style="border: 1px solid lightgray;">
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="item-icon bg-light-yellow">
                                        <i class="flaticon-multiple-users-silhouette text-orange"></i>
                                    </div>
                                </div>
                                <div class="col-md-8">
                                    <div class="item-content">
                                        <div class="item-title" style="font-size: 15px;">Today Late Staff</div>
                                        <div class="item-number"><span></span><span class="counter" data-num=""></span>
                                        <?php echo todayLateEmployees($m,$total_staff); ?></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                     
                 </a>  
            </div>



            <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                 <a href="view_emp_attendance.php?todayLate=late">
                        <div class="dashboard-summery-one" style="border: 1px solid lightgray;">
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="item-icon bg-light-yellow">
                                        <i class="flaticon-multiple-users-silhouette text-orange"></i>
                                    </div>
                                </div>
                                <div class="col-md-8">
                                    <div class="item-content">
                                        <div class="item-title" style="font-size: 15px;">Today Leave Staff</div>
                                        <div class="item-number"><span></span><span class="counter" data-num=""></span>
                                        <?php echo $leave; ?></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                     
                 </a>  
            </div>















            <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                 <a href="#">
                        <div class="dashboard-summery-one" style="border: 1px solid lightgray;">
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="item-icon bg-light-green">
                                        <i class="flaticon-user text-green"></i>
                                    </div>
                                </div>
                                <div class="col-md-8">
                                    <div class="item-content">
                                        <div class="item-title" style="font-size: 15px;">Today Present Students</div>
                                        <div class="item-number"><span></span><span class="counter" data-num=""></span>
                                        <?php echo todayPresentStudentsCount($m,$total_students); ?></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                     
                 </a>  
            </div>

            <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                 <a href="daily_leave_students.php?<?php echo session_id().session_id().session_id().session_id().session_id(); ?>&date=<?php echo date("Y-m-d");?>">
                        <div class="dashboard-summery-one" style="border: 1px solid lightgray;">
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="item-icon bg-light-green">
                                        <i class="flaticon-user text-green"></i>
                                    </div>
                                </div>
                                <div class="col-md-8">
                                    <div class="item-content">
                                        <div class="item-title" style="font-size: 15px;">Today Leave Student</div>
                                        <div class="item-number"><span></span><span class="counter" data-num=""></span>
                                        <?php echo todayLeaveStudentsCount($m,$total_students); ?></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                     
                 </a>  
            </div>



            <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                 <a href="daily_absents_students.php?<?php echo session_id().session_id().session_id().session_id().session_id(); ?>&date=<?php echo date("Y-m-d");?>">
                        <div class="dashboard-summery-one" style="border: 1px solid lightgray;">
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="item-icon bg-light-red">
                                        <i class="flaticon-user text-red"></i>
                                    </div>
                                </div>
                                <div class="col-md-8">
                                    <div class="item-content">
                                        <div class="item-title" style="font-size: 15px;">Today Absent Student</div>
                                        <div class="item-number"><span></span><span class="counter" data-num=""></span>
                                        <?php echo todayAbsentStudentsCount($m,$total_students); ?></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                     
                 </a>  
            </div>

            <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                 <a href="daily_late_students.php?<?php echo session_id().session_id().session_id().session_id().session_id(); ?>&date=<?php echo date("Y-m-d");?>">
                        <div class="dashboard-summery-one" style="border: 1px solid lightgray;">
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="item-icon bg-light-yellow">
                                        <i class="flaticon-multiple-users-silhouette text-orange"></i>
                                    </div>
                                </div>
                                <div class="col-md-8">
                                    <div class="item-content">
                                        <div class="item-title" style="font-size: 15px;">Today Late Student</div>
                                        <div class="item-number"><span></span><span class="counter" data-num=""></span>
                                        <?php echo todayLateStudentsCount($m,$total_students); ?></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                     
                 </a>  
            </div>


           

<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                 <a href="daily_absents_students.php?<?php echo session_id().session_id().session_id().session_id().session_id(); ?>&date=<?php echo date('Y-m-d',strtotime("-1 days"));?>">
                        <div class="dashboard-summery-one" style="border: 1px solid lightgray;">
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="item-icon bg-light-yellow">
                                        <i class="flaticon-multiple-users-silhouette text-orange"></i>
                                    </div>
                                </div>
                                <div class="col-md-8">
                                    <div class="item-content">
                                        <div class="item-title" style="font-size: 15px;">Yesterday's Absentees</div>
                                        <div class="item-number"><span></span><span class="counter" data-num=""></span>
                                        <?php echo todayLateStudentsCount($m,$total_students); ?></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                     
                 </a>  
            </div>


           





           <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                 <a href="mark_attendanceReport_list.php">
                        <div class="dashboard-summery-one" style="border: 1px solid lightgray;">
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="item-icon bg-light-yellow">
                                        <i class="flaticon-multiple-users-silhouette text-orange"></i>
                                    </div>
                                </div>
                                <div class="col-md-8">
                                    <div class="item-content">
                                      <div class="item-title" style="font-size: 15px;">Attendance Reports</div>
                                      <div class="item-number"><span></span><span class="counter" data-num=""></span>
                                      </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                     
                 </a>  
            </div>


    
 
               


              </div>

              
                
    </div>
    </div>
          
            </div>
          </div>
        </div>
        <!-- /page content -->
  

    <?php include('RootMe/js_linksscript.php');?>
  

  </body>
</html>
