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

ini_set('max_execution_time', '300'); //300 seconds = 5 minutes
ini_set('max_execution_time', '0'); // for infinite time of execution 

      if($_REQUEST['class_id']!=NULL){
     
       $m->where("class_id", $_REQUEST['class_id']);  
            
   
      if($_REQUEST['session']!=NULL){

        $m->where("session_id", $_REQUEST['session']);
        
      }

      if($_REQUEST['section']!=NULL){

        $m->where("section_id", $_REQUEST['section']);
        
      }
           
      if($_REQUEST['rollno']!=NULL){

        $m->where("candidate_roll_no", $_REQUEST['rollno']);
        
      }


         if($_REQUEST['orderBy']=='RollNoWise'){
       
       $m->where("status", '0');
       $m->where("branch_id", $_SESSION['branch']);
       $m->orderBy("candidate_roll_no","asc");  
       $WorkAssignListings = $m->get("edu_student_details");
       
       } else {

       $m->where("status", '0');
       $m->where("branch_id", $_SESSION['branch']);
       $m->orderBy("first_name","asc");
       $WorkAssignListings = $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">
<title>Print Syllabus Management</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 {font-size:14px;}
tr td {font-size:16px;}
  
.border{border:1px solid black;}

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

.borderbottom{
  border-bottom:1px solid black;
}



@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;
  }
}
.center{text-align:center;}
</style>
</head>

<body style="font-size:12px;padding-right:1%;padding-left:1%;padding-top:3%;padding-bottom:1%;">
<div style="text-align:center;font-size:24px;font-weight:bold;margin:0 auto;"><?php echo $brid[0]['Branch_Name'];?> 
</div>

<br>

<div style="text-align:center;font-size:18px;font-weight:bold;"> Syllabus Management
 </div>

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



<div style="width:33%; float:left;font-size:18px; margin-left:10px; "> <b> Class:</b> <?php echo getClassName($m,$_REQUEST['class_id']);?> Section <?php echo getSectionName($m,$_REQUEST['section']);?>  </div>


<br>  

    <table border="1"  data-page-length='100' class="table table-striped table-bordered " style="width:100%;font-size:11px; border-collapse: collapse;">
              
   

          
          <thead>
            <tr>
           
            <th  style="text-align: center;font-size: 18px;font-weight: bold;width: 30%;">Subjects</th>
            <th  style="text-align: left;font-size: 18px;font-weight: bold;width: 70%;">Syllabus</th>             
              
  
            </tr>
        </thead>
        <tbody>

         <?php 
              
          // printing all the relevant subjects of each class
                                
             if ($_REQUEST['section']=="All") {
               
              $branchID=$_SESSION['branch'];
              $sessionIDs=$_REQUEST['session'];
              $classID=$_REQUEST['class_id'];
              $sql="SELECT * FROM eduportal_class_subjects where branch_id='$branchID' and session_id='$sessionIDs' and class_id='$classID' group by subject_id";
           //  print_r($sql); 
              $teacher_sbj = $m->query($sql); 

             } else {

              $m->where("branch_id", $_SESSION['branch']);
              $m->where("session_id", $_REQUEST['session']);
              $m->where("class_id", $_REQUEST['class_id']);
              $m->where("section_id", $_REQUEST['section']);          

              $teacher_sbj = $m->get("eduportal_class_subjects");  

              }
                         


              foreach($teacher_sbj as $teacher_sb) {

                      
                $m->where("subject_id", $teacher_sb['subject_id']);
                $subjects = $m->get("eduportal_subject_config");

                if ($_REQUEST['section']=="All") {

                $m->where ("session_id", $_REQUEST['session']);
                $m->where ("branch_id", $_SESSION['branch']);
                $m->where("class_id", $_REQUEST['class_id']);
                $m->where ("term_id", $_REQUEST['term_id']);
               // $m->where("section_id", $_REQUEST['section']); 
                $m->where ("subjects_id", $teacher_sb['subject_id']);      

                $Syllabus =  $m->get ('eduportal_syllabus_management');

              } else {

                $m->where ("session_id", $_REQUEST['session']);
                $m->where ("branch_id", $_SESSION['branch']);
                $m->where("class_id", $_REQUEST['class_id']);
                $m->where ("term_id", $_REQUEST['term_id']);
                $m->where("section_id", $_REQUEST['section']); 
                $m->where ("subjects_id", $teacher_sb['subject_id']);      

                $Syllabus =  $m->get ('eduportal_syllabus_management');

              }

                 ?>
           
            <tr>
             <td width="" class=" center"> <?php echo $subjects[0]['subject']; ?></td>
             <td> <?php echo $Syllabus[0]['syllabus'];?></td> 
            </tr> 
             
         <?php  }  ?> 
 
     </tbody>
        
    </table>



    

</body>
</html>
