@extends('layouts.app') @section('title', 'Simulation Results') @section('content')
{{ $cropPlan->crop }} in {{ $cropPlan->location }} — {{ count($scenarios) }} scenarios compared
| Metric | @foreach($scenarios as $scenario)
{{ $scenario['month_name'] }}
@if($scenario['month'] === $cropPlan->planting_month)
Current @endif |
@endforeach
|---|---|
| Verdict | @foreach($scenarios as $scenario)@if(isset($scenario['error'])) Error @else @php $sc = $scenario['feasibility']; $bc = match($sc) { 'suitable' => 'badge-suitable', 'risky' => 'badge-risky', 'not_suitable' => 'badge-not-suitable', default => 'bg-secondary' }; $bt = match($sc) { 'suitable' => 'Suitable', 'risky' => 'Risky', 'not_suitable' => 'Not Suitable', default => 'Unknown' }; @endphp {{ $bt }} @endif | @endforeach
| Confidence | @foreach($scenarios as $scenario){{ isset($scenario['confidence']) ? round($scenario['confidence'] * 100) . '%' : '—' }} | @endforeach
| Expected yield | @foreach($scenarios as $scenario){{ isset($scenario['yield']) ? $scenario['yield'] . ' t/ha' : '—' }} | @endforeach
| Rainfall forecast | @foreach($scenarios as $scenario){{ isset($scenario['rainfall']) ? $scenario['rainfall'] . ' mm' : '—' }} | @endforeach
| Trend | @foreach($scenarios as $scenario){{ $scenario['trend'] ?? '—' }} | @endforeach
| Market price | @foreach($scenarios as $scenario){{ isset($scenario['market_price']) ? '₹' . $scenario['market_price'] : '—' }} | @endforeach
| Est. profit/ha | @foreach($scenarios as $scenario)@if(isset($scenario['estimated_profit'])) ₹{{ number_format($scenario['estimated_profit']) }} @else — @endif | @endforeach
| Loss risk/ha | @foreach($scenarios as $scenario)@if(isset($scenario['estimated_loss'])) ₹{{ number_format($scenario['estimated_loss']) }} @else — @endif | @endforeach