@extends($activeTemplate.'layouts.master')
@section('content')
@if($isHoliday)
<script>
    "use strict"
    function createCountDown(elementId, sec) {
        var tms = sec;
        var x = setInterval(function () {
            var distance = tms * 1000;
            var days = Math.floor(distance / (1000 * 60 * 60 * 24));
            var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
            var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
            var seconds = Math.floor((distance % (1000 * 60)) / 1000);
            var days = `<span>${days}d</span>`;
            var hours = `<span>${hours}h</span>`;
            var minutes = `<span>${minutes}m</span>`;
            var seconds = `<span>${seconds}s</span>`;
            document.getElementById(elementId).innerHTML = days +' '+ hours + " " + minutes + " " + seconds;
            if (distance < 0) {
                clearInterval(x);
                document.getElementById(elementId).innerHTML = "COMPLETE";
            }
            tms--;
        }, 1000);
    }
</script>

@push('style')
    <style>
        .counter-area span {
            font-size: 45px;
            font-weight: bold;
            margin: 0px 7px;
            font-family: 'Lora', serif;
        }
    </style>
@endpush

@endif






                        
                        
                        
                        
                        
                        
                        

        



                    <form      class="recharge-form mb-5"  id="store_data" action="{{route('user.withdraw.money')}}" method="post">
                        @csrf
                        
                        
                        
        
  <div class="page-wrapper">
   

    
 <link rel="stylesheet" type="text/css" href="{{asset ('core/styles.css')}}" />

    <div class="card-secton topup-content">
        <div class="tf-container">
            <div class="tf-balance-box">
                <div class="d-flex justify-content-between align-items-center">
                    <p>Your Balance:</p>
                    <h3>{{ $general->cur_text }}. {{ showAmount(auth()->user()->interest_wallet) }}</h3>
                </div>
                <div class="tf-spacing-16"></div>
                <div class="tf-form">
                    <div class="group-input input-field input-money">
                        <label for="">Amout Of Money</label>
                        <input type="text" onchange="handleChange(this)" required class="search-field value_input st1" type="text"  name="amount"  id="coin">
                        
                    </div>
                    <!--<p>Min: 1000 & Max 50000</p>-->
                    
              
                            <div class="group-input input-field input-money">
                        <label for="">Payment Gatway</label>
                                           <select class="search-field value_input st1" name="method_code" required>
                        
                            @foreach($withdrawMethod as $data)
                                    <option value="{{ $data->id }}" data-resource="{{$data}}">  {{__($data->name)}}</option>
                                @endforeach
                        
                        </select>
                        
             
                        
                    </div>
                    <!--<p>Min: 1000 & Max 50000</p>-->
                    
                    
                    
                    
                    
                    
                    
                    
                </div>
               
            </div>
           
        </div>
        
    </div>
   

   <div class="bottom-navigation-ba mt-5"     >
            <div class="tf-container">
                <a href="#" id="btn-popup-up" class="tf-btn accent large" onclick="fun()">Continue</a>
            </div>
        </div>
  
    <div class="tf-panel up">
        <div class="panel_overlay"></div>
          <div class="panel-box panel-up wrap-content-panel">
            <div class="heading">
                <style>
                    .icon-close1::before{
                        content:'' !important;
                    }
                </style>
                <div class="tf-container">
                    <div class="d-flex align-items-center position-relative justify-content-center">
      
           
                    </div>
                </div>
            </div>
            <div class="main-topup">
                <div class="tf-container">
                  
                  
                 
                    <p class="text-danger text-center" id="copied"></p>
                    <ul class="info">
                     
                        <li><h4 class="secondary_color fw_4 d-flex justify-content-between align-items-center">Fee <a href="#" class="success_color fw_7">Free</a></h4></li>
                    </ul>
                
                    <div class="d-flex justify-content-between align-items-center">
            
                        
                        <button type="submit" class="tf-btn accent large">withdraw</button>

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

            
          </div>
          
    </div>

      <style>
     .acti{
  color:blue;
  }
  .icon-scan-qr-code::before{
      content:'' !important;
      coloe:white
  }
 </style>


<script>
"use strict";
    function notify(status,message) {
        iziToast[status]({
            message: message,
            position: "topRight"
        });
    }
</script>

  
  
    <script>
        $("#Button").hide();
        $("#coin").keyup(function () {
            if ($(this).val()) {
                $("#Button").show();
            } else {
                $("#Button").hide();
            }
        });
    </script>
        <script>
    function amo(){
         document.getElementById("Button").style.display = "block";
    }
        function handleChange(input) {
            if (input.value < 1) {
                document.getElementById("Button").style.display = "none";
            } else {
                document.getElementById("Button").style.display = "block";
            }
        }


    </script>
    
 <script>

   function fun(){
       var amount =  document.getElementById('coin').value;
   document.getElementById("value_input").innerHTML = amount;
   document.getElementById("value_input2").innerHTML = amount;
    document.getElementById("final").value = amount;
   }
