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

@push('title') Income Lists @endpush
@section('css')
    <style>
        .th-white-space th{
            white-space: nowrap;
        }
    </style>
    <!-- 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') Advertiser @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>
                                    <!--<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 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