

<?php $__env->startSection('content'); ?>
<!-- content @s -->
                <div class="nk-content nk-content-fluid">
                    <div class="container-xl wide-lg">
                        <div class="nk-content-body">
                            <div class="components-preview wide-md mx-auto">
                                <div class="nk-block-head nk-block-head-lg wide-sm">
                                    <div class="nk-block-head-content">
                                        <div class="nk-block-head-sub"><a class="back-to" href="<?php echo e(url('admin/coins')); ?>"><em class="icon ni ni-arrow-left"></em><span>Coin/Wallet List</span></a></div>
                                        <h2 class="nk-block-title fw-normal">Coin/Wallet Details</h2>
                                        <div class="nk-block-des">
                                            <p class="lead">Update/Modify Your coin/wallet details.</p>
                                        </div>
                                    </div>
                                </div><!-- .nk-block-head -->
                                <div class="nk-block nk-block-lg">
                                     
                                    <div class="card card-bordered card-preview">
                                        <div class="card-inner">
                                            <div class="preview-block">
                                                <span class="preview-title-lg overline-title">Coin Details</span>
                                                
                                        <form action="<?php echo e(isset($coin) ? route('admin.updateCoin', $coin->id) : route('admin.storeCoin')); ?>" method="POST">
    <?php echo csrf_field(); ?>
    <?php if(isset($coin)): ?>
        <?php echo method_field('PUT'); ?>
    <?php endif; ?>        
    
    <div class="row gy-4">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="form-label" for="default-01">Coin Name</label>
                <div class="form-control-wrap">
                    <input type="text" class="form-control" id="default-01" name="name" value="<?php echo e($coin->name ?? ''); ?>" required>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="form-label" for="default-01">Coin ShortName</label>
                <div class="form-control-wrap">
                    <input type="text" class="form-control" id="default-01" name="sname" value="<?php echo e($coin->sname ?? ''); ?>" required>
                </div>
            </div>
        </div>
        <div class="col-sm-12">
            <div class="form-group">
                <label class="form-label" for="default-05">Coin Icon URL</label>
                <div class="form-control-wrap">
                    <input type="text" class="form-control" id="default-05" name="icon" value="<?php echo e($coin->icon ?? ''); ?>" required>
                </div>
            </div>
        </div>
        <div class="col-sm-12">
            <div class="form-group">
                <label class="form-label" for="default-03">Coin Wallet Address</label>
                <div class="form-control-wrap">
                    <input type="text" class="form-control" id="default-03" name="wallet_address" value="<?php echo e($coin->wallet_address ?? ''); ?>" required>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="form-label" for="default-textarea">Coin Symbol</label>
                <div class="form-control-wrap">
                    <input type="text" class="form-control" id="symbol" name="symbol" value="<?php echo e($coin->symbol ?? ''); ?>" required>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
    <div class="form-group">
        <label class="form-label" for="customcoin">Custom Coin</label>
        <div class="form-control-wrap">
            <div class="form-control-select">
                <select name="customcoin" id="customcoin" class="form-control" onchange="togglePriceFields()">
                    <option value="0" <?php echo e($coin->customcoin == '0' ? 'selected' : ''); ?>>NO</option>
                    <option value="1" <?php echo e($coin->customcoin == '1' ? 'selected' : ''); ?>>YES</option>
                </select>
            </div>
        </div>
    </div>
</div>

<div class="col-sm-6 box" id="customCoinPrice" style="display: none;">
    <div class="form-group">
        <label class="form-label" for="customprice">Custom Coin Price (<?php echo e($currency); ?>)</label>
        <div class="form-control-wrap">
            <input type="text" class="form-control" id="customprice" name="customprice" value="<?php echo e($coin->customprice ?? ''); ?>">
        </div>
    </div>
</div>

<div class="col-sm-6 box" id="latestPrice" style="display: none;">
    <div class="form-group">
        <label class="form-label" for="latest_price">Latest Price (<?php echo e($currency); ?>)</label>
        <div class="form-control-wrap">
            <input type="text" class="form-control" id="latest_price" name="latest_price" value="<?php echo e($coin->latest_price ?? ''); ?>">
        </div>
    </div>
</div>

<script>
    function togglePriceFields() {
        const customcoin = document.getElementById('customcoin').value;
        const customCoinPrice = document.getElementById('customCoinPrice');
        const latestPrice = document.getElementById('latestPrice');

        if (customcoin === '1') {
            customCoinPrice.style.display = 'block';
            latestPrice.style.display = 'none';
        } else {
            customCoinPrice.style.display = 'none';
            latestPrice.style.display = 'block';
        }
    }

    // Initialize the visibility on page load
    document.addEventListener('DOMContentLoaded', togglePriceFields);
</script>

        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="fv-phone">Status</label>
                <div class="form-control-wrap">
                    <ul class="custom-control-group">
                        <li>
                            <div class="custom-control custom-radio custom-control-pro no-control">
                                <input type="radio" class="custom-control-input" name="status" id="active" value="active" required <?php if($coin->status == 'active'): ?> checked <?php endif; ?>>
                                <label class="custom-control-label" for="active">Active</label>
                            </div>
                        </li>
                        <li>
                            <div class="custom-control custom-radio custom-control-pro no-control">
                                <input type="radio" class="custom-control-input" name="status" id="inactive" value="inactive" required <?php if($coin->status == 'inactive'): ?> checked <?php endif; ?>>
                                <label class="custom-control-label" for="inactive">InActive</label>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="fv-phone">Feature Coin</label>
                <div class="form-control-wrap">
                    <ul class="custom-control-group">
                        <li>
                            <div class="custom-control custom-radio custom-control-pro no-control">
                                <input type="radio" class="custom-control-input" name="featurecoin" id="yes" value="1" required <?php if($coin->featurecoin == '1'): ?> checked <?php endif; ?>>
                                <label class="custom-control-label" for="yes">Yes</label>
                            </div>
                        </li>
                        <li>
                            <div class="custom-control custom-radio custom-control-pro no-control">
                                <input type="radio" class="custom-control-input" name="featurecoin" id="no" value="0" required <?php if($coin->featurecoin == '0'): ?> checked <?php endif; ?>>
                                <label class="custom-control-label" for="no">No</label>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="col-sm-12">
            <div class="form-group">
                <label class="form-label" for="default-03">Coin Wallet Address</label>
                <div class="form-control-wrap">
                    <textarea type="text" class="form-control" id="default-03" name="description" required><?php echo e($coin->description ?? ''); ?></textarea>
                </div>
            </div>
        </div>
    </div>
    <hr class="preview-hr">
    
    <button type="submit" class="btn btn-primary"><?php echo e(isset($coin) ? 'Update' : 'Create'); ?></button>
</form>

                                            </div>
                                        </div>
                                    </div><!-- .card-preview -->
                                     
                                </div><!-- .nk-block -->
                                
                                
                                
                                
                                
                                
                                
                                
                            </div><!-- .components-preview -->
                        </div>
                    </div>
                </div>
                <!-- content @e -->
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/qfsworl3/public_html/resources/views/admin/editCoin.blade.php ENDPATH**/ ?>