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

  $m->where("section_id", $_REQUEST['section']);
  $sectionName=$m->get("edu_adm_section_detail");


  // getting branch details

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

    
  $m->where("class_id", $_REQUEST['class_id']);
  $className=$m->get("edu_class_config");


$branch=$_SESSION['branch'];
 $m->where("status", '0');
 $m->where("branch_id", $_SESSION['branch']);
 $m->where("designation_id!=14");
 $m->orderBy("user_id", 'desc');
 $WorkAssignListings = $m->get("edu_user_config");


 ?>
<!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">
<title>Print PayRoll Sheet</title>
<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />
<script type="text/javascript">
// window.print();
</script>
<style type="text/css">

tr th {border-top:1px solid gray;border-left:1px solid black;border-bottom:1px solid black;text-align:center;font-size:14px; padding:3px;}
tr td {border-bottom:1px solid gray;border-left:1px solid black;font-size:14px; padding:3px;}
  
.border{border:1px solid black;}
.center{text-align:center;}
.alignment{padding-left:1%;text-align:left;}
.borderTop{
  border-top: none;
}
</style>
</head>
<body style="font-size:12px;padding:1%;">





<br>

<div style="text-align:center;font-size:24px;font-weight:bold;">Staff Attendance Sheets

 </div>

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

<div style="width:30%; float:left;font-size:18px; margin-left:10px; "> <b> Month:</b> <?php echo date("M");?> </div>


<br><br>
   
    <table id="listofstudents3" data-page-length='100' class="table table-striped table-bordered" style="width:100%">
          
          <thead>
            <tr>
                
                <th width="10%" style="background-color:lightgray;">Name</th>
        
        
       <th width="90%">
        
      <table border="1" width="100%"  class="responsive" style="border: none;">
              <?php 

          $days=date("t");
          for($i=1;$i<$days+1;$i++){     

          ?>

           <th width="2%" class="" style="padding:0px;text-align: center;background-color:lightgray;border-left: 1px solid lightgray;"> <?php echo $i;?>  </th>

          <?php } ?>
                
      </table>
      
      </th>
    

            </tr>
      
        </thead>
        <tbody>
     
     <?php
     
     $count=1; 

     /*print_r($WorkAssignListings);
     echo "=======";*/
      foreach($WorkAssignListings as $WorkAssignListVal)
      { 
      
      ?>


<tr>
        
     

  <td>
    
    <?php echo $WorkAssignListVal['user_fname'];?>
    <input name="attendance[]" id="attendance[]" type="hidden" value="<?php echo $WorkAssignListVal['emp_id'];?>">
            
                     
  </td>

      
      

      <td>

    <div style="">


    <table border="1" width="100%"  class="responsive" style="border: none;">  

    <tr>  
<?php 

$days=date("t");
for($i=1;$i<$days+1;$i++){

   $date=date("Y")."-".str_pad($_GET['month'], 2, '0', STR_PAD_LEFT)."-".str_pad($i, 2, '0', STR_PAD_LEFT);
   
   $id=$WorkAssignListVal['user_id'];  
   $qr="select * from eduportal_hrm_emp_attendance where date='$date' and emp_id='$id' and branch_Id=".$_SESSION['branch'];
   $att = $m->query($qr);
?>

 <th  width="2%" style="padding:0px;text-align: center;color: white;border-left:  1px solid gray;border-bottom: none; border-top: none;"> <?php  if($att[0]['attendance']!=NULL){echo $att[0]['attendance'];}else {echo "--";};?> </th>

<?php } ?>

  </tr>

</table>

  </div>

   

      </td>
</tr>

        <?php } ?>



           
            
           
        </tbody>
        
    </table><br>
     
      
      

</body>
</html>
