@extends('crudbooster::admin_template_no_side_bar')

@section('content')
<?php
    use Carbon\Carbon;
    setlocale(LC_TIME, 'id');
    
   // var_dump($usaha_saya);
?>
<section class="data-pelatihan">
        <div class="box">
            <div class="box-header">
                <strong>Anda akan Mengajukan Permohonan "{{ $row->bantuan }}"</strong>
            </div>
                <div class="card" >
                    <div class="card-body">
                            <table  class="table table-hover table-striped table-bordered w-auto">
                                <tr>
                                    <td>
                                        Pemberi Bantuan
                                    </td>
                                    <td>
                                        {{ $row->pemberi_bantuan }}
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Tanggal
                                    </td>
                                    <td>
                                        {{ strftime( "%d %B %Y", strtotime($row->updated_at))  }}
                                    </td>
                                </tr>
                        </table>
                   </div>
                   <div class="card-footer">
                         @if( date($row->aktif) == 1)
                            <form method='post' action='{{CRUDBooster::mainpath("daftar-bantuan")}}'>
                		        <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
                		        <input type="hidden" name="id" value="{{ $row->id }}"/>
                		        <input type="hidden" name="warga_bjb_id" value="{{ $warga_bjb_id }}"/>
                		        <input type="hidden" name="owner_priv" value="{{ $row->updated_by_priv }}"/>
                		        <input type="hidden" name="usaha_required" value="{{ $row->usaha_required }}"/>
                		        @if($row->usaha_required==1)
                    		        @if(sizeof($usaha_saya)>0)
                    		            <table  class="table table-hover table-striped table-bordered ">
                    		                <tr>
                                                <td>
                                                    Pilih Usaha:
                                                </td>
                                                <td>
                                                    <select name="usaha" id="usaha">
                                                        <option value="0" selected>-- Silahkan Pilih Usaha --</option>
                                		            @foreach($usaha_saya as $us)
                                                         <option value="{{ $us->id }}">{{ $us->nama_usaha }}</option>
                                		            @endforeach
                                		            </select> 
                                                </td>
                                            </tr>
                        		        </table> 
                                            
                        		        <div class='form-group'>
                            			    <!--<input type="submit" class='btn btn-primary' value="VERIFIKASI" style="margin-left:15px"/>-->
                        					<input type="submit" class='btn btn-primary' value="LANJUTKAN" style="margin-left:15px"/>
                        					<a href="{{ CRUDBooster::mainpath('sistem-bantuan')}}" class="btn btn-info">Kembali</a> 
                        				</div>
                        		    @else
                        		        <div class='form-group'>
                        					<a href="{{ CRUDBooster::mainpath('sistem-bantuan')}}" class="btn btn-info">Kembali</a> 
                        				</div>
                    		        @endif
                    		    @else
                    		        <div class='form-group'>
                        			    <!--<input type="submit" class='btn btn-primary' value="VERIFIKASI" style="margin-left:15px"/>-->
                    					<input type="submit" class='btn btn-primary' value="LANJUTKAN" style="margin-left:15px"/>
                    					<a href="{{ CRUDBooster::mainpath('sistem-bantuan')}}" class="btn btn-info">Kembali</a> 
                    				</div>
                		        @endif
                    			
                			</form>
                            
                        @else
                            <a href="#" class="btn btn-danger">Pengumuman</a> 
                        @endif
                        @if (\Session::has('surat_exist'))
                                <div class="text-danger">{!! \Session::get('surat_exist') !!}</div>
                        @endif
                    </div>
                </div>
                <br>
        </div>
    </section>
@endsection