2019-12-01 00:22:33 +01:00
|
|
|
@extends('layouts.adminpanel')
|
|
|
|
|
2019-12-06 22:34:25 +01:00
|
|
|
@section('title') Panel admina - obecności @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 obecność </h5>
|
2019-12-01 19:31:49 +01:00
|
|
|
<form method="POST" action="{{ route('admin_add_attendance') }}" class="col-md-12">
|
|
|
|
@csrf
|
|
|
|
|
|
|
|
<div class="form-group row">
|
2019-12-06 22:34:25 +01:00
|
|
|
<label for="classes_id" class="col-md-4 col-form-label text-md-right">{{ __('Zajęcia') }}</label>
|
2019-12-01 19:31:49 +01:00
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
<select id="classes_id" class="form-control @error('classes_id') is-invalid @enderror" name="classes_id" required>
|
|
|
|
@foreach ($classes as $classes_item)
|
|
|
|
<option value="{{ $classes_item->id }}">{{ App\Subject::find(App\Classes::find($classes_item->id)->subject_id)->name }},
|
|
|
|
{{ App\Classes::find($classes_item->id)-> date }} {{ App\Subject::find(App\Classes::find($classes_item->id)->subject_id)->time }}
|
|
|
|
</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
|
|
|
|
@error('classes_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="student_id" class="col-md-4 col-form-label text-md-right">{{ __('ID studenta') }}</label>
|
2019-12-01 19:31:49 +01:00
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
<input id="student_id" type="number" class="form-control @error('student_id') is-invalid @enderror" name="student_id" value="{{ old('student_id') }}" required autocomplete="student_id" autofocus>
|
|
|
|
|
|
|
|
@error('student_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="student_name" class="col-md-4 col-form-label text-md-right">{{ __('Imię studenta') }}</label>
|
2019-12-01 19:31:49 +01:00
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
<input id="student_name" type="text" class="form-control @error('student_name') is-invalid @enderror" name="student_name" value="{{ old('student_name') }}" autocomplete="student_name">
|
|
|
|
|
|
|
|
@error('student_name')
|
|
|
|
<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="student_surname" class="col-md-4 col-form-label text-md-right">{{ __('Nazwisko studenta') }}</label>
|
2019-12-01 19:31:49 +01:00
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
<input id="student_surname" type="text" class="form-control @error('student_surname') is-invalid @enderror" name="student_surname" value="{{ old('student_surname') }}" autocomplete="student_surname">
|
|
|
|
|
|
|
|
@error('student_surname')
|
|
|
|
<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="seat_number" class="col-md-4 col-form-label text-md-right">{{ __('Nr miejsca') }}</label>
|
2019-12-01 19:31:49 +01:00
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
<input id="seat_number" type="number" class="form-control @error('seat_number') is-invalid @enderror" name="seat_number" value="{{ old('seat_number') }}" required autocomplete="seat_number" autofocus>
|
|
|
|
|
|
|
|
@error('seat_number')
|
|
|
|
<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 ($attendances->count() > 0)
|
|
|
|
<h5> All attendance records: ({{ $attendances->count() }}) </h5>
|
|
|
|
<table class="table table-striped">
|
|
|
|
<tr class="thead-dark">
|
|
|
|
<th>ID</th>
|
2019-12-06 22:34:25 +01:00
|
|
|
<th> ID zajęc </th>
|
|
|
|
<th> Nazwa zajęć </th>
|
|
|
|
<th> ID studenta </th>
|
|
|
|
<th> Imię studenta</th>
|
|
|
|
<th> Nazwisko studenta </th>
|
|
|
|
<th> Nr miejsca </th>
|
2019-12-01 19:31:49 +01:00
|
|
|
<th></th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
@foreach ($attendances as $attendance)
|
2019-12-01 00:22:33 +01:00
|
|
|
<tr>
|
2019-12-01 19:31:49 +01:00
|
|
|
<td> {{ $attendance->id }}</td>
|
|
|
|
<td> {{ $attendance->classes_id }} </td>
|
|
|
|
<td> {{ App\Subject::find(App\Classes::find($attendance->classes_id)->subject_id)->name }},
|
|
|
|
{{ App\Classes::find($attendance->classes_id)-> date }} {{ App\Subject::find(App\Classes::find($attendance->classes_id)->subject_id)->time }} </td>
|
|
|
|
<td> {{ $attendance->student_id_number }} </td>
|
|
|
|
<td> {{ $attendance->student_name}}</td>
|
|
|
|
<td> {{ $attendance->student_surname}}</td>
|
|
|
|
<td> {{ $attendance->seat_number }} </td>
|
|
|
|
<td>
|
2019-12-06 22:34:25 +01:00
|
|
|
<a href="{{ route('admin_delete_attendance', [$attendance->id]) }}" name="delete-attendance-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_attendance', [$attendance->id]) }}" name="edit-attendance-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 obecności. </p>
|
2019-12-01 19:31:49 +01:00
|
|
|
@endif
|
2019-12-01 00:22:33 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|