@extends('admin.admin_dashboard')
@section('admin')
@php
/* LOGICS */
//payments TABLE
$payments = App\Models\Payment::orderBy('id', 'DESC')->get();
//payments in Espees
$espees = App\Models\Payment::where('currency', 'ESPEES')->get();
//payments in USD
$usd = App\Models\Payment::where('currency', 'usd')->get();
//payments in GBP
$gbp = App\Models\Payment::where('currency', 'gbp')->get();
//payments in EUR
$eur = App\Models\Payment::where('currency', 'eur')->get();
//payments in CAD
$cad = App\Models\Payment::where('currency', 'cad')->get();
//payments in ZAR
$zar = App\Models\Payment::where('currency', 'zar')->get();
//payments in ngn
$ngn = App\Models\Payment::where('currency', 'ngn')->get();
//payments in Voucher
$voucher = App\Models\Payment::where('currency', 'Espees-Voucher')->get();
//users
$users = App\Models\User::where('role', 'user')->where('status', 1)->latest()->get();
//Total subscription
$totalSubscriptions = App\Models\Subscription::where('status', 'active')->latest()->get();
//Active subscription
$activeSubscriptions = App\Models\Subscription::where('status', 'active')
->where('end_date', '>', now())
->count();
//Purchases - E-Book
$purchases = App\Models\Purchase::where('status', 'active')->latest()->get();
//Purchases - Print Copies
$uniqueOrders = App\Models\Order::where('status', 'active')->distinct('payment_id')->count('payment_id');
//Purchases - Print Copies - Pending
$pendingUniqueOrders = App\Models\Order::where('status', 'active')->where('order_status', 'pending')->distinct('payment_id')->count('payment_id');
//Purchases - Print Copies - Processing
$processingUniqueOrders = App\Models\Order::where('status', 'active')->where('order_status', 'processing')->distinct('payment_id')->count('payment_id');
$adminProfile = Auth::user();
@endphp
{{-- display only to admin with active status --}}
@if ($adminProfile && $adminProfile->role === 'admin' && $adminProfile->status === '1')
@if (Auth::user()->can('users.all'))
@endif
@if (Auth::user()->can('payment.espees'))
@endif
@if (Auth::user()->can('payment.usd'))
@endif
@if (Auth::user()->can('payment.usd'))
@endif
@if (Auth::user()->can('payment.usd'))
@endif
@if (Auth::user()->can('payment.usd'))
@endif
@if (Auth::user()->can('payment.usd'))
@endif
@if (Auth::user()->can('payment.usd'))
@endif
@if (Auth::user()->can('payment.redemption.voucher'))
@endif
@if (Auth::user()->can('subscriptions.all'))
@endif
@if (Auth::user()->can('subscriptions.active'))
@endif
@if (Auth::user()->can('purchases.all'))
@endif
@if (Auth::user()->can('orders.all'))
@endif
@if (Auth::user()->can('orders.pending'))
@endif
@if (Auth::user()->can('orders.processing'))
@endif
@if (Auth::user()->can('payment.all'))
Latest Transactions
{{-- --}}
| s/n |
user_fullname |
total_amount |
currency |
payment_date |
purpose |
narration |
payment_gateway |
status |
name |
email |
phone_no |
tx_ref |
payment_ref |
@foreach($payments as $key => $payment)
| {{ $key+1 }} |
{{ $payment->user->title }} {{ $payment->user->firstname }} {{ $payment->user->surname }} |
{{ $payment->total_amount }} |
{{ strtolower($payment->currency) }} |
{{ $payment->payment_date }} |
{{ $payment->purpose }} |
{{ $payment->narration }} |
{{ $payment->payment_gateway }} |
{{ $payment->status }} |
{{ $payment->name }} |
{{ $payment->email }} |
{{ $payment->phone_number }} |
{{ $payment->tx_ref }} |
{{ $payment->payment_ref }} |
@endforeach
@endif
{{-- display only to admin with INactive status --}}
@elseif ($adminProfile && $adminProfile->role === 'admin' && $adminProfile->status === '0')
Admin Profile Not Activated. Contact Admin
@endif
@endsection