<?php include('includes/config.php');?>
<?php include('includes/session_check.php');?>
<?php   


        $db->where("status", '0');
        $db->where("branch_id", $_REQUEST['bid']);
        $students=$db->get("edu_student_details");

        $db->where("branch_id", $_REQUEST['bid']);
        $branch=$db->get("edu_branch_config");

        $WorkAssignListVal = $db->get("edu_student_details");
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Students | Admin Panal</title>

    <!-- Bootstrap -->
    <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <link href="../vendors/nprogress/nprogress.css" rel="stylesheet">
    <!-- iCheck -->
    <link href="../vendors/iCheck/skins/flat/green.css" rel="stylesheet">
    <!-- Datatables -->
    <link href="../vendors/datatables.net-bs/css/dataTables.bootstrap.min.css" rel="stylesheet">
    <link href="../vendors/datatables.net-buttons-bs/css/buttons.bootstrap.min.css" rel="stylesheet">
    <link href="../vendors/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css" rel="stylesheet">
    <link href="../vendors/datatables.net-responsive-bs/css/responsive.bootstrap.min.css" rel="stylesheet">
    <link href="../vendors/datatables.net-scroller-bs/css/scroller.bootstrap.min.css" rel="stylesheet">

    <!-- Custom Theme Style -->
    <link href="../build/css/custom.min.css" rel="stylesheet">


    <script type="text/javascript">
      function HideDate(str){
  
  if(str=="1"){
    
    document.getElementById("from").style.display="block";
    
    document.getElementById("col1").style.display="block";
    document.getElementById("col2").style.display="block";
  }
  else {
    
    document.getElementById("from").style.display="none";
  
    document.getElementById("col1").style.display="none";
    document.getElementById("col2").style.display="none";
  }
}

    </script>
  </head>

  <body class="nav-md">
    <div class="container body">
      <div class="main_container">

        <div class="col-md-3 left_col">

    

     
        <?php include('includes/sidebar.php');?>


        <?php include('includes/header.php');?>
  

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
                <h3>Students List<small> (<?php echo count($students);?> records)</small></h3>
              </div>

              <div class="title_right">
                <div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
                  <div class="input-group">
                    <input type="text" class="form-control" placeholder="Search for...">
                    <span class="input-group-btn">
                      <button class="btn btn-default" type="button">Go!</button>
                    </span>
                  </div>
                </div>
              </div>
            </div>

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

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <h3 class="text-center"><?php echo $branch[0]['Branch_Name'];?></h3>
                  <div class="x_content">
                    
                    <table id="datatable" class="table table-striped table-bordered">
                       <thead>
                        <tr>
                          <th>S.No</th>
                          <th>Student Name</th>
                          <th>Roll#</th>
                          <th>Cell</th>
                          <th>Class</th>
                          <th>Action</th>
                          <th>Profile</th>
                          
                        </tr>
                      </thead>
                      <tbody>

                        
<?php  $count=1;
$date= date("Y-m-d");

