Current File : //home/tradevaly/public_html/resources/views/backend/pages/advertiser/pending.blade.php
@extends('backend.ayaan.master')

@push('title') Income Lists @endpush
@section('css')
    <!-- DataTables -->
    <link href="{{ asset('/assets/libs/datatables/datatables.min.css') }}" rel="stylesheet" type="text/css" />
@endsection
@section('content')

    @component('components.breadcrumb')
        @slot('li_1') Dashboards @endslot
        @slot('title')Pending Advertisment @endslot
    @endcomponent
 <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body">
                    

                    <div class="table-responsive ">
                        <table class="table th-white-space" id="datatable-buttons">
                            <thead>
                            <tr>
                                <th class="text-center">#</th>
                                <th>{{translate('Member ID')}}</th>
                                <th>{{translate('Comapany Name')}}</th>
                                <th>{{translate('Contact Number')}}</th>
                                <th>{{translate('Banner Location')}}</th>
                                <th>{{translate('Duration')}}</th>
                                <th>{{translate('Amount')}}</th>
                                <th>{{translate('Payment Status')}}</th>
                                <th>{{translate('Action')}}</th>
                            </tr>
                            </thead>
                            <tbody>

                            @foreach ($advertisers as $advertiser)
                                <tr>
                                    <td class="text-center">{{$loop->iteration}}</td>
                                    <td class="text-center">{{$advertiser->id}}</td>
                                    <td>
                                        @if($advertiser->user)
                                            {{$advertiser->user->company?$advertiser->user->company->name:"Company Not Exists"}}
                                        @else
                                            Company Not Exists
                                        @endif
                                    </td>
                                    <td>
                                        {{$advertiser->user?$advertiser->user->phone:"User Not Exists"}}
                                    </td>
                                    <td>
                                        {{ $advertiser->advertiser_name }}
                                    </td>
                                    <td>
                                        {{$advertiser->duration}} Month
                                    </td>
                                    <td>
                                        @if($advertiser->currency == 'BDT')
                                            Tk{{ $advertiser->amount * settings()->bdt_rate }}
                                        @else
                                            ${{ $advertiser->amount }}
                                        @endif
                                    </td>

                                    <td>
                                        <span class="text-uppercase badge bg-{{ $advertiser->payment_status == 'paid' ? 'success': 'danger'}}">
                                            {{ $advertiser->payment_status }}
                                        </span>
                                    </td>
                                    <td>
                                               <a class="btn btn-info btn-sm d-block mb-2 btn-sm"
                                                   href="{{ route('admin.advertiser.invoice_details',$advertiser->id) }}">
                                                   <i class="fa fa-download"></i> Invoice
                                             </a> 
                                            
                                                @if($advertiser->payment_status == 'paid')
                                                    <a style="white-space: nowrap;" class="btn btn-success mb-2 btn-sm d-block  text-nowrap" href="{{ route('admin.advertiser.money_receipt',$advertiser->id) }}">
                                                        <i class="fa fa-download"></i>  Money Receipt
                                                    </a>
                                                @endif
                                        
                                    </td>

                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                    </div>
                    
                </div>
            </div>
        </div>
    </div>
    <!-- end row -->
@endsection
@section('script')
    <!-- Required datatable js -->
    <script src="{{ asset('/assets/libs/datatables/datatables.min.js') }}"></script>
    <script src="{{ asset('/assets/libs/jszip/jszip.min.js') }}"></script>
    <script src="{{ asset('/assets/libs/pdfmake/pdfmake.min.js') }}"></script>
    <!-- Datatable init js -->
     <script>
         let advertiser_buttons = document.querySelectorAll('.advertiser_buttons');
         
         advertiser_buttons.addEventListener("click",updateFunction);
         function updateFunction(){
             console.log('mehedi');
         }
     </script>
    <script type="text/javascript">
  $(function () {
    
    
    
    
    $(document).ready(function () {
 
  var table = $('#datatable-buttons').DataTable({
    lengthChange: false,
    processing: true,
    dom: 'Bfrtip',
        
    buttons: ['copy', 'excel', 'pdf', 'colvis']
  });
  table.buttons().container().appendTo('#datatable-buttons_wrapper .col-md-6:eq(0)');
  $(".dataTables_length select").addClass('form-select form-select-sm');
});
});
</script>
@endsection