dashboard.blade.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. @extends('app.my-account.layout-lite')
  2. @section('page')
  3. <div class="px-3">
  4. <div class="px-3 d-flex align-items-baseline border-bottom py-2 mb-3 m-neg-3 bg-light">
  5. <h2 class="font-size-16 text-secondary fw-bold m-0">Dashboard</h2>
  6. </div>
  7. <div class="row">
  8. <div class="col-lg-6">
  9. <h2 class="font-size-14 fw-bold mb-2">Overall Stats</h2>
  10. <table class="table table-sm table-bordered dashboard-stats-table mb-4">
  11. <tbody>
  12. <tr>
  13. <?php $c = \App\Models\User::count(); ?>
  14. <th class="px-2 bg-light fw-bold text-nowrap min-width-70px">
  15. {{ $c }}
  16. </th>
  17. <th class="pl-2 w-100">
  18. <a href="{{route('admin.users')}}">Client{{$c === 1 ? '' : 's'}}</a>
  19. </th>
  20. </tr>
  21. <tr>
  22. <?php $c = \App\Models\StoreOrder::count(); ?>
  23. <th class="px-2 bg-light fw-bold text-nowrap">{{$c}}</th>
  24. <th class="pl-2">
  25. <a href="{{route('admin.orders')}}">Order{{$c === 1 ? '' : 's'}}</a>
  26. </th>
  27. </tr>
  28. <tr>
  29. <th class="px-2 bg-light fw-bold text-nowrap">{{displayAmount('$', $ordersTotal)}}</th>
  30. <th class="pl-2">
  31. <a href="{{route('admin.orders')}}">Order Value</a>
  32. </th>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>
  37. <div class="col-lg-6">
  38. <h2 class="font-size-14 fw-bold mb-2">Action Pending</h2>
  39. <table class="table table-sm table-bordered dashboard-stats-table">
  40. <tbody>
  41. <tr>
  42. <?php
  43. $c = \App\Models\User::whereHas('storeOrdersAsClient', function($qry){
  44. return $qry->whereRaw('(store_order.id NOT IN (SELECT financial_transaction.order_id FROM financial_transaction))');
  45. })->orderBy('created_at', 'DESC')->paginate(30);
  46. ?>
  47. <th class="px-2 bg-light fw-bold text-nowrap min-width-70px">
  48. {{ $c->total() }}
  49. </th>
  50. <th class="pl-2 w-100">
  51. <a href="{{route('admin.report', 'new-orders-pending-processing')}}">Users With New order{{$c === 1 ? '' : 's'}} pending processing</a>
  52. </th>
  53. </tr>
  54. </tbody>
  55. </table>
  56. </div>
  57. </div>
  58. </div>
  59. @endsection