@extends('layouts.appmin')

@section('tajuk')
Senarai Belum Bayar Lesen
@endsection


@section('breadcrumb')
    <ul class="breadcrumbs mb-3">
        <li class="nav-home">
            <a href="#">
            <i class="icon-home"></i>
            </a>
        </li>
        <li class="separator">
            <i class="icon-arrow-right"></i>
        </li>
        <li class="nav-item">
            <a href="#">Penjaja</a>
        </li>
        <li class="separator">
            <i class="icon-arrow-right"></i>
        </li>
        <li class="nav-item">
            <a href="#">Belum Bayar Lesen</a>
        </li>
    </ul>
@endsection

@section('content')                    

    <div class="row mt-4">
        <div class="col-lg-12">
            <a href="{{route('pt.semaklesenhutang')}}" class="btn btn-primary mb-4">Semak di ePBT</a>
            <div class="table-responsive p-0 text-sm text-secondary">
                <table class="table align-items-center mb-0"  id="senarai">
                    <thead>
                        <tr>
                            <th style="width: 10px">#</th>
                            <th>Tarikh<br>Mohon</th>
                            <th>Tarikh<br />Lesen</th>
                            <th>Pemohon</th>
                            <th>Perniagaan</th>
                            <th>Jenis Penjaja</th>
                            <th>Alamat Aktiviti</th>
                            <th>&nbsp;</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $i = 0; ?>
                        @foreach($senarais as $senarai)
                        <tr class="align-middle text-sm">
                            <td><?php echo ++$i; ?></td>
                            <td>{{$senarai->created_at}}</td>
                            <td>{{$senarai->dt_lesen_dikeluarkan}}</td>
                            <td>{{stripslashes($senarai->user->name)}}<br><small>{{$senarai->user->nokp}}</small></td>
                            <td>{{$senarai->syarikat->name}}<br><small>{{$senarai->syarikat->nossm}}</small></td>
                            <td>{{$senarai->jenis}}</td>
                            <td>
                                @if(!is_null($senarai->penempatan?->nama)) {{ucwords($senarai->penempatan?->nama)}},<br /> @endif
                                @if(!is_null($senarai->jalan?->nama)) {{ucwords(strtolower($senarai->jalan?->nama))}},<br /> @endif
                                @if(!is_null($senarai->taman?->nama)) {{ucwords(strtolower($senarai->taman?->nama))}},<br /> @endif
                               {{ucwords(strtolower($senarai->kawasan->nama))}}</td>
                            <td><a href="{{route('admin.papar', [$senarai->id])}}"><i class="fas fa-file-signature"></i></a></td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>                      
            </div>                        
        </div> <!-- /.col -->                   
    </div> <!--end::Row-->
@endsection
@section('js')
<script>
$(document).ready(function () {
    $('#senarai').DataTable({
        dom: '<"row mb-3"<"col-md-3 col-sm-6"f><"col-md-8 col-sm-2"><"col-md-1 col-sm-4"l>>' +
                '<"row"<"col-12"tr>>' +
                '<"row mt-3"<"col-md-5"i><"col-md-7"p>>',
        language: {
            search: '<span class="me-2">Cari:</span>',
            lengthMenu: '<span class="me-2">Show</span> _MENU_'
        },
        responsive: true
    });
});

</script>
@endsection