@extends('layouts.appmin')

@section('tajuk')
Senarai Untuk Dibawa ke Mesyuarat
@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="#">Untuk Dibawa ke Mesyuarat</a>
      </li>
    </ul>
@endsection

@section('content')                    
    <form action="{{route('pt.cetak-lampiran-b')}}" method="post">
        @csrf
        <input type="hidden" name="mesyuarat_id" value="{{$mesyuarat->id}}">
    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title">Mesyuarat Jawatankuasa Kesihatan dan Pelesenan (Bilangan {{$mesyuarat->bil_mesyuarat}}/{{$mesyuarat?->tahun}})</h4>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-sm-12 col-md-6">
                            <p>Tarikh : {{$mesyuarat->dt_mesyuarat}}</p>
                            <p>Bilangan Permohonan : {{$mesyuarat->lesen_penjajas->count()}}</p>
                            <div class="form-group">
                                <label for="bylaw">By-Law Lesen</label>
                                <input type="text" class="form-control" name="bylaw" id="bylaw" value="Undang-undang Kecil Penjaja(MBIP)2020">
                            </div>
                            <div class="form-group">
                                <label for="kodlesen">Kod Lesen</label>
                                <input type="text" class="form-control" id="kodlesen" name="kodlesen" value="71408">
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-6">
                            <div class="form-group">
                                <table class="table">
                                    <tr>
                                        <th>Lesen</th>
                                        <td>
                                            <div class="form-group">
                                                <div class="input-group mb-0">
                                                    <span class="input-group-text">RM</span>
                                                    <input
                                                    type="text"
                                                    class="form-control"
                                                    aria-label="Kadar Lesen" value="60.00"
                                                    />
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                    <th>Sampah</th>
                                        <td>
                                            <div class="form-group">
                                                <div class="input-group mb-0">
                                                    <span class="input-group-text">RM</span>
                                                    <input
                                                    type="text"
                                                    class="form-control"
                                                    aria-label="Kadar Sampah" value="60.00"
                                                    />
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                    <th>Sewa Petak</th>
                                        <td>
                                            <div class="form-group">
                                                <div class="input-group mb-0">
                                                    <span class="input-group-text">RM</span>
                                                    <input
                                                    type="text"
                                                    class="form-control"
                                                    aria-label="Kadar Sewa Petak" value="60.00"
                                                    />
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                    <th>Patil</th>
                                        <td>
                                            <div class="form-group">
                                                <div class="input-group mb-0">
                                                    <span class="input-group-text">RM</span>
                                                    <input
                                                    type="text"
                                                    class="form-control"
                                                    aria-label="Kadar Patil" value="8.50"
                                                    />
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                    <th></th>
                                        <td>
                                            <div class="form-group">
                                                <div class="input-group mb-0">
                                                    <span class="input-group-text">RM</span>
                                                    <input
                                                    type="text"
                                                    class="form-control"
                                                    aria-label="Kadar Lesen" value="188.50"
                                                    />
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                    <input type="submit" class="btn btn-primary" value="Lampiran B">
                    <input type="submit" class="btn btn-primary" value="Sahkan Senarai">
                </div>
            </div>
        </div>
    </div>
    </form>
    <div class="row">
        <div class="col-md-6">
            <div class="row">                
                <div class="col-md-12">
                    <div class="card">
                        <div class="card-header">
                            <h4 class="card-title">Akan Dibawa ke Mesyuarat (Bilangan {{$mesyuarat?->bil_mesyuarat}}/{{$mesyuarat?->tahun}})</h4>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table id="senarai2" class="display table table-striped table-hover" >
                                    <thead>
                                        <tr>
                                            <th style="width: 10px">#</th>
                                            <th>Tarikh<br>Arahan</th>
                                            <th>Pemohon<br />Perniagaan</th>
                                            <th>Jenis Penjaja</th>
                                            <th>Kawasan</th>
                                            <th>No Fail<br />No Akaun Permohonan</th>
                                            <th>&nbsp;</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $i = 0; ?>
                                        @if(!is_null($mesyuarat?->lesen_penjajas))
                                            @foreach($mesyuarat?->lesen_penjajas as $senarai)
                                            <?php $i++; ?>
                                            <tr class="align-middle text-sm">
                                                <td><?php echo $i; ?></td>
                                                <td>{{$senarai->ulasanPegawai[0]->dt_pengarah_ulas}}</td>
                                                <td>{{stripslashes($senarai->user->name)}}<br>
                                                    <small>[{{$senarai->syarikat->name}}]</small></td>
                                                <td>{{$senarai->jenis}}</td>
                                                <td>{{$senarai->kawasan->nama}}</td>
                                                    <td>{{$senarai->no_fail_lesen}}
                                                        <br />[{{$senarai->no_akaun_permohonan}}]</td>
                                                <td><a href="{{route('pt.buang-dari-mesyuarat', [$senarai->id, $mesyuarat->id])}}"><i class="fas fa-file-export fa-lg"></i></a></td>
                                            </tr>
                                            @endforeach
                                        @endif
                                    </tbody>
                                </table>                      
                            </div>              
                        </div>              
                    </div>                                                  
                </div> <!-- /.col -->    
            </div>
        </div>
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title">Belum Dibawa ke Mesyuarat</h4>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table id="senarai3" class="display table table-striped table-hover" >
                            <thead>
                                <tr>
                                    <th style="width: 10px">#</th>
                                    <th>Tarikh<br>Mohon</th>
                                    <th>Pemohon<br />Perniagaan</th>
                                    <th>Jenis Penjaja</th>
                                    <th>Kawasan</th>
                                    <th>No Fail<br />No Akaun Permohonan</th>
                                    <th>&nbsp;</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $i = 0; ?>
                                @foreach($senarais as $senarai)
                                <?php $i++; ?>
                                <tr class="align-middle text-sm table-warning">
                                    <td><?php echo $i; ?></td>
                                    <td>{{$senarai->tarikhmohon}}</td>
                                    <td>{{stripslashes($senarai->user->name)}}<br>
                                        <small>[{{$senarai->syarikat->name}}]</small></td>
                                    <td>{{$senarai->jenis}}</td>
                                    <td>{{$senarai->kawasan->nama}}</td>
                                        <td>{{$senarai->no_fail_lesen}}
                                            <br />[{{$senarai->no_akaun_permohonan}}]</td>
                                    <td><a href="{{route('pt.tambah-ke-mesyuarat', [$senarai->id, $mesyuarat?->id])}}"><i class="fas fa-file-import fa-lg"></i></a></td>
                                </tr>
                                @endforeach
                            </tbody>
                        </table>                      
                    </div>              
                </div>              
            </div>                                                  
        </div> <!-- /.col -->                   
    </div> <!--end::Row-->
@endsection
@section('js')
<script>
$(document).ready(function () {
    $('#senarai').DataTable({
        responsive: true
    });
});

</script>
@endsection