<div class="row">
    <div class="col-lg-8">
        <div class="card glass-card">
            <div class="card-header"><h5 class="card-title">Edit Loyalty Points</h5></div>
            <div class="card-body">
                <form method="POST" action="<?= url('loyalty/loyalty/update/' . $entry->id) ?>" class="needs-validation" novalidate>
                    <?= csrf_field() ?>
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Customer</label>
                            <input type="text" class="form-control" value="<?= e($entry->customer_name ?? '') ?>" disabled>
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Points <span class="text-danger">*</span></label>
                            <input type="number" name="points" class="form-control" required min="1" value="<?= $entry->points ?>">
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Type</label>
                            <select name="type" class="form-select">
                                <option value="earned" <?= $entry->type === 'earned' ? 'selected' : '' ?>>Earned</option>
                                <option value="redeemed" <?= $entry->type === 'redeemed' ? 'selected' : '' ?>>Redeemed</option>
                                <option value="expired" <?= $entry->type === 'expired' ? 'selected' : '' ?>>Expired</option>
                            </select>
                        </div>
                        <div class="col-12 mb-3">
                            <label class="form-label">Notes</label>
                            <textarea name="notes" class="form-control" rows="2"><?= e($entry->notes ?? '') ?></textarea>
                        </div>
                    </div>
                    <button type="submit" class="btn btn-gold"><i class="fas fa-save me-1"></i>Update</button>
                    <a href="<?= url('loyalty/loyalty') ?>" class="btn btn-ghost ms-2">Cancel</a>
                </form>
            </div>
        </div>
    </div>
</div>
