2019-12-01 23:36:12 +01:00
|
|
|
@extends('home')
|
|
|
|
|
2019-12-06 22:34:25 +01:00
|
|
|
@section('title') Mój Panel - Obecności @endsection
|
2019-12-01 23:36:12 +01:00
|
|
|
|
|
|
|
@section('user_content')
|
|
|
|
<div class="row justify-content-center">
|
|
|
|
<div class="col-md-12">
|
2019-12-13 23:28:16 +01:00
|
|
|
<div class="card-header custom-header">
|
|
|
|
<h4> Wszystkie obecności: ({{ $attendances->count() }}) </h4>
|
|
|
|
<button type="button" class="btn btn-primary btn-custom add-attendance-btn"> Dodaj nowy wpis </button>
|
2019-12-01 23:36:12 +01:00
|
|
|
</div>
|
|
|
|
|
2019-12-13 23:28:16 +01:00
|
|
|
<div class="card-body add-attendance">
|
|
|
|
<h4 class="card-header"> Dodaj obecność </h4>
|
|
|
|
<form method="POST" action="{{ route('user_add_attendance') }}" class="col-md-12">
|
|
|
|
@csrf
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label for="classes_id" class="col-md-4 col-form-label text-md-right">{{ __('Zajęcia') }}</label>
|
|
|
|
|
|
|
|
<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\Subject::find(App\Classes::find($classes_item->id)->subject_id)->type }},
|
|
|
|
{{ 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">
|
2019-12-19 10:16:48 +01:00
|
|
|
<strong>{{ $message }}</strong>
|
|
|
|
</span>
|
2019-12-13 23:28:16 +01:00
|
|
|
@enderror
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
2019-12-14 00:37:54 +01:00
|
|
|
<label for="student_id" class="col-md-4 col-form-label text-md-right">{{ __('Nr indeksu') }}</label>
|
2019-12-13 23:28:16 +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">
|
2019-12-19 10:16:48 +01:00
|
|
|
<strong>{{ $message }}</strong>
|
|
|
|
</span>
|
2019-12-13 23:28:16 +01:00
|
|
|
@enderror
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
2019-12-14 00:37:54 +01:00
|
|
|
<label for="student_name" class="col-md-4 col-form-label text-md-right">{{ __('Imię') }}</label>
|
2019-12-13 23:28:16 +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') }}" required autocomplete="student_name">
|
|
|
|
|
|
|
|
@error('student_name')
|
|
|
|
<span class="invalid-feedback" role="alert">
|
2019-12-19 10:16:48 +01:00
|
|
|
<strong>{{ $message }}</strong>
|
|
|
|
</span>
|
2019-12-13 23:28:16 +01:00
|
|
|
@enderror
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
2019-12-14 00:37:54 +01:00
|
|
|
<label for="student_surname" class="col-md-4 col-form-label text-md-right">{{ __('Nazwisko') }}</label>
|
2019-12-13 23:28:16 +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') }}" required autocomplete="student_surname">
|
|
|
|
|
|
|
|
@error('student_surname')
|
|
|
|
<span class="invalid-feedback" role="alert">
|
2019-12-19 10:16:48 +01:00
|
|
|
<strong>{{ $message }}</strong>
|
|
|
|
</span>
|
2019-12-13 23:28:16 +01:00
|
|
|
@enderror
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label for="seat_number" class="col-md-4 col-form-label text-md-right">{{ __('Nr miejsca') }}</label>
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
2019-12-19 10:16:48 +01:00
|
|
|
<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">
|
2019-12-13 23:28:16 +01:00
|
|
|
|
|
|
|
@error('seat_number')
|
|
|
|
<span class="invalid-feedback" role="alert">
|
2019-12-19 10:16:48 +01:00
|
|
|
<strong>{{ $message }}</strong>
|
|
|
|
</span>
|
|
|
|
@enderror
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label for="note" class="col-md-4 col-form-label text-md-right">{{ __('Notatka') }}</label>
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
<textarea id="note" class="form-control" name="note"></textarea>
|
|
|
|
|
|
|
|
@error('note')
|
|
|
|
<span class="invalid-feedback" role="alert">
|
|
|
|
<strong>{{ $message }}</strong>
|
|
|
|
</span>
|
2019-12-13 23:28:16 +01:00
|
|
|
@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">
|
|
|
|
{{ __('Dodaj') }}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@if ($attendances->count() > 0)
|
2019-12-19 00:10:39 +01:00
|
|
|
<div class="card-body card-custom">
|
|
|
|
<span class="sort-span"> Grupuj: </span>
|
|
|
|
<input type="hidden" id="groupBy-hidden" value="{{ $grouped_by }}">
|
|
|
|
<select id="group-select" class="form-control form-custom" name="group-select">
|
|
|
|
<option value="{{ route('user_attendances', ['classes_id']) }}"> po nazwie zajęć </option>
|
|
|
|
<option value="{{ route('user_attendances', ['student_id_number']) }}"> po numerze indeksu </option>
|
|
|
|
<option value="{{ route('user_attendances', ['seat_number']) }}"> po numerze miejsca </option>
|
|
|
|
</select>
|
2019-12-13 23:28:16 +01:00
|
|
|
</div>
|
2019-12-14 22:03:41 +01:00
|
|
|
|
2019-12-19 00:10:39 +01:00
|
|
|
<div class="card-body">
|
2019-12-14 22:03:41 +01:00
|
|
|
@foreach ($attendances_grouped as $attendances_group_name => $attendances_list)
|
2019-12-01 23:36:12 +01:00
|
|
|
@if($attendances_group_name)
|
|
|
|
@if($grouped_by == 'classes_id')
|
|
|
|
<h5 class="card-title"> {{ App\Subject::find(App\Classes::find($attendances_group_name)->subject_id)->name }},
|
|
|
|
{{ App\Classes::find($attendances_group_name)-> date }} {{ App\Subject::find(App\Classes::find($attendances_group_name)->subject_id)->time }}
|
|
|
|
({{ $attendances_list->count() }}) </h5>
|
|
|
|
@else
|
|
|
|
<h5 class="card-title"> {{ $attendances_group_name }} ({{ $attendances_list->count() }}) </h5>
|
|
|
|
@endif
|
|
|
|
@else
|
2019-12-06 22:34:25 +01:00
|
|
|
<h5 class="card-title"> Inne ({{ $attendances_list->count() }})</h5>
|
2019-12-01 23:36:12 +01:00
|
|
|
@endif
|
2019-12-14 22:03:41 +01:00
|
|
|
@include('user.attendances_table', ['attendances_list' => $attendances_list, 'export' => 0])
|
|
|
|
@endforeach
|
2019-12-13 23:28:16 +01:00
|
|
|
</div>
|
|
|
|
@else
|
|
|
|
<div class="card-body">
|
2019-12-07 22:16:05 +01:00
|
|
|
<p> Brak zarejestrowantch obecności. </p>
|
2019-12-13 23:28:16 +01:00
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
2019-12-01 23:36:12 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-19 00:10:39 +01:00
|
|
|
|
2019-12-01 23:36:12 +01:00
|
|
|
@endsection
|