<?php include('parent/callMe.php');?>
<?php include('Sessioncheck.php');?>
<?php 


  $m->where("branch_id", $_SESSION['branch']);
  $branch=$m->get("edu_branch_config");


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

$WorkAssignListings = $m->query("SELECT sec.*, cls.* FROM edu_adm_section_detail as sec LEFT JOIN edu_class_config as cls ON sec.class_id = cls.class_id where cls.class_id!='' and cls.branch_id='$brnch' ORDER BY cls.class_id asc");


      $m->where("status", 0);
      $m->where("branch_id", $_SESSION['branch']);
      $total_students=$m->get("edu_student_details");
 
?>
 <!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Favicons-->
<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />
<title> Print Students Report </title>

<script type="text/javascript">
 // window.print();
</script>
<style type="text/css">
.border{border:1px solid black;}
.center{text-align:center;}
.alignment{padding-left:1%;text-align:left;}

tr th {padding:1.5%;font-size:16px; }
tr td {padding:1%;}



@media print {
    #Header, #Footer { display: none !important; }
}
@media screen
   {
      p.bodyText {font-family:verdana, arial, sans-serif;}
   }

   @media print
   {
      p.bodyText {font-family:georgia, times, serif;}
   }
   @media screen, print
   {
      p.bodyText {font-size:10pt}
   }
   @media print {
  a[href]:after {
    content: none !important;
  }
}
</style>
</head>
<body>



<div style="text-align:center;font-size:25px;font-weight:bold;margin:0 auto;">Students Report </div> <br>


<div style="text-align:center;font-size:14px;"><b><?php echo $branch[0]['Branch_Name'];?> </b> <br>(<?php echo $branch[0]['Branch_Location']." Cell: ".$branch[0]['Owner_no'];?>) </div>

<hr style="width:100%;">

<div style="width:40%;float:left;">  <b> Date:</b> <?php echo date("d-M-Y");?> </div>

<div style="width:20%; float:left; "> <!-- <b> Total Presents:</b> --> </div>

<div style="width:20%; float:left; "><!--  <b> Total Absents:</b> -->  </div>

<div style="width:20%; float:right; "> <b> Total Students:</b> <?php echo count($total_students);?> </div>

<br>


 

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

                <th width="10%" class="border center"> S.No </th>
                <th width="40%" class="border "> Class-Section </th>
                <th width="30%" class="border center"> Students </th>
                
            </tr>
        </thead>
        <tbody>


   
     
     <?php 
    // print_r($WorkAssignListings);
   
     $count=1;
      foreach($WorkAssignListings as $WorkAssignListVal)
      { 

        
      $cls=$WorkAssignListVal['class_id'];
      $section=$WorkAssignListVal['section_id'];
      
       // getting strength of students 
       
      $m->where("section_id", $section);
      $m->where("class_id", $cls);
      $m->where("status", 0);
      $m->where("branch_id", $_SESSION['branch']);
      $total=$m->get("edu_student_details");
 
      ?>

        <tr>


                  
                  <td class="border center"> <?php echo $count; $count++;?> </td>

                  <td class="border " style="padding-left:5%;"> <?php echo  $WorkAssignListVal['Class_Name']." - ".$WorkAssignListVal['section_name'] ; ?> </td>

                  <td  class="border center"> <?php echo count($total);?> </td>
 

              </tr>





              <?php
      } ?>



           
            
           
        </tbody>
        
    </table>

</body>
</html>
