<?php $__env->startSection('content'); ?>
<div class="row justify-content-center">
    <div class="col-lg-6">
        <div class="card">
            <div class="card-body">
                <h1 class="h4 mb-3">Edit Account</h1>
                <form method="POST" action="<?php echo e(route('accounts.update', $account)); ?>">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('PUT'); ?>
                    <div class="mb-3">
                        <label class="form-label" for="name">Name</label>
                        <input class="form-control" id="name" name="name" value="<?php echo e(old('name', $account->name)); ?>" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label" for="currency_id">Currency</label>
                        <select class="form-select" id="currency_id" name="currency_id" required>
                            <?php $__currentLoopData = $currencies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $currency): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($currency->id); ?>" <?php if(old('currency_id', $account->currency_id) == $currency->id): echo 'selected'; endif; ?>>
                                    <?php echo e($currency->code); ?> - <?php echo e($currency->name); ?>

                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                    <div class="mb-3">
                        <label class="form-label" for="type">Type</label>
                        <select class="form-select" id="type" name="type" required>
                            <option value="bank" <?php if(old('type', $account->type) === 'bank'): echo 'selected'; endif; ?>>Bank</option>
                            <option value="cash" <?php if(old('type', $account->type) === 'cash'): echo 'selected'; endif; ?>>Cash</option>
                        </select>
                    </div>
                    <div class="d-flex gap-2">
                        <button class="btn btn-primary" type="submit">Update Account</button>
                        <a class="btn btn-outline-secondary" href="<?php echo e(route('accounts.index')); ?>">Cancel</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH F:\christopher\currencychangerui\resources\views/accounts/edit.blade.php ENDPATH**/ ?>