<?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">
                    <?= _l('staff_declaration'); ?>
                </h4><br>
             <div class="_buttons tw-mb-2">
             <?php if (staff_can('create', 'staff_declaration')) { ?>
                  <a href="<?php echo admin_url('staff_declaration/create'); ?>" class="btn btn-primary">
                    <i class="fa fa-plus"></i> <?php echo _l('staff_declaration_new'); ?>
                  </a>

                <?php } ?>
                <?php $has_declarations = ($this->db->count_all_results() > 0);?>
                <?php if ($has_declarations) { ?>

<a class="btn btn-success mleft5" href="<?php echo admin_url('staff_declaration/export_excel'); ?>">
  <i class="fa fa-file-excel-o"></i> Export Excel
</a>
    <?php } ?>


         </div>
                
            </div>

<style>
    .btn-info{color: rgb(255 255 255) !important;}
    .btn-danger{color: rgb(255 255 255) !important;}
</style>
 
                                <div class="col-md-12 panel-table-full">
                                    <div class="panel_s">
                                        <div class="panel-body">

           

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

          

            <?php
              $table_data = [
                _l('id'),
                _l('staff'),
                _l('department'),
                _l('date'),
                _l('status'),
                _l('date_created'),
                _l('options'),
              ];
              render_datatable($table_data, 'staff-declarations');
            ?>

          </div>
        </div>

      </div>
    </div>
  </div>
</div>

<?php init_tail(); ?>

<script>
  $(function () {
    // Standard Perfex initDataTable
    initDataTable('.table-staff-declarations', admin_url + 'staff_declaration/table', undefined, undefined, undefined);
  });
</script>
