
<?php $__env->startSection('content'); ?>
    <div class="page-container">

        <div class="page-title-head d-flex align-items-sm-center flex-sm-row flex-column gap-2">
            <div class="flex-grow-1">
                <h4 class="fs-18 fw-semibold mb-0"><?php echo e($title); ?></h4>
            </div>

            <div class="text-end">
                <?php echo $__env->make('dashboard.user.layouts.components.breadcrumbs', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            </div>
        </div>

        <div class="row">
            <?php echo $__env->make('dashboard.user.components.menu', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        <?php if($deposit == 'Card'): ?>
                            
                            <p class="text-muted">
                                Enter your card details to make a deposit. All fields marked with an asterisk (*) are
                                required.
                            </p>
                            <form method="POST" action="<?php echo e(route('user.deposit.card.store')); ?>">
                                <?php echo csrf_field(); ?>
                                <div class="row">
                                    <div class="col-lg-6">
                                        <div class="mb-3">
                                            <label for="amount" class="form-label">Amount
                                                (<?php echo e(currency($user->currency)); ?>)
                                                *</label>
                                            <input type="number" id="amount" name="amount"
                                                class="form-control <?php $__errorArgs = ['amount'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                                value="<?php echo e(old('amount')); ?>" min="1" step="0.01" required>
                                            <?php $__errorArgs = ['amount'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class="invalid-feedback"><?php echo e($message); ?></span>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>

                                        <div class="mb-3">
                                            <input type="hidden" id="method" name="method" class="form-control"
                                                value="card" readonly>
                                        </div>

                                        <div class="mb-3">
                                            <label for="card_number" class="form-label">Card Number *</label>
                                            <input type="text" id="card_number" name="card_number"
                                                class="form-control <?php $__errorArgs = ['card_number'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                                value="<?php echo e(old('card_number')); ?>" placeholder="1234 5678 9012 3456" required>
                                            <?php $__errorArgs = ['card_number'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class="invalid-feedback"><?php echo e($message); ?></span>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>
                                    </div> <!-- end col -->

                                    <div class="col-lg-6">
                                        <div class="mb-3">
                                            <label for="cvv" class="form-label">CVV *</label>
                                            <input type="text" id="cvv" name="cvv"
                                                class="form-control <?php $__errorArgs = ['cvv'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                                value="<?php echo e(old('cvv')); ?>" placeholder="123" required>
                                            <?php $__errorArgs = ['cvv'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class="invalid-feedback"><?php echo e($message); ?></span>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>

                                        <div class="mb-3">
                                            <label for="card_expiry_date" class="form-label">Card Expiry Date (MM/YY)
                                                *</label>
                                            <input type="text" id="card_expiry_date" name="card_expiry_date"
                                                class="form-control <?php $__errorArgs = ['card_expiry_date'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                                value="<?php echo e(old('card_expiry_date')); ?>" placeholder="12/25" required>
                                            <?php $__errorArgs = ['card_expiry_date'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class="invalid-feedback"><?php echo e($message); ?></span>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>
                                    </div> <!-- end col -->
                                </div> <!-- end row -->

                                <div class="row">
                                    <div class="col-12">
                                        <button type="submit" class="btn btn-primary">Submit Deposit</button>
                                        <a href="<?php echo e(route('user.deposit.index')); ?>" class="btn btn-light">Cancel</a>
                                    </div>
                                </div>
                            </form>
                            
                        <?php else: ?>
                            
                            <p class="text-muted">
                                Send your Bitcoin payment to the address below or scan the QR code with your wallet. Enter
                                the deposit amount and optionally upload proof of the transaction (e.g., transaction ID or
                                screenshot). All fields marked with an asterisk (*) are required.
                            </p>
                            <form method="POST" action="<?php echo e(route('user.deposit.bitcoin.store')); ?>"
                                enctype="multipart/form-data">
                                <?php echo csrf_field(); ?>
                                <div class="row">
                                    <div class="col-lg-6">
                                        <div class="mb-3">
                                            <label for="wallet_address" class="form-label">Bitcoin Wallet Address *</label>
                                            <div class="input-group">
                                                <input type="text" id="wallet_address" name="wallet_address"
                                                    class="form-control" value="<?php echo e($admin->btc_address); ?>" readonly>
                                                <button type="button" class="btn btn-outline-secondary"
                                                    onclick="copyToClipboard('wallet_address')" title="Copy address">
                                                    <i class="ti ti-copy"></i>
                                                </button>
                                            </div>
                                        </div>

                                        <div class="mb-3">
                                            <label class="form-label">QR Code</label><br>
                                            <?php if($admin->btc_qr_code): ?>
                                                <img src="<?php echo e(asset($admin->btc_qr_code)); ?>" alt="Bitcoin QR Code"
                                                    style="max-width: 200px;">
                                            <?php else: ?>
                                                <?php echo e($qrCode); ?>

                                            <?php endif; ?>

                                        </div>

                                        <div class="mb-3">
                                            <label for="amount" class="form-label">Amount
                                                (<?php echo e(currency($user->currency)); ?>) *</label>
                                            <input type="number" id="amount" name="amount"
                                                class="form-control <?php $__errorArgs = ['amount'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                                value="<?php echo e(old('amount')); ?>" min="1" step="0.01" required>
                                            <?php $__errorArgs = ['amount'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class="invalid-feedback"><?php echo e($message); ?></span>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>

                                        <div class="mb-3">
                                            <input type="hidden" id="method" name="method" class="form-control"
                                                value="bitcoin" readonly>
                                        </div>
                                    </div> <!-- end col -->

                                    <div class="col-lg-6">
                                        <div class="mb-3">
                                            <label for="proof" class="form-label">Transaction Proof (JPG,
                                                PNG)</label>
                                            <input type="file" id="proof" name="proof"
                                                class="form-control <?php $__errorArgs = ['proof'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                                accept=".jpg,.jpeg,.png">
                                            <?php $__errorArgs = ['proof'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class="invalid-feedback"><?php echo e($message); ?></span>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>
                                    </div> <!-- end col -->
                                </div> <!-- end row -->

                                <div class="row">
                                    <div class="col-12">
                                        <button type="submit" class="btn btn-primary">Submit Deposit</button>
                                        <a href="<?php echo e(route('user.deposit.index')); ?>" class="btn btn-light">Cancel</a>
                                    </div>
                                </div>
                            </form>
                            
                        <?php endif; ?>
                    </div><!-- end card-body -->
                </div><!-- end card -->
            </div>

        </div>

    </div>

    <script>
        function copyToClipboard(elementId) {
            const input = document.getElementById(elementId);
            navigator.clipboard.writeText(input.value).then(() => {
                alert('Bitcoin address copied to clipboard!');
            }).catch(err => {
                console.error('Failed to copy: ', err);
                alert('Failed to copy address. Please try again.');
            });
        }
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('dashboard.user.layouts.master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\projects\online-banking-v6.0\resources\views/dashboard/user/deposit/create.blade.php ENDPATH**/ ?>