@extends('layout.main') @section('content')

{{ $petaniSummary->sum('total') }}

Petani

{{ $petaniSummary->count('total') }} komoditas utama

{{ number_format($lahanSummary->sum('luas_lahan'), 0, ',', '.') }}m2

Lahan

{{ $lahanSummary->count('total') }} komoditas utama

{{ $tanamanSummary->sum('total') }}

Tanaman Komoditas Utama

@foreach($komoditas as $k)

{{ $tanamanSummary->where('komoditas_id', $k->id)->sum('total') }} tanaman {{ $k->nama }}

@endforeach
Segmentasi Petani

untuk semua komoditas

Penggerak (4.0 - 5.0)
{{ $skorSummary->where('segmen', 'Penggerak')->sum('total') }} petani {{ number_format(($skorSummary->where('segmen', 'Penggerak')->sum('total') / $petaniSummary->sum('total')) * 100, 2) }}%
Perintis (3.0 - 3.9)
{{ $skorSummary->where('segmen', 'Perintis')->sum('total') }} petani {{ number_format(($skorSummary->where('segmen', 'Perintis')->sum('total') / $petaniSummary->sum('total')) * 100, 2) }}%
Pemerhati (2.0 - 2.9)
{{ $skorSummary->where('segmen', 'Pemerhati')->sum('total') }} petani {{ number_format(($skorSummary->where('segmen', 'Pemerhati')->sum('total') / $petaniSummary->sum('total')) * 100, 2) }}%
Pemula (1.0 - 1.9)
{{ $skorSummary->where('segmen', 'Pemula')->sum('total') }} petani {{ number_format(($skorSummary->where('segmen', 'Pemula')->sum('total') / $petaniSummary->sum('total')) * 100, 2) }}%
Segmentasi Petani Komoditas

berdasarkan mayoritas segmentasi

@foreach ($komoditas as $k) where('komoditas_id', $k->id) ->whereIn('segmen', ['Penggerak', 'Perintis', 'Pemerhati', 'Pemula']) ->sortByDesc('total') ->first(); ?> @endforeach
{{ $k->nama }}
@if(isset($max)) @if($max->segmen == 'Penggerak') Petani Penggerak @elseif($max->segmen == 'Perintis') Petani Perintis @elseif($max->segmen == 'Pemerhati') Petani Pemerhati @elseif($max->segmen == 'Pemula') Petani Pemula @else Belum Lengkap @endif @else Belum Tersegmentasi @endif {{ isset($max) ? $max->total : 0 }} Petani {{ isset($max) ? number_format(($max->total / $petaniSummary->sum('total')) * 100, 2) : 0 }}%
@endsection