@extends('root')
@section('styles')
<link rel="stylesheet" href="{{ url('/') }}/assets/global/css/wizard/style.css">
<link rel="stylesheet" href="{{ url('/') }}/assets/global/css/spectre.css">
@endsection
@section('content')
<section class="bg-05 page-hero-section division">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="hero-txt white-color">
                    <h3 class="h3-xs">Formulir Pengajuan Akreditasi</h3>
                </div>
            </div>
        </div>
    </div>
</section>
<section class="categories-section division">
    <div class="wizard-main">
        <div id="particles-js"></div>
        <div class="container">
            <div class="row">
                <div class="col-lg-12 login-sec">
                    <div class="login-sec-bg">
                        <form method="POST" id="main-form">
                            @csrf
                            @if(!empty($id))
                            <input type="hidden" name="id" value="{{$id}}">
                            @endif
                            <h3>Step I</h3>
                            <fieldset class="form-input" style="border: 0px">
                                <div class="">

                                    @php $no = ""; $rowspan=""; $number=""; $grup=""; $group_indikator=""; @endphp
                                    @foreach($asesmen_item1 as $i)

                                    <h5>{{$i['table']}}</h5>

                                    <div class="row mt-20">
                                        <div class="col-md-12">
                                            <table class="table table-bordered table-full">
                                                <tdead>
                                                    <tr>
                                                        <th width="5%" class="text-center">No</th>
                                                        <th width="60%">Indikator Asesmen</th>
                                                        <th width="35%">File Asesmen</th>
                                                    </tr>
                                                </tdead>
                                                <tbody>

                                                    @foreach($i['detail'] as $d)
                                                    <tr>
                                                        <td class="text-center">
                                                            
                                                            @if($group_indikator !=
                                                            $d->group_indikator) {{$d->group_indikator}} @endif
                                                        </td>
                                                        <td>@if(!empty($d->no_indikator)) {{$d->no_indikator}})
                                                            @endif {!! $d->indikator_asesmen !!}
                                                        </td>
                                                        <td>
                                                            @if($d->input_type == 'file')
                                                            <input type="hidden" name="item_id1[]" value="{{$d->item_id}}">
                                                            <input type="file" onchange="convertBase64(this, 'file_asesmen1')" name="file_asesmen1[]" class="form-document" accept="application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/pdf, image/*">
                                                            @else
                                                            <input type="hidden" name="text_itemId[]" value="{{$d->item_id}}">
                                                            <input type="text" name="text_asesmen[]" placeholder="Type URL here.." class="form-control"> 
                                                            @endif
                                                        </td>
                                                    </tr>

                                                    @php $no = $i['no']; $number=""; $group_indikator=$d->group_indikator;
                                                    @endphp
                                                    @endforeach

                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    @endforeach
                                </div>
                            </fieldset>

                            <h3>Step II</h3>
                            <fieldset class="form-input" style="border: 0px">
                                <div class="">

                                    @php $no = ""; $rowspan=""; $number=""; $grup=""; $group_indikator=""; @endphp
                                    @foreach($asesmen_item2 as $i)

                                    <h5>{{$i['table']}}</h5>

                                    <div class="row mt-20">
                                        <div class="col-md-12">
                                            <table class="table table-bordered table-full mb-40">
                                                <tdead>
                                                    <tr>
                                                        <th width="5%" class="text-center">No</th>
                                                        <th width="60%">Indikator Asesmen</th>
                                                        <th width="35%">File Asesmen</th>
                                                    </tr>
                                                </tdead>
                                                <tbody>

                                                    @foreach($i['detail'] as $d)
                                                    <tr>
                                                        <td class="text-center">
                                                            
                                                            @if($group_indikator !=
                                                            $d->group_indikator) {{$d->group_indikator}} @endif
                                                        </td>
                                                        <td>@if(!empty($d->no_indikator)) {{$d->no_indikator}})
                                                            @endif {!! $d->indikator_asesmen !!}
                                                        </td>
                                                        <td>
                                                            @if($d->input_type == 'file')
                                                            <input type="hidden" name="item_id2[]" value="{{$d->item_id}}">
                                                            <input type="file" onchange="convertBase64(this, 'file_asesmen2')" name="file_asesmen2[]" class="form-document" accept="application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/pdf, image/*">
                                                            @else
                                                            <input type="hidden" name="text_itemId[]" value="{{$d->item_id}}">
                                                            <input type="text" name="text_asesmen[]" placeholder="Type URL here.." class="form-control"> 
                                                            @endif
                                                        
                                                        </td>
                                                    </tr>

                                                    @php $no = $i['no']; $number=""; $group_indikator=$d->group_indikator;
                                                    @endphp
                                                    @endforeach

                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    @endforeach
                                </div>
                            </fieldset>

                            <h3>Step III</h3>
                            <fieldset class="form-input" style="border: 0px">
                                <div class="">

                                    @php $no = ""; $rowspan=""; $number=""; $grup=""; $group_indikator=""; @endphp
                                    @foreach($asesmen_item3 as $i)

                                    <h5>{{$i['table']}}</h5>
                                    <div class="row mt-20">
                                        <div class="col-md-12">
                                            <table class="table table-bordered table-full mb-40">
                                                <tdead>
                                                    <tr>
                                                        <th width="5%" class="text-center">No</th>
                                                        <th width="60%">Indikator Asesmen</th>
                                                        <th width="35%">File Asesmen</th>
                                                    </tr>
                                                </tdead>
                                                <tbody>

                                                    @foreach($i['detail'] as $d)

                                                    <tr>
                                                        <td class="text-center">
                                                            
                                                            @if($group_indikator !=
                                                            $d->group_indikator) {{$d->group_indikator}} @endif
                                                        </td>
                                                        <td>
                                                            @if(!empty($d->no_indikator)) {{$d->no_indikator}})
                                                            @endif {!! $d->indikator_asesmen !!}
                                                        </td>
                                                        <td>
                                                            @if($d->input_type == 'file')
                                                            <input type="hidden" name="item_id3[]" value="{{$d->item_id}}">
                                                            <input type="file" onchange="convertBase64(this, 'file_asesmen3')" name="file_asesmen3[]" class="form-document" accept="application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/pdf, image/*">
                                                            @else
                                                            <input type="hidden" name="text_itemId[]" value="{{$d->item_id}}">
                                                            <input type="text" name="text_asesmen[]" placeholder="Type URL here.." class="form-control"> 
                                                            @endif
                                                        </td>
                                                    </tr>

                                                    @php $no = $i['no']; $number=""; $group_indikator=$d->group_indikator;
                                                    @endphp
                                                    @endforeach

                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    @endforeach
                                </div>
                            </fieldset>

                            <h3>Step IV</h3>
                            <fieldset class="form-input" style="border: 0px">
                                <div class="">

                                    @php $no = ""; $rowspan=""; $number=""; $grup=""; $group_indikator=""; @endphp
                                    @foreach($asesmen_item4 as $i)

                                    <h5>{{$i['table']}}
                                    </h5>

                                    <div class="row mt-20">
                                        <div class="col-md-12">
                                            <table class="table table-bordered table-full">
                                                <tdead>
                                                    <tr>
                                                        <th width="5%" class="text-center">No</th>
                                                        <th width="60%">Indikator Asesmen</th>
                                                        <th width="35%">File Asesmen</th>
                                                    </tr>
                                                </tdead>
                                                <tbody>

                                                    @foreach($i['detail'] as $d)
                                                    <tr>
                                                        <td class="text-center">
                                                            
                                                            @if($group_indikator !=
                                                            $d->group_indikator) {{$d->group_indikator}} @endif
                                                        </td>
                                                        <td>
                                                            @if(!empty($d->no_indikator)) {{$d->no_indikator}})
                                                            @endif {!! $d->indikator_asesmen !!}
                                                        </td>
                                                        <td>
                                                            @if($d->input_type == 'file')
                                                            <input type="hidden" name="item_id4[]" value="{{$d->item_id}}">
                                                            <input type="file" onchange="convertBase64(this, 'file_asesmen4')" name="file_asesmen4[]" class="form-document" accept="application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/pdf, image/*">
                                                            @else
                                                            <input type="hidden" name="text_itemId[]" value="{{$d->item_id}}">
                                                            <input type="text" name="text_asesmen[]" placeholder="Type URL here.." class="form-control"> 
                                                            @endif
                                                        </td>
                                                    </tr>

                                                    @php $no = $i['no']; $number=""; $group_indikator=$d->group_indikator;
                                                    @endphp
                                                    @endforeach

                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    @endforeach
                                </div>
                            </fieldset>

                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<div class="modal fade" id="warningerror" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLongTitle">Peringatan</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div id="pesan"></div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="warningconfirm" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLongTitle">Peringatan</h5>
            </div>
            <div class="modal-body">
                Apakah Anda Yakin Melakukan Submit Akreditasi ?
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Batalkan</button>
                <button type="button" class="btn btn-primary" id="confirm">Konfirmasi</button>
            </div>
        </div>
    </div>
</div>

@endsection
@push('scripts')
<script src="{{ url('/assets/global/js/wizard/popper.min.js') }}"></script>
<script src="{{ url('/assets/global/js/wizard/jquery.steps.js') }}"></script>
<script src="{{ url('/assets/global/js/wizard/particles.js') }}"></script>
<script src="{{ url('assets/global/js/blockui.min.js') }}"></script>
<script src="{{ url('/assets/global/js/jquery.validate.js') }}"></script>
{!! Helper::generate_js([
'/assets/global/js/apps/pengajuan_akreditasi/add.js'
]) !!}
@endpush