CourseWork/resources/views/scores/show.blade.php
2024-05-17 18:46:12 +04:00

54 lines
2.4 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container col-md-4">
<div class="row justify-content-center">
<div class="card mt-4">
<div class="card-header">
<p>{{ $lesson->name }}</p>
</div>
<div class="card-body">
<form action="{{ route('lessons.scores.update', [$lesson]) }}" method="POST">
@csrf
@method('PUT')
@if(count($students))
<table class="table table-striped">
<thead>
<th>ФИО</th>
<th>Оценка</th>
</thead>
<tbody>
@foreach ($students as $student)
<tr>
<td class="table-text">
<div>
<p>{{ $student->fio }}</p>
</div>
</td>
<td>
<div>
<select id="score" name="score" class="form-select form-select-sm" required>
<option value="">Нет оценки</option>
@foreach($scores as $score)
<option value="{{ $score }}" {{ isset($student->pivot->score) && $student->pivot->score == $score ? 'selected' : '' }}>
{{ $score }}
</option>
@endforeach
</select>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
@else
<p>Ученики остутствуют</p>
@endif
<button type="submit" class="btn btn-success">Подтвердить</button>
</form>
</div>
</div>
</div>
</div>
@endsection