    <div class="row">
      <div class="col-sm-12 col-md-8">
        <div class="card card-round">
          <div class="card-header">
            <div class="card-head-row card-tools-still-right">
              <h4 class="card-title">Wang Proses</h4>
            </div>
          </div>
          <div class="card-body">
    @if(auth()->user()->hasRole(['pembantu tadbir', 'super'])&&($permohonan->status_progress == 'baru'))
            <div class="form-group">
                <label>Bil Pelbagai</label><br />
                <div class="row">
                    <div class="col-12">
                        <div class="d-flex">
                            <div class="form-check">
                                <input
                                    class="form-check-input"
                                    type="radio"
                                    name="cara_jana"
                                    id="cara_jana_mylesen" 
                                    value="mylesen"
                                />
                                <label
                                    class="form-check-label"
                                    for="cara_jana_mylesen"
                                >
                                    Automatik
                                </label>
                                <input id="janabil" class="btn btn-sm btn-secondary" type="button" name="janabil" value="Jana" disabled />
                                
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-12">
                        <div class="d-flex">
                            <div class="form-check">
                                <input
                                    class="form-check-input"
                                    type="radio"
                                    name="cara_jana"
                                    id="cara_jana_epbt"
                                    checked
                                    value="epbt"
                                />
                                <label
                                    class="form-check-label"
                                    for="cara_jana_epbt"
                                >
                                    Manual
                                </label>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-12">
                    <form action="{{route('pt.simpan-wangproses')}}" method="post">
                        @csrf
                        <input type="hidden" name="permohonan_id" id="permohonan_id" value="{{$permohonan->id}}">
                    
                        <div class="row g-3 align-items-center">
                            <div class="col-auto">
                                <label for="no_bil_pelbagai" class="col-form-label">No Akaun Bil Pebagai(BPELxxx) <small>(jana di ePBT)</small></label>
                            </div>
                            <div class="col-auto">
                                <input id="no_bil_pelbagai" class="form-control" type="text" name="no_bil_pelbagai" value="" />
                            </div>
                            <div class="col-auto">
                                <input id="simpanbil" class="btn btn-sm btn-secondary" disabled type="submit" name="simpanbil" value="Simpan" />
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            
    @endif
            <div class="row">
                <div class="col-12">
                    <table class="table">
                        <?php 
                        $i = 0;
                        ?>
                        <tr>
                            <th>#</th>
                            <th>No Akaun BP</th>
                            <th>No Resit<br />(Tarikh Bayar)</th>
                            <th>Bayaran<br />(RM)</th>
                        </tr>
                        @foreach($permohonan?->bilpelbagais as $bp)
                        <?php $i++; ?>
                        <tr>
                            <td><?php echo $i; ?>.</td>
                            <td>{{$bp->no_akaun_bilpelbagai}}</td>
                            <td>{{$bp->no_resit}}<br />{{$bp->dt_bayar}}</td>
                            <td>{{$bp->amaun_bayar}}</td>
                        </tr>
                        @endforeach
                    </table>
                </div>
            </div>
            <div class="row">
                <div class="col-12">
                    <form action="{{ route('get-bilpelbagai') }}" method="post" target="_blank">
                        @csrf
                        <input id="carian" name="carian" type="hidden" value="{{ $permohonan->user->nokp }}" required autofocus class="form-control ">
                        <input id="hantar" class="btn btn-primary" type="submit" value="Lihat Bil Pelbagai Dia"/>
                    </form>
                </div>
            </div>
          </div>
        </div>
      </div> <!-- /.col -->    
      <div class="col-sm-12 col-md-4">
        <div class="card card-round">
            <div class="card-header">
                <div class="card-head-row card-tools-still-right">
                <h4 class="card-title">Maklumat Fail</h4>
                </div>
            </div>        
            <div class="card-body"> 
    @if(auth()->user()->hasRole(['pembantu tadbir', 'super'])&&($permohonan->status_progress == 'semakan bayaran proses'))            
                <form action="{{route('pt.simpan-nofail')}}" method="post">
                    @csrf
                    <input type="hidden" name="permohonan_id" id="permohonan_id" value="{{$permohonan->id}}">
                    <div class="form-group">
                        <label for="no_fail_lesen">No Fail Lesen</label>
                        <input type="text" class="form-control" id="no_fail_lesen" name="no_fail_lesen"
                        value="{{ old('no_fail_lesen', $permohonan->no_fail_lesen) }}" />
                    </div> 
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="jenis_perniagaan">Jenis Perniagaan</label>
                                <select id="jenis_perniagaan" name="jenis_perniagaan" class="form-select" required>
                                    <option value=""></option>    
                                    <option value="makanan" {{ old('jenis_perniagaan', $permohonan?->jenis_perniagaan) == 'makanan' ? 'selected' : ''}}>makanan</option>
                                    <option value="minuman" {{ old('jenis_perniagaan', $permohonan?->jenis_perniagaan) == 'minuman' ? 'selected' : ''}}>minuman</option>
                                    <option value="makanan dan minuman" {{ old('jenis_perniagaan', $permohonan?->jenis_perniagaan) == 'makanan dan minuman' ? 'selected' : ''}}>makanan dan minuman</option>
                                    <option value="makanan berbungkus" {{ old('jenis_perniagaan', $permohonan?->jenis_perniagaan) == 'makanan berbungkus' ? 'selected' : ''}}>makanan berbungkus</option>
                                </select>
                            </div> 
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="kawasan">Kawasan</label>
                                <select id="kawasan" name="kawasan" class="form-select" required>
                                    <option value=""></option>    
                                    <option value="01" {{ old('kawasan', $permohonan?->kodkawasan) == '01' ? 'selected' : ''}}>skudai</option>
                                    <option value="04" {{ old('kawasan', $permohonan?->kodkawasan) == '04' ? 'selected' : ''}}>kangkar pulai</option>
                                    <option value="05" {{ old('kawasan', $permohonan?->kodkawasan) == '05' ? 'selected' : ''}}>gelang patah</option>
                                    <option value="07" {{ old('kawasan', $permohonan?->kodkawasan) == '07' ? 'selected' : ''}}>ulu choh</option>
                                    <option value="08" {{ old('kawasan', $permohonan?->kodkawasan) == '08' ? 'selected' : ''}}>lima kedai</option> 
                                    <option value="09" {{ old('kawasan', $permohonan?->kodkawasan) == '09' ? 'selected' : ''}}>iskandar puteri</option>
                                    <option value="11" {{ old('kawasan', $permohonan?->kodkawasan) == '11' ? 'selected' : ''}}>teknologi johor</option> 
                                    <option value="13" {{ old('kawasan', $permohonan?->kodkawasan) == '13' ? 'selected' : ''}}>tanjung kupang dan sekitar</option>
                                </select>
                            </div> 
                        </div>
                    </div>
                    <div class="form-group">
                        <input id="simpannofail" class="btn btn-sm btn-secondary" type="submit" name="simpannofail" value="Simpan" />
                    </div>
                </form>
                <hr>
                <form action="{{route('pt.hantar-ppk')}}" method="post">
                        @csrf
                        <input type="hidden" name="permohonan_id" id="permohonan_id" value="{{$permohonan->id}}">
                        <div class="form-group">
                            <label class="form-check-label" for="flexRadioDefault1">
                                Serah kepada Penolong Pegawai Kesihatan
                            </label>
                        </div>
                        <div class="form-group">
                            <input id="simpan" class="btn btn-sm btn-secondary" type="submit" name="janabil" value="Hantar" />
                        </div> 
                    </div>
                </form>
        @else
        
                  <div class="form-group">
                      <label for="no_fail_lesen">No Fail Lesen</label>
                      <input type="text" class="form-control" id="no_fail_lesen" disabled
                      value="{{ old('no_fail_lesen', $permohonan->no_fail_lesen) }}" />
                  </div> 
                  <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label for="jenis_perniagaan">Jenis Perniagaan</label>
                            <input type="text" class="form-control" id="jenis_perniagaan" disabled
                            value="{{ old('jenis_perniagaan', $permohonan->jenis_perniagaan) }}" />
                        </div> 
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label for="kodkawasan">Kawasan</label>
                            <input type="text" class="form-control" id="kodkawasan" disabled
                            value="{{ old('kodkawasan', $permohonan->kodkawasan) }}" />
                        </div>                         
                    </div>
                  </div>
        @endif
            </div>
        </div>
      </div> <!-- /.col -->         
    </div> <!--end::Row-->
    

    @section('js')
    
    @if(auth()->user()->hasRole(['pembantu tadbir', 'super'])&&($permohonan->status_progress == 'baru'))
    <!-- Select2 -->
        <script src="{{ asset('plugins/select2/js/select2.full.min.js') }}"></script>
        <script type="text/javascript" src="https://js.arcgis.com/4.25/"></script>

        <script type="text/javascript">
        
        $(document).ready(function() {	
            
            $('#cara_jana_mylesen').click(function(){
                $('#janabil').removeAttr('disabled');
                $('#simpanbil').attr('disabled', 'disabled');
            });
            
            $('#cara_jana_epbt').click(function(){
                $('#simpanbil').removeAttr('disabled');
                $('#janabil').attr('disabled', 'disabled');
            });

            $('#no_bil_pelbagai').change(function() {
                let nobil = $(this).val();

                if(nobil != ''){
                    $('#simpanbil').removeAttr('disabled');
                }
                else{
                $('#simpanbil').attr('disabled', 'disabled');
                }
            })
        });
        </script>
        @endif
    @endsection