@extends('layouts.admin') @section('content')
{{-- ============ HEADER ============ --}}

AI Prediction

Cut-off Trend & Prediction

Historical papers + AI analysis = Next exam ka cut-off prediction

โ† All Papers
@if(session('status'))
โœ… {{ session('status') }}
@endif @if($errors->any())
@foreach($errors->all() as $error)

โš ๏ธ {{ $error }}

@endforeach
@endif @if($examTypes->isEmpty())

๐Ÿ“Š

No Cut-off Data Available

Prediction generate karne ke liye pehle PYQ papers upload karein aur unke cut-offs daalein.

+ Upload First Paper
@else {{-- ============ EXAM TYPE FILTER ============ --}}
@foreach($examTypes as $type) @php $data = $groupedData[$type] ?? null; @endphp {{ $type }} @if($data) {{ $data['papers_with_cutoff'] }}y @endif @endforeach
@php $selectedData = $groupedData[$selectedExamType] ?? null; $latestPrediction = $selectedData['latest_prediction'] ?? null; @endphp @if($selectedData && count($selectedData['history']) >= 2) {{-- ============ TREND CHART ============ --}}

๐Ÿ“ˆ {{ $selectedExamType }} Cut-off Trend

Based on {{ count($selectedData['history']) }} years of data

{{-- ============ PREDICTION RESULT ============ --}} @if($latestPrediction)

๐Ÿค– AI Prediction

{{ $selectedExamType }} {{ $latestPrediction->predicted_for_year }} Predicted Cut-off

Generated {{ $latestPrediction->generated_at?->diffForHumans() }} ยท Based on {{ implode(', ', $latestPrediction->based_on_years ?? []) }}

{{ ucfirst($latestPrediction->confidence_level) }} Confidence @if($latestPrediction->trend_direction === 'increasing') ๐Ÿ“ˆ Increasing @elseif($latestPrediction->trend_direction === 'decreasing') ๐Ÿ“‰ Decreasing @else โžก๏ธ Stable @endif
{{-- Cut-off Cards --}}

General

{{ $latestPrediction->predicted_cutoff_general ?? 'โ€”' }}

OBC

{{ $latestPrediction->predicted_cutoff_obc ?? 'โ€”' }}

SC

{{ $latestPrediction->predicted_cutoff_sc ?? 'โ€”' }}

ST

{{ $latestPrediction->predicted_cutoff_st ?? 'โ€”' }}

{{-- Reasoning --}} @if($latestPrediction->reasoning)

AI Reasoning

{{ $latestPrediction->reasoning }}

@endif {{-- Key Factors + Recommendations --}}
@if(!empty($latestPrediction->key_factors))

๐Ÿ”‘ Key Factors

    @foreach($latestPrediction->key_factors as $factor)
  • โ€ข {{ $factor }}
  • @endforeach
@endif @if(!empty($latestPrediction->recommendations))

๐Ÿ’ก Recommendations

    @foreach($latestPrediction->recommendations as $rec)
  • โœ“ {{ $rec }}
  • @endforeach
@endif
@else

๐Ÿค–

No prediction generated yet

Click "Generate Prediction" to get AI analysis

@endif {{-- ============ HISTORICAL DATA TABLE ============ --}}

๐Ÿ“‹ Historical Cut-off Data

@foreach($selectedData['history'] as $row) @endforeach
Year Title Questions Difficulty General OBC SC ST
{{ $row['year'] }} {{ Str::limit($row['title'], 40) }} {{ $row['total_questions'] ?? 'โ€”' }} @if($row['difficulty']) {{ ucfirst($row['difficulty']) }} @else โ€” @endif {{ $row['cutoffs']['general'] ?? 'โ€”' }} {{ $row['cutoffs']['obc'] ?? 'โ€”' }} {{ $row['cutoffs']['sc'] ?? 'โ€”' }} {{ $row['cutoffs']['st'] ?? 'โ€”' }}
{{-- ============ PREDICTION HISTORY ============ --}} @if($predictions->count() > 1)

๐Ÿ“š Previous Predictions

@foreach($predictions->skip(1) as $pred)

{{ $selectedExamType }} {{ $pred->predicted_for_year }}

{{ $pred->generated_at?->format('d M Y, h:i A') }}

Gen: {{ $pred->predicted_cutoff_general ?? 'โ€”' }} {{ ucfirst($pred->confidence_level) }}
@endforeach
@endif @else

๐Ÿ“‰

Not Enough Data for {{ $selectedExamType }}

Prediction ke liye kam se kam 2 years ka cut-off data chahiye. Abhi {{ $selectedData['papers_with_cutoff'] ?? 0 }} year(s) ka data available hai.

+ Upload More Papers
@endif @endif
{{-- ============ PREDICTION FORM (hidden) ============ --}} @if($selectedData && count($selectedData['history']) >= 2) @endif @endsection