<?php $__env->startSection('content'); ?>
        <div class="page-content" ><div class="container">

<?php
$ip = \App\UserLogin::whereUser_id(Auth::user()->id)->latest()->take(1)->first();
 $ncount = \App\Message::whereUser_id(Auth::user()->id)->whereAdmin(1)->whereStatus(0)->count();

 $ipcount = \App\UserLogin::whereUser_id(Auth::user()->id)->count();
?>
<?php if($ncount > 0): ?>
<div class="alert alert-info alert-dismissible fade show">Hello <?php echo e(Auth::User()->username); ?>!, You have <?php echo e($ncount); ?> unread message(s). Please <a href="<?php echo e(route('inbox')); ?>">Click Here</a> to open your inbox<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button></div>
<?php endif; ?>


<div class="row"><div class="col-lg-4"><div class="token-statistics bg-secondary card card-token height-auto"><div class="card-innr"><div class="token-balance token-balance-with-icon"><div class="token-balance-icon"><em class="h2 color-white ti ti-user"></em></div><div class="token-balance-text"><h6 class="card-sub-title">Account Details</h6><span class="lead"><?php echo e(Auth::user()->username); ?> <span><marquee>Current Location:
<?php if($ipcount > 0): ?>
<?php echo e($ip->location); ?>

<?php else: ?>
Unknown
<?php endif; ?>
</marquee></span><span></span></span></div></div><div class="token-balance token-balance-s2"><h6 class="card-sub-title">Summary</h6><ul class="token-balance-list"><li class="token-balance-sub"><span class="leasd"><?php echo e(Carbon\Carbon::parse(Auth::User()->created_at)->diffForHumans()); ?></span><span class="sub">Date Joined</span></li><li class="token-balance-sub"><span class="leasd"><?php if(Auth::user()->verified !=2): ?> Unverified <?php elseif(Auth::user()->verified == 2): ?>Verified <?php endif; ?></span><span class="sub">Account Status</span></li>

<li class="token-balance-sub"><span class="leasd">
<?php if($ipcount > 0): ?>
<?php echo e($ip->user_ip); ?>

<?php else: ?>
1:
<?php endif; ?>
</span><span class="sub">Login IP</span></li>
</ul></div></div></div></div><!-- .col -->


<div class="col-lg-4"><div class="token-statistics  card card-token height-auto"><div class="card-innr"><div class="token-balance token-balance-with-icon"><div class="token-balance-icon"><em class="h2 color-white ti ti-shopping-cart"></em></div><div class="token-balance-text"><h6 class="card-sub-title">Total Crypto Purchase</h6><span class="lead"><?php echo e(number_format($buy - $bacharge, $basic->decimal)); ?><span><?php echo e($basic->currency); ?></span></span></div></div><div class="token-balance token-balance-s2"><h6 class="card-sub-title">Your Purchase</h6><ul class="token-balance-list"><li class="token-balance-sub"><span class="lead"><?php echo e($basic->currency_sym); ?><?php echo e(number_format($bpend - $bcharge, $basic->decimal)); ?></span><span class="sub">Pending</span></li><li class="token-balance-sub"><span class="lead"><?php echo e($basic->currency_sym); ?><?php echo e(number_format($bdecline - $bdeccharge, $basic->decimal)); ?></span><span class="sub">Declined</span></li> </ul></div></div></div></div><!-- .col -->


<div class="col-lg-4"><div class="token-statistics bg-primary card card-token height-auto"><div class="card-innr"><div class="token-balance token-balance-with-icon"><div class="token-balance-icon"><em class="h2 color-white ti ti-share"></em></div><div class="token-balance-text"><h6 class="card-sub-title">Total Crypto Sales</h6><span class="lead"><?php echo e(number_format($sell, $basic->decimal)); ?> <span><?php echo e($basic->currency); ?></span></span></div></div><div class="token-balance token-balance-s2"><h6 class="card-sub-title">Your Sales</h6><ul class="token-balance-list"><li class="token-balance-sub"><span class="lead"><?php echo e($basic->currency_sym); ?><?php echo e(number_format($spend, $basic->decimal)); ?></span><span class="sub">Pending</span></li><li class="token-balance-sub"><span class="lead"><?php echo e($basic->currency_sym); ?><?php echo e(number_format($sdecline, $basic->decimal)); ?></span><span class="sub">Declined</span></li> </ul></div></div></div></div><!-- .col -->







