CourseWork/resources/views/grade-lesson/form.blade.php
m.zargarov 48b191e345 Fix
2024-06-16 12:24:07 +04:00

52 lines
3.1 KiB
PHP

<div class="container col-md-5">
<div class="row justify-content-center">
<div class="card mt-4">
<div class="card-body">
<form action="{{ $route }}" method="POST">
@csrf
@method($method)
<div class="mb-3">
<label for="name" class="form-label">Тема:</label>
<input type="text" id="name" name="name" class="form-control" value="{{ isset($lesson) ? $lesson->name : old('name') }}" required>
</div>
<div class="mb-3">
<label for="type" class="form-label">Тип работы:</label>
<select id="type" name="type" class="form-select" required>
<option value="">Выберите тип деятельности</option>
@foreach($types as $type)
<option value="{{ $type }}" {{ isset($lesson) && $lesson->type == $type ? 'selected' : old('type') }}>
{{ $type }}
</option>
@endforeach
</select>
</div>
<div class="mb-3">
<label for="subject_id" class="form-label">Предмет:</label>
<select id="subject_id" name="subject_id" class="form-select" required>
<option value="">Выберите предмет</option>
@foreach($grade->subjects as $subject)
<option value="{{ $subject->id }}" {{ isset($lesson) && $lesson->subject_id == $subject->id ? 'selected' : old('subject_id') }}>
{{ $subject->name }}
</option>
@endforeach
</select>
</div>
<div class="mb-3">
<label for="description" class="form-label">Описание(макс. 250 символов):</label>
<textarea class="form-control" id="description" name="description" rows="5" >{{ isset($lesson) ? $lesson->description : old('description') }}</textarea>
</div>
<div class="mb-3">
<label for="lesson_date" class="form-label">Дата рождения:</label>
<input type="date" id="lesson_date" name="lesson_date" class="form-control" value="{{ isset($lesson) ? $lesson->lesson_date : old('lesson_date') }}" required>
</div>
<input type="hidden" name="grade_id" value="{{ $grade->id }}">
<input type="hidden" name="teacher_id" value="{{ \Illuminate\Support\Facades\Auth::id() }}">
<div>
<button type="submit" class="btn btn-success">Подтвердить</button>
</div>
</form>
</div>
</div>
</div>
</div>