@extends('layouts.admin')

@section('content')
<div class="container mt-4">
    <h2 class="mb-4">Add New Result</h2>

    @if ($errors->any())
        <div class="alert alert-danger">
            <ul class="mb-0">
                @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
    @endif

    <form action="{{ route('admin.results.store') }}" method="POST">
        @csrf
        <div class="mb-3">
            <label for="registration_number" class="form-label">Registration Number</label>
            <input type="text" name="registration_number" class="form-control" required>
        </div>

        <div class="mb-3">
            <label for="course_code" class="form-label">Course Code</label>
            <input type="text" name="course_code" class="form-control" required>
        </div>

        <div class="mb-3">
            <label for="mark" class="form-label">Mark</label>
            <input type="number" name="mark" class="form-control" min="0" max="100" required>
        </div>

        <button type="submit" class="btn btn-success">Save</button>
        <a href="{{ route('admin.results.index') }}" class="btn btn-secondary">Cancel</a>
    </form>
</div>
@endsection