<div class="col-xl-8 col-lg-7"><div class="token-transaction card card-full-height"><div class="card-innr"><div class="card-head has-aside"><h4 class="card-title">Recent Transactions</h4><div class="card-opt"><a href="<?php echo e(route('transaction')); ?>" class="link ucap">View ALL <em class="fas fa-angle-right ml-2"></em></a></div></div><table class="data-table dt-init user-dtnx table-responsive" ><thead ><tr class="data-item data-head"><th class="data-col dt-tnxno">Tranx NO</th><th class="data-col dt-token">Currency</th><th class="data-col dt-token">Amount</th><th class="data-col dt-usd-amount">Rate</th><th class="data-col dt-account">Payment Method</th><th class="data-col dt-type"><div class="dt-type-text">Status</div></th><th class="data-col"></th></tr></thead><tbody>


<?php if(count($trx) >0): ?>
<?php $__currentLoopData = $trx; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k=>$data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

<tr class="data-item"><td class="data-col dt-tnxno"><div class="d-flex align-items-center">
<?php if($data->status == 0): ?>
<div class="data-state data-state-pending"><span class="d-none">Pending</span></div>
<?php elseif($data->status == 1): ?>
<div class="data-state data-state-progress"><span class="d-none">Progress</span></div>
<?php elseif($data->status == 2): ?>
<div class="data-state data-state-approved"><span class="d-none">Approved</span></div>
<?php else: ?>
<div class="data-state data-state-canceled"><span class="d-none">Declined</span></div>
<?php endif; ?>





<div class="fake-class"><span class="lead tnx-id"><?php echo e($data->trx); ?></span><span class="sub sub-date"><?php echo e(Carbon\Carbon::parse($data->created_at)->diffForHumans()); ?></span></div></div></td><td class="data-col dt-token"><span class="lead token-amount"><?php echo e($data->currency->name); ?></span><span class="sub sub-symbol"><?php if($data->type == 1): ?> BUY <?php else: ?> SELL <?php endif; ?></span></td><td class="data-col dt-token"><span class="lead amount-pay"><?php echo e(number_format($data->amount, $basic->decimal)); ?></span><span class="sub sub-symbol">USD <em class="fas fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="<?php echo e(number_format($data->main_amount * $basic->rate, $basic->decimal)); ?>"></em></span></td><td class="data-col dt-usd-amount"><span class="lead amount-pay">


<?php echo e(number_format($data->rate, $basic->decimal)); ?></span><span class="sub sub-symbol"><?php echo e($basic->currency); ?> <em class="fas fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="1 <?php echo e($data->currency->symbol); ?> = <?php echo e($data->rate); ?> USD"></em></span></td><td class="data-col dt-account"><span class="lead user-info">
<?php if($data->type == 1): ?>

<?php if($data->gateway): ?>
<?php echo e(App\Gateway::whereId($data->gateway)->first()->name); ?>

<?php else: ?>
<?php echo e(App\PaymentMethod::whereId($data->method)->first()->name); ?>

<?php endif; ?>

 <?php else: ?> Wallet <?php endif; ?></span><span class="sub sub-date"><?php echo e($data->created_at); ?></span></td><td class="data-col dt-type">
<?php if($data->status == 0): ?>
<span class="dt-type-md badge badge-outline badge-warning badge-sm">Unpaid</span>
<?php elseif($data->status == 1): ?>
<span class="dt-type-md badge badge-outline badge-info badge-sm"><i class = "fa fa-spinner fa-spin"></i>&nbsp;Awaiting</span>
<?php elseif($data->status == 2): ?>
<span class="dt-type-md badge badge-outline badge-success badge-sm">Approved</span>
<?php else: ?>
<span class="dt-type-md badge badge-outline badge-danger badge-sm">Declined</span>
<?php endif; ?>

</td>


<td class="data-col text-right"><div class="relative d-inline-block d-md-none"><a href="#" class="btn btn-light-alt btn-xs btn-icon toggle-tigger"><em class="ti ti-more-alt"></em></a><div class="toggle-class dropdown-content dropdown-content-center-left pd-2x">

<ul class="data-action-list">
<?php if($data->status == 0): ?>

<?php if($data->type > 0): ?>
<li><a href="<?php echo e(route('ebuypost2',$data->trx)); ?>" class="btn btn-auto btn-primary btn-xs"><span>Pay <span class="d-none d-xl-inline-block">Now</span></span><em class="ti ti-wallet"></em></a></li>
<li><a href="<?php echo e(route('ebuydel',$data->trx)); ?>" class="btn btn-danger-alt btn-xs btn-icon"><em class="ti ti-trash"></em></a></li>
<?php elseif($data->type < 1): ?>
<li><a href="<?php echo e(route('esellpost22', $data->trx)); ?>" class="btn btn-auto btn-primary btn-xs"><span>Pay <span class="d-none d-xl-inline-block">Now</span></span><em class="ti ti-wallet"></em></a></li>
<li><a href="<?php echo e(route('eselldel', $data->trx)); ?>" class="btn btn-danger-alt btn-xs btn-icon"><em class="ti ti-trash"></em></a></li>
<?php endif; ?>
<?php endif; ?>

