<div class="row">
    <div class="col-lg-8">
        <div class="card glass-card">
            <div class="card-header"><h5 class="card-title">Edit Petty Cash Entry</h5></div>
            <div class="card-body">
                <form method="POST" action="<?= url('accounting/pettycash/update/' . $entry->id) ?>" class="needs-validation" novalidate>
                    <?= csrf_field() ?>
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Amount <span class="text-danger">*</span></label>
                            <input type="number" step="0.01" name="amount" class="form-control" required value="<?= $entry->amount ?>">
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Date <span class="text-danger">*</span></label>
                            <input type="date" name="date" class="form-control" required value="<?= $entry->date ?>">
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Fund Source</label>
                            <input type="text" name="fund_source" class="form-control" value="<?= e($entry->fund_source ?? '') ?>">
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Status</label>
                            <select name="status" class="form-select">
                                <option value="pending" <?= $entry->status === 'pending' ? 'selected' : '' ?>>Pending</option>
                                <option value="approved" <?= $entry->status === 'approved' ? 'selected' : '' ?>>Approved</option>
                                <option value="rejected" <?= $entry->status === 'rejected' ? 'selected' : '' ?>>Rejected</option>
                            </select>
                        </div>
                        <div class="col-12 mb-3">
                            <label class="form-label">Description <span class="text-danger">*</span></label>
                            <textarea name="description" class="form-control" rows="2" required><?= e($entry->description) ?></textarea>
                        </div>
                    </div>
                    <button type="submit" class="btn btn-gold"><i class="fas fa-save me-1"></i>Update Entry</button>
                    <a href="<?= url('accounting/pettycash') ?>" class="btn btn-ghost ms-2">Cancel</a>
                </form>
            </div>
        </div>
    </div>
</div>
