@extends('layouts.app') @section('title') {{trans('general.withdrawals')}} -@endsection @section('content')

{{trans('general.withdrawals')}}

{{trans('general.history_withdrawals')}}

@include('includes.cards-settings')
@include('errors.errors-forms') @if (auth()->user()->payment_gateway == '') @endif
@php $datePaid = Withdrawals::select('date') ->where('user_id', auth()->user()->id) ->where('status','pending') ->orderBy('id','desc') ->first(); @endphp
@if (auth()->user()->balance >= $settings->amount_min_withdrawal && auth()->user()->payment_gateway != '' && auth()->user()->withdrawals() ->where('status','pending') ->count() == 0) {!! Form::open([ 'method' => 'POST', 'url' => "settings/withdrawals", 'class' => 'd-inline' ]) !!} @if ($settings->type_withdrawals == 'custom')
{{$settings->currency_symbol}}
@endif {!! Form::submit(trans('general.make_withdrawal'), ['class' => 'btn btn-1 btn-success mb-2 saveChanges']) !!} {!! Form::close() !!} @else @endif
@if ($withdrawals->count() != 0)
@foreach ($withdrawals as $withdrawal) @endforeach
{{trans('admin.amount')}} {{trans('admin.method')}} {{trans('admin.date')}} {{trans('admin.status')}} {{trans('admin.actions')}}
{{Helper::amountFormatDecimal($withdrawal->amount)}} {{$withdrawal->gateway == 'Bank' ? trans('general.bank') : $withdrawal->gateway}} {{Helper::formatDate($withdrawal->date)}} @if ( $withdrawal->status == 'paid' ) {{trans('general.paid')}} @else {{trans('general.pending_to_pay')}} @endif @if ($withdrawal->status != 'paid' && Carbon\Carbon::parse($withdrawal->estimated_payment)->shortAbsoluteDiffForHumans() <> '5d') {!! Form::open([ 'method' => 'POST', 'url' => "delete/withdrawal/$withdrawal->id", 'class' => 'd-inline' ]) !!} {!! Form::button(trans('general.delete'), ['class' => 'btn btn-danger btn-sm deleteW p-1 px-2']) !!} {!! Form::close() !!} @elseif ($withdrawal->status != 'paid' && Carbon\Carbon::parse($withdrawal->estimated_payment)->shortAbsoluteDiffForHumans() == '5d') {{ trans('general.in_process') }} @else {{trans('general.paid')}} - {{Helper::formatDate($withdrawal->date_paid)}} @endif
@if ($withdrawals->hasPages()) {{ $withdrawals->links() }} @endif @endif
@endsection