<?php
defined('BASEPATH') or exit('No direct script access allowed');

if (!function_exists('read_spreadsheet')) {
    function read_spreadsheet($filepath, $startRow = 2)
    {
        $CI = &get_instance();
        $CI->load->library('spreadsheet');
        return $CI->spreadsheet->readHasilTKA($filepath, $startRow);
    }
}

if (!function_exists('export_spreadsheet')) {
    function export_spreadsheet($data, $filename = 'export.xlsx')
    {
        $CI = &get_instance();
        $CI->load->library('spreadsheet');
        return $CI->spreadsheet->exportHasilTKA($data, $filename);
    }
}

if (!function_exists('download_template_excel')) {
    function download_template_excel()
    {
        $CI = &get_instance();
        $CI->load->library('spreadsheet');
        return $CI->spreadsheet->downloadTemplate();
    }
}
