<!-- 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>View Roll No. Slips</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">
                       <form class="form-horizontal form-label-left" action="<?php echo base_url(); ?>Exam/rolldatesection" method="post">
                           <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-1">
                         </div>
                    <table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap">
									<thead>
			<tr>
			<th>All<input type="checkbox" id="checkall" / >&nbsp;</th>
			<th>S.ID</th>
				<th>Gr No</th>
			<th>Student Name</th>     
			<th>Father Name</th>     
				<th>Remaining Fee</th>
			<?php if($this->user_model->is_super()){ ?><th>Branch</th> <? } ?>
			<th>Action</th>
                    </tr>
									</thead>
									<tbody>
                    <?php $i=1; foreach($data as  $value){ 
                    $invoice=$this->db->select('invoice.id as inv_id,invoice.remaining,invoice.status')
                                      ->from('invoice')
                                      ->where('student_id',$value['stid'])
                                      ->order_by('invoice.id',"DESC")
                                      ->limit('1')
                                      ->get()->row_array();
                    ?>
                     <!--echo "<pre>";print_r($student);exit;-->
                    <tr>
                    <td><input type="checkbox" name="student[]" value="<?php echo $value['stid']; ?>"></td>
                    <td><?php echo $value['sid']."-".$invoice['inv_id']; ?></td>
                     <td><?php echo $value['grno']; ?></td>
                    <td><?php echo $value['student_name']; ?></td>
                     <td><?php echo $value['father_name']; ?></td>
                     <td style="text-align: right">
                         <?php 
                         if($invoice['status']==1)
                         {
                             echo $invoice['remaining']."<span class='text-danger'><b>  </b></span>";
                         }else
                         {
                             echo ($this->voucher_model->countTotalFee($invoice['inv_id']))."<span class='text-danger'><b></b></span>";
                         }
                        // if($invoice['remaining'] && $invoice['remaining'] == 0 && $invoice['status'] == 1){echo 0;}elseif($invoice['remaining'] && $invoice['remaining'] > 0 && $invoice['status'] !=0){echo $invoice['remaining']."<span class='text-danger'><b>  </b></span>";}else{echo ($this->voucher_model->countTotalFee($invoice['inv_id']))."<span class='text-danger'><b></b></span>";} 
                        ?></td>
                    <?php if($this->user_model->is_super()){ ?>
                     <td><?php echo $value['name']; ?></td>
                     <? } ?>
                    <td><a href="<?php echo base_url(); ?>Exam/rolldate/<?php echo $value['stid']?>/<?php echo $exam?>"><i class="fa fa-eye"></i></a></td>
                    </td>
                    </tr>
                     
                    <?php  $i++; } ?>
                  </tbody>
								</table>
								 <input type="hidden" name="class" value="<?php echo $class; ?>">
                        <input type="hidden" name="section" value="<?php echo $section; ?>">
                        <input type="hidden" name="exam" value="<?php echo $exam; ?>">
                                <div class="row">
                                <div class="ln_solid"></div>
                     
                                    <div class="col-md-2 col-sm-2 col-xs-6 col-md-offset-10 col-sm-offset-10 col-xs-offset-6">
                                    <button id="send" type="submit" class="btn btn-success pull-right">Show</button>    </div>
                                </div>
                                </form>
							</div>
						</div></div></div></div></div>
						 <!-- /page content -->

        <!-- footer content -->
        <footer>
          <div class="pull-right">
            EduSolutions
          </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>
     <!-- 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>
    

 <script>
       $(function(){
           
           $('#checkall').change(function(){
               if (this.checked) {
        // the checkbox is now checked
                   $('input:checkbox').not(this).prop('checked', this.checked);
                } else {
                    // the checkbox is now no longer checked
                    $('input:checkbox').not(this).prop('checked', '');
                }
           })
       })
   </script>
    <script>
$(document).ready(function(){

            
                $("#datatable-buttons").DataTable({
                    dom: "lBfrtip",
              "bPaginate": true,
              "pageLength":35,
              "lengthMenu": [[35, 70, 100, -1], [35, 70, 100, "All"]],
               
             buttons: [
                 {
                  extend: "print",
                  className: "btn-sm"
                },
                {
                  extend: "copy",
                  className: "btn-sm"
                },
                {
                  extend: "csv",
                  className: "btn-sm"
                },
                {
                  extend: "excel",
                  className: "btn-sm"
                },
                {
                extend: 'pdf',
                className: "btn-sm",
                title: '',
                },
              ],
              responsive: true
            });
            

});
</script>                 									
																		
  </body>
</html>