@extends('layouts.appmin')

@section('tajuk')
Dashboard
@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>
    </ul>
@endsection

@section('content')

<div class="row mt-4">
    <div class="col-lg-12">
        <form action="{{ route('get-bilpelbagai') }}" method="post">
            @csrf
            <div class="card mb-3">
                <div class="card-body">
                    <div class="row">
                        <div class="col-12 mb-3">
                            <label for="carian">No KP atau Katakunci Nama</label>
                            <input id="carian" name="carian" type="text" value="" required autofocus class="form-control ">
                        </div>
                        <div class="col-12 mb-3">
                        <input id="hantar" class="btn btn-primary" type="submit" value="Cari"/>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<div class="row mt-4">
        <div class="col-lg-12">
            
        @if(!is_null($no_pelanggans))    
            @foreach($no_pelanggans as $no_pelanggan)
                <h5>No Pelanggan : {{$no_pelanggan->nopelanggan}}</h5>
                <h6>Nama Pelanggan : {{$no_pelanggan->nama}}</h6>
                <h6>No KP Pelanggan : {{$no_pelanggan->nokpdaftar}}</h6>
            <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>No Bil</th>
                            <th>No Akaun Bil Pel</th>
                            <th>Tarikh Bil</th>
                            <th>Keterangan</th>
                            <th>Amaun</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $i = 0; ?>   
                        @foreach($no_pelanggan->bilpels as $bil)
                            <?php $i++; ?>
                        <tr class="align-middle text-sm">
                            <td><?php echo $i; ?>.</td>
                            <td>{{$bil->nobil}}</td>
                            <td>{{$bil->noakaun}}</td>
                            <td>{{$bil->tarikh}}</td>
                            <td>{{$bil->keterangan}}</td>
                            <td>{{$bil->amaun}}</td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>                      
            </div> 
            @endforeach
        @endif                       
        </div> <!-- /.col -->                   
    </div> <!--end::Row-->

@endsection