<?php
setlocale(LC_ALL, 'IND');
?>

@extends('crudbooster::admin_template')
@section('content')
        <div class='panel panel-default' >
            <div class='panel-heading'><strong>{{ $modul->name }}  {{ $perusahaan->nama_perusahaan }} ({{$surat->id}})</strong></div>
        
                <div class='panel-body'>
                    @if($terkirim)
                    <p style="color:red;">Permohonan ini sudah di proses !</p>
                    @endif
                    <form method='post' action='{{CRUDBooster::mainpath("teruskan/".$surat->id."/true")}}' name="nomorform" id="nomorform" onsubmit="return validateForm()">
                        <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
                        <input type="hidden" name="id" value="{{ $id }}"/>
                        <input type="hidden" name="parent_table" value="{{ $surat->parent_table }}"/>
                        <input type="hidden" name="parent_id" value="{{ $surat->parent_id }}"/>
                        <input type="hidden" name="jenis_surat_id" value="{{ $surat->jenis_surat_id }}"/>
                        

                        <div class="form-group">
                            <label for="target_id">Mediator *</label>
                            <select name="target_id" required="required" form="nomorform"  class="form-control form-select-lg mb-3" id="target_id" >
                              <option selected value=0>Pilih Mediator *</option>
                              @foreach($mediator as $mtr)
                                <option value="{{ $mtr->id }}">{{ $mtr->name }}</option>
                              @endforeach
                            </select>
                        </div>


              
                    	<div class='form-group'>
                    	    <a type="button" class='btn btn-default'  href='{{ CRUDBooster::adminPath('surat_idv') }}' style="margin-left:15px"><i class='fa fa-chevron-circle-left'></i> Kembali</a>
                    		<input type="submit" class='btn btn-info' value="KIRIM" style="margin-left:15px"/>
                    		
                    		<!--@if($terkirim)-->
                    		<!--    <a type="button" class='btn btn-default'  href='{{ CRUDBooster::adminPath('surat_idv/') }}' style="margin-left:15px"><i class='fa fa-chevron-circle-left'></i> Perbaharui</a>-->
                    		<!--@endif-->
                    	</div>
                    </form>
                </div>
            
      </div>
@endsection

@push('bottom')

    <script type="text/javascript">


        $('#nomorform').on('submit', function(){
            if($('#mediator_id').val()==0){
                alert("Pilih Mediator !");
                return false;
            }
        })

    </script>
@endpush

