<?= message_box('success'); ?>
<?= message_box('error');
$created = can_action('95', 'created');
$edited = can_action('95', 'edited');
$deleted = can_action('95', 'deleted');
if (!empty($created) || !empty($edited)) {
?>
<div class="space-y-4">
    <div class="rounded-2xl border border-border bg-card shadow-sm">
        <div class="p-5">
            <form data-parsley-validate="" novalidate="" role="form" enctype="multipart/form-data"
                  action="<?php echo base_url() ?>admin/payroll/set_hourly_rate/<?php
                    if (!empty($hourly_rate->hourly_rate_id)) {
                        echo $hourly_rate->hourly_rate_id;
                    }
                    ?>" method="post" class="space-y-4">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                    <?= form_input_group('hourly_grade', lang('hourly_grade'), !empty($hourly_rate->hourly_grade) ? $hourly_rate->hourly_grade : '', 'text', true); ?>
                    <?= form_input_group('hourly_rate', lang('hourly_rates'), !empty($hourly_rate->hourly_rate) ? $hourly_rate->hourly_rate : '', 'text', true, array('data-parsley-type' => 'number', 'class' => 'salary')); ?>
                </div>

                <div class="flex items-center justify-end gap-2 pt-2">
                    <?php if (!empty($hourly_rate)) { ?>
                        <button type="submit" 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('updates') ?>
                        </button>
                        <a href="<?= base_url('admin/payroll/hourly_rate') ?>" 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">
                            <i data-lucide="x" class="h-4 w-4"></i>
                            <?= lang('cancel') ?>
                        </a>
                    <?php } else { ?>
                        <button type="submit" 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>
                    <?php } ?>
                </div>
            </form>
        </div>
    </div>
</div>
<?php } ?>
