CourseWork/resources/views/scores/show.blade.php
2024-06-16 00:41:31 +04:00

53 lines
2.3 KiB
PHP

@extends('layouts.application')
@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{{ $student->id }}" class="form-select form-select-sm">
@foreach($scores as $score)
<option value="{{ $score }}" {{ isset($student->pivot->score) && $student->pivot->score == $score->value ? '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