wallet_request_salesman.blade.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. @extends('salesman.layouts.app')
  2. @section('panel_content')
  3. <div class="card">
  4. <div class="card-header">
  5. <h5 class="mb-0 h6">{{translate('Offline Wallet Recharge Requests')}}</h5>
  6. </div>
  7. <div class="card-body">
  8. <table class="table aiz-table mb-0">
  9. <thead>
  10. <tr>
  11. <th>#</th>
  12. <th>{{translate('Name')}}</th>
  13. <th>{{translate('Amount')}}</th>
  14. <th>{{translate('Method')}}</th>
  15. <th>{{translate('TXN ID')}}</th>
  16. <th>{{translate('Photo')}}</th>
  17. <th>{{translate('Approval')}}</th>
  18. <th>{{translate('Date')}}</th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. @foreach($wallets as $key => $wallet)
  23. @if ($wallet->user != null)
  24. <tr>
  25. <td>{{ ($key+1) }}</td>
  26. <td>{{ $wallet->user->name }}</td>
  27. <td>{{ $wallet->amount }}</td>
  28. <td>{{ $wallet->payment_method }}</td>
  29. <td>{{ $wallet->payment_details }}</td>
  30. <td>
  31. @if ($wallet->reciept != null)
  32. <a href="{{ uploaded_asset($wallet->reciept) }}" target="_blank">{{translate('Open Reciept')}}</a>
  33. @endif
  34. </td>
  35. <td>
  36. <label class="aiz-switch aiz-switch-success mb-0">
  37. <input onchange="update_approved(this)" value="{{ $wallet->id }}" type="checkbox" @if($wallet->approval == 1) checked @endif >
  38. <span class="slider round"></span>
  39. </label>
  40. </td>
  41. <td>{{ $wallet->created_at }}</td>
  42. </tr>
  43. @endif
  44. @endforeach
  45. </tbody>
  46. </table>
  47. <div class="aiz-pagination">
  48. {{ $wallets->links() }}
  49. </div>
  50. </div>
  51. </div>
  52. @endsection
  53. @section('script')
  54. <script type="text/javascript">
  55. function update_approved(el){
  56. if(el.checked){
  57. var status = 1;
  58. }
  59. else{
  60. var status = 0;
  61. }
  62. $.post('{{ route('salesman.offline_recharge_request.approved') }}', {_token:'{{ csrf_token() }}', id:el.value, status:status}, function(data){
  63. if(data == 1){
  64. AIZ.plugins.notify('success', '{{ translate('Money has been added successfully') }}');
  65. }
  66. else{
  67. AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
  68. }
  69. });
  70. }
  71. </script>
  72. @endsection