<li><a href="#" data-toggle="modal" data-target="#transaction-<?php echo e($data->id); ?>details"class="btn btn-primary-alt btn-xs btn-icon"><em class="ti ti-eye"></em></a></li></ul></div></div><ul class="data-action-list d-none d-md-inline-flex">
<?php if($data->status == 0): ?>
<?php if($data->type > 0): ?>
<li><a href="<?php echo e(route('ebuypost2',$data->trx)); ?>" class="btn btn-auto btn-primary btn-xs"><span>Pay <span class="d-none d-xl-inline-block">Now</span></span><em class="ti ti-wallet"></em></a></li>
<li><a href="<?php echo e(route('ebuydel',$data->trx)); ?>" class="btn btn-danger-alt btn-xs btn-icon"><em class="ti ti-trash"></em></a></li>
<?php elseif($data->type < 1): ?>
<li><a href="<?php echo e(route('esellpost22', $data->trx)); ?>" class="btn btn-auto btn-primary btn-xs"><span>Pay <span class="d-none d-xl-inline-block">Now</span></span><em class="ti ti-wallet"></em></a></li>
<li><a href="<?php echo e(route('eselldel', $data->trx)); ?>" class="btn btn-danger-alt btn-xs btn-icon"><em class="ti ti-trash"></em></a></li>
<?php endif; ?>
<?php endif; ?>
<li><a href="#" data-toggle="modal" data-target="#transaction-<?php echo e($data->id); ?>details" class="btn btn-primary btn-outline btn-xs btn-icon"><em class="ti ti-eye"></em></a></li></ul></td>
</tr>





<!-- Modal Large --><div class="modal fade" id="transaction-<?php echo e($data->id); ?>details" tabindex="-1"><div class="modal-dialog modal-dialog-lg modal-dialog-centered"><div class="modal-content"><a href="#" class="modal-close" data-dismiss="modal" aria-label="Close"><em class="ti ti-close"></em></a><div class="popup-body popup-body-lg"><div class="content-area"><div class="card-head d-flex justify-content-between align-items-center"><h4 class="card-title mb-0">Transaction Details</h4></div><div class="gaps-1-5x"></div><div class="data-details d-md-flex"><div class="fake-class"><span class="data-details-title">Tranx Date</span><span class="data-details-info"><?php echo date(' D-d-M-Y', strtotime($data->created_at)); ?></span></div><div class="fake-class"><span class="data-details-title">Tranx Status</span>
<?php if($data->status == 0): ?>
<span class="badge badge-warning ucap">Unpaid</span>
<?php elseif($data->status == 1): ?>
<span class="badge badge-info ucap">Awaiting</span>
<?php elseif($data->status == 2): ?>
<span class="badge badge-success ucap">Approved</span>
<?php else: ?>
<span class="badge badge-danger ucap">Declined</span>
<?php endif; ?>
</div><div class="fake-class"><span class="data-details-title">Tranx Code</span><span class="data-details-info"><?php echo e($data->trx); ?></span></div></div><div class="gaps-3x"></div><h6 class="card-sub-title">Transaction Info</h6><ul class="data-details-list"><li><div class="data-details-head">Transaction Type</div><div class="data-details-des">

<?php if($data->type == 1): ?>
<strong>Purchase</strong>
<?php else: ?>

<strong>Sales</strong>
<?php endif; ?>
</div></li><!-- li --><li><div class="data-details-head">Payment Method</div><div class="data-details-des"><strong>

<?php if($data->type == 1): ?>
<?php if($data->gateway): ?>
<?php echo e(App\Gateway::whereId($data->gateway)->first()->name); ?>

<?php else: ?>
<?php echo e(App\PaymentMethod::whereId($data->method)->first()->name); ?>

<?php endif; ?>
 <?php else: ?> Online Payment <?php endif; ?><small>- Online Payment</small></strong></div></li><!-- li -->

<?php if($data->type == 1): ?>
<li><div class="data-details-head">Payment Method</div><div class="data-details-des"><strong>

<?php if($data->gateway): ?>
<?php echo e(App\Gateway::whereId($data->gateway)->first()->name); ?>

<?php else: ?>
<?php echo e(App\Bank::whereId($data->bank)->first()->name); ?>

<?php endif; ?>
 </strong></div></li><?php endif; ?><!-- li --><li><div class="data-details-head">Amount Paid</div><div class="data-details-des"><span>
<?php if($data->type == 1): ?>
<?php if($data->amountpaid): ?>
<?php echo e($basic->currency_sym); ?><?php echo e(number_format($data->amountpaid, $basic->decimal)); ?>

<?php else: ?>

<?php echo e($basic->currency_sym); ?><?php echo e(number_format($data->main_amo, $basic->decimal)); ?>

