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

 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['orderBy']=="AdmNoWise"){

        $m->orderBy("ref_no", "asc");
        
      }

      if($_REQUEST['orderBy']=="RollNoWise"){

        $m->orderBy("candidate_roll_no", "asc");
        
      }

      if($_REQUEST['orderBy']=="asc"){

        $m->orderBy("first_name", "asc");
        
      }

      if($_REQUEST['orderBy']=="desc"){

        $m->orderBy("last_name", "asc");
        
      }
     

       $m->where("status", '0');
       $m->where("branch_id", $_SESSION['branch']);    
       $WorkAssignListings = $m->get("edu_student_details"); 
       
      }

       $sessionIDs;
 
  if($_GET["session"]!=NULL ){

      $sessionIDs= $_GET["session"];
    }
    else{
      $sessionIDs= $_SESSION['current_session'];
    }
 
    $m->where("branch_id", $_SESSION['branch']);
    $acadmic_heads = $m->get("eduportal_acadmic_heads"); 

     $m->where("term_id", $_REQUEST['term_id']);
     $terms = $m->get("eduportal_exam_terms")
     ?>
<!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 Class List</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> <br>


<div style="text-align:center;font-size:14px;"><b><?php echo $_GET['studnetlist'];?></b> </div>

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

<div style="width:50%;float:left;">  <b> Class Name:</b> <?php echo getClassName($m,$_REQUEST['class_id'])."-".getSectionName($m,$_REQUEST['section']);?> </div>

<div style="width:50%; float:right; "> <b> Term:</b> <?php echo $terms[0]['term_title'];?> </div>


<br>


   <table data-page-length='100' class="table table-striped table-bordered" style="width:100%">
          
          <thead>
            <tr>
                <th width="3%">S.No</th>
                <th width="15%">Student Name</th>
                <th width="15%">Last Name</th>
                <th width="8%">Roll# / Adm#</th>                 
                <?php           
                foreach ($acadmic_heads as $acadmic_head) { ?>
                <th width="8%" style="text-align:center;"> <?php echo $acadmic_head['heads_title'];?></th>
              <?php } ?>
                 
            </tr>
        </thead>
        <tbody>


   
     
     <?php $count=1;

      foreach($WorkAssignListings as $WorkAssignListVal)
      { 

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

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

        $m->where("session_id", $WorkAssignListVal['session_id']);
        $sessionID=$m->get("edu_session_config");
        $id=$WorkAssignListVal['student_id'];  
      ?>

        <tr>
          <td style="text-align:center;"> <?php echo $count; $count+=1;?> </td>
          <td><?php echo $WorkAssignListVal['first_name'];?></td>
          <td> <?php echo $WorkAssignListVal['last_name'];?> </td>
          <td><?php echo $WorkAssignListVal['candidate_roll_no']." / ".$WorkAssignListVal['ref_no'];?></td>
                                                
                <?php           
                foreach ($acadmic_heads as $acadmic_head1) {

                  $m->where("branch_id", $_SESSION['branch']);
                  $m->where("heads_id", $acadmic_head1['heads_id']);
                  $m->where("term_id", $_REQUEST['term_id']);
                  $m->where("student_id", $WorkAssignListVal['student_id']);
                 $stdMarks=$m->get("eduportal_test_acadmic_performance_marks");

                 ?>

                  <td> <?php echo $stdMarks[0]['student_remarks']; ?> </td>

                <?php } ?>
            
              </tr>





              <?php
      } ?>



           
            
           
        </tbody>
        
    </table>

</body>
</html>
