        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
                <div class="title_left">
                </div>
            </div>
            <div class="clearfix"></div>
            <?php if(!$is_super){ ?>
            <div class="row">
              <div class="col-md-12 col-sm-6 col-xs-12 ">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Staff Status</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; ?>staff/status_update" method="post">

                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="role">Status <span class="required">*</span>
                        </label>
                        <div class="col-md-5 col-sm-9 col-xs-12">
                          <select id="status" class="form-control col-md-7 col-xs-12" name="status" required="required">
                            <option value="">Select Status</option>
                             <?php       $branch=$this->user_model->getbranch();
                                       $this->db->where('is_delete',0) ;
                                       $this->db->where('type','Staff')->where('branch',$branch) ;
                                $satus=$this->db->get('status')->result_array();
                              foreach($satus as $value) {
                  ?>
                              <option value="<?php echo $value['id'];?> "><?php echo $value['name']; ?></option>
                       <?php     } 
                            ?>
                          </select>
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="user">Staff <span class="required">*</span>
                        </label>
                        <div class="col-md-5 col-sm-9 col-xs-12">
                          <select id="staff" class="form-control col-md-7 col-xs-12" name="staff" required="required">
                            <option value="">Select Staff</option>
                             <?php       
                                       $this->db->where('status',0)->where('branch',$branch) ;
                               $tea=$this->db->get('staff')->result_array();
                              foreach($tea as $value) {
                  ?>
                              <option value="<?php echo $value['id'];?> "><?php echo $value['firstname']." ".$value['lastname']; ?></option>
                       <?php     } 
                            ?>
                          </select>
                        </div>
                      </div>
                      
                        <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name"> Date of Leaving<span class="required">*</span>
                        </label>
                        <div class="col-md-5 col-sm-6 col-xs-12">
                         <input type="date"  id="dol" name="dol" required-temp="true" class="form-control" placeholder="dd-mm-yyyy"> 
                        
                        </div>
                      </div> 
                        <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name"> Reason of Leaving<span class="required">*</span>
                        </label>
                          <div class="col-md-5 col-sm-6 col-xs-12">
                          <textarea class="form-control" name="rol" id="rol"></textarea>
                        </div>
                       </div>
                       
                       <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-5 col-md-offset-3">
                          <button id="send" type="submit" class="btn btn-success pull-right">Update</button>
                        </div>
                      </div>
                     
                    </form>
                  </div>
                </div>
              </div>

              

            </div>

                <?php } ?>
  <div class="row">

              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>View</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" class="table table-striped table-bordered dt-responsive nowrap">
                      <thead>
                        <tr>
                          <th>#</th>
                          <th>Name</th>
                          <th>Designation</th>
                          <th>Contact</th>
                          <th>Qualification</th>
                          <th>Date of Birth</th>
                          <th>Date of Joining</th>
                          <th>Status</th>
                          <th>Action</th>
                          
                        </tr>
                      </thead>


                      <tbody>
                        <?php $i=1; foreach ($staffs as $value) { ?>
                        <tr>
                          <td><?php echo $i++; ?></td>
                          <td><?php echo $value['firstname']." ".$value['lastname']; ?></td>
                          <td><?php echo $value['designation']; ?></td>
                          <td><?php echo $value['contact']; ?></td>
                          <td><?php echo $value['qualification']; ?></td>
                          <td><?php echo $newDate = date("d-m-Y", strtotime($value['dob'])); ?></td>
                          <td><?php echo $newDate = date("d-m-Y", strtotime($value['doj'])); ?></td>
                          <td><?php echo $value['name']; ?></td>
                          <td><a href="<?php echo $base_url;?>staff/rollback/<?php echo $value['id'];?>"><i class="fa fa-undo" aria-hidden="true"></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() {
   
        $('#datatable').DataTable( {
            dom: "lBfrtip",
              "bPaginate": true,
              "pageLength":35,
              "lengthMenu": [[35, 70, 100, -1], [35, 70, 100, "All"]],
              buttons: [
                {
                  extend: "copy",
                  className: "btn-sm"
                },
                {
                  extend: "csv",
                  className: "btn-sm"
                },
                {
                  extend: "excel",
                  exportOptions: {
                    columns: [ 0, 1, 2, 3,4,5,6,7,8 ]
                    },
                className: "btn-sm"
                },
                {
                  extend: "pdfHtml5",
                  exportOptions: {
                    columns: [ 0, 1, 2, 3,4,5,6,7,8 ]
                    },
                  className: "btn-sm"
                },
                {
                  extend: "print",
                  exportOptions: {
                    columns: [ 0, 1, 2, 3,4,5,6,7,8 ]
                },
                  className: "btn-sm"
                },
              ],
              responsive: true
            } );
        } );
    </script>
    
    <script>
    $('#staff').select2({
      
        //selectOnClose: true,
        placeholder: "Select an option",
        allowClear:true

    });


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