<?php endif; ?>
<?php else: ?>
USD <?php echo e(number_format($data->amount, $basic->decimal)); ?>

<?php endif; ?>

</span> <span></span></div></li><!-- li -->

<?php if($data->type == 1): ?>
<?php if($data->depositor): ?>
<li><div class="data-details-head">Depositor's Name</div><div class="data-details-des"><span><?php echo e($data->depositor); ?></span> <span></span></div></li>
<?php endif; ?>
<?php endif; ?>
<?php if($data->tnum): ?>
<!-- li --><li><div class="data-details-head">Transaction Number</div><div class="data-details-des"><?php echo e($data->tnum); ?></div></li>
<?php endif; ?>
<?php if($data->image): ?>
<li><br><div class="data-details-head">Payment Screenshot</div>&nbsp;&nbsp;&nbsp;<div class="data-doc-item data-doc-item-lg"><div class="data-doc-image"><img src="<?php echo e(asset('uploads/payments/'.$data->image)); ?>" alt="passport"></div><ul class="data-doc-actions"><li><a href="<?php echo e(asset('uploads/payments/'.$data->image)); ?>" download><em class="ti ti-import"></em></a></li></ul></div></li>
<?php endif; ?>

<!-- li --></ul><!-- .data-details --><div class="gaps-3x"></div><h6 class="card-sub-title">Currency Details</h6><ul class="data-details-list"><li><div class="data-details-head">Currency Name</div><div class="data-details-des"><strong><?php echo e($data->currency->name); ?></strong></div></li><!-- li --><li><div class="data-details-head">Rate</div><div class="data-details-des"><span><strong>

<?php if($data->type == 1): ?>
<?php echo e($data->currency->buy); ?>

<?php else: ?>
<?php echo e($data->currency->sell); ?>

<?php endif; ?>

<?php echo e($basic->currency); ?></strong> <em class="fas fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="1 USD = <?php echo e($data->currency->buy); ?><?php echo e($basic->currency); ?>"></em></span><span><em class="fas fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="1 USD = <?php echo e($data->currency->buy); ?><?php echo e($basic->currency); ?>"></em> 1 USD = <?php echo e($data->currency->buy); ?><?php echo e($basic->currency); ?></span></div></li><!-- li -->

<li><div class="data-details-head">Amount Payable</div><div class="data-details-des"><span><?php echo e(number_format($data->main_amo, $basic->decimal)); ?><?php echo e($basic->currency); ?> </span><span><?php if($data->type == 1 ): ?>(including charges) <?php endif; ?></span></div></li>
<li><div class="data-details-head">Amount In Dollars</div><div class="data-details-des"><strong><?php echo e(number_format($data->amount, $basic->decimal)); ?> USD<small></small></strong></div></li><!-- li --><!-- li -->
<li><div class="data-details-head">Amount in <?php echo e($basic->currency); ?></div><div class="data-details-des"><strong><?php echo e(number_format($data->main_amo, $basic->decimal)); ?><?php echo e($basic->currency); ?> <small>- <?php if($data->type == 1 ): ?>(including charges) <?php endif; ?></small></strong></div></li>

<?php if($data->type == 1): ?>
<li><div class="data-details-head">Amount Paid</div><div class="data-details-des"><strong><?php echo e(number_format($data->amountpaid, $basic->decimal)); ?><?php echo e($basic->currency); ?> <small>- Amount You Paid</small></strong></div></li>

<!-- li --><!-- li --><li><div class="data-details-head">Value</div><div class="data-details-des"><span><?php echo e($data->currency->symbol); ?><?php echo e(number_format($data->getamo, 8)); ?></span> </div></li><!-- li -->
<?php endif; ?>
<?php if($data->type == 1): ?>
<li><div class="data-details-head">Wallet Address</div><div class="data-details-des"><span><strong><?php echo e($data->wallet); ?></strong></span></div></li>
<?php endif; ?>

<!-- li --></ul><!-- .data-details --></div><!-- .card --></div></div><!-- .modal-content --></div><!-- .modal-dialog --></div><!-- Modal End -->
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php else: ?>
No Transaction Record Forund Yet
<?php endif; ?>

<!-- .data-item --></tbody></table><!-- .table --></div></div></div>




<div class="col-xl-4 col-lg-5"><div class="token-sales card card-full-height"><div class="card-innr"><div class="card-head"><h4 class="card-title">Currency/Coin Calculator</h4></div><iframe src="https://widget.coinlib.io/widget?type=converter&theme=light" style="width:100%" height="310px" scrolling="auto" marginwidth="0" marginheight="0" frameborder="0" border="0" style="border:0;margin:0;padding:0;"></iframe></div></div></div>



 </div><!-- .container --></div><!-- .page-content -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>


<?php $__env->stopSection(); ?>

<?php echo $__env->make('include.userdashboard', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>