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

        $WorkAssignListings = $m->get("eduportal_days_config");

     
$class_id=$_REQUEST['class_id'];
$section=$_REQUEST['section'];
$periodCat_id=$_REQUEST['periodCat_id'];
$sql = "SELECT * FROM  eduportal_periods_category as Pcat, eduportal_school_periods_details as Pdetails  WHERE Pcat.category_period_id=Pdetails.period_id and Pdetails.period_id='$periodCat_id' ORDER BY Pdetails.period_details_id ASC";

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

   // 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");

  $m->where("section_id", $_REQUEST['section']);
  $sectionName=$m->get("edu_adm_section_detail");
  
     ?>
<!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 Contacts</title>
<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />
<script type="text/javascript">
 // window.print();
</script>
<style type="text/css">



.center{text-align:center;}
.alignment{padding-left:1%;text-align:left;}

tr th {border:1px solid black;text-align:center;background-color:lightgray;font-size:14px;}
tr td {border-bottom:1px solid black;border-left:1px solid black;font-size:14px;padding:3px;}
  

@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;"><?php echo $branch[0]['Branch_Name'];?> </div> 


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

<div style="text-align:center;font-size:25px;font-weight:bold;margin:0 auto;">Teacher Time Table</div>
<hr style="width:100%;">

<!-- <div style="width:33%; float:left; "> <b> Class:</b> <?php echo $className[0]['Class_Name'];?> </div>

<div style="width:33%; float:left; "> <b> Section:</b> <?php echo $sectionName[0]['section_name'];?> </div> -->



<br>


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

          
                <th width="">Days</th>

               <?php 
                  
                  foreach ($WorkAssignListings5 as $Data) {
          
        ?>         
        <input type="hidden" name="period_id" value="<?php echo $Data['period_details_id']; ?>">
        <input type="hidden" name="period_cat_id" value="<?php echo $Data['period_id']; ?>">
             <th width="" class=" center"> <?php echo $Data['period_details_title']; ?><br><span style="font-size: 11px;"><?php echo $Data['period_start']."-".$Data['period_end']; ?></span> </th>
            
        <?php } ?>

              
                
                
                
            </tr>
        </thead>
        <tbody>


   
     
     <?php 

     $count=1;
     $number1;
      foreach($WorkAssignListings as $WorkAssignListVal)
      { 
        
    

      ?>
 
        <tr>

            
                
          <td> <?php echo $WorkAssignListVal['day_name'];?> </td>

              <?php
          for ($x = 1; $x <= count($WorkAssignListings5); $x++) { 

            $row=$WorkAssignListVal['day_name'].$x;


   

       $day=$WorkAssignListVal['day_id'];
       $detailId=$WorkAssignListings5[$x-1]['period_details_id'];
       $cat_id=$WorkAssignListings5[$x-1]['period_id'];
       $user=$_REQUEST['user_id'];
   
       $sqll = "SELECT cls.Class_Name, usr.user_fname, sec.section_name FROM  eduportal_lectures_time as lec, edu_class_config as cls, edu_user_config as usr, edu_adm_section_detail as sec  WHERE cls.class_id=lec.class_id and  usr.user_id=lec.user_id and lec.period_id='$detailId' and usr.user_id='$user' and lec.period_cat_id='$cat_id' and lec.day_id='$day' and lec.period_cat_id='$periodCat_id' and lec.section_id=sec.section_id";
    // print_r($sqll);
       $lectureData = $m->query($sqll);
      
            ?>

           
            <td style="text-align: center;">
              
              <?php echo "<b>".$lectureData[0]['Class_Name']."/".$lectureData[0]['section_name']."</b><br>";

                  echo $lectureData[0]['user_fname'];
              ?>


                 <div class="form-group ">
                 
     
                  
                </div>

            </td>
          <?php } ?>
                 
    



              </tr>


 <?php  }  ?>



           
        </tbody>
        
    </table>

</body>
</html>
