@extends('layouts.admin')

@section('content')
<div class="container mt-4">
    <h2>Edit Course</h2>

    <form action="{{ route('admin.courses.update', $course->id) }}" method="POST">
        @csrf
        @method('PUT')

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

        <div class="mb-3">
            <label for="course_name" class="form-label">Course Name</label>
            <input type="text" class="form-control" name="course_name" value="{{ $course->course_name }}" required>
        </div>

        <div class="mb-3">
            <label for="credits" class="form-label">Credits</label>
            <input type="number" class="form-control" name="credits" value="{{ $course->credits }}" required>
        </div>

        <div class="mb-3">
            <label for="level" class="form-label">Level</label>
            <input type="text" class="form-control" name="level" value="{{ $course->level }}" required>
        </div>

        <div class="mb-3">
            <label for="semester" class="form-label">Semester</label>
            <input type="text" class="form-control" name="semester" value="{{ $course->semester }}" required>
        </div>

        <button type="submit" class="btn btn-primary">Update Course</button>
        <a href="{{ route('admin.courses.index') }}" class="btn btn-secondary">Back</a>
    </form>
</div>
@endsection