foreach($students as $student){

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

?>
                        <tr>
                          <td style="text-align:center;"><?php echo $count; $count++;?></td>
                          <td><?php echo $student['first_name'];?></td>
                          <td><?php echo $student['candidate_roll_no'];?></td>
                          <td><?php echo $student['cell_no'];?></td>
                          <td><?php echo $class[0]['Class_Name'];?></td>
                          
                        

                          <td>

          <!--   <a style="padding: 0px 5px; font-size:14px;"  href="add_student.php?<?php echo session_id().session_id().session_id().session_id().session_id();?>&student=<?php echo $WorkAssignListVal['student_id'];?>#sec" style="cursor:pointer;"  class="btn btn-success">

            <i class="fa fa-pencil" aria-hidden="true"></i>


            </a> -->


      <a style="padding: 0px 5px; font-size:14px;" data-toggle="modal" data-target="#EmpPayroll<?php echo $student['student_id'];?>,<?php echo $_SESSION['branch'];?>"; class="btn btn-danger"><i class="fa fa-remove"></i> </a>
      

                        </td>

    <!-- Student Result popup start -->


      <div id="EmpPayroll<?php echo $student['student_id'];?>" class="modal fade" role="dialog">
        <div class="modal-dialog">

          <!-- Modal content-->
          <div class="modal-content">
            <div class="modal-header" style="border-bottom:none;">
              <button type="button" class="close" data-dismiss="modal">&times;</button>
              <h4 class="modal-title" style="text-align:center;"> Reasons of Delete (<?php echo $student['first_name']." - ".$WorkAssignListVal[0]['user_lname']; ?>)  </h4>
            </div>

            <div class="modal-body">



<form  action="<?php  echo DOMAIN.AdminDirectory; ?>includes/InsertMe.php" method="post">

</form>







<form  action="<?php  echo DOMAIN.AdminDirectory; ?>includes/InsertMe.php" method="post">

           <input type="hidden" name="action" value="delete_student"> 
           <input type="hidden" id="date"  name="month" value="<?php echo $_GET['month']; ?>" />
           <input type="hidden" name="session" value="<?php echo $student[0]['session_id']; ?>">
           <input type="hidden" name="branch" value="<?php echo $student[0]['branch_id']; ?>">
           <input type="hidden" name="student" value="<?php echo $student['student_id']; ?>">
           
                   <div class="col-md-12" style="padding: 8px;">

                       <div class="form-group ">

                          <label class="required">Reasons</label>
                              <select required name="fee" onChange="HideDate(this.value);" class="form-control"  >

                                <option value=''>Select</option>
                                <option <?php if($_GET['fee']=="0"){echo 'selected';}?> value='Completed'>Class/Course Completed</option>
                                <option <?php if($_GET['fee']=="0"){echo 'selected';}?> value='Migration'>Migration </option>
                                <option <?php if($_GET['fee']=="0"){echo 'selected';}?> value='Miss Behaviour'>Miss Behaviour</option>
                                <option <?php if($_GET['fee']=="0"){echo 'selected';}?> value='Fee Defaulter'>Fee Defaulter</option>
                                 <option <?php if($_GET['fee']=="0"){echo 'selected';}?> value='Regular Absents'>Regular Absents</option>
                                                                 
                                <option <?php if($_GET['fee']=="1"){echo 'selected';}?> value='1'>Other </option>
                                  
                              </select>
                            </div>


                    </div> 
                   
              
                  
                  <div class="col-md-12" style="padding:8px;<?php if(isset($_REQUEST['from']) && $_REQUEST['fee']==1){ echo 'display:block;';}else {echo 'display:none;';} ?>"  id="col1">

                       <div class="form-group ">

                          <label class="required"> Explain</label>
                              <textarea name="expln"  id="from" value="<?php echo $_POST['expln']?>" type="text" class="form-control"></textarea>
                       
                          </div>
                  </div>                      
             

                                  



            <div class="modal-footer">

            <button type="submit" class="btn btn-primary" name="submit" >Submit </button>
              


            </div>



                 </form>

          </div>

          </div>

        </div>
      </div>

      <!-- Student result popup ending -->
                          

                          <td>
                           <a style="padding: 0px 5px; font-size:14px;"  href="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 $student['student_id']; ?>" style="cursor:pointer;"  class="btn btn-success">

                                  PROFILE
                            </a>
                          </td>

                        </tr>
<?php } ?>
                      

                      </tbody>
                    </table>
                  </div>
                </div>
              </div>

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

 <?php include('includes/footer.php');?>


      </div>
    </div>

    <!-- jQuery -->
    <script src="../vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="../vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="../vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="../vendors/nprogress/nprogress.js"></script>
    <!-- iCheck -->
    <script src="../vendors/iCheck/icheck.min.js"></script>
    <!-- Datatables -->
    <script src="../vendors/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="../vendors/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
    <script src="../vendors/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
    <script src="../vendors/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
    <script src="../vendors/datatables.net-buttons/js/buttons.flash.min.js"></script>
    <script src="../vendors/datatables.net-buttons/js/buttons.html5.min.js"></script>
    <script src="../vendors/datatables.net-buttons/js/buttons.print.min.js"></script>
    <script src="../vendors/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
    <script src="../vendors/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
    <script src="../vendors/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="../vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js"></script>
    <script src="../vendors/datatables.net-scroller/js/dataTables.scroller.min.js"></script>
    <script src="../vendors/jszip/dist/jszip.min.js"></script>
    <script src="../vendors/pdfmake/build/pdfmake.min.js"></script>
    <script src="../vendors/pdfmake/build/vfs_fonts.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="../build/js/custom.min.js"></script>

   <!--  <script>
        
  $(document).ready(function() {
    $('#datatable').DataTable({
      "pageLength": 100
    });
    } 
  );

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

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


</script> -->

  </body>
</html>