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


   
   $sessionIDID;

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

      $sessionIDID=$_REQUEST['session'];
      
    } else {
      
      $sessionIDID=$_SESSION['current_session'];
    }


   $branch=$_SESSION['branch'];
   
   $classes = $m->query("select * from edu_class_config where branch_id=".$branch." order by class_id asc limit 1");
   // print_r($classes);
   


 /* code for advance Search*/


$sql = "SELECT * FROM  edu_student_details  WHERE branch_id='$branch' and status='1' and session_id='$sessionIDID' ";

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

    if($_REQUEST['class_id']=="All"){
      $sql;
    } else {
    $sql .= " AND class_id = '" .$_REQUEST['class_id']. "' ";

    }

  if($_REQUEST['section']!=''){
      $sql .= " AND section_id ='" . $_REQUEST['section']. "' ";
 }



  if(isset($_REQUEST['from']) && isset($_REQUEST['to']) && $_REQUEST['fee']==1){
    

    
      if($_REQUEST['from']!=" " && $_REQUEST['from']!=NULL ) {
        $from=date("Y-m-d",strtotime($_REQUEST['from']));  

      }else {
        $from=date("01-m-Y");  
      }
     
      if($_REQUEST['to']!=" " && $_REQUEST['to']!=NULL   ) {
        $to=date("Y-m-d",strtotime($_REQUEST['to']));
      }else {
        $to=date("t-m-Y");  
      } 
      
    
    $sql .= " AND expel_date BETWEEN '" .$from. "' AND '" .$to. "'";

  }

    $sql.=" order by expel_date desc";

 // echo $sql;

  $WorkAssignListings = $m->query($sql);
} else {

  $sql = "SELECT * FROM  edu_student_details  WHERE branch_id='$branch' and status='1' and session_id='$sessionIDID' order by expel_date desc ";
 $WorkAssignListings = $m->query($sql); 
}



     ?>


<!DOCTYPE html>
<html lang="en">
  <head>
    
    <title>Struck Of Students | EduPortal</title>
    <?php include('RootMe/css_links.php');?>
<style>

.thStyle{background-color:lightgray;text-align:center;}

</style>   
  </head>
 

  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        <div class="col-md-3 left_col">
     
            <?php include('RootMe/sidebar.php');?>

              <?php include('RootMe/header.php');?>
     
        <!-- page content -->
          <div class="right_col" role="main">
          <div class="" style="background-color: white;">
           
<section class="add_sub_agent" id="table_sub_agent">
  <div class="container">

 <div class="" style="margin-top:10px;">
      
      
      <div class="clearfix"></div>
    </div>
   

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

              
                <th width="5%">S.No</th>
                <th width="15%">Student Name</th>
                <th width="5%">Roll#</th>
                <th width="5%">Reg#</th>
                <th width="10%">Cell </th>              
                <th width="8%">Class </th>
                <th width="8%">Struck off Date </th>
                <th width="10%">Reasons </th>               
                        
               
                
            </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']);
        $session=$m->get("edu_session_config");
        
      ?>

        <tr>

            <td><?php echo $count++;?></td>        
            <td><?php echo $WorkAssignListVal['first_name'];?></td>
            <td><?php  echo $WorkAssignListVal['candidate_roll_no']; ?> </td>
            <td><?php  echo $WorkAssignListVal['ref_no']; ?> </td>
            <td><?php echo $WorkAssignListVal['cell_no'];?> </td>      
            <td><?php echo $class[0]['Class_Name']." / ".$section[0]['section_name'];?></td>
            <td><?php echo $WorkAssignListVal['expel_date'];?></td>
            <td><?php echo $WorkAssignListVal['expel_reason'];?></td>
               

              </tr>


              <?php
      } ?>



        </tbody>
        
    </table>








  </div>
  <div class="clearfix"></div>
</section>            
    

           
          </div>
        </div>

            </div>
          </div>
        </div>
        <!-- /page content -->
  

    
  <?php include('RootMe/js_linksscript.php');?>
  <script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
   
   <script src="js/FileSaver.min.js" type="text/javascript"></script>
  <script src="js/tableexport.min.js" type="text/javascript"></script>

  <script type="text/javascript">
    $('#excelexpo').tableExport();
  </script>
  </body>
</html>
