<!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
                <div class="title_left">
                    <h3>Fine Voucher</h3>
                </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>Fine Voucher List</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>
                   <!--  <form method="post">
                     <center>
                    <select name="search" id="searchbydropdown" class="form-control" style="width:400px;">
                      <option value="">--Select and Search--</option>
                      <option value="1">Student</option>
                      <option value="2">Teacher</option>
                      <option value="3">Staff</option>
                      </select>
                      </center>
                    </form>-->
                  </div>
                  <div class="x_content dt-responsive">
                    <table id="datatable-buttons" class="table table-striped table-bordered  nowrap">
                      <thead>
                                <tr>
                                    <th>#</th>
                                    <th>CCS NO</th>
                                    <th>User Type</th>
                                    <th>Name</th>
                                    <th>Book Name</th>
                                    <th>ISBN</th>
                                    <th>Issue Date</th>
                                    <th>Return Date</th>
                                    <th>Fine</th>
                                    <th>Action</th>
                                </tr>
                      </thead>          
                            <?php $i=1; foreach($voucher_list as $k=>$v){ ?>
                                <tr>
                                    <td><?php echo $i++; ?></td>
                                    <td>
                                <?php 
                                    if ($v['user_type']==1){ echo $this->lim->SearchByIdWithOutDel($v['user_id'],"student")['p_no'];  }  
                                    elseif($v['user_type']==2){echo $this->lim->SearchByIdWithOutDel($v['user_id'],"teacher")['emp_id'];}
                                    elseif($v['user_type']==3){echo $this->lim->SearchByIdWithOutDel($v['user_id'],"staff")['emp_id']; }
                                ?></td>
                                    
                                    <td><?php echo ($v['user_type']==1?"Cadet":($v['user_type']==2?"Teacher":($v['user_type']==3?"Admin":""))); ?></td>
                                     <td>
                                <?php 
                                    if ($v['user_type']==1){ echo $this->lim->SearchByIdWithOutDel($v['user_id'],"student")['student_name'];  }  
                                    elseif($v['user_type']==2){echo $this->lim->SearchByIdWithOutDel($v['user_id'],"teacher")['firstname'];}
                                    elseif($v['user_type']==3){echo $this->lim->SearchByIdWithOutDel($v['user_id'],"staff")['firstname']; }
                                ?></td>
                                   <td><?php echo $this->lim->getbookdetail($v['user_id'],$v['user_type'])['name']; ?></td>
                                    <td><?php echo $this->lim->getbookdetail($v['user_id'],$v['user_type'])['isbn']; ?></td>
                                    <td><?php echo $this->lim->getbookdetail($v['user_id'],$v['user_type'])['issue_date']; ?></td>
                                    <td><?php echo $this->lim->getbookdetail($v['user_id'],$v['user_type'])['return_date']; ?></td>
                                    <td><?php echo $this->lim->getbookdetail($v['user_id'],$v['user_type'])['fine']; ?></td>
                                    <td><a href="<?php echo $base_url; ?>Liberary_item/voucherprint/<?php echo $v['user_id']; ?>/<?php echo $v['user_type']; ?>/<?php echo $v['id']; ?>"><i class="fa fa-eye"></i></a></td>
                                </tr>
                                
                            <?php } ?>
                      </tbody>
                    </table>
                    <div class="row">
                      <div class="col-md-offset-8 col-sm-offset-8 col-md-4 col-sm-4 col-xs-12">
                        <div class="btn-group pull-right">
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->
           <!-- jQuery -->
   <script src="<?php echo base_url(); ?>assets/vendors/jquery/dist/jquery.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/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 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>
    
        <!-- Datatables -->
        <script>
            //var $j = jQuery.noConflict();
        </script>
    <script>
      $(document).ready(function() {
     
          var handleDataTableButtons = function() {
          if ($("#datatable-buttons").length) {
            $("#datatable-buttons").DataTable({
              dom: "Bfrtip",
              "bPaginate": true,
              buttons: [
                {
                  extend: "copy",
                  className: "btn-sm"
                },
                {
                  extend: "csv",
                  className: "btn-sm"
                },
                {
                  extend: "excel",
                  className: "btn-sm"
                },
                {
                  extend: "pdfHtml5",
                  className: "btn-sm"
                },
                {
                  extend: "print",
                  className: "btn-sm",
                //   action: function () {
                //               window.open('<?php //echo base_url()."Liberary_item/print_issuebooks"; ?>', '_blank');
                //           }
                },
              ],
              responsive: true
            });
          }
        };

        TableManageButtons = function() {
          "use strict";
          return {
            init: function() {
              handleDataTableButtons();
            }
          };
        }();

        TableManageButtons.init();
      });
    </script>
    <!-- /Datatables -->
        