users.blade.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. @extends('backend.layouts.app')
  2. @section('content')
  3. <div class="card">
  4. <div class="card-header">
  5. <h5 class="mb-0 h6">{{ translate('Affiliate Users')}}</h5>
  6. </div>
  7. <div class="card-body">
  8. <table class="table aiz-table">
  9. <thead>
  10. <tr>
  11. <th>#</th>
  12. <th>{{ translate('Name')}}</th>
  13. <th data-breakpoints="lg">{{ translate('Phone')}}</th>
  14. <th data-breakpoints="lg">{{ translate('Email Address')}}</th>
  15. <th data-breakpoints="lg">{{ translate('Verification Info')}}</th>
  16. <th>{{ translate('Approval')}}</th>
  17. <th data-breakpoints="lg">{{ translate('Due Amount') }}</th>
  18. <th width="10%" class="text-right">{{ translate('Options')}}</th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. @foreach($affiliate_users as $key => $affiliate_user)
  23. @if($affiliate_user->user != null)
  24. <tr>
  25. <td>{{ ($key+1) + ($affiliate_users->currentPage() - 1)*$affiliate_users->perPage() }}</td>
  26. <td>{{$affiliate_user->user->name}}</td>
  27. <td>{{$affiliate_user->user->phone}}</td>
  28. <td>{{$affiliate_user->user->email}}</td>
  29. <td>
  30. @if ($affiliate_user->informations != null)
  31. <a href="{{ route('affiliate_users.show_verification_request', $affiliate_user->id) }}">
  32. <span class="badge badge-inline badge-info">{{translate('Show')}}</span>
  33. </a>
  34. @endif
  35. </td>
  36. <td>
  37. <label class="aiz-switch aiz-switch-success mb-0">
  38. <input onchange="update_approved(this)" value="{{ $affiliate_user->id }}" type="checkbox" <?php if($affiliate_user->status == 1) echo "checked";?> >
  39. <span class="slider round"></span>
  40. </label>
  41. </td>
  42. <td>
  43. @if ($affiliate_user->balance >= 0)
  44. {{ single_price($affiliate_user->balance) }}
  45. @endif
  46. </td>
  47. <td class="text-right">
  48. <a href="#" class="btn btn-soft-primary btn-icon btn-circle btn-sm" onclick="show_payment_modal('{{$affiliate_user->id}}');" title="{{ translate('Pay Now') }}">
  49. <i class="las la-money-bill"></i>
  50. </a>
  51. <a class="btn btn-soft-success btn-icon btn-circle btn-sm" href="{{route('affiliate_user.payment_history', encrypt($affiliate_user->id))}}" title="{{ translate('Payment History') }}">
  52. <i class="las la-history"></i>
  53. </a>
  54. <!-- <a href="#" class="btn btn-soft-danger btn-icon btn-circle btn-sm confirm-delete" data-href="{{route('sellers.destroy', $affiliate_user->id)}}" title="{{ translate('Delete') }}">
  55. <i class="las la-trash"></i>
  56. </a> -->
  57. </td>
  58. </tr>
  59. @endif
  60. @endforeach
  61. </tbody>
  62. </table>
  63. <div class="aiz-pagination">
  64. {{ $affiliate_users->appends(request()->input())->links() }}
  65. </div>
  66. </div>
  67. </div>
  68. @endsection
  69. @section('modal')
  70. @include('modals.delete_modal')
  71. <div class="modal fade" id="payment_modal">
  72. <div class="modal-dialog">
  73. <div class="modal-content" id="modal-content">
  74. </div>
  75. </div>
  76. </div>
  77. @endsection
  78. @section('script')
  79. <script type="text/javascript">
  80. function show_payment_modal(id){
  81. $.post('{{ route('affiliate_user.payment_modal') }}',{_token:'{{ @csrf_token() }}', id:id}, function(data){
  82. $('#payment_modal #modal-content').html(data);
  83. $('#payment_modal').modal('show', {backdrop: 'static'});
  84. AIZ.plugins.bootstrapSelect('refresh');
  85. });
  86. }
  87. function update_approved(el){
  88. if(el.checked){
  89. var status = 1;
  90. }
  91. else{
  92. var status = 0;
  93. }
  94. $.post('{{ route('affiliate_user.approved') }}', {_token:'{{ csrf_token() }}', id:el.value, status:status}, function(data){
  95. if(data == 1){
  96. AIZ.plugins.notify('success', '{{ translate('Approved sellers updated successfully') }}');
  97. }
  98. else{
  99. AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
  100. }
  101. });
  102. }
  103. </script>
  104. @endsection