purchase_history.blade.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. @extends('frontend.layouts.user_panel')
  2. @section('panel_content')
  3. <div class="card">
  4. <div class="card-header">
  5. <h5 class="mb-0 h6">{{ translate('Purchase History') }}</h5>
  6. </div>
  7. @if (count($orders) > 0)
  8. <div class="card-body">
  9. <table class="table aiz-table mb-0">
  10. <thead>
  11. <tr>
  12. <th>{{ translate('Code')}}</th>
  13. <th data-breakpoints="md">{{ translate('Date')}}</th>
  14. <th>{{ translate('Amount')}}</th>
  15. <th data-breakpoints="md">{{ translate('Delivery Status')}}</th>
  16. <th data-breakpoints="md">{{ translate('Payment Status')}}</th>
  17. <th class="text-right">{{ translate('Options')}}</th>
  18. </tr>
  19. </thead>
  20. <tbody>
  21. @foreach ($orders as $key => $order)
  22. @if (count($order->orderDetails) > 0)
  23. <tr>
  24. <td>
  25. <a href="{{route('purchase_history.details', encrypt($order->id))}}">{{ $order->code }}</a>
  26. </td>
  27. <td>{{ date('d-m-Y', $order->date) }}</td>
  28. <td>
  29. {{ single_price($order->grand_total) }}
  30. </td>
  31. <td>
  32. {{ translate(ucfirst(str_replace('_', ' ', $order->delivery_status))) }}
  33. @if($order->delivery_viewed == 0)
  34. <span class="ml-2" style="color:green"><strong>*</strong></span>
  35. @endif
  36. </td>
  37. <td>
  38. @if ($order->payment_status == 'paid')
  39. <span class="badge badge-inline badge-success">{{translate('Paid')}}</span>
  40. @else
  41. <span class="badge badge-inline badge-danger">{{translate('Unpaid')}}</span>
  42. @endif
  43. @if($order->payment_status_viewed == 0)
  44. <span class="ml-2" style="color:green"><strong>*</strong></span>
  45. @endif
  46. </td>
  47. <td class="text-right">
  48. @if ($order->delivery_status == 'pending' && $order->payment_status == 'unpaid')
  49. <a href="javascript:void(0)" class="btn btn-soft-danger btn-icon btn-circle btn-sm confirm-delete" data-href="{{route('purchase_history.destroy', $order->id)}}" title="{{ translate('Cancel') }}">
  50. <i class="las la-trash"></i>
  51. </a>
  52. @endif
  53. <a href="{{route('purchase_history.details', encrypt($order->id))}}" class="btn btn-soft-info btn-icon btn-circle btn-sm" title="{{ translate('Order Details') }}">
  54. <i class="las la-eye"></i>
  55. </a>
  56. <a class="btn btn-soft-warning btn-icon btn-circle btn-sm" href="{{ route('invoice.download', $order->id) }}" title="{{ translate('Download Invoice') }}">
  57. <i class="las la-download"></i>
  58. </a>
  59. </td>
  60. </tr>
  61. @endif
  62. @endforeach
  63. </tbody>
  64. </table>
  65. <div class="aiz-pagination">
  66. {{ $orders->links() }}
  67. </div>
  68. </div>
  69. @endif
  70. </div>
  71. @endsection
  72. @section('modal')
  73. @include('modals.delete_modal')
  74. <div class="modal fade" id="order_details" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  75. <div class="modal-dialog modal-dialog-centered modal-xl" role="document">
  76. <div class="modal-content">
  77. <div id="order-details-modal-body">
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. @endsection
  83. @section('script')
  84. <script type="text/javascript">
  85. $('#order_details').on('hidden.bs.modal', function () {
  86. location.reload();
  87. })
  88. </script>
  89. @endsection