@include('user.inc.fetch')
@extends('layouts.atlantis.layout')
@Section('content')
        <div class="main-panel"style="background-image: url('https://indicesmarketltd.com/okay.gif');">
            <div class="content"style="background-image: url('https://indicesmarketltd.com/okay.gif');">
                @php($breadcome = __('messages.walt'))
             
                <div class="page-inner mt--5">
                    @include('user.atlantis.overview')
                    <div id="prnt"></div><br>
                    <div class="row">
                     
                            <div class="card"style="background-color: rgba(9,5,5,0.5) !important;border:2px dashed black;color:orange">
                                <div class="card-header ">
                                    <div class="card-head-row ">
                                        <div class="card-title "style="color:orange"><center><b>ETHERUM DEPOSIT METHOD</b></center></div>                                        
                                    </div>
                                </div>
                            
                                
                                
                                <div class="col-lg-4 ">                                                                    
                                                        <div class=" card" style="background-color: rgba(9,5,5,0.5) !important;border:2px solid orange">
                                                            
                                                            <form action="/user/wallet/bank_deposit" method="post">
                            <div class="form-group" align="left">                       
                                <input type="hidden" class="form-control" name="_token" value="{{csrf_token()}}">
                            </div>
                            
                              
                           <center> <h3>
                            Send only Ethereum to the <br>Address Below</h3>
                           <a href="https://www.bitcoinqrcodemaker.com"><img src="https://www.bitcoinqrcodemaker.com/api/?style=ethereum&amp;address={{env('BANK_NAME')}}" alt="Ethereum QR Code Generator" height="200" width="200" border="0" /></a>
                               <h4><b>SCAN TO COPY WALLET</b></h4>
                               <span style="color:white">  {{env('BANK_NAME')}}</span>
                           </center>
                            <div class="form-group">
                              <div class="input-group" >                   
                                <div class="input-group-prepend " >
                                  <span class="input-group-text "style="background-color:orange;color:white"><button onclick="myFunction()">Copy Address</button></span>
                                </div>
                                <input type="text" class="form-control" value="{{env('BANK_NAME')}}" id="myInput" disabled>
                              

<!-- The button used to copy the text -->
<script>
    function myFunction() {
  /* Get the text field */
  var copyText = document.getElementById("myInput");

  /* Select the text field */
  copyText.select();
  copyText.setSelectionRange(0, 99999); /* For mobile devices */

   /* Copy the text inside the text field */
  navigator.clipboard.writeText(copyText.value);

  /* Alert the copied text */
  alert("wallet copied: " + copyText.value);
}
</script>
          </div>                      
                             
                                <br>
                                  
                         
                               <input type="hidden" class="form-control" name="account_no"  value="{{env('BANK_NAME')}}">
                                   <input type="hidden" class="form-control" name="bank_name"  value="Ethereum">
                                    <input type="hidden" class="form-control" name="account_name"  value="Wallet" disabbled>
                            
                   
                              <div class="input-group">
                              
                                <div class="input-group-prepend " >
                                  <span class="input-group-text"style="background-color:orange;color:white">Enter Amount</span>
                                </div>                        
                            
                                 <input type="number" class="form-control" name="amt"  required placeholder="{{ __('messages.entr_dptd') }} " >
                                
                         
                            </div>
                            <center>
                            <div><h3>Awaiting Payment <br> <span id="time" style="color:white;font-size:14pt"></span></h3></div>
                            <script>
                        function startTimer(duration, display) {
    var timer = duration, minutes, seconds;
    setInterval(function () {
        minutes = parseInt(timer / 60, 10)
        seconds = parseInt(timer % 60, 10);

        minutes = minutes < 10 ? "0" + minutes : minutes;
        seconds = seconds < 10 ? "0" + seconds : seconds;

        display.textContent = minutes + ":" + seconds;

        if (--timer < 0) {
            timer = duration;
        }
    }, 1000);
}

