<div class="header">
    <h1>Edit gas kit add-on</h1>
</div>
<?php if (session('message')): ?>
<p class="message"><?= esc(session('message')) ?></p>
<?php endif ?>
<?php if (session('error')): ?>
<p class="error"><?= esc(session('error')) ?></p>
<?php endif ?>
<form method="post" action="<?= base_url('admin/gas-kit-addons/update/' . $addon->id) ?>">
    <input type="hidden" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>">
    <p>
        <label>Name</label><br>
        <input type="text" name="name" value="<?= esc(old('name', $addon->name)) ?>" required>
    </p>
    <p>
        <label>Price (UGX)</label><br>
        <input type="number" name="price" value="<?= esc(old('price', (string)(float)$addon->price)) ?>" step="0.01" min="0">
    </p>
    <p>
        <label>Sort order</label><br>
        <input type="number" name="sort_order" value="<?= esc(old('sort_order', (string)(int)$addon->sort_order)) ?>">
    </p>
    <p>
        <button type="submit" class="btn btn-primary">Save</button>
        <a href="<?= base_url('admin/gas-kit-addons') ?>" class="btn btn-secondary">Cancel</a>
    </p>
</form>
