<div class="modal-header flex items-center justify-between border-b border-border px-4 py-3">
    <?php
    if ($status == '1') {
        $text = lang('pending');
    } elseif ($status == '2') {
        $approved = true;
        $text = lang('approved');
    } else {
        $status = 3;
        $text = lang('rejected');
    }
    ?>
    <h4 class="text-sm font-semibold text-foreground">
        <?= lang('change') . ' ' . lang('status') . ' ' . lang('leave_to') . ' ' . $text ?>
    </h4>
    <button type="button" class="text-muted-foreground hover:text-foreground" data-dismiss="modal" aria-label="<?= lang('close') ?>">
        <i data-lucide="x" class="h-4 w-4"></i>
    </button>
</div>
<div class="modal-body p-4">
    <form id="form_validation"
          action="<?php echo base_url() ?>admin/payroll/set_salary_status/<?php if (!empty($advance_salary->advance_salary_id)) echo $advance_salary->leave_application_id; ?>"
          method="post" class="space-y-4">

        <?= form_textarea_group('comment', lang('give_comment'), $advance_salary->comments, 3, false); ?>

        <input type="hidden" name="status" value="<?php echo $status ?>">
        <input type="hidden" name="approve_by" value="<?php echo $this->session->userdata('user_id') ?>">

        <div class="flex items-center justify-end gap-2 border-t border-border pt-3">
            <button type="button" class="inline-flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-semibold text-foreground hover:bg-muted" data-dismiss="modal">
                <i data-lucide="x" class="h-4 w-4"></i>
                <?= lang('close') ?>
            </button>
            <button type="submit" <?php if (!empty($approved)) { ?>onclick="return confirm('<?= lang('delete_alert') ?>')"<?php } ?>
                    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="check" class="h-4 w-4"></i>
                <?= lang('update') ?>
            </button>
        </div>
    </form>
</div>
