<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<?php init_head(); ?>
<div id="wrapper">
  <div class="content">
    <div class="row">


<div class="col-md-12 tw-mb-3">
                <h4 class="tw-my-0 tw-font-bold tw-text-xl">
                  <?php echo _l('staff_external_engagement'); ?>
                </h4><br>
             <div class="_buttons tw-mb-2">
              <?php if (staff_can('create', 'staff_external_engagement')) { ?>
                <a href="<?php echo admin_url('staff_external_engagement/create'); ?>"
                   class="btn btn-primary">
                  <i class="fa fa-plus"></i> <?php echo _l('staff_external_engagement_new'); ?>
                </a>
              <?php } ?>

              <?php if (!empty($has_data)) { ?>
                <a class="btn btn-success mright10"
                   href="<?php echo admin_url('staff_external_engagement/export_excel'); ?>">
                  <i class="fa fa-file-excel-o"></i> Export Excel
                </a>
              <?php } ?>


         </div>
                
            </div>



      <div class="col-md-12">
        <div class="panel_s">
          <div class="panel-body">

           
            <hr class="hr-panel-heading"/>

            <?php
              render_datatable([
                '#',
                _l('staff_name'),
                _l('staff_id'),
                _l('department'),
               // _l('submission_type'),
                _l('status'),
                'Engagements',
                'Total Payment (RM)',
                'Date',
                _l('date_created'),
              ], 'staff_external_engagement');
            ?>

          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<?php init_tail(); ?>
<script>
$(function(){
  initDataTable('.table-staff_external_engagement',
    admin_url+'staff_external_engagement/table', undefined, undefined, undefined, [0,'desc']);
});
</script>
