| 
				Server : Apache System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : matalashes ( 1004) PHP Version : 8.1.29 Disable Function : NONE Directory : /home/matalashes/.trash/app.bak2/Helpers/  | 
Upload File :  | 
<?php
/*
 * ============ Helper untuk Elemen HTML Tag ==============
 * */
use Config\Services;
if (!function_exists('input_field')) {
    /**
     * @param string $id ID field
     * @param string $class Class field properties
     * @param string $name Field name properties
     * @param string $type Field type (text,password,email,etc)
     * @param string $placeholder Placeholder field properties
     * @param string $value Set field value properties
     * @param string $additional Set additional properties --> required, readonly separated by space
     *
     * @return html input
     */
    function input_field($id = '', $class = '', $name = '', $type = '', $placeholder = '', $value = '', $additional = '')
    {
        return '<input id="' . $id . '" class="' . $class . '" name="' . $name . '" type="' . $type . '" placeholder="' . $placeholder . '" value="' . $value . '" ' . $additional . '/>';
    }
}
if (!function_exists('textarea_field')) {
    function textarea_field($id = '', $class = '', $name = '', $placeholder = '', $value = '', $row = 4, $col = 50, $additional = '')
    {
        return '<textarea ' . $additional . ' id="' . $id . '" class="' . $class . '" name="' . $name . '" rows="' . $row . '" cols="' . $col . '" 
        placeholder="' . $placeholder . '">' . $value . '</textarea>';
    }
}
if (!function_exists('button_button')) {
    function button_button($id = '', $class = '', $name = '', $type = '', $additional = '', $icon = '', $btn_name = '')
    {
        return '<button id="' . $id . '" class="' . $class . '" name="' . $name . '" type="' . $type . '"
        ' . $additional . '>' . $btn_name . '</button>';
    }
}
if (!function_exists('href_button')) {
    function href_button($id = '', $class = '', $name = '', $type = '', $additional = '', $icon = '', $btn_name = '', $keyword = '', $url_action_table = '')
    {
        if ($keyword) {
            $href = $url_action_table['search'];
        } else {
            $href = $url_action_table['main'];
        }
        return '<a href="' . $href . '" id="' . $id . '" class="' . $class . '" name="' . $name . '" type="' . $type . '" 
        ' . $additional . '>' . $btn_name . '</a>';
    }
}
if (!function_exists('href_button_custom')) {
    function href_button_custom($id = '', $class = '', $name = '', $type = '', $additional = '', $icon = '', $btn_name = '', $keyword = '', $href = '')
    {
        return '<a href="' . $href . '" id="' . $id . '" class="' . $class . '" name="' . $name . '" type="' . $type . '" 
        ' . $additional . '>' . $btn_name . '</a>';
    }
}
if (!function_exists('input_dropdown')) {
    function input_dropdown($id, $class, $name, $dropdown_name, $opt_arr, $additional)
    {
        $select = '';
        $select .= '<select id="' . $id . '" class="' . $class . '" name="' . $name . '" ' . $additional . '>';
        $select .= '<option value="">Select ' . $dropdown_name . '</option>';
        foreach ($opt_arr as $value => $selected) {
            $sel = explode('|', $selected);
            $select .= '<option ' . $sel[1] . ' value="' . $value . '">' . $sel[0] . '</option>';
        }
        $select .= '</select>';
        return $select;
    }
}
if (!function_exists('upload_field')) {
    function upload_field($upload_data, $upload_field, $state, $id = '', $class = '', $name = '', $type = '', $input_on_change = '', $delete_on_click = '', $id_data = '')
    {
        if ($state == 'edit') {
            $input_additional = (isset($upload_field) || isset($_SESSION[$upload_data['upload_field_name']])) ? 'style="display:none"' : '';
            $img_additional_1 = isset($upload_field) ? base_url() . $upload_data['upload_path'] . $upload_field : (isset($_SESSION[$upload_data['upload_field_name']]) ? base_url() . $upload_data['upload_path'] . $_SESSION[$upload_data['upload_field_name']] : '');
            $img_additional_2 = (isset($upload_field) || isset($_SESSION[$upload_data['upload_field_name']])) ? '' : 'style="display:none"';
            $del_additional = (isset($upload_field) || isset($_SESSION[$upload_data['upload_field_name']])) ? '' : 'style="display:none"';
            $display = 'display:none';
            if (isset($upload_field)) {
                $path = $upload_field;
                $display = 'display:block';
            } else {
                if (isset($_SESSION[$upload_data['upload_field_name']])) {
                    $path = $_SESSION[$upload_data['upload_field_name']];
                    $display = 'display:block';
                } else {
                    $path = '';
                }
            }
            $str = '<div class="d-flex flex-center mb-2">';
            $str .= '<input id="' . $id . '" class="' . $class . '" name="' . $name . '" type="' . $type . '" onchange="' . $input_on_change . '()" ' . $input_additional . '/>';
            $str .= '<br/><img width="100px" id="preview_' . $id . '" class="preview_image" src="' . $img_additional_1 . '" ' . $img_additional_2 . '/>';
            $str .= '<a style="color:white;' . $display . '" id="delete_' . $id . '" class="btn close_upload_btn ms-4" title="Delete" alt="Delete" onclick="' . $delete_on_click . '(); return false;" ' . $del_additional . ' state="' . $state . '" path="' . $path . '" _id="' . $id_data . '"><i class="fas fa-window-close"></i></a>';
            $str .= '</div>';
        } else {
            $input_additional = isset($_SESSION[$upload_data['upload_field_name']]) ? 'style="display:none"' : '';
            $img_additional_1 = isset($_SESSION[$upload_data['upload_field_name']]) ? base_url() . $upload_data['upload_path'] . $_SESSION[$upload_data['upload_field_name']] : '';
            $img_additional_2 = isset($_SESSION[$upload_data['upload_field_name']]) ? '' : 'style="display:none"';
            $del_additional = isset($_SESSION[$upload_data['upload_field_name']]) ? '' : 'style="display:none"';
            $display = 'display:none';
            if ($upload_field != '') {
                $display = 'display:block';
            } else {
                if (isset($_SESSION[$upload_data['upload_field_name']])) {
                    $display = 'display:block';
                }
            }
            $str = '<div class="d-flex flex-center mb-2">';
            $str .= '<input id="' . $id . '" class="' . $class . '" name="' . $name . '" type="' . $type . '" onchange="' . $input_on_change . '()" ' . $input_additional . '/>';
            $str .= '<br/><img width="100px" id="preview_' . $id . '" class="preview_image" src="' . $img_additional_1 . '" ' . $img_additional_2 . '/>';
            $str .= '<a style="color:white;' . $display . '" id="delete_' . $id . '" class="btn close_upload_btn ms-4" title="Delete" alt="Delete" onclick="' . $delete_on_click . '(); return false;" ' . $del_additional . ' _id="' . $id_data . '"><i class="fas fa-window-close"></i></a>';
            $str .= '</div>';
        }
        return $str;
    }
}
if (!function_exists('upload_field2')) {
    function upload_field2($upload_data, $upload_field, $state, $id = '', $class = '', $name = '', $type = '', $input_on_change = '', $delete_on_click = '')
    {
        if ($state == 'edit') {
            $input_additional = (isset($upload_field) || isset($_SESSION[$upload_data['upload_field_name2']])) ? 'style="display:none"' : 'required';
            $img_additional_1 = isset($upload_field) ? base_url() . $upload_field : (isset($_SESSION[$upload_data['upload_field_name2']]) ? base_url() . $_SESSION[$upload_data['upload_field_name2']] : '');
            $img_additional_2 = (isset($upload_field) || isset($_SESSION[$upload_data['upload_field_name2']])) ? '' : 'style="display:none"';
            $del_additional = (isset($upload_field) || isset($_SESSION[$upload_data['upload_field_name2']])) ? '' : 'style="display:none"';
            if (isset($upload_field)) {
                $path = $upload_field;
            } else {
                if (isset($_SESSION[$upload_data['upload_field_name2']])) {
                    $path = $_SESSION[$upload_data['upload_field_name2']];
                } else {
                    $path = '';
                }
            }
            $str = '<input id="' . $id . '" class="' . $class . '" name="' . $name . '" type="' . $type . '" onchange="' . $input_on_change . '()" ' . $input_additional . '/>';
            $str .= '<img id="preview_' . $id . '" class="preview_image2" src="' . $img_additional_1 . '" ' . $img_additional_2 . '/>';
            $str .= ' <a id="delete_' . $id . '" class="btn btn-danger close_upload_btn2" onclick="' . $delete_on_click . '(); return false;" ' . $del_additional . ' state="' . $state . '" path="' . $path . '"><i class="fa fa-close"></i></a>';
        } else {
            $input_additional = isset($_SESSION[$upload_data['upload_field_name2']]) ? 'style="display:none"' : 'required';
            $img_additional_1 = isset($_SESSION[$upload_data['upload_field_name2']]) ? base_url() . $_SESSION[$upload_data['upload_field_name']] : '';
            $img_additional_2 = isset($_SESSION[$upload_data['upload_field_name2']]) ? '' : 'style="display:none"';
            $del_additional = isset($_SESSION[$upload_data['upload_field_name2']]) ? '' : 'style="display:none"';
            $str = '<input id="' . $id . '" class="' . $class . '" name="' . $name . '" type="' . $type . '" onchange="' . $input_on_change . '()" ' . $input_additional . '/>';
            $str .= '<img id="preview_' . $id . '" class="preview_image2" src="' . $img_additional_1 . '" ' . $img_additional_2 . '/>';
            $str .= ' <a id="delete_' . $id . '" class="btn btn-danger close_upload_btn2" onclick="' . $delete_on_click . '(); return false;" ' . $del_additional . '><i class="fa fa-close"></i></a>';
        }
        return $str;
    }
}
if (!function_exists('upload_field2_file')) {
    function upload_field2_file($upload_data, $upload_field, $state, $id = '', $class = '', $name = '', $type = '', $input_on_change = '', $delete_on_click = '')
    {
        $session = Services::session();
        if ($state == 'edit') {
            $input_additional = (isset($upload_field) || $session->get($upload_data['upload_field_name2']) !== null) ? 'style="display:none;color:white"' : '';
            $img_additional_1 = isset($upload_field) ? base_url() . $upload_field : ($session->get($upload_data['upload_field_name2']) !== null ? base_url() . $session->get($upload_data['upload_field_name2']) : '');
            $img_additional_2 = (isset($upload_field) || $session->get($upload_data['upload_field_name2']) !== null) ? '' : 'style="display:none;color:blue"';
            $del_additional = (isset($upload_field) || $session->get($upload_data['upload_field_name2']) !== null) ? '' : 'style="display:none;color:white"';
            if (isset($upload_field)) {
                $path = $upload_field;
            } else {
                if ($session->get($upload_data['upload_field_name2']) !== null) {
                    $path = $session->get($upload_data['upload_field_name2']);
                } else {
                    $path = '';
                }
            }
            $str = '<input id="' . $id . '" class="' . $class . '" name="' . $name . '" type="' . $type . '" onchange="' . $input_on_change . '()" ' . $input_additional . '/>';
            $str .= '<a id="preview_' . $id . '" class="preview_image2" target="_blank" href="' . $img_additional_1 . '" ' . $img_additional_2 . '>  View File  </a>';
            $str .= ' <a id="delete_' . $id . '" class="btn btn-danger close_upload_btn2" onclick="' . $delete_on_click . '(); return false;" ' . $del_additional . ' state="' . $state . '" path="' . $path . '"><i class="fa fa-close"></i></a>';
        } else {
            $input_additional = $session->get($upload_data['upload_field_name2']) !== null ? 'style="display:none;color:white"' : '';
            $img_additional_1 = $session->get($upload_data['upload_field_name2']) !== null ? base_url() . $session->get($upload_data['upload_field_name2']) : '';
            $img_additional_2 = $session->get($upload_data['upload_field_name2']) !== null ? '' : 'style="display:none;color:blue"';
            $del_additional = $session->get($upload_data['upload_field_name2']) !== null ? '' : 'style="display:none;color:white"';
            $str = '<input id="' . $id . '" class="' . $class . '" name="' . $name . '" type="' . $type . '" onchange="' . $input_on_change . '()" ' . $input_additional . '/>';
            $str .= '<a id="preview_' . $id . '" class="preview_image2" target="_blank" href="' . $img_additional_1 . '" ' . $img_additional_2 . '>  View File  </a>';
            $str .= ' <a id="delete_' . $id . '" class="btn btn-danger close_upload_btn2" onclick="' . $delete_on_click . '(); return false;" ' . $del_additional . '><i class="fa fa-close"></i></a>';
        }
        return $str;
    }
}
if (!function_exists('dropdown_field')) {
    function dropdown_field($id, $class, $name, $selected, $dropdown_data, $additional = '')
    {
        $additional = 'class="' . $class . '" id="' . $id . '" ' . $additional;
        $select = '';
        $select .= form_dropdown($name, $dropdown_data, $selected, $additional);
        return $select;
    }
}
/**
 * ============ End of Helper untuk Elemen HTML Tag ==============
 */
