@php use App\Models\Kriteria; @endphp @extends('layouts.app') @section('title', 'Edit Kriteria - ' . $kriteria->nama_kriteria) @section('content')
Edit Kriteria
@if (Session::has('msg'))
{{ Session::get('msg') }}
@endif @php $totalBobotSaatIni = round(App\Models\Kriteria::sum('bobot'), 2); $selisih = $totalBobotSaatIni - $kriteria->bobot; $bobotBaru = old('bobot', $kriteria->bobot); $totalSetelahEdit = round($selisih + $bobotBaru, 2); @endphp @if ($totalSetelahEdit < 1)
⚠️ Total bobot setelah penyimpanan akan menjadi {{ number_format($totalSetelahEdit, 2) }}
Total masih kurang sebesar {{ number_format(1 - $totalSetelahEdit, 2) }}.
@elseif ($totalSetelahEdit > 1)
❌ Total bobot setelah penyimpanan akan menjadi {{ number_format($totalSetelahEdit, 2) }}
Total melebihi sebesar {{ number_format($totalSetelahEdit - 1, 2) }}.
@else
✅ Total bobot setelah penyimpanan akan tepat 1.
@endif
@csrf @method('PUT')
@error('nama_kriteria')
{{ $message }}
@enderror
@error('attribut')
{{ $message }}
@enderror
@error('bobot')
{{ $message }}
@enderror
Nilai antara 0.0000 sampai 1.0000
Batal
@endsection @section('scripts') @endsection