

       <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
                <div class="title_left">
                   
                </div>
            </div>
            <div class="clearfix"></div>
           <div class="row">

              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2> CNIC Detail</h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap">
                      <thead>
                       <tr>
                          <th>#</th>
                          <th>SID</th>
                          <th>GR #</th>
                          <th>Student Name</th>
                          <th>Parent Name</th>
                          <th>Parent ID</th>
                          <th>Course Name</th>
                          <th>Batch Name</th>
                          <th>Actions</th>
                         
                        </tr>
                      </thead>


                      <tbody>
                        <?php $i=1; foreach ($student as $value) { ?>
                        <tr>
                          <td><?php echo $i++; ?></td>
                          <td><?php echo $value['sid']; ?></td>
                          <td><?php echo $value['grno']; ?></td>
                          <td><?php echo $value['student_name']; ?></td>
                          <td><?php echo $value['father_name']; ?></td>
                          <td><?php echo $value['father_cnic']; ?></td>
                          <td><?php echo $value['class_name']; ?></td>
                          <td><?php echo $value['section_name']; ?></td>
                          <td>
                            <a href="<?php echo base_url();?>report/edit_cnic/<?php echo $value['id']."/".$value['class_id']."/".$value['section_id']; ?>"><i class="fa fa-edit"></i></a> 
                          </td>

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

            </div>





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

        <!-- footer content -->
        <footer>
          <div class="pull-right">
            Prudmac
          </div>
          <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->
      </div>
    </div>

    <!-- jQuery -->
    <script src="<?php echo base_url(); ?>assets/vendors/jquery/dist/jquery.min.js"></script>
    <!-- Custom JS -->
    <script src="<?php echo base_url(); ?>assets/js/main.js"></script>
    <!-- Bootstrap -->
    <script src="<?php echo base_url(); ?>assets/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="<?php echo base_url(); ?>assets/vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="<?php echo base_url(); ?>assets/vendors/nprogress/nprogress.js"></script>
    <!-- Chart.js -->
    <script src="<?php echo base_url(); ?>assets/vendors/Chart.js/dist/Chart.min.js"></script>
    <!-- gauge.js -->
    <script src="<?php echo base_url(); ?>assets/vendors/gauge.js/dist/gauge.min.js"></script>
    <!-- bootstrap-progressbar -->
    <script src="<?php echo base_url(); ?>assets/vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
    <!-- iCheck -->
    <script src="<?php echo base_url(); ?>assets/vendors/iCheck/icheck.min.js"></script>
    <!-- Skycons -->
    <script src="<?php echo base_url(); ?>assets/vendors/skycons/skycons.js"></script>
    <!-- Flot -->
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.pie.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.time.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.stack.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.resize.js"></script>
    <!-- Flot plugins -->
    <script src="<?php echo base_url(); ?>assets/js/flot/jquery.flot.orderBars.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/date.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/jquery.flot.spline.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/curvedLines.js"></script>
    <!-- jVectorMap -->
    <script src="<?php echo base_url(); ?>assets/js/maps/jquery-jvectormap-2.0.3.min.js"></script>
    <!-- bootstrap-daterangepicker -->
    <script src="<?php echo base_url(); ?>assets/js/moment/moment.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/datepicker/daterangepicker.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="<?php echo base_url(); ?>assets/build/js/custom.min.js"></script>
    
    <!-- jQuery Tags Input -->
    <script src="<?php echo base_url(); ?>assets/vendors/jquery.tagsinput/src/jquery.tagsinput.js"></script>

        <!-- Datatables -->
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
     <script src="<?php echo base_url(); ?>assets/vendors/jszip/dist/jszip.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/pdfmake/build/pdfmake.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/pdfmake/build/vfs_fonts.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons/js/buttons.flash.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons/js/buttons.html5.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons/js/buttons.print.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-scroller/js/dataTables.scroller.min.js"></script>
   

    <!-- Datatables -->

  <script>
          $(document).ready(function(){
                    $("#course_div").hide();
                    $("#batch_div").hide();
                    $("#student_div").hide();
                    $("#status_div").hide();
            
        });
        
        $('#branch').on('change',function(){
            var branch_id = $(this).val();
            if(branch_id){
                $("#course_div").show();

                $.ajax({
                    url:'<?= base_url() ?>Course/setcourse',
                    type:'POST',
                    data: {'branch_id': branch_id },
                    success:function(data){
                        $('#course').html(data); 
                    },
                    error:function(){
                        alert('Error occur...!!');
                    }
                });
            }
            
        });
        
        $('#course').on('change',function(){
            var branch_id = $('#branch').val();
            var course_id = $(this).val();
            $("#batch_div").show();

                $.ajax({
                    url:'<?= base_url() ?>Course/setallbatch',
                    type:'POST',
                    data: {'branch_id': branch_id ,'course_id': course_id},
                    success:function(data){
                        $('#batch').html(data); 
                    },
                    error:function(){
                        alert('Error occur...!!');
                    }
                });
          });

      $('#batch').change(function(){
         var val=$('#course').val();
         var ba=$(this).val();
         $.ajax({
           url: '<?php echo base_url(); ?>load/batchstudents/'+val+'/'+ba,
          data: {},
          success: function (result) {
              if(result!=""){
                $("#student_div").show();
                $("#status_div").show();
            
                  jq('#student').html(result); 
                  jq('#student').multiselect('reload');

              }else{
                $("#send").attr('disabled',true);
              }
            }               
            
            });
       });

      jq('#student').multiselect({
          columns: 1,
          placeholder: 'Select Students',
          selectAll: true,
          search: true 

        });


    </script>

    <!-- Datatables -->
   <script>

$(document).ready(function(){
         
            $(document).ajaxStart(function() {
                $('#ajaxload').show();
            });
            
            
        // $('#datatable-buttons').DataTable();
   $.ajax({
    url: '<?php echo base_url(); ?>admin/fetch_user/',data: {},
         success: function (result) {
            
      $(document).ajaxStop(function() {
           $('#ajaxload').hide();
      });
        
        
             console.log(result);
              $("#datatable-buttons").dataTable().fnDestroy();
               setTimeout(function(){
               
               $("tbody.center").html(result);
                $("#datatable-buttons").DataTable({
                "lengthMenu": [ [10, 25, 50, -1], [10, 25, 50, "All"] ],
                "pageLength": 10,
              dom: "lBfrtip",
              
              "bPaginate": true,
               
             buttons: [
                 {
                  extend: "print",
                  className: "btn-sm",
                   exportOptions: {
                       <?php  if($this->user_model->is_super()){ ?>
                        columns: [0,1,2,3,4,5,6,7],
                       <?php }else{?>
                       columns: [0,1,2,3,4,5,6],
                       <?php }?>
                        modifier: {
                            selected: true
                        }
                    }
                },
                {
                  extend: "copy",
                  className: "btn-sm",
                  exportOptions: {
                       <?php  if($this->user_model->is_super()){ ?>
                        columns: [0,1,2,3,4,5,6,7],
                       <?php }else{?>
                       columns: [0,1,2,3,4,5,6],
                       <?php }?>
                        modifier: {
                            selected: true
                        }
                    }
                },
                {
                  extend: "csv",
                  className: "btn-sm",
                  exportOptions: {
                       <?php  if($this->user_model->is_super()){ ?>
                        columns: [0,1,2,3,4,5,6,7],
                       <?php }else{?>
                       columns: [0,1,2,3,4,5,6],
                       <?php }?>
                        modifier: {
                            selected: true
                        }
                    }
                },
                {
                  extend: "excel",
                  className: "btn-sm",
                  exportOptions: {
                       <?php  if($this->user_model->is_super()){ ?>
                        columns: [0,1,2,3,4,5,6,7],
                       <?php }else{?>
                       columns: [0,1,2,3,4,5,6],
                       <?php }?>
                        modifier: {
                            selected: true
                        }
                    }
                },
                {
                extend: 'pdfHtml5',
                className: "btn-sm",
                title: '',
                exportOptions: {
                       <?php  if($this->user_model->is_super()){ ?>
                        columns: [0,1,2,3,4,5,6,7],
                       <?php }else{?>
                       columns: [0,1,2,3,4,5,6],
                       <?php }?>
                        modifier: {
                            selected: true
                        }
                    }
                },
              ],
              responsive: true
            });
            },500);
           }
     });//end ajax for loading form


});
</script>

    <!-- /Datatables -->

  </body>
</html>