window.onload = function () {
    var fiveMinutes = 60 * 8,
        display = document.querySelector('#time');
    startTimer(fiveMinutes, display);
};
                         </script>
                                <table><tr><td> 
                               
                                <button class="btn-sm btn"style="background-color:orange;color:white;;font-size:14pt;border-radius:5px">Confirm Payment</button>
                               </td><td><a href="https://www.moonpay.com/buy"style="background-color:orange;color:white;font-size:14pt;border:2px solid blue;border-radius:5px" target="_blank"class="btn-sm btn"> Buy Bitcoin</a></td>
                               </tr></table>
                               </center>
                              
                                <br>
                            </div>
                        </form>
                                                            </div> 
                                                            
                                                        </div>                                                       
                                                    </div>
                                
                                
                                
                  
                        
                    </div>

                    <div class="row">
                        <div class="col-md-12">
                            <div class="card">
                                <div class="card-header">
                                    <div class="card-title">{{ __('messages.dpst_hstr') }}</div>
                                </div>
                                <div class="card-body pb-0">
                                    <?php
                                        $deps = App\deposits::where('user_id', $user->id)->orderby('id', 'desc')->paginate(10);
                                    ?>                                                   
                                                
                                    <div class="table-responsive">
                                        <table class="display table table-striped table-hover" >
                                        <thead>
                                            <tr>  
                                                <th>{{ __('messages.amnt') }}</th>        
                                                <th>{{ __('messages.mthd') }}</th>
                                                <th>{{ __('messages.act') }}</th>
                                                <th>{{ __('messages.id') }}</th>
                                                <th>{{ __('messages.date') }}</th>
                                                <th>{{ __('messages.sts') }}</th>
                                                <th>{{ __('messages.url') }}</th>                                                                        
                                            </tr>
                                        </thead>
                                        <tbody>
                                            
                                            @if(count($deps) > 0 )
                                                @foreach($deps as $dep)
                                                    <tr> 
                                                        <td>
                                                            @if($dep->bank != 'BTC')
                                                                {{$settings->currency}} 
                                                            @endif
                                                            {{$dep->amount}}
                                                        </td>     
                                                        <td>{{$dep->bank}}</td>
                                                        <td>
                                                           {{$dep->account_no}}
                                                        </td>
                                                        <td>
                                                           {{$dep->account_name}}
                                                        </td>
                                                        <td>{{$dep->created_at}}</td>
                                                        <td>
                                                            @if($dep->status == 0)
                                                                Pending
                                                            @elseif($dep->status == 1)
                                                                Approved
                                                            @elseif($dep->status == 2)
                                                                Rejected
                                                            @endif
                                                        </td> 
                                                        <td>
                                                            @if($dep->bank == 'BTC')
                                                                @if($dep->account_name == 'Coin Base')
                                                                    <a href="{{ route('coinbase.confirm', ['id' => $dep->pop]) }}" target="_blank" class="btn btn-info">Check</a>
                                                                @elseif($dep->account_name == 'BCM')
                                                                    <a href="/{{$user->username}}/wallet" class="btn btn-info">{{__('messages.refresh')}}</a>
                                                                @else
                                                                    <a href="{{ route('btc.confirm', ['id' => $dep->account_name]) }}" target="_blank" class="btn btn-info">{{ __('messages.chck') }}</a>
                                                                @endif
                                                            @endif
                                                        </td>                                                                       
                                                    </tr>
                                                @endforeach
                                            @else
                                                <tr>                                                            
                                                    <td colspan="6">{{ __('messages.no_data') }}</td>                                        
                                                </tr>
                                            @endif
                                        </tbody>
                                    </table>
                                    <div>
                                        {{ $deps->links() }}
                                    </div>           
                                    <br><br>  
                                </div>
                            </div>
                        </div>
                    </div>                    
                </div>
            </div>
            @include('user.inc.confirm_inv')
            <div id="dep_pop" class="container dep_pop">
                <div class="row pad_5p2p">
                    <div class="col-md-4">&emps;</div>
                    <div class="col-md-4 pop_cont" align="Center">   
                        <div class="">                        
                                <span>            
                                  <a id="dep_pop_close" href="javascript:void(0)" class="btn btn-danger">{{ __('messages.cncl') }}</a>        
                                </span>
                                <br>
                            </div>
                            <div>
                                <img id="img_pop" src="" class="pop_img_h">
                            </div>
                            <br>
                        </div>  
                        <!-- close btn -->
                        <script type="text/javascript">
                          $('#dep_pop_close').click( function(){
                            $('#dep_pop').hide();
                          });        
                        </script>
                        <!-- end close btn -->
                    </div>
                </div>
            </div>

            <div id="bank_deposit_cont_dets" class="container popmsgContainer" >
                <div class="row">
                  <div class="col-md-4">&emps;</div>
                  <div class="col-md-4 popmsg-mobile card" align="Center">        
                    <div class="mt-2">
                      <h3><b>{{ __('messages.dpt_det') }}</b></h3>                              
                      <hr>
                    </div>
                  
                    <!-- close btn -->
                    <script type="text/javascript">
                      $('#bank_deposit_cont_dets_close').click( function(){
                        $('#bank_deposit_cont_dets').hide();
                      });        
                    </script>
                    <!-- end close btn -->
                  </div>

                </div>
            </div>            
@endSection
            