69 lines
3.2 KiB
PHP
69 lines
3.2 KiB
PHP
@extends('layouts.application')
|
||
|
||
@section('content')
|
||
<div class="container col-md-6">
|
||
<div class="row justify-content-center">
|
||
<div class="card">
|
||
<div class="card-header">
|
||
{{ ('Учитель') }}
|
||
</div>
|
||
<div class="card-body">
|
||
<div class="mb-3">
|
||
<h5><strong>ФИО: </strong>{{ $teacher->fio }}</h5>
|
||
</div>
|
||
<div class="mb-3">
|
||
<h5><strong>Дата рождения: </strong>{{ $teacher->birthday }}</h5>
|
||
</div>
|
||
</div>
|
||
<div class="card-footer">
|
||
<a href="{{ route('teachers.edit', $teacher) }}" class="btn btn-primary">Редактировать</a>
|
||
</div>
|
||
</div>
|
||
<div class="card mt-4">
|
||
<div class="card-header">
|
||
{{__('Предметы учителя')}}
|
||
</div>
|
||
<div class="card-body">
|
||
@if(count($subjects))
|
||
<table class="table table-striped">
|
||
<thead>
|
||
<th>Название</th>
|
||
<th> </th>
|
||
</thead>
|
||
<tbody>
|
||
@foreach ($subjects as $subject)
|
||
<tr>
|
||
<td class="table-text">
|
||
<div>
|
||
<a href="{{ route('teachers.subjects.show', [$teacher, $subject]) }}" class="btn btn-block col-8">{{ $subject->name }}</a>
|
||
</div>
|
||
</td>
|
||
<td>
|
||
<div>
|
||
<a href="{{ route('teachers.subjects.edit', [$teacher, $subject]) }}" class="btn btn-warning">Редактировать</a>
|
||
</div>
|
||
</td>
|
||
<td>
|
||
<form action="{{ route('teachers.subjects.destroy', [$teacher, $subject]) }}" method="POST" style="display: inline-block;">
|
||
@csrf
|
||
@method('DELETE')
|
||
<button type="submit" class="btn btn-danger">Удалить</button>
|
||
</form>
|
||
</td>
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
@else
|
||
<p>У учителя отсутствуют предметы</p>
|
||
@endif
|
||
</div>
|
||
<div class="card-footer">
|
||
<a href="{{ route('teachers.subjects.create', $teacher) }}" class="btn btn-success">Добавить</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
@endsection
|
||
|