<?php $__env->startSection('content'); ?>
<script type="text/javascript">
    if (window.performance && window.performance.navigation.type == window.performance.navigation.TYPE_BACK_FORWARD) {
        location.reload();
    }
</script>
 <div class="nk-content">
                        <div class="container-fluid">                            <div class="nk-content-body">
                                <div class="buysell widse-xs m-aussto">
                                <br><br><br>

                                    <div class="buysell-block">
                                     <div class="buysell-title text-center"><h4 class="title text-primary">Convert Airtime To Cash</h4><small><b>Fill the form below to intiate your airtime convestion process<br>Your deposit wallet will be credited once transaction is approved.</small></div>
                                        <form method="post" autocomplete="off" class="buysell-form" action="<?php echo e(route('convertairtimepost')); ?>">
                                        <?php echo csrf_field(); ?>
                                        <input autocomplete="false" name="hidden" type="text" style="display:none;">
                                            <div class="buysell-field form-group">
                                                  <div class="invest-field form-group">
                                                    <div class="form-label-group"><label class="form-label">Select Amount</label></div>


                                                     <script type="text/javascript">

                                                        function goDoSomething1(identifier){

                                                  document.getElementById("amount").value = $(identifier).data('amount');
                                                   }

                                                    </script>

                                                    <div class="invest-amount-group g-2">
                                                        
                                                        <div class="invest-amount-item">
                                                            <input type="radio" class="invest-amount-control" onclick="goDoSomething1(this);"  data-amount="1000" name="iv-amount" id="iv-amount-4" /><label class="invest-amount-label" for="iv-amount-4"><?php echo e($basic->currency_sym); ?> 1,000</label>
                                                        </div>
                                                        <div class="invest-amount-item">
                                                            <input type="radio" class="invest-amount-control" onclick="goDoSomething1(this);"  data-amount="1500" name="iv-amount" id="iv-amount-5" /><label class="invest-amount-label" for="iv-amount-5"><?php echo e($basic->currency_sym); ?> 1,500</label>
                                                        </div>
                                                        <div class="invest-amount-item">
                                                            <input type="radio" class="invest-amount-control" onclick="goDoSomething1(this);"  data-amount="2000" name="iv-amount" id="iv-amount-6" /><label class="invest-amount-label" for="iv-amount-6"><?php echo e($basic->currency_sym); ?> 2,000</label>
                                                        </div>
                                                        
                                                        <div class="invest-amount-item">
                                                            <input type="radio" class="invest-amount-control" onclick="goDoSomething1(this);"  data-amount="2500" name="iv-amount" id="iv-amount-7" /><label class="invest-amount-label" for="iv-amount-7"><?php echo e($basic->currency_sym); ?> 2,500</label>
                                                        </div>        
                                                        <div class="invest-amount-item">
                                                            <input type="radio" class="invest-amount-control" onclick="goDoSomething1(this);"  data-amount="3000" name="iv-amount" id="iv-amount-8" /><label class="invest-amount-label" for="iv-amount-8"><?php echo e($basic->currency_sym); ?> 3000</label>
                                                        </div>         
                                                        <div class="invest-amount-item">
                                                            <input type="radio" class="invest-amount-control" onclick="goDoSomething1(this);"  data-amount="5000" name="iv-amount" id="iv-amount-9" /><label class="invest-amount-label" for="iv-amount-9"><?php echo e($basic->currency_sym); ?> 5000</label>
                                                        </div>
                                                    </div>
                                                </div>
                                                </div>
                                            </div><br>

                                            <div class="buysell-field form-group">
                                                <script type="text/javascript">

                                                        function goDoSomethingnet(identifier){

        document.getElementById("network").innerHTML = $(identifier).data('network');
         document.getElementById("name").innerHTML = $(identifier).data('network');
       
       document.getElementById("rate").innerHTML = $(identifier).data('rate')+"%";
        document.getElementById("rate2").innerHTML = $(identifier).data('rate')+"%";
        document.getElementById("number").innerHTML = $(identifier).data('number');
        
         var amount = $('#amount').val() ;
        document.getElementById("toconvert").innerHTML = amount+"<?php echo e($basic->currency_sym); ?>";
        
         document.getElementById("ratecharge").innerHTML = amount*$(identifier).data('rate')/100+"<?php echo e($basic->currency_sym); ?>";
    
        var charge = amount*$(identifier).data('rate')/100;
         document.getElementById("pay").innerHTML = amount - charge +"<?php echo e($basic->currency_sym); ?>";
          }

                                                    </script>
                                                    
                                                     <script>
                                    function myFunction() {
                                    
                                    };
                                    </script>


                                            
                                                <div class="form-label-group"><label class="form-label" for="buysell-amount">Or Enter Amount Directly</label></div>
                                                <div class="form-control-group">
                                                    <input type="number" class="form-control form-control-lg form-control-number" id="amount" onkeyup="goDoSomethingnet(identifier)"   name="amount" placeholder="0.00" />
                                                    <div class="form-dropdown">
                                                        <div class="text"><?php echo e($basic->currency_sym); ?><span></span></div>

                                                    </div>
                                                </div>
                                      
                                                 
                                            </div>


                                             <div class="buysell-field form-group">
                                                <div class="form-label-group"><label class="form-label" for="buysell-amount">Enter Phone Number</label></div>
                                                <div class="form-control-group">
                                                    <input type="number" class="form-control form-control-lg form-control-number"   name="phone" placeholder="+2341234567890" />
                                                    <small>The phone number you are sending the airtime from</small>

                                                </div>
                                             </div>
                                             
                                             <div class="buysell-field form-group">
                                                <div class="form-label-group"><label class="form-label" for="buysell-amount">Confirm Phone Number</label></div>
                                                <div class="form-control-group">
                                                    <input type="number" class="form-control form-control-lg form-control-number"   name="phone2" placeholder="+2341234567890" />

                                                </div>
                                             </div>
                                            <div class="buysell-field form-group">
                                                <div class="form-label-group"><label class="form-label">Network</label></div>
                                                <div class="form-pm-group">
                                                    <ul class="buysell-pm-list">
                                                    <?php $__currentLoopData = $network; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <li class="buysell-pm-item" onclick="goDoSomethingnet(this);" data-network="<?php echo e($data->name); ?>" data-rate="<?php echo e($data->rate); ?>" data-number="<?php echo e($data->number); ?>" >
                                                            <input class="buysell-pm-control"  type="radio" name="network" value="<?php echo e($data->code); ?>" id="pm-paypal<?php echo e($data->id); ?>" />
                                                            <label class="buysell-pm-label" for="pm-paypal<?php echo e($data->id); ?>">
                                                                <span class="pm-name"><?php echo e($data->name); ?></span><span class="pm-icon"><div class="user-avatar sm"><img src="<?php echo e(asset($data->image)); ?> " width="100"
                             alt="Avatar"></div></span>
                                                            </label>
                                                        </li>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                                                           </ul>
                                                </div>
                                            </div> 
                                             <div class="buysell-field form-action"><a href="#" class="btn btn-lg btn-block btn-primary" data-toggle="modal" data-target="#enterpin2">Proceed</a></div>
 
                                            <div class="form-note text-base text-center">Note: our transaction fee included, <a href="#">see our fees</a>. </div>

                                    </div>
                                </div>
                            </div>
                        </div>
        
         <div class="modal fade" tabindex="-1" id="enterpin2">
            <div class="modal-dialog modal-dialog-centered modal-md">
                <div class="modal-content">
                    <div class="modal-body modal-body-md text-center">
                        <div class="nk-modal">
                            <h4 class="nk-modal-title">Preview Transaction</h4>
                            <div class="nk-modal-text">
                                <p>
                                    You have opted to convert <a id="name">no</a> network airtime. <br>Please transfer the unit amount to <a href="#" id="number">0</a> and proceed by clicking on the button below to log your airtime conversion process.
                                </p>
                            </div>
                            
                            <div class="buysell-overview">
                                <ul class="buysell-overview-list">
                                    <li class="buysell-overview-item">
                                        <span class="pm-title">Network</span><span class="pm-currency"><em class="icon ni ni-signal"></em> <span id="network">Network</span></span>
                                    </li>
                                    
                                    <li class="buysell-overview-item"><span class="pm-title">Network Charge</span><span class="pm-currency" id="rate">0</span></li>
                                    <li class="buysell-overview-item"><span class="pm-title">Amount</span><span class="pm-currency" id="toconvert">0<?php echo e($basic->currency_sym); ?></span></li>
                                     <li class="buysell-overview-item"><span class="pm-title">Transaction Charge</span><span class="pm-currency" id="ratecharge">0.00<?php echo e($basic->currency_sym); ?></span> </li>
                                    <li class="buysell-overview-item"><span class="pm-title">Payable</span><span class="pm-currency" id="pay">0.00<?php echo e($basic->currency_sym); ?></span> </li>
                                   
                                </ul>
                                <div class="sub-text-sm">* Our transaction fee of <a href="#" id="rate2">0.00</a> is removed from the unit amount transfered</div>
                            </div>
                            
                             <?php if(Auth::user()->setpin == 1): ?>
                            <div class="nk-modal-form">
                                <label>Enter Transaction Pin</label>
                                <div class="form-group"><input type="password" name="pin" class="form-control form-control-password-big text-center" /></div>
                            </div>
                            <?php endif; ?>
                            <div class="nk-modal-action">
                                <button type="submit" class="btn btn-lg btn-mw btn-primary" >Confirm Process</button>
                                <div class="sub-text sub-text-alt mt-3 mb-4">The equivalent of your airtime to be converted will be credited to your deposit wallet balance once approved.</div>
                                <a href="#" class="link link-soft" data-dismiss="modal">Cancel and return</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div> 
 </form>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('include.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>