@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100'])
{{-- section content --}}
@section('content')
@include('layouts.navbars.auth.topnav', ['title' => ''])
{{-- Display success or error messages --}}
@if (session('success'))
{{ session('success') }}
@elseif (session('error'))
{{ session('error') }}
@endif
{{-- Notification --}}
@if (Session::has('message'))
{{ Session::get('message') }}
@endif
| No |
Nama Catering |
Rata-Rata Keseluruhan |
Action |
@php
$groupedData = $hasil->groupBy('id')->map(function ($items) {
$totalGdg = $items->sum('gdg');
$totalOff = $items->sum('off');
$count = $items->count();
$average = $count > 0 ? number_format(($totalGdg + $totalOff) / ($count * 2), 2) : 0;
return [
'nama_catering' => $items->first()->nama_catering, // Updated to use nama_catering
'average' => $average,
'id' => $items->first()->id, // Use the first item's ID for actions
];
});
@endphp
@foreach ($groupedData as $data)
| {{ $loop->iteration }} |
{{ $data['nama_catering'] }} |
{{ $data['average'] }} |
{{-- button view --}}
{{-- check authorize edit --}}
@if ($authorize->edit == '1')
{{-- button edit --}}
@endif
{{-- check authorize delete --}}
@if ($authorize->delete == '1')
@endif
|
@endforeach
@endsection