index.blade.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. @extends('backend.layouts.app')
  2. @section('content')
  3. <div class="card">
  4. <div class="card-header">
  5. <h5 class="mb-0 h6">{{translate('Seller Withdraw Request')}}</h5>
  6. </div>
  7. <div class="card-body">
  8. <table class="table aiz-table mb-0">
  9. <thead>
  10. <tr>
  11. <th data-breakpoints="lg">#</th>
  12. <th data-breakpoints="lg">{{translate('Date')}}</th>
  13. <th>{{translate('Seller')}}</th>
  14. <th data-breakpoints="lg">{{translate('Total Amount to Pay')}}</th>
  15. <th>{{translate('Requested Amount')}}</th>
  16. <th>{{translate('Type')}}</th>
  17. <th data-breakpoints="lg">{{ translate('Withdraw type') }}</th>
  18. <th data-breakpoints="lg" width="20%">{{ translate('Message') }}</th>
  19. <th data-breakpoints="lg">{{ translate('Status') }}</th>
  20. <th data-breakpoints="lg" width="15%" class="text-right">{{translate('Options')}}</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. @foreach($seller_withdraw_requests as $key => $seller_withdraw_request)
  25. @php $user = \App\Models\User::find($seller_withdraw_request->user_id); @endphp
  26. @if ($user && $user->shop)
  27. <tr>
  28. <td>{{ ($key+1) + ($seller_withdraw_requests->currentPage() - 1)*$seller_withdraw_requests->perPage() }}</td>
  29. <td>{{ $seller_withdraw_request->created_at }}</td>
  30. <td>{{ $user->name }} ({{ $user->shop->name }})</td>
  31. <td>{{ single_price($user->shop->admin_to_pay) }}</td>
  32. <td>{{ single_price($seller_withdraw_request->amount) }}</td>
  33. <td>
  34. @if( $seller_withdraw_request->type == 1)
  35. {{translate('User Balance')}}
  36. @else
  37. {{translate('Guarantee')}}
  38. @endif
  39. </td>
  40. <td>
  41. @if ($seller_withdraw_request->w_type == 1)
  42. {{translate('Cash')}}
  43. @elseif ($seller_withdraw_request->w_type == 2)
  44. {{translate('Bank')}}
  45. @elseif ($seller_withdraw_request->w_type == 3)
  46. {{translate('USDT')}}
  47. @endif
  48. </td>
  49. <td>
  50. {{ $seller_withdraw_request->message }}
  51. </td>
  52. <td>
  53. @if ($seller_withdraw_request->status == 1)
  54. <span class="badge badge-inline badge-success">{{translate('Paid')}}</span>
  55. @elseif ($seller_withdraw_request->status == 2)
  56. <span class="badge badge-inline badge-error">{{translate('Refuse')}}</span>
  57. @else
  58. <span class="badge badge-inline badge-info">{{translate('Pending')}}</span>
  59. @endif
  60. </td>
  61. <td class="text-right">
  62. @if ($seller_withdraw_request->status == 0)
  63. <a onclick="show_seller_payment_modal('{{$seller_withdraw_request->user_id}}','{{ $seller_withdraw_request->id }}');" class="btn btn-soft-warning btn-icon btn-circle btn-sm" href="javascript:void(0);" title="{{ translate('Pay Now') }}">
  64. <i class="las la-money-bill"></i>
  65. <a onclick="show_refuse_modal('{{$seller_withdraw_request->user_id}}','{{ $seller_withdraw_request->id }}');" class="btn btn-soft-warning btn-icon btn-circle btn-sm" href="javascript:void(0);" title="{{ translate('Refuse') }}">
  66. <i class="las la-money-bill"></i>
  67. </a>
  68. @endif
  69. <a onclick="show_message_modal('{{ $seller_withdraw_request->id }}');" class="btn btn-soft-success btn-icon btn-circle btn-sm" href="javascript:void(0);" title="{{ translate('Message View') }}">
  70. <i class="las la-eye"></i>
  71. </a>
  72. <a href="{{route('sellers.payment_history', encrypt($seller_withdraw_request->user_id))}}" class="btn btn-soft-primary btn-icon btn-circle btn-sm" title="{{ translate('Payment History') }}">
  73. <i class="las la-history"></i>
  74. </a>
  75. </td>
  76. </tr>
  77. @endif
  78. @endforeach
  79. </tbody>
  80. </table>
  81. <div class="aiz-pagination">
  82. {{ $seller_withdraw_requests->links() }}
  83. </div>
  84. </div>
  85. </div>
  86. @endsection
  87. @section('modal')
  88. <!-- payment Modal -->
  89. <div class="modal fade" id="payment_modal">
  90. <div class="modal-dialog">
  91. <div class="modal-content" id="payment-modal-content">
  92. </div>
  93. </div>
  94. </div>
  95. <div class="modal fade" id="refuse_modal">
  96. <div class="modal-dialog">
  97. <div class="modal-content" id="refuse_modal-content">
  98. </div>
  99. </div>
  100. </div>
  101. <!-- Message View Modal -->
  102. <div class="modal fade" id="message_modal">
  103. <div class="modal-dialog">
  104. <div class="modal-content" id="message-modal-content">
  105. </div>
  106. </div>
  107. </div>
  108. @endsection
  109. @section('script')
  110. <script type="text/javascript">
  111. function show_seller_payment_modal(id, seller_withdraw_request_id){
  112. $.post('{{ route('withdraw_request.payment_modal') }}',{_token:'{{ @csrf_token() }}', id:id, seller_withdraw_request_id:seller_withdraw_request_id}, function(data){
  113. $('#payment-modal-content').html(data);
  114. $('#payment_modal').modal('show', {backdrop: 'static'});
  115. $('.demo-select2-placeholder').select2();
  116. });
  117. }
  118. function show_refuse_modal(id, seller_withdraw_request_id){
  119. $.post('{{ route('withdraw_request.refuse_modal') }}',{_token:'{{ @csrf_token() }}', id:id, seller_withdraw_request_id:seller_withdraw_request_id}, function(data){
  120. $('#refuse_modal-content').html(data);
  121. $('#refuse_modal').modal('show', {backdrop: 'static'});
  122. });
  123. }
  124. function show_message_modal(id){
  125. $.post('{{ route('withdraw_request.message_modal') }}',{_token:'{{ @csrf_token() }}', id:id}, function(data){
  126. $('#message-modal-content').html(data);
  127. $('#message_modal').modal('show', {backdrop: 'static'});
  128. });
  129. }
  130. </script>
  131. @endsection