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


<!DOCTYPE html>
<html lang="en">
  <head>
   
    <title>Active Parents List | EduPortal</title>
     <?php include('RootMe/css_links.php');?>
   
  </head>
  

  <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="row" style="background-color: white;">
           
  <section class="add_sub_agent" id="table_sub_agent">
  <div class="container">

 <div class="" style="margin-top:10px;">
     
        <div class="">
          <h3 style="float: left;">Last Month Active Parents List</h3>

          </span><div class="clearfix"></div> </div>
         
        </div>
      </form>
      <div class="clearfix"></div>
    </div>
    <br>
     

<div style="overflow-x:auto;">


<table id="listofstudents" class="table table-striped table-bordered" style="width:100%">
        <thead>
            <tr>

                <th width="5%">S.No</th>
                <th width="30%">Parents Name</th>
                <th width="12%">Parents Cell No </th>
                <th width="12%">Login Date</th>
                <th width="15%">Login Time </th>
                
                                
            </tr>
        </thead>
        <tbody>


   
     
     <?php 

     $count=1;
     $Pmonth=date('m',strtotime("-1 month"));
     $branchId=$_SESSION['branch'];
   $qr="SELECT * FROM eduportal_parents_access_audit WHERE month_id='$Pmonth' and branch_id='$branchId' GROUP BY parents_id";
   
   $LastMonthVisitors=$m->query($qr);

      foreach($LastMonthVisitors as $LastMonthVisitor)
      { 

        $m->where("parents_id", $LastMonthVisitor['parents_id']);
        $LastMonthActiveParents=$m->get("eduportal_parents_access");
  

      ?>

  <tr>
        
     <td style="text-align:center;"> <?php echo $count; $count++; ?>  </td>
     <td>  <?php echo $LastMonthActiveParents[0]['parents_name'];?> </td>
     <td> <?php echo $LastMonthActiveParents[0]['parents_cellno'];?> </td>
     <td> <?php echo $LastMonthVisitor['Date'];?> </td>
     <td> <?php echo $LastMonthVisitor['Time'];?> </td>
      
  </tr>

              <?php
      } ?>



           
            
           
        </tbody>
        
    </table>

</div>

    <br><br>


  </div>
  <div class="clearfix"></div>
</section>
    

           
          </div>
        </div>

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

  
  </body>
</html>
