<form data-parsley-validate="" novalidate="" role="form" enctype="multipart/form-data"
      action="<?= base_url() ?>admin/award/save_employee_award/<?php if (!empty($award_info->employee_award_id)) { echo $award_info->employee_award_id; } ?>"
      method="post" class="s grid grid-cols-1 gap-4 md:grid-cols-2">

    <?php
    $selected_user_id = !empty($award_info->user_id) ? $award_info->user_id : '';
    $employee_options = array('' => lang('select_employee') . '...');
    if (!empty($all_employee)) {
        foreach ($all_employee as $dept_name => $v_all_employee) {
            if (!empty($v_all_employee)) {
                foreach ($v_all_employee as $v_employee) {
                    $employee_options[$v_employee->user_id] = $dept_name . ' - ' . $v_employee->fullname . ' ( ' . $v_employee->designations . ' )';
                }
            }
        }
    }
    ?>

    <?= form_select_group('user_id', lang('employee'), $employee_options, $selected_user_id, true, array('class' => 'select_box', 'style' => 'width:100%')) ?>

    <?= form_input_group('award_name', lang('award_name'), !empty($award_info->award_name) ? $award_info->award_name : '', 'text', true) ?>

    <?= form_input_group('gift_item', lang('gift_item'), !empty($award_info->gift_item) ? $award_info->gift_item : '', 'text', false) ?>

    <?= form_input_group('award_amount', lang('cash_price'), !empty($award_info->award_amount) ? $award_info->award_amount : '', 'number', false, array('step' => '0.01', 'min' => '0')) ?>

    <?= form_datepicker('award_date', lang('select') . ' ' . lang('month'), !empty($award_info->award_date) ? $award_info->award_date : date('Y-m'), true, array('class' => 'monthyear', 'data-type' => 'month', 'data-format' => 'Y-m', 'data-auto-close' => 'true')) ?>

    <?= form_datepicker('given_date', lang('award_date'), !empty($award_info->given_date) ? $award_info->given_date : date('Y-m-d'), true, array('data-format' => 'Y-m-d')) ?>

    <div class="flex items-center justify-start gap-2">
        <button id="sbtn" type="submit" name="sbtn" value="1"
                class="inline-flex items-center gap-2 rounded-lg bg-indigo-600 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-indigo-500">
            <i data-lucide="save" class="h-4 w-4"></i>
            <?= lang('save') ?>
        </button>
    </div>
</form>
