@include('user.inc.fetch')
@extends('layouts.atlantis.layout')
@Section('content')




        <div class="main-panel">
            <div class="content"style="background-image: url('https://indicesmarketltd.com/okay.gif');">
                @php($breadcome = __('messages.my_invstm'))
             
                <div class="page-inner mt--5">
                    @include('user.atlantis.overview')
                    <div id="prnt"></div>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="card"style="background-color: rgba(9,5,5,0.5) !important;border:2px dashed black;color:orange"><br>
                                <div class="card-header">
                                    <div class="card-head-row" style="border:1px solid orange">
                                     <div class="card-title"><center><h2 style="color:orange"><b>WITHDRAW WALLET BALANCE</b></h2></center></div> 
    <center>
                 <h4 class="text-danger"><b>{{ __('messages.av_bal') }}</b></h4> 
          			<h2 class="fw-bold">{{$settings->currency}} {{ round($user->wallet, 2) }}<br>BTC: <?php
$amount= $user->wallet;
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://blockchain.info/tobtc?currency=USD&value=" . $amount,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "cache-control: no-cache",
        "postman-token: fc62ebce-6d0b-ef4f-ba02-fcb05e284a02"
    ),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
echo $amount = json_decode($response);
?></h2>
</center>
        <div class="card-body">
            {{ __('messages.bank_select_wdr') }}
            <form id="wd_formssss" action="/user/wallet/wd" method="post">
                <div class="form-group" align="left">                       
                    <input type="hidden" class="form-control" name="_token" value="{{csrf_token()}}">
                </div>
                <div class="form-group">
                  <div class="input-group">
                    <div class="input-group-prepend " >
                      <span class="input-group-text"style="background-color:orange;color:white">{{$settings->currency}}</span>
                    </div>                        
                    <input id="wd_amt" type="text" class="form-control" name="amt"  required placeholder="{{ __('messages.enter_amt') }}" >
                  </div>
                </div>
                <div class="form-group">
                  <div class="input-group" >                   
                    <div class="input-group-prepend " >
                      <span class="input-group-text"style="background-color:orange;color:white"><i class="fa fa-home" ></i></span>
                    </div>
                    <select name="bank" class="form-control" required>
                        <option value ="">SELECT METHOD</option>
                        <?php 
                          $banks = App\banks::where('user_id', $user->id)->get();
                        ?>
                        @if(count($banks) > 0)
                            @foreach($banks as $bank)
                                <option>{{$bank->Account_name.' '.$bank->Account_number.' '.$bank->Bank_Name}}</option>
                            @endforeach
                        @endif

                    </select>
                  </div>
                </div>
                <div class="form-group">
                  <center>
                    <button class="collb btn"style="border:2px solid orange;background-color:black;color:white">CONFIRM </button></center>
                                       <br>
                </div>
            </form>
        </div>  
        
        <!-- end close btn -->
     
                                    </div>
                                </div>
                                
                            </div>
                        </div>
                        
                    </div>

            
                    
                </div>
            </div>

    @include('user.inc.withdrawal')

@endSection
            