<?php $__env->startSection('content'); ?>
     <div class="nk-content nk-content-fluid">
                        <div class="container-xl wide-lg">
                            <div class="nk-content-body">
                                <div class="buysell  ">
                                    <div class="buysell-nav text-center">

                                    </div>
                                    <div class="buysell-title text-center"><h4 class="title">Exchange Giftcard</h4></div>
                                    <div class="buysell-block">

                                       <form role="form" method="POST" action="<?php echo e(route('excard')); ?>" enctype="multipart/form-data">
                                        <?php echo e(csrf_field()); ?>




                                        <script type="text/javascript">

                                            function goDoSomething(identifier){

                                     document.getElementById("gate").value = $(identifier).data('id');
                                     document.getElementById("name").innerHTML = $(identifier).data('name');
                                     document.getElementById("select").innerHTML = "Selected";
                                    document.getElementById("image").innerHTML = "<em class='icon ni ni-"+$(identifier).data('image')+"'></em>";

                                }
                              </script>
                                        <script>
                                    function myFunction2() {
                                    var usd = $('#usd').val() ;
                                    var xch = "<?php echo e($basic->rate); ?>";
                                    document.getElementById("convert").innerHTML = "<?php echo e($basic->currency_sym); ?>"+usd*xch;
                                    document.getElementById("amount").innerHTML = usd;
                                    document.getElementById("amount2").innerHTML = usd;
                                    };
                                    </script>

                                            <div class="buysell-field form-group">
                                                <div class="form-label-group"><label class="form-label">Select Giftcard</label></div>

                                                <div class="dropdown buysell-cc-dropdown">
                                                    <a href="#" class="buysell-cc-choosen dropdown-indicator" data-toggle="dropdown">
                                                        <div class="coin-item coin-btc">
                                                            <div class="coin-icon" id="image"><em class="icon ni ni-cc-secure" ></em></div>
                                                            <div class="coin-info"><span class="coin-name" id="name">Giftcards</span><span id="select" class="coin-text">Select Giftcard</span></div>
                                                        </div>
                                                    </a>
                                                    <div class="dropdown-menu dropdown-menu-auto dropdown-menu-mxh">
                                                        <ul class="buysell-cc-list">
                                                        <?php $__currentLoopData = $currency; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gate): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                         <li class="buysell-cc-item"  onclick="goDoSomething(this);"  data-id="<?php echo e($gate->id); ?>"   data-name="<?php echo e($gate->name); ?>"   data-rate="<?php echo e($gate->price); ?>"  data-image="<?php echo e($gate->image); ?>">
                                                                <a href="#" class="buysell-cc-opt" data-currency="eth">
                                                                    <div class="coin-item coin-eth">
                                                                        <div class="coin-icon"><em class="icon ni ni-<?php echo e($gate->image); ?>"></em></div>
                                                                        <div class="coin-info"><span class="coin-name"><?php echo e($gate->name); ?></span><span class="coin-text"></span></div>
                                                                    </div>
                                                                </a>
                                                            </li>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


                                                        </ul>
                                                    </div>
                                                </div>
                                            </div>
                                               <script type="text/javascript">

                                            function goDoSomething0(identifier){

                                                         document.getElementById("currency").innerHTML = $(identifier).data('curr');
                                                         document.getElementById("curen").value = $(identifier).data('curr');


                                                    }
                                                  </script>
                                            <input id="gate" name="card" hidden>
                                            <input id="curen" name="currency" hidden>
                                            <input id="type2" name="type" hidden>
                                            <div class="buysell-field form-group">
                                                <div class="form-label-group"><label class="form-label" for="buysell-amount">Amount Of Card</label></div>
                                                <div class="form-control-group">
                                                    <input type="number" id="usd" onkeyup="myFunction2()"   class="form-control form-control-lg form-control-number" name="amount"  placeholder=" 0.00" />
                                                    <div class="form-dropdown">

                                                         <div class="dropdown"><a href="#" class="dropdown-indicator-caret" data-toggle="dropdown" data-offset="0,2"><p id="currency">Select Currency</p></a><div class="dropdown-menu dropdown-menu-xxs dropdown-menu-right text-center"><ul class="link-list-plain"><li onclick="goDoSomething0(this);"    data-curr="EUR" ><a href="#">EUR</a></li><li onclick="goDoSomething0(this);"    data-curr="CAD"><a href="#">CAD</a></li><li onclick="goDoSomething0(this);"    data-curr="USD"><a href="#">USD</a></li></ul></div></div>
                                                    </div>
                                                </div>
                                                <div class="form-note-group"><span class="buysell-min form-note-alt"><a id="convert"></a></span><span class="buysell-rate form-note-alt"><a id="rate"></a></span></div>








                                                <br>
                                                  <script type="text/javascript">

                                            function goDoSomething1(identifier){

                                     document.getElementById("type").innerHTML = $(identifier).data('id');
                                     document.getElementById("type2").value = $(identifier).data('id');

                                     if($(identifier).data('upload') > 0){
                                     document.getElementById("upload").innerHTML = "<div class='form-label-group'><label class='form-label' for='buysell-amount'>Upload Gift Card Front View</label></div><input required type='file' multiple class='form-control' name='front' accept='image/*' id='customFile'> </div><br><br>";
                                      document.getElementById("upload2").innerHTML = "<div class='form-label-group'><label class='form-label' for='buysell-amounts'>Upload Gift Card Back View</label></div><input required type='file' multiple class='form-control' name='back' accept='image/*' id='customFile2'></div>";

                                     }
                                     if($(identifier).data('upload') < 1){
                                    document.getElementById("upload").innerHTML = "<div class='form-label-group'><label class='form-label' for='buysell-amount'>Enter Gift Card Number</label></div><input type='text'  class='form-control' required name='code' ></div><br>";
                                    document.getElementById("upload2").innerHTML = ""
                                     }
                                     document.getElementById("icon2").innerHTML = "<em class='icon ni ni-"+$(identifier).data('id2')+"'></em>";

                                }
                              </script>

                                                <div class="buysell-field form-group">
                                                <div class="form-label-group"><label class="form-label">Select Type</label></div>

                                                <div class="dropdown buysell-cc-dropdown">
                                                    <a href="#" class="buysell-cc-choosen dropdown-indicator" data-toggle="dropdown">
                                                        <div class="coin-item coin-btc">
                                                            <div class="coin-icon" id="icon2"><em class="icon ni ni-happyf-fill" ></em></div>
                                                            <div class="coin-info"><span class="coin-name" id="type">Select</span><span class="coin-text">Giftcard Type</span></div>
                                                        </div>
                                                    </a>
                                                    <div class="dropdown-menu dropdown-menu-auto dropdown-menu-mxh">
                                                        <ul class="buysell-cc-list">

                                                         <li class="buysell-cc-item"  onclick="goDoSomething1(this);"  data-upload="1"  data-id="Physical" data-id2="gift">
                                                                <a href="#" class="buysell-cc-opt" data-currency="eth">
                                                                    <div class="coin-item coin-eth">
                                                                        <div class="coin-icon"><em class="icon ni ni-gift"></em></div>
                                                                        <div class="coin-info"><span class="coin-name">Physical</span><span class="coin-text">Card</span></div>
                                                                    </div>
                                                                </a>
                                                            </li>

                                                             <li class="buysell-cc-item"  onclick="goDoSomething1(this);"    data-id="Digital"  data-upload="0" data-id2="scan-fill">
                                                                <a href="#" class="buysell-cc-opt" data-currency="eth">
                                                                    <div class="coin-item coin-eth">
                                                                        <div class="coin-icon"><em class="icon ni ni-scan-fill"></em></div>
                                                                        <div class="coin-info"><span class="coin-name">Digital</span><span class="coin-text">Card</span></div>
                                                                    </div>
                                                                </a>
                                                            </li>





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

                                            <a id="upload"></a>
                                             <a id="upload2"></a>



<div class="buysell-field form-action"><button  type="submit"  class="btn btn-lg  btn-outline btn-primary" >Confirm Exchange</button></div>

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



<?php $__env->stopSection(); ?>

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