@extends('crudbooster::admin_template')
@section('content')

    <div>

        <!--@if(CRUDBooster::getCurrentMethod() != 'getProfile' && $button_cancel)-->
        <!--    @if(g('return_url'))-->
        <!--        <p><a title='Return' href='{{g("return_url")}}'><i class='fa fa-chevron-circle-left '></i>-->
        <!--                &nbsp; {{trans("crudbooster.form_back_to_list",['module'=>CRUDBooster::getCurrentModule()->name])}}</a></p>-->
        <!--    @else-->
        <!--        <p><a title='Main Module' href='{{CRUDBooster::mainpath()}}'><i class='fa fa-chevron-circle-left '></i>-->
        <!--                &nbsp; {{trans("crudbooster.form_back_to_list",['module'=>CRUDBooster::getCurrentModule()->name])}}</a></p>-->
        <!--    @endif-->
        <!--@endif-->

        <div class="panel panel-default">
            <!--<div class="panel-heading">-->
            <!--    <strong><i class='{{CRUDBooster::getCurrentModule()->icon}}'></i> {!! $page_title or "Page Title" !!}</strong>-->
            <!--</div>-->

            <div class="panel-body" style="padding:20px 0px 0px 0px">
                
                <?php
                
                $action = (@$row) ? CRUDBooster::mainpath("edit-save/$row->id") : CRUDBooster::mainpath("add-save");
                $return_url = ($return_url) ?: g('return_url');

                ?>
                
                <form class='form-horizontal' method='post' id="form" enctype="multipart/form-data" action='{{$action}}'>
                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                    <input type='hidden' name='return_url' value='{{ @$return_url }}'/>
                    <input type='hidden' name='ref_mainpath' value='{{ CRUDBooster::mainpath() }}'/>
                    <input type='hidden' name='ref_parameter' value='{{urldecode(http_build_query(@$_GET))}}'/>
					
                    @if($hide_form)
                        <input type="hidden" name="hide_form" value='{!! serialize($hide_form) !!}'>
                    @endif
                    <div class="box-body" id="parent-form-area">

                        @if($command == 'detail')
                            @include("crudbooster::default.form_detail")
                        @else
                            
                            @if($persyaratan)
                                @if(sizeof($persyaratan)>0)
                                <?php //var_dump($persyaratan) ?>
                                    <ul class="nav nav-tabs nav-justified">
                                      <li class="active"><a data-toggle="tab" href="#form-permohonan">Form Permohonan</a></li>
                                      <li><a data-toggle="tab" href="#sample">Unduh Contoh</a></li>
                                    </ul>
                                    <div class="tab-content">
                                        <div class="tab-pane active" id="form-permohonan" >
                                            <br>
                                          @include("crudbooster::default.form_body")
                                        </div>
                                        <div class="tab-pane fade" id="sample" >
                                            <br>
                                            @foreach($persyaratan as $syarat)
                                                <div class="row">
                                                    <div class="col-md-5"><strong>{{ $syarat->deskripsi }}</strong></div>
                                                    <div class="col-md-5"><a href="{{ CRUDBooster::publicPath($syarat->file) }}">Unduh <i class="fa fa-download"></i></a></div>
                                                </div>
                                                <?php
                                                    $ext = pathinfo($syarat->file, PATHINFO_EXTENSION);
                                                ?>
                                                @if(strtolower($ext) == 'pdf')
                                                    <div style="display:block;">
                                                        <embed type="application/pdf" src="{{ CRUDBooster::publicPath($syarat->file) }}" width="600" height="400"></embed>
                                                    </div>
                                                @endif
                                                <br>
                                            @endforeach
                                        </div>
                                        
                                    </div>
                                @else
                                    @include("crudbooster::default.form_body")
                                @endif
                            @else
                                @include("crudbooster::default.form_body")
                            @endif
                        @endif
						
                    </div><!-- /.box-body -->
					
                    <div class="box-footer" style="background: #F5F5F5">
						
                        <div class="form-group">
                            <label class="control-label col-sm-2"></label>
                            <div class="col-sm-10">
                                @if($button_cancel && CRUDBooster::getCurrentMethod() != 'getDetail')
                                    @if(g('return_url'))
                                        <a href='{{g("return_url")}}' class='btn btn-default'><i
                                                    class='fa fa-chevron-circle-left'></i> {{trans("crudbooster.button_back")}}</a>
                                    @else
                                        <a href='{{CRUDBooster::mainpath("?".http_build_query(@$_GET)) }}' class='btn btn-default'><i
                                                    class='fa fa-chevron-circle-left'></i> {{trans("crudbooster.button_back")}}</a>
                                    @endif
                                @endif
                                <?php //dd(CRUDBooster::isUpdate()); ?>
                                @if(CRUDBooster::isCreate() || CRUDBooster::isUpdate())

                                    @if(CRUDBooster::isCreate() && $button_addmore==TRUE && $command == 'add')
                                            @if(CRUDBooster::myPrivilegeId() <> 2)
                                                @if(g('command') != 'proses')
                                                    <input type="submit" name="submit" value='{{trans("crudbooster.button_save_more")}}' class='btn btn-success'>
                                                @endif
                                                
                                            @endif
                                    @endif
                                    
                                    @if($button_save && $command != 'detail')
                                        @if(CRUDBooster::myPrivilegeId() <> 2)
                                            @if(g('command') == 'proses')
                                                <a href='{{g("next_action")}}/{{$notasiku}}' class='btn btn-warning'>TERUSKAN <i class='fa fa-chevron-circle-right'></i> </a>
                                            @elseif(g('command') == 'teruskan' )
                                                <input type="submit" name="submit" value='TTD DAN TERUSKAN' class='btn btn-success'>
                                                <!--<a href='{{g("next_action")}}/{{$notasiku}}' class='btn btn-warning'>TTD DAN TERUSKAN <i class='fa fa-chevron-circle-right'></i> </a>-->
                                            @else
                                                <input type="submit" name="submit" value='{{trans("crudbooster.button_save")}}' class='btn btn-success'>
                                            @endif
                                        @else
                                            <input type="submit" name="submit" value='KIRIM' class='btn btn-success'>
                                        @endif
                                    @endif
                                @endif
							
                            </div>
                        </div>

                    
                    </div><!-- /.box-footer-->

                </form>

            </div>
        </div>
    </div><!--END AUTO MARGIN-->

@endsection