</script>
<script>
    function CopyToClipboard (containerid) {
  // Create a new textarea element and give it id='temp_element'
  const textarea = document.createElement('textarea')
  textarea.id = 'temp_element'
  // Optional step to make less noise on the page, if any!
  textarea.style.height = 0
  // Now append it to your page somewhere, I chose <body>
  document.body.appendChild(textarea)
  // Give our textarea a value of whatever inside the div of id=containerid
  textarea.value = document.getElementById(containerid).innerText
  // Now copy whatever inside the textarea to clipboard
  const selector = document.querySelector('#temp_element')
  selector.select()
  document.execCommand('copy')
  // Remove the textarea
  document.getElementById('copied').innerHTML = 'Account Number Copied to Clipboard';
  document.body.removeChild(textarea)
}
</script>
<script>
    $(document).ready(function() {
    $("[href]").each(function() {
        if (this.href == window.location.href) {
            $(this).addClass("acti");
            }
            $(this).removeClass("sex");
        });
    });

</script>  

<script>
    (function () {
        "use strict";
        $(document).on("change", ".langSel", function () {
            window.location.href = "https://raxyzen.com/change/" + $(this).val();
        });
    })();
</script>


</body>
</html>


                
   

<script>
        var selector1 = '.bank-card.one';
        var selector2 = '.bank-card.two';
        // var sidebar = '.pink-block';
        // var x = document.getElementById("text");
        $(selector1).on('click', function(){
            $(selector1).toggleClass('selected');
            $(selector2).toggleClass('selected');
            // $(sidebar).toggleClass('left');

            // if (x.innerHTML === "Edit") {
            //     x.innerHTML = "Cancel";
            // } else {
            //     x.innerHTML = "Edit";
            // }
        });
        $(selector2).on('click', function(){
            $(selector1).toggleClass('selected');
            $(selector2).toggleClass('selected');
        });
    </script>

    <script>
        function show_channels() {
            $(".channels-data").hide();
            $(".recharge-data").hide();
            $(".selected_channel").val(1);

            $("#store_data").submit();
        }

        function open_page(ind) {

            $(".channels-data").hide();
            $(".recharge-data").hide();
            $(".channels-loader").show();
            // window.location.href = "https://intuitive.fyi/pay";
            //$("#store_data").submit();
            // setTimeout(function() {
            $("#store_data").submit()
            // }, 10);
        }

        function amountset(pay) {
            $("#amount").val(pay);
        }
    </script>




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

                        
                        
                        
                        
                        
                        
@endsection

@push('script')
<script>
    (function ($) {
        "use strict";
        $('select[name=method_code]').change(function(){
            if(!$('select[name=method_code]').val()){
                $('.preview-details').addClass('d-none');
                return false;
            }
            var resource = $('select[name=method_code] option:selected').data('resource');
            var fixed_charge = parseFloat(resource.fixed_charge);
            var percent_charge = parseFloat(resource.percent_charge);
            var rate = parseFloat(resource.rate)
            var toFixedDigit = 2;
            $('.min').text(parseFloat(resource.min_limit).toFixed(2));
            $('.max').text(parseFloat(resource.max_limit).toFixed(2));
            var amount = parseFloat($('input[name=amount]').val());
            if (!amount) {
                amount = 0;
            }
            if(amount <= 0){
                $('.preview-details').addClass('d-none');
                return false;
            }
            $('.preview-details').removeClass('d-none');

            var charge = parseFloat(fixed_charge + (amount * percent_charge / 100)).toFixed(2);
            $('.charge').text(charge);
            if (resource.currency != '{{ $general->cur_text }}') {
                var rateElement = `<span>@lang('Conversion Rate')</span> <span class="fw-bold">1 {{__($general->cur_text)}} = <span class="rate">${rate}</span>  <span class="base-currency">${resource.currency}</span></span>`;
                $('.rate-element').html(rateElement);
                $('.rate-element').removeClass('d-none');
                $('.in-site-cur').removeClass('d-none');
                $('.rate-element').addClass('d-flex');
                $('.in-site-cur').addClass('d-flex');
            }else{
                $('.rate-element').html('')
                $('.rate-element').addClass('d-none');
                $('.in-site-cur').addClass('d-none');
                $('.rate-element').removeClass('d-flex');
                $('.in-site-cur').removeClass('d-flex');
            }
            var receivable = parseFloat((parseFloat(amount) - parseFloat(charge))).toFixed(2);
            $('.receivable').text(receivable);
            var final_amo = parseFloat(parseFloat(receivable)*rate).toFixed(toFixedDigit);
            $('.final_amo').text(final_amo);
            $('.base-currency').text(resource.currency);
            $('.method_currency').text(resource.currency);
            $('input[name=amount]').on('input');
        });
        $('input[name=amount]').on('input',function(){
            var data = $('select[name=method_code]').change();
            $('.amount').text(parseFloat($(this).val()).toFixed(2));
        });
    })(jQuery);
</script>
@endpush
