2019-12-01 00:22:33 +01:00
|
|
|
@extends('layouts.adminpanel')
|
|
|
|
|
2019-12-06 22:34:25 +01:00
|
|
|
@section('title') Panel admina - Zajęcia @endsection
|
2019-12-01 00:22:33 +01:00
|
|
|
|
|
|
|
@section('admin_content')
|
2019-12-01 19:31:49 +01:00
|
|
|
<div class="row justify-content-center">
|
|
|
|
<div class="col-md-12">
|
2019-12-06 22:34:25 +01:00
|
|
|
<h5> Dodaj zajęcia </h5>
|
2019-12-01 19:31:49 +01:00
|
|
|
<form method="POST" action="{{ route('admin_add_classes') }}">
|
|
|
|
@csrf
|
|
|
|
|
|
|
|
<div class="form-group row">
|
2019-12-06 22:34:25 +01:00
|
|
|
<label for="subject_id" class="col-md-4 col-form-label text-md-right">{{ __('Przedmiot') }}</label>
|
2019-12-01 19:31:49 +01:00
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
<select id="subject_id" class="form-control @error('subject_id') is-invalid @enderror" name="subject_id" required>
|
|
|
|
@foreach ($subjects as $subject)
|
2019-12-06 22:34:25 +01:00
|
|
|
<option value="{{ $subject->id }}">{{ $subject->name }}, {{ $subject->weekday }} {{ $subject->time }}</option>
|
2019-12-01 19:31:49 +01:00
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
|
|
|
|
@error('subject_id')
|
|
|
|
<span class="invalid-feedback" role="alert">
|
|
|
|
<strong>{{ $message }}</strong>
|
|
|
|
</span>
|
|
|
|
@enderror
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
2019-12-06 22:34:25 +01:00
|
|
|
<label for="date" class="col-md-4 col-form-label text-md-right">{{ __('Data') }}</label>
|
2019-12-01 19:31:49 +01:00
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
<input id="date" type="date" class="form-control @error('date') is-invalid @enderror" name="date" value="{{ old('date') }}" autocomplete="date">
|
|
|
|
|
|
|
|
@error('date')
|
|
|
|
<span class="invalid-feedback" role="alert">
|
|
|
|
<strong>{{ $message }}</strong>
|
|
|
|
</span>
|
|
|
|
@enderror
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row mb-0">
|
|
|
|
<div class="col-md-6 offset-md-4">
|
|
|
|
<button type="submit" class="btn btn-primary">
|
2019-12-06 22:34:25 +01:00
|
|
|
{{ __('Dodaj') }}
|
2019-12-01 19:31:49 +01:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
@if ($classes->count() > 0)
|
2019-12-06 22:34:25 +01:00
|
|
|
<h5> Wszystkie zajęcia: ({{ $classes->count() }}) </h5>
|
2019-12-01 19:31:49 +01:00
|
|
|
<table class="table table-striped">
|
|
|
|
<tr class="thead-dark">
|
|
|
|
<th>ID</th>
|
2019-12-06 22:34:25 +01:00
|
|
|
<th> ID przedmoitu </th>
|
|
|
|
<th> Nazwa przedmiotu </th>
|
|
|
|
<th> Data </th>
|
2019-12-13 23:28:16 +01:00
|
|
|
<th> Kod </th>
|
2019-12-01 19:31:49 +01:00
|
|
|
<th></th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
@foreach ($classes as $classes_item)
|
2019-12-01 00:22:33 +01:00
|
|
|
<tr>
|
2019-12-01 19:31:49 +01:00
|
|
|
<td> {{ $classes_item->id }}</td>
|
|
|
|
<td> {{ $classes_item->subject_id }} </td>
|
|
|
|
<td> {{ App\Subject::find($classes_item->subject_id)->name }}, {{ App\Subject::find($classes_item->subject_id)->type }},
|
|
|
|
{{ App\Subject::find($classes_item->subject_id)->weekday }} {{ App\Subject::find($classes_item->subject_id)->time }}</td>
|
|
|
|
<td> {{ $classes_item->date }} </td>
|
2019-12-13 23:28:16 +01:00
|
|
|
<td> {{ $classes_item->classes_code }}</td>
|
2019-12-01 19:31:49 +01:00
|
|
|
<td>
|
2019-12-06 22:34:25 +01:00
|
|
|
<a href="{{ route('admin_delete_classes', [$classes_item->id]) }}" name="delete-classes-btn" class="btn btn-danger"> Usuń </a>
|
2019-12-01 19:31:49 +01:00
|
|
|
</td>
|
|
|
|
<td>
|
2019-12-06 22:34:25 +01:00
|
|
|
<a href="{{ route('admin_edit_classes', [$classes_item->id]) }}" name="edit-classes-btn" class="btn btn-secondary"> Edytuj </a>
|
2019-12-01 19:31:49 +01:00
|
|
|
</td>
|
2019-12-01 00:22:33 +01:00
|
|
|
</tr>
|
2019-12-01 19:31:49 +01:00
|
|
|
@endforeach
|
|
|
|
</table>
|
|
|
|
@else
|
2019-12-06 22:34:25 +01:00
|
|
|
<p> Brak zajęć. </p>
|
2019-12-01 19:31:49 +01:00
|
|
|
@endif
|
2019-12-01 00:22:33 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|