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

@section('title') Income Lists @endsection
@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 Placement')}}</th>
                                <th>{{translate('Banner Location')}}</th>
                                <th>{{translate('Duration')}}</th>
                                <th>{{translate('Amount')}}</th>
                                <th>{{translate('Invoice Number')}}</th>
                                <th>{{translate('Invoice')}}</th>
                                <th> Expired Date</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>

                                    </td>
                                    <td>
                                        {{$advertiser->duration}} Month
                                    </td>
                                    <td>
                                        @if($advertiser->currency == 'BDT')
                                            Tk{{ $advertiser->amount * settings()->bdt_rate }}
                                        @else
                                            ${{ $advertiser->amount }}
                                        @endif
                                    </td>

                                    <td>
                                        {{ $advertiser->order_id }}
                                    </td>
                                    <td>
                                        <a class="badge bg-success"
                                           href="{{ route('admin.advertiser.invoice_details',$advertiser->id) }}">
                                           <i class="fa fa-download"></i> Invoice
                                        </a>

                                        @if($advertiser->payment_status == 'paid')
                                            <span>| </span>
                                            <a  class="badge bg-warning" href="{{ route('admin.advertiser.money_receipt',$advertiser->id) }}">
                                                <i class="fa fa-download"></i>  Money Receipt
                                            </a>
                                        @endif
                                    </td>
                                    <td>
                                        <span
                                            class="badge bg-info"> {{ \Carbon\Carbon::parse($advertiser->start_date)->format('d/m/Y H:i A')}} </span>
                                        To <span
                                            class="badge bg-info"> {{ \Carbon\Carbon::parse($advertiser->expire_date)->format('d/m/Y H:i A')  }}</span>

                                    </td>

                                    <td>
                                        <span class="text-uppercase badge bg-{{ $advertiser->payment_status == 'paid' ? 'success': 'danger'}}">
                                            {{ $advertiser->payment_status }}
                                        </span>
                                    </td>
                                    <td>
                                        <div class="dropdown">
                                            <button class="btn dropdown-toggle btn-sm" type="button"
                                                    id="dropdownMenuButton1" data-bs-toggle="dropdown"
                                                    aria-expanded="false">
                                                    <i class="fa fa-ellipsis-v"></i>
                                            </button>
                                            <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
                                                <li>
                                                    <a class="dropdown-item text-info"
                                                       href="{{ route('admin.advertiser.show',$advertiser->id) }}">
                                                        View
                                                    </a>
                                                </li>
                                                @if($advertiser->status != 'active')
                                                    <li>
                                                        <a href="javascript:void(0)" class="dropdown-item text-success"
                                                           data-bs-toggle="modal"
                                                           data-bs-target="#exampleModal_{{ $advertiser->id }}">
                                                            Active
                                                        </a>
                                                    </li>
                                                @else
                                                    <li>
                                                        <a href="{{ route('admin.advertiser.unactive_status',$advertiser->id) }}"
                                                           class="dropdown-item text-warning">
                                                            Unactive
                                                        </a>
                                                    </li>
                                                @endif

                                                <li>
                                                    <a class="dropdown-item text-danger"
                                                       href="{{ route('admin.advertiser.destroy',$advertiser->id) }}">
                                                        Delete
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>
                                    </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