@php use App\Models\Employee; @endphp @extends('layouts.backend.index') @section('title', $label) @section('content')

 {{ $label }}

@if (isset($vacancy)) Fitur untuk edit data {{ Str::lower($label) }}. @else Fitur untuk menambah data {{ Str::lower($label) }}. @endif


@csrf @if (isset($diklat)) @method('PUT') @endif
@php $old = old('employee', []); $old_items = @$diklat->employees; $total = 0; @endphp @if (empty($old)) @if (isset($old_items)) @foreach ($old_items as $index => $i) @php $total += $i['fee']; $employee = Employee::find($i['id']); @endphp @endforeach @else @endif @else @foreach ($old['id'] as $index => $i) @php $fee = empty($old['fee'][$index]) ? 0 : str_replace('.', '', $old['fee'][$index]); $total += $fee; @endphp @endforeach @endif @if (@$errors->has('employees')) @foreach ($errors->get('employees') as $message) @endforeach @endif
NIP NAMA JABATAN BIAYA  
@if ($index > 0) @endif
 
@if ($index > 0) @endif
{{json_encode($message)}}
ADD
Total : Rp {{ number_format(@$total, 0, '', '.') }}

CANCEL
@endsection @push('styles') @endpush @push('scripts') @endpush