/**
 * ============ Helper Tambahan untuk Form Add Edit ==============
 */
if (!function_exists('span_error')) {
    function span_error($column_name, $validation)
    {
        if ($validation->getError($column_name)) {
            return '<span class="error-text-form">' . $validation->getError($column_name) . '<br/><span>';
        }
    }
}
if (!function_exists('form_table_tag_open')) {
    function form_table_tag_open()
    {
        return '<table class="table">';
    }
}
if (!function_exists('form_table_tag_close')) {
    function form_table_tag_close()
    {
        return '</table>';
    }
}
/**
 * ============ End of Helper Tambahan untuk Form Add Edit ==============
 */
/**
 * ============ Helper untuk Halaman View Tabel Utama ==============
 */
if (!function_exists('form_content_table_tag_open')) {
    function form_content_table_tag_open($table_id, $table_class, $additional, $trash_session)
    {
        if ($trash_session) {
            $str_class = 'danger-table';
        } else {
            $str_class = 'info-table';
        }
        return '<table id="' . $table_id . '" class="' . $table_class . ' ' . $str_class . '" ' . $additional . '>';
    }
}
if (!function_exists('form_content_table_tag_close')) {
    function form_content_table_tag_close()
    {
        return '</table>';
    }
}
if (!function_exists('sort_order_panel')) {
    function sort_order_panel($trash_session, $sort, $sort_session, $order, $order_session)
    {
        if (!$trash_session) {
            $attr_sort = array('class' => 'form-control', 'id' => 'sort-control');
            $attr_order = array('class' => 'form-control', 'id' => 'order-control');
            $sort_dropdown = form_dropdown('sort-control', $sort, $sort_session, $attr_sort);
            $order_dropdown = form_dropdown('order-control', $order, $order_session, $attr_order);
            $html_sort = '<div class="row">
                            <div class="col-md-2 m-b-10"><label> Sort by:</label>' . $sort_dropdown . '</div>
                            <div class="col-md-2 m-b-10"><label> Order</label>' . $order_dropdown . '</div>
                        </div>';
            return $html_sort;
        }
    }
}
// custom for API Key Page
if (!function_exists('action_panel_key')) {
    function action_panel_key($trash_session, $url_action_table)
    {
        $html_action = '<div class="row">';
        if (!$trash_session) {
            $html_action .= '<div class="col-md-12 m-b-10">';
            $html_action .= action_button_top_key($url_action_table);
            $html_action .= '</div></div>';
        }
        return $html_action;
    }
}
if (!function_exists('action_button_top_key')) {
    function action_button_top_key($url)
    {
        return '<div class="actionbutton" class="input-group">
                    <span>
                        <a title = "Generate New API Key" href="' . $url['add'] . '" class="btn btn-success"><i class="fa fa-plus"></i> Generate New API Key</a>
                    </span>
</div > ';
    }
}
// custom for API Key Page
// custom for Profile User & order
if (!function_exists('action_panel_profile')) {
    function action_panel_profile($trash_session, $url_action_table)
    {
        $html_action = '<div class="row">';
        if (!$trash_session) {
            $html_action .= '<div class="col-md-12 m-b-10">';
            $html_action .= action_button_top_profile($url_action_table);
            $html_action .= '</div></div>';
        }
        return $html_action;
    }
}
if (!function_exists('action_button_top_profile')) {
    function action_button_top_profile($url)
    {
        return '<div id="actionbutton" class="input-group"></div > ';
    }
}
// custom for Profile User
if (!function_exists('action_panel')) {
    function action_panel($trash_session, $url_action_table)
    {
        $html_action = '';
        if (!$trash_session) {
            $html_action .= action_button_top($url_action_table);
        }
        return $html_action;
    }
}
if (!function_exists('action_button_top')) {
    function action_button_top($url)
    {
        return '<div id="actionbutton" style="margin-left:10px;"></div>
                <a href="' . $url['add'] . '" type="button" class="button-add btn btn-primary"><i class="bi bi-journal-plus"></i> Tambah</a>';
    }
}
if (!function_exists('action_panel_penjualan')) {
    function action_panel_penjualan($trash_session, $url_action_table)
    {
        $html_action = '';
        if (!$trash_session) {
            $html_action .= action_button_top_penjualan($url_action_table);
        }
        return $html_action;
    }
}
if (!function_exists('action_button_top_penjualan')) {
    function action_button_top_penjualan($url)
    {
        return '<div id="actionbutton" style="margin-left:10px;"></div>
                <a href="" type="button" class="button-add btn btn-primary ms-2" data-bs-toggle="modal" data-bs-target="#modalTandaTerima"><i class="bi bi-journal-plus"></i> Tambah</a>';
    }
}
if (!function_exists('keyword_search_panel')) {
    function keyword_search_panel($keyword_session, $url_action_table)
    {
        $form_open = form_open($url_action_table['search']);
        $form_close = form_close();
        $keyword = null !== $keyword_session ? $keyword_session : '';
        $html_search = $form_open . '<div class="input-group">
    <input name="keyword" class="form-control keyword" placeholder="Search Keyword..." value="' . $keyword . '">
    <span class="input-group-btn"><button title="Search" class="btn btn-info" type="submit"><i class="ti-search"></i></button></span>
    <span class="input-group-btn"><button title="Refresh Keyword" class="btn btn-info clear-keyword" type="button"><i class="ti-close"></i></button></span>
</div> ' . $form_close;
        return $html_search;
    }
}
if (!function_exists('trash_table_info')) {
    function trash_table_info($trash_session, $url_action_table)
    {
        if ($trash_session) {
            $str = '<a title="View Existing Data" href="' . $url_action_table['main'] . '" class="btn btn-light-primary">Lihat Data</a>';
        } else {
            $str = '<a title="View Deleted" href="' . $url_action_table['trash'] . '" class="btn btn-light-primary button-trash">Archive</a>';
        }
        return $str;
    }
}
// if (!function_exists('action_button_table')) {
//     function action_button_table($trash_session, $url, $id, $opennewtab = false)
//     {
//         $html_action_table = $target = '';
//         if ($opennewtab) {
//             $target = 'target="_blank"';
//         }
//         $html_action_table .= '<a href="#" class="btn btn-light btn-active-light-primary btn-sm" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end">Aksi
//                                     <i class="fas fa-chevron-down"></i>
//                                 </a>
//                                 <div class="me
//                                 nu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-bold fs-7 w-125px py-4" data-kt-menu="true">';
//         if ($trash_session) {
//             $html_action_table .= '<div class="menu-item px-3">
//                                         <a title="Restore" href = "' . $url['restore'] . $id . '" class="menu-link px-3">Kembalikan</a>
//                                     </div>
//                                     <div class="menu-item px-3">
//                                         <a title = "Delete Permanently" class="delete-action menu-link px-3" href = "' . $url['deletepermanent'] . $id . '">Hapus</a>
//                                     </div>';
//         } else {
//             $html_action_table .= '<div class="button-edit menu-item px-3">
//                                         <a class="menu-link px-3" ' . $target . ' title="Edit" href="' . $url['edit'] . $id . '">Ubah</a>
//                                     </div>
//                                     <div class="button-delete menu-item px-3">
//                                         <a class="delete-action menu-link px-3" title = "Delete" href="' . $url['delete'] . $id . '">Hapus</a>
//                                     </div>';
//         }
//         $html_action_table .= '</div>';
//         return $html_action_table;
//     }
// }
if (!function_exists('action_button_table')) {
    function action_button_table($trash_session, $url, $id, $opennewtab = false)
    {
        $html_action_table = $target = '';
        if ($opennewtab) {
            $target = 'target="_blank"';
        }
        if ($trash_session) {
            $html_action_table .= '
                <div class="menu-item">
                    <a title="Restore" href = "' . $url['restore'] . $id . '" >Kembalikan</a>
                </div>
                <div class="menu-item">
                    <a title = "Delete Permanently" class="delete-action" href = "' . $url['deletepermanent'] . $id . '">Hapus</a>
                </div>';
        } else {
            $html_action_table .= '
                <div class="d-flex action-list">
                    <div class="button-edit menu-item ">
                        <a ' . $target . ' title="Edit" class="badge badge-light-secondary" href="' . $url['edit'] . $id . '"><i class="fas fa-pen"></i></a>
                    </div>
                    <div class="button-delete menu-item">
                        <a class="delete-action badge badge-light-secondary" title="Delete" href="' . $url['delete'] . $id . '"><i class="fas fa-trash"></i></a>
                    </div>
                </div>';
        }
        return $html_action_table;
    }
}
if (!function_exists('action_button_table_icon_view')) {
    function action_button_table_icon_view($trash_session, $url, $id, $opennewtab = false)
    {
        $html_action_table = $target = '';
        if ($opennewtab) {
            $target = 'target="_blank"';
        }
        if ($trash_session) {
            $html_action_table .= '
                <div class="menu-item">
                    <a title="Restore" href = "' . $url['restore'] . $id . '" >Kembalikan</a>
                </div>
                <div class="menu-item">
                    <a title = "Delete Permanently" class="delete-action" href = "' . $url['deletepermanent'] . $id . '">Hapus</a>
                </div>';
        } else {
            $html_action_table .= '
                <div class="d-flex action-list">
                    <div class="button-edit menu-item ">
                        <a ' . $target . ' title="Edit" class="badge badge-light-secondary" href="' . $url['edit'] . $id . '"><i class="fas fa-eye"></i></a>
                    </div>
                    <div class="button-delete menu-item">
                        <a class="delete-action badge badge-light-secondary" title="Delete" href="' . $url['delete'] . $id . '"><i class="fas fa-trash"></i></a>
                    </div>
                </div>';
        }
        return $html_action_table;
    }
}
if (!function_exists('action_button_table_no_view')) {
    function action_button_table_no_view($trash_session, $url, $id, $opennewtab = false)
    {
        $html_action_table = $target = '';
        if ($opennewtab) {
            $target = 'target="_blank"';
        }
        if ($trash_session) {
            $html_action_table .= '<a title="Restore" href = "' . $url['restore'] . $id . '" ><i class="fa fa-arrow-up" ></i ></a><a title = "Delete Permanently" class="delete-action" href = "' . $url['deletepermanent'] . $id . '" ><i class="fa fa-remove"></i ></a>';
        } else {
            $html_action_table .= '<a class="button-edit" ' . $target . ' title="Edit" href="' . $url['edit'] . $id . '"><i class="fa fa-pencil"></i></a> <a class="button-delete" title = "Delete" class="delete-action" href="' . $url['delete'] . $id . '"><i class="fa fa-trash"></i></a>';
        }
        return $html_action_table;
    }
}
if (!function_exists('action_button_table_edit_only')) {
    function action_button_table_edit_only($trash_session, $url, $id, $opennewtab = false)
    {
        $html_action_table = $target = '';
        if ($opennewtab) {
            $target = 'target="_blank"';
        }
        if ($trash_session) {
            $html_action_table .= '<a title="Restore" href = "' . $url['restore'] . $id . '" ><i class="fa fa-arrow-up" ></i ></a><a title = "Delete Permanently" class="delete-action" href = "' . $url['deletepermanent'] . $id . '" ><i class="fa fa-remove"></i ></a>';
        } else {
            $html_action_table .= '<a class="button-edit" ' . $target . ' title="Edit" href="' . $url['edit'] . $id . '"><i class="fa fa-pencil"></i></a>';
        }
        return $html_action_table;
    }
}
//custom for profile page
if (!function_exists('action_button_table_custom')) {
    function action_button_table_custom($trash_session, $url, $id)
    {
        $html_action_table = '';
        if ($trash_session) {
            $html_action_table .= '<a title="Restore" href = "' . $url['restore'] . $id . '" ><i class="fa fa-arrow-up" ></i ></a><a title = "Delete Permanently" class="delete-action" href = "' . $url['deletepermanent'] . $id . '" ><i class="fa fa-remove"></i ></a>';
        } else {
            $html_action_table .= '<a title="Edit" href="' . $url['edit'] . $id . '"><i class="fa fa-pencil"></i></a> <a title="View" href="' . $url['view'] . $id . '"><i class="fa fa-eye"></i></a>';
        }
        return $html_action_table;
    }
}
//Helper SVG Icon
if (!function_exists('icon_export')) {
    function icon_export()
    {
        return '<span class="svg-icon svg-icon-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><rect opacity="0.3" x="12.75" y="4.25" width="12" height="2" rx="1" transform="rotate(90 12.75 4.25)" fill="currentColor" /><path d="M12.0573 6.11875L13.5203 7.87435C13.9121 8.34457 14.6232 8.37683 15.056 7.94401C15.4457 7.5543 15.4641 6.92836 15.0979 6.51643L12.4974 3.59084C12.0996 3.14332 11.4004 3.14332 11.0026 3.59084L8.40206 6.51643C8.0359 6.92836 8.0543 7.5543 8.44401 7.94401C8.87683 8.37683 9.58785 8.34458 9.9797 7.87435L11.4427 6.11875C11.6026 5.92684 11.8974 5.92684 12.0573 6.11875Z" fill="currentColor" /><path d="M18.75 8.25H17.75C17.1977 8.25 16.75 8.69772 16.75 9.25C16.75 9.80228 17.1977 10.25 17.75 10.25C18.3023 10.25 18.75 10.6977 18.75 11.25V18.25C18.75 18.8023 18.3023 19.25 17.75 19.25H5.75C5.19772 19.25 4.75 18.8023 4.75 18.25V11.25C4.75 10.6977 5.19771 10.25 5.75 10.25C6.30229 10.25 6.75 9.80228 6.75 9.25C6.75 8.69772 6.30229 8.25 5.75 8.25H4.75C3.64543 8.25 2.75 9.14543 2.75 10.25V19.25C2.75 20.3546 3.64543 21.25 4.75 21.25H18.75C19.8546 21.25 20.75 20.3546 20.75 19.25V10.25C20.75 9.14543 19.8546 8.25 18.75 8.25Z" fill="#C4C4C4" /></svg></span>';
    }
}
if (!function_exists('icon_search')) {
    function icon_search()
    {
        return '<span class="svg-icon svg-icon-1 position-absolute ms-6"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><rect opacity="0.5" x="17.0365" y="15.1223" width="8.15546" height="2" rx="1" transform="rotate(45 17.0365 15.1223)" fill="currentColor"/><path d="M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z" fill="currentColor"/></svg></span>';
    }
}
if (!function_exists('icon_filter')) {
    function icon_filter()
    {
        return '<span class="svg-icon svg-icon-5 svg-icon-gray-500 me-1"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M19.0759 3H4.72777C3.95892 3 3.47768 3.83148 3.86067 4.49814L8.56967 12.6949C9.17923 13.7559 9.5 14.9582 9.5 16.1819V19.5072C9.5 20.2189 10.2223 20.7028 10.8805 20.432L13.8805 19.1977C14.2553 19.0435 14.5 18.6783 14.5 18.273V13.8372C14.5 12.8089 14.8171 11.8056 15.408 10.964L19.8943 4.57465C20.3596 3.912 19.8856 3 19.0759 3Z" fill="currentColor" /></svg></span>';
    }
}
/**
 * ============ End of Helper untuk Halaman View Utama ==============
 */