CourseWork/resources/views/teachers/show.blade.php
2024-05-07 15:05:10 +04:00

69 lines
3.2 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('layouts.app')
@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>&nbsp;</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