<?php $__env->startSection('content'); ?>
<div class="row justify-content-center">
    <div class="col-lg-6">
        <div class="card">
            <div class="card-header">
                <h5 class="card-title mb-0">Record Borrow</h5>
            </div>
            <div class="card-body">
                <form method="POST" action="<?php echo e(route('borrows.store')); ?>">
                    <?php echo csrf_field(); ?>
                    <div class="row g-3">
                        <div class="col-md-12">
                            <label class="form-label" for="agent_id">Agent</label>
                            <select class="form-select" id="agent_id" name="agent_id" required>
                                <option value="">Select agent</option>
                                <?php $__currentLoopData = $agents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $agent): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($agent->id); ?>" <?php if(old('agent_id') == $agent->id): echo 'selected'; endif; ?>>
                                        <?php echo e($agent->name); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="col-md-12">
                            <label class="form-label" for="currency_id">Currency to Borrow</label>
                            <select class="form-select" id="currency_id" name="currency_id" required>
                                <option value="">Select currency</option>
                                <?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') == $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="col-md-12">
                            <label class="form-label" for="target_account_id">Target Account (To receive borrowed currency)</label>
                            <select class="form-select" id="target_account_id" name="target_account_id" required>
                                <option value="">Select target account</option>
                                <?php $__currentLoopData = $accounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $account): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($account->id); ?>" <?php if(old('target_account_id') == $account->id): echo 'selected'; endif; ?>>
                                        <?php echo e($account->name); ?> - <?php echo e(number_format((float) $account->balance, 2)); ?> <?php echo e($account->currency->code); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="col-md-12">
                            <label class="form-label" for="date">Transaction Date</label>
                            <input type="date" class="form-control" id="date" name="date" value="<?php echo e(old('date', now()->format('Y-m-d'))); ?>" required>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label" for="quantity">Quantity Borrowed</label>
                            <input class="form-control text-end atm-decimal" id="quantity" name="quantity" inputmode="numeric" placeholder="0.00" value="<?php echo e(old('quantity')); ?>" required>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label" for="rate">Agreed Rate</label>
                            <input class="form-control text-end atm-decimal" id="rate" name="rate" inputmode="numeric" placeholder="0.00" value="<?php echo e(old('rate')); ?>" required>
                        </div>
                    </div>
                    <div class="d-flex justify-content-end mt-4">
                        <button class="btn btn-primary" type="submit">Save Borrow</button>
                    </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/borrows/create.blade.php ENDPATH**/ ?>