@extends('layouts.app') @section('title', 'Operations Dashboard - Blackberry Farm') @section('content')
{{ $todayStats['watering_logs'] ?? 0 }}
๐Ÿ’ง Watering Sessions Today
{{ $todayStats['fertilizer_applications'] ?? 0 }}
๐ŸŒฑ Fertilizer Applications
{{ $todayStats['pest_observations'] ?? 0 }}
๐Ÿ› Pest Observations
{{ $todayStats['active_plants'] ?? 0 }}
๐Ÿซ Active Plants
{{ $weekStats['watering_sessions'] ?? 0 }}
This Week: Watering
{{ $weekStats['fertilizer_treatments'] ?? 0 }}
This Week: Fertilizer
{{ $weekStats['pest_issues'] ?? 0 }}
This Week: Pest Issues
{{ $weekStats['soil_tests'] ?? 0 }}
This Week: Soil Tests
@if(($urgentItems['follow_up_pests'] ?? 0) > 0 || ($urgentItems['plants_need_attention'] ?? 0) > 0 || ($urgentItems['critical_pests'] ?? 0) > 0)

โš ๏ธ Items Requiring Attention

@endif
@if(isset($currentWeather) && $currentWeather)

๐ŸŒค๏ธ Current Weather Conditions

@if(isset($currentWeather['temperature']))
{{ $currentWeather['temperature'] }}ยฐF

Conditions: {{ $currentWeather['description'] }}

Feels like: {{ $currentWeather['feels_like'] }}ยฐF

Humidity: {{ $currentWeather['humidity'] }}%

Wind: {{ $currentWeather['wind_speed'] }} mph {{ \App\Services\OpenWeatherMapService::getWindDirection($currentWeather['wind_direction']) }}

@if($currentWeather['wind_gust'] > 0)

Gusts: {{ $currentWeather['wind_gust'] }} mph

@endif

Pressure: {{ $currentWeather['pressure'] }}" Hg

Visibility: {{ $currentWeather['visibility'] }} miles

Updated: {{ $currentWeather['updated_at'] }} | Location: {{ $currentWeather['location'] }}

@else
{{ round($currentWeather['main']['temp']) }}ยฐF

Conditions: {{ ucfirst($currentWeather['weather'][0]['description']) }}

Feels like: {{ round($currentWeather['main']['feels_like']) }}ยฐF

Humidity: {{ $currentWeather['main']['humidity'] }}%

@if(isset($currentWeather['wind']['speed']))

Wind: {{ round($currentWeather['wind']['speed']) }} mph

@endif

Source: Open-Meteo API | Note: Configure OpenWeatherMap API key for enhanced weather data

@endif
@endif @if(isset($forecast) && $forecast)

๐Ÿ“… Weather Forecast

@if(isset($forecast['daily'])) {{-- OpenWeatherMap format --}}
@foreach($forecast['daily'] as $day)
{{ ($day['day_name'] ?? '') === now()->format('l') ? 'Today' : ($day['day_name'] ?? 'Day ' . ($loop->index + 1)) }}
{{ $day['date'] ?? '' }}
@if(isset($day['primary_icon']))
{{ $day['primary_condition'] ?? 'Weather' }}
@endif
{{ $day['high_temp'] ?? '?' }}ยฐ / {{ $day['low_temp'] ?? '?' }}ยฐ
@if(isset($day['primary_condition']))
{{ $day['primary_condition'] }}
@endif @if(($day['max_precipitation_chance'] ?? 0) > 0)
๐ŸŒง๏ธ {{ $day['max_precipitation_chance'] }}%
@endif @if(isset($day['avg_wind']) && isset($day['avg_humidity']))
๐Ÿ’จ {{ $day['avg_wind'] }} mph | ๐Ÿ’ง {{ $day['avg_humidity'] }}%
@endif
@endforeach
@elseif(isset($forecast['daily'])) {{-- Open-Meteo fallback format --}}

๐Ÿ“Š 5-day forecast available with basic weather data
Configure OpenWeatherMap API key for detailed forecast with icons and precipitation chances

@if(isset($forecast['daily']))
@foreach(array_slice($forecast['daily'], 0, 5) as $index => $day)
{{ $index === 0 ? 'Today' : \Carbon\Carbon::now()->addDays($index)->format('D') }}
{{ round($day['temperature_2m_max'] ?? 0) }}ยฐ / {{ round($day['temperature_2m_min'] ?? 0) }}ยฐ
@endforeach
@endif
@endif
@endif @if(isset($weatherAlerts) && count($weatherAlerts) > 0)

โš ๏ธ Weather Alerts

@foreach($weatherAlerts as $alert)
{{ $alert['event'] ?? 'Weather Alert' }}
{{ isset($alert['start']) ? date('M j, g:i A', $alert['start']) : '' }} - {{ isset($alert['end']) ? date('M j, g:i A', $alert['end']) : '' }}
{{ $alert['description'] ?? 'Check local weather sources for details.' }}
@endforeach
@endif @if(isset($recommendations) && count($recommendations) > 0)

๐Ÿ’ก Operation Recommendations

@foreach($recommendations as $recommendation)
{{ $recommendation['icon'] }} {{ $recommendation['title'] }}
{{ $recommendation['message'] }}
Action: {{ $recommendation['action'] }}
@endforeach
@else

๐Ÿ’ก Today's Recommendations

    @if(isset($currentWeather) && $currentWeather['humidity'] < 60)
  • Low humidity detected ({{ $currentWeather['humidity'] }}%) - consider additional watering for stressed plants
  • @endif @if(isset($currentWeather) && $currentWeather['temperature'] > 85)
  • High temperature ({{ $currentWeather['temperature'] }}ยฐF) - monitor plants for heat stress
  • @endif @if(($urgentItems['plants_need_attention'] ?? 0) > 0)
  • {{ $urgentItems['plants_need_attention'] }} plants need immediate attention - check watering and health status
  • @endif
  • Regular weekly tasks: Scout for pests, check soil moisture, monitor plant health
  • Record all observations and treatments for optimal farm management
@endif

๐Ÿ“‹ Recent Activities

@if(isset($recentActivities) && count($recentActivities) > 0) @foreach($recentActivities as $activity)
@if($activity['type'] === 'watering') ๐Ÿ’ง @elseif($activity['type'] === 'fertilizer') ๐ŸŒฑ @elseif($activity['type'] === 'pest') ๐Ÿ› @elseif($activity['type'] === 'soil') ๐Ÿงช @else ๐Ÿ“‹ @endif
{{ $activity['title'] }}
{{ $activity['time'] }}
@endforeach @else

No recent activities. Start logging your farm operations!

@endif

Blackberry Farm Operations Dashboard | Last updated: {{ date('M j, Y g:i A') }}

@endsection