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

<?php


     $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);    


   $session;

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

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


     /* code for advance Search*/


$sql = "SELECT * FROM  edu_student_details  WHERE branch_id='$branch' and status='0' ";

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

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

    $sql .= " AND re_enroll_date BETWEEN '" .$from. "' AND '" .$to. "'";

    $sql .= " order by re_enroll_date desc";

  
 // echo $sql;

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

 

 ?>

<!DOCTYPE html>
<html lang="en">
  <head>
   
    <title> Re-Enroll Students Report | EduPortal </title>
     <?php include('RootMe/css_links.php');?> 
  </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="row" style="background-color: white;">
  
   <a href="<?php echo $_SESSION['dashboard'];?>">Dashboard </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i>  &nbsp; 
    
     <a href="students_reports_link.php">Students Reports </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i>  &nbsp; 
          
      Re-Enroll Students Report

      <br><br>

<section class="add_sub_agent" id="table_sub_agent">
  <div class="container">



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



      <form class="" action="date_wise_reenroll_student_reports.php" enctype="multipart/form-data" method="get">
        <div class="panel panel-default">
          <div class="panel-heading"><?php echo count($WorkAssignListings);?> Students Records <span style="float:right;margin-top: -7px;">

          <input type="hidden" value="<?php echo session_id().session_id().session_id().session_id().session_id(); ?>" name="session" />



          </span><div class="clearfix"></div> </div>
          <div class="panel-body">
          
            <div class="col-md-12" id="" style="">
            


                <div class="col-md-3 col-xs-12" style="padding:8px;">

                       <div class="form-group ">

                          <label class="required"> From Date</label>
                              <input name="from"  id="from" value="<?php echo $from;?>" type="date" class="form-control"  >
                       
                          </div>
                  </div>                     
             

                  <div class="col-md-3 col-xs-12" style="padding:8px;" >

                       <div class="form-group ">

                          <label class="required"> To Date</label>
                             <input name="to" id="to" value="<?php echo $to;?>" type="date" class="form-control"  >
                       
                       </div>
                  </div>

             

               <div class="col-md-2" style="padding:2px;margin-top: 28px;">
                <div class="form-group ">
                   <input type="hidden" name="addaccountAdmin" value="1">
                <button type="submit" class="btn btn-primary">Search</button>

                <a href="print_datewise_reenroll_student.php?<?php echo session_id().session_id().session_id().session_id().session_id(); ?>&from=<?php echo $from;?>&to=<?php echo $to;?>"style="" class="btn btn-success"target="_blank" > <i class="fa fa-print"></i>&nbsp;&nbsp;Print</a>
                </div>

              </div>

             
            </div>
            <div class="clearfix"></div>
          </div>
        </div>
      </form>
      <div class="clearfix"></div>
    </div>
    <br>

     
          

<form action="date_wise_reenroll_student_reports.php" enctype="multipart/form-data" method="post">

<input type="hidden" value="<?php echo $_REQUEST['class_id']; ?>" name="class_id" />
<input type="hidden" value="<?php echo $_REQUEST['section']; ?>" name="section" />

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

              
                <th width="5%">S.No</th>
                <th width="15%">Student</th>
                <th width="12%">Father</th>
                <th width="10%" style="text-align:center;">Adm/Roll No</th>
                <th width="10%" style="text-align:center;"> Cell Number </th>
                <th width="12%" style="text-align:center;"> Class </th>
                <th width="8%" style="text-align:center;"> Re-Enroll Date </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 style="text-align:center; padding: 2px;"><?php echo $count++;?></td>        

                  <td style="padding: 2px;" > 

<!-- making a link   -->

<a style="padding: 0px 5px; font-size:14px;"  href="student_profile.php?<?php echo session_id().session_id().session_id().session_id().session_id(); ?>&class_id=<?php echo $_REQUEST['class_id']; ?>&section=<?php echo $_REQUEST['section']; ?>&session=<?php echo $_REQUEST['session']; ?>&student=<?php echo $WorkAssignListVal['student_id']; ?>" style="cursor:pointer;">


      <?php if($WorkAssignListVal['image']!=NULL){?>

        <img style="border-radius:50%;height:30px;width:30px;" src="<?php echo DOMAIN.AgentDirectory;?>/students_pics/<?php echo $WorkAssignListVal['image'];?>"  />
      <?php }else {?>

        <img style="border-radius:50%;height:30px;with:30px;" src="images/student.png" />

      <?php }?>
      
       &nbsp;&nbsp; <?php echo $WorkAssignListVal['first_name'];?>
    </a>
                       
                       
    </td>
      <td style="padding: 2px; text-align:left;"> &nbsp; <?php echo $WorkAssignListVal['last_name']; ?> </td>
      <td style="padding: 2px; text-align: center;"> <?php echo $WorkAssignListVal['ref_no']; ?> / <?php echo $WorkAssignListVal['candidate_roll_no']; ?> </td>
      <td style="padding: 2px; text-align: center;"> <?php echo $WorkAssignListVal['cell_no'];?> </td>
      
      <td style="text-align:center; padding: 2px;">
       <?php echo getClassName($m,$WorkAssignListVal['class_id']);?> / <?php echo getSectionName($m,$WorkAssignListVal['section_id']);?> </td>
      
      <td style="text-align:center; padding: 2px;">
        
       <?php  echo date("d-M-Y",strtotime($WorkAssignListVal['re_enroll_date'])); ?>

        </td>

    
  </tr> <?php   } ?>
 
        </tbody>
        
    </table>

  </div>

    </form>

    <br><br>


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

        </div> 
        </div>


            </div>
          </div>
        </div>


     
        <!-- /page content -->


 <!-- jQuery -->
    <script src="js/ajax_functions.js"></script>
  <?php include('RootMe/js_linksscript.php');?> 
  <!-- Links for Datatable-->

<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
 <script>
        
  $(document).ready(function() {
    $('#listofstudents').DataTable({
      "pageLength": 100
    });
    } 
  );

  $("#checkAll").change(function () {

      $("input:checkbox").prop('checked', $(this).prop("checked"));
  });


</script>
  
  </body>
</html>
