<?php $userIncome = 'income'; if($user->user_currency != 'NGN'){ $userIncome = 'usdt_income'; } ?>
@extends($activeTemplate.'layouts.users')

<?php $paidOne = $withdrawal->where('status', 1)->sum('amount'); ?>
<?php $rejectOne = $withdrawal->where('status','!=', 1)->sum('amount'); ?>

@push('style')
	<link rel="stylesheet" href="{{ asset($activeTemplateTrue.'css/history.css') }}{{$catch}}">
@endpush

@section('content')
<uni-app class="uni-app--maxwidth">
	<uni-page data-page="pages/record/balance">
        <uni-page-wrapper class="IoksjnD">
			<uni-page-body>
				<uni-view data-v-d40c0b3e="" class="bg">
					<uni-view data-v-58cb4ed7="" data-v-d40c0b3e="" class="back-title">
						<span data-v-58cb4ed7="" data-href="{{ route('user.profile') }}" class="linkBTN"></span>
						<span data-v-58cb4ed7="" class="title-txt">Withdrawal flows</span>
					</uni-view>
					
					<?php $jStK = array('Initiated','Successful','Pending','Cancelled'); ?>
					<uni-view data-v-d40c0b3e="" class="content color-bg" style="height: auto;">
						
						<uni-view data-v-7625a4cc="" data-v-3eaa641c="" class="bg" style="margin-top:30px">
							<uni-image data-v-7625a4cc="" class="bg2" style="width: 100px;">
								<div style="background-image: url(&quot;{{ asset($activeTemplateTrue.'img/wenli.png') }}&quot;); background-size: 100% 100%; background-repeat: no-repeat;"></div>
								<img src="{{ asset($activeTemplateTrue.'img/wenli.png') }}" draggable="false">
							</uni-image>
							
							<uni-view data-v-7625a4cc="" class="asset-info">
								<uni-view data-v-7625a4cc="" class="asset-info-item">
									<span data-v-7625a4cc="" class="asset-info-item-s1">WITHDRAWAL BALANCE</span>
									<span data-v-7625a4cc="" class="asset-info-item-s2">{{ $user->user_currency_sym }}{{ showAmount($user->$userIncome,2) }}</span>
								</uni-view>
							</uni-view>

							<uni-view data-v-7625a4cc="" data-href="{{ route('user.transaction.type', ['type' => 'bonus']) }}" class="asset-btn linkBTN">
                                <uni-view data-v-7625a4cc="" class="btn" style="padding-left:7px;">
									<span data-v-7625a4cc="">Rejected</span>
                                    <uni-text data-v-0a75b799="" data-v-7625a4cc="" class="uni-icons uniui-right " style="top:auto;">&nbsp;&nbsp;{{ $user->user_currency_sym }}{{showAmount($paidOne,0)}}&nbsp;</uni-text>
                                </uni-view>
                            </uni-view>
							
						</uni-view>
												
						<uni-view data-v-d40c0b3e="" class="content-inset">
							
							<ul class="lists" style="width: 100%; margin: 0 auto; position: relative; margin-top: 10px; height: auto; overflow: hidden; padding-top:10px; padding-bottom:64px;padding-left:0px;" id="itemlist">
								@foreach($withdraws as $data)
								<li class="iUjseRd ">
									<div style="padding:1px;">
										<div style="float:left;width:45%; margin-left:5%">
											<div style="height:27px; line-height:27px;">
												<span style ="padding:3px; padding-left: 0px;padding-right:10px;border-radius: 10px; font-weight:bold;color: #fff;">{{ $data->currency }}</span>
											</div>
											<div style="height:27px; line-height:27px;">
												<span style="padding:3px; padding-left: 0px;padding-right:10px;border-radius: 10px; color: #fff;">{{ $data->trx }}</span>
											</div>
											<div class="hstyDte">{{ $data->created_at->format('dS F Y, H:i') }}</div>
										</div>
										<div style="float:left;width:45%; text-align:right; margin-right:5%">
											<div style="height:27px; line-height:27px; font-size:20px; font-family: Roboto Condensed-Regular,Roboto Condensed;font-weight:700;color: #FFF;">{{ showAmount($data->amount) }}</div>
											<div class="amoHity">&nbsp;amount</div>
											<div class="{{ strtolower($jStK[$data->status]) }} htryStus">Status: {{ $jStK[$data->status] }}</div>
											
											<div style="height:27px; line-height:27px;font-size:12px;color:#955c14;margin-top:-7px;"><span style="cursor:pointer;border-radius:3px;padding:2px 4px;font-weight:900;border:1px solid #71ac6b;color:#FFF;">{{ config('settings')->cur_sym }}{{ showAmount($data->after_charge) }} ~Paid</span></div>
										</div>

										@if( $data->admin_feedback )
										<div class='adRpts'>{{ $data->admin_feedback }}</div>
										@endif
									</div>
								</li>
								@endforeach
							</ul>
							
						</uni-view>

						<uni-view data-v-0af76499="" data-v-d40c0b3e="" class="uni-load-more">
							<uni-text data-v-0af76499="" class="uni-load-more__text" style="color: rgb(119, 119, 119);"><span>No More Data</span></uni-text>
						</uni-view>
						
					</uni-view>
				</uni-view>
			</uni-page-body>
		</uni-page-wrapper>
	</uni-page>
</uni-app>
@endsection

@push('script')
@endpush
