2019-12-01 23:36:12 +01:00
|
|
|
@extends('home')
|
|
|
|
|
2019-12-06 22:34:25 +01:00
|
|
|
@section('title') Mój Panel - Zajęcia @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> Sprawdź obecność </h4>
|
|
|
|
</div>
|
2020-03-01 23:30:37 +01:00
|
|
|
@if ($errors->any())
|
|
|
|
<div class="alert alert-danger invalid-feedback-alert">
|
|
|
|
<ul>
|
|
|
|
@foreach ($errors->all() as $error)
|
|
|
|
<li>{{ $error }}</li>
|
|
|
|
@endforeach
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
@endif
|
2019-12-01 23:36:12 +01:00
|
|
|
<div class="card-body">
|
2019-12-13 23:28:16 +01:00
|
|
|
<form method="POST" action="{{ route('user_add_classes') }}" class="classes-form">
|
2019-12-01 23:36:12 +01:00
|
|
|
@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 23:36:12 +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-09 12:25:32 +01:00
|
|
|
<option value="{{ $subject->id }}">{{ $subject->name }}, {{ $subject->weekday }} {{ $subject->time }}, sala {{ App\Room::find($subject->room_id)->name }}</option>
|
2019-12-01 23:36:12 +01:00
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
|
|
|
|
@error('subject_id')
|
2020-03-01 23:30:37 +01:00
|
|
|
<span class="invalid-feedback" role="alert">
|
|
|
|
<strong>{{ $message }}</strong>
|
|
|
|
</span>
|
2019-12-01 23:36:12 +01:00
|
|
|
@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 23:36:12 +01:00
|
|
|
|
|
|
|
<div class="col-md-6">
|
2019-12-13 23:28:16 +01:00
|
|
|
<input id="date" type="date" class="form-control @error('date') is-invalid @enderror" name="date" value="{{ $defaultDate }}" required autocomplete="date">
|
2019-12-01 23:36:12 +01:00
|
|
|
|
|
|
|
@error('date')
|
2020-03-01 23:30:37 +01:00
|
|
|
<span class="invalid-feedback" role="alert">
|
|
|
|
<strong>{{ $message }}</strong>
|
|
|
|
</span>
|
2019-12-01 23:36:12 +01:00
|
|
|
@enderror
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-12-20 15:46:32 +01:00
|
|
|
<div class="form-group row">
|
|
|
|
|
2020-01-17 17:10:54 +01:00
|
|
|
<div class="mode-div">
|
2020-01-18 01:19:30 +01:00
|
|
|
<div>
|
|
|
|
<label for="test-mode" class="form-check-label">{{ __('Tryb egzaminu') }}</label>
|
2020-03-01 23:30:37 +01:00
|
|
|
<input id="test-mode" type="checkbox" class="form-control @error('mode') is-invalid @enderror" name="mode" value="test">
|
2020-01-18 01:19:30 +01:00
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<label for="quick-mode" class=" form-check-label">{{ __('Tryb szybki') }}</label>
|
2020-03-01 23:30:37 +01:00
|
|
|
<input id="quick-mode" type="checkbox" class="form-control @error('mode') is-invalid @enderror" name="mode" value="quick">
|
2020-01-18 01:19:30 +01:00
|
|
|
</div>
|
2019-12-20 15:46:32 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-12-01 23:36:12 +01:00
|
|
|
<div class="form-group row mb-0">
|
|
|
|
<div class="col-md-6 offset-md-4">
|
2019-12-20 14:09:16 +01:00
|
|
|
<button type="submit" class="btn btn-primary" title="Dodaj zajęcia i rozpocznij zapisy">
|
2019-12-06 22:34:25 +01:00
|
|
|
{{ __('Dodaj zajęcia i rozpocznij zapisy') }}
|
2019-12-01 23:36:12 +01:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2019-12-13 23:28:16 +01:00
|
|
|
@if ($classes->count() > 0)
|
|
|
|
<div class="card-header custom-header">
|
2020-01-17 17:10:54 +01:00
|
|
|
<h4> Moje zajęcia <span class="badge badge-secondary" title="Liczba zajęć"> {{ $classes->count() }} </span> </h4>
|
2019-12-13 23:28:16 +01:00
|
|
|
</div>
|
2019-12-01 23:36:12 +01:00
|
|
|
|
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_classes', ['subject_id']) }}"> po nazwie przedmiotu </option>
|
|
|
|
<option value="{{ route('user_classes', ['date']) }}"> po dacie </option>
|
|
|
|
</select>
|
2019-12-13 23:28:16 +01:00
|
|
|
</div>
|
2019-12-01 23:36:12 +01:00
|
|
|
|
2019-12-13 23:28:16 +01:00
|
|
|
<div class="card-body">
|
2019-12-01 23:36:12 +01:00
|
|
|
@foreach ($classes_grouped as $classes_group_name => $classes_list)
|
|
|
|
@if($classes_group_name)
|
|
|
|
@if($grouped_by == 'subject_id')
|
2019-12-06 22:34:25 +01:00
|
|
|
<h5 class="card-title"> {{ App\Subject::find($classes_group_name)->name }},
|
2020-01-17 17:10:54 +01:00
|
|
|
{{ App\Subject::find($classes_group_name)->weekday }} {{ App\Subject::find($classes_group_name)->time }} <span class="badge badge-secondary" title="Liczba zajęć"> {{ $classes_list->count() }} </span> </h5>
|
2019-12-01 23:36:12 +01:00
|
|
|
@else
|
2020-01-17 17:10:54 +01:00
|
|
|
<h5 class="card-title"> {{ $classes_group_name }} <span class="badge badge-secondary" title="Liczba zajęć"> {{ $classes_list->count() }} </span> </h5>
|
2019-12-01 23:36:12 +01:00
|
|
|
@endif
|
|
|
|
@else
|
2020-01-17 17:10:54 +01:00
|
|
|
<h5 class="card-title"> Inne <span class="badge badge-secondary" title="Liczba zajęć"> {{ $classes_list->count() }} </span></h5>
|
2019-12-01 23:36:12 +01:00
|
|
|
@endif
|
2019-12-20 14:09:16 +01:00
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-striped table-borderless custom-table">
|
|
|
|
<tr class="thead-dark">
|
|
|
|
<th> Nazwa przedmiotu </th>
|
|
|
|
<th> Data </th>
|
|
|
|
<th></th>
|
|
|
|
<th></th>
|
|
|
|
<th></th>
|
2019-12-01 23:36:12 +01:00
|
|
|
</tr>
|
2019-12-20 14:09:16 +01:00
|
|
|
@foreach ($classes_list as $classes_item)
|
|
|
|
<tr>
|
|
|
|
<td> {{ App\Subject::find($classes_item->subject_id)->name }},
|
2019-12-20 15:46:32 +01:00
|
|
|
{{ App\Subject::find($classes_item->subject_id)->weekday }} {{ App\Subject::find($classes_item->subject_id)->time }}, sala {{ App\Room::find(App\Subject::find($classes_item->subject_id)->room_id)->name }}
|
2020-01-17 17:10:54 +01:00
|
|
|
@if($classes_item->mode == 'test')
|
2019-12-20 15:46:32 +01:00
|
|
|
<span class="badge badge-warning" title="Zajęcia w trybie egzaminu"> Egzamin </span>
|
2020-01-17 17:10:54 +01:00
|
|
|
@elseif($classes_item->mode == 'quick')
|
|
|
|
<span class="badge badge-info" title="Zajęcia w trybie szybkim"> Tylko obecność </span>
|
|
|
|
@endif
|
|
|
|
</td>
|
2019-12-20 14:09:16 +01:00
|
|
|
<td> {{ $classes_item->date }} </td>
|
|
|
|
<td>
|
|
|
|
@if($classes_item->classes_code)
|
|
|
|
<a href="{{ route('user_start_classes', [$classes_item->id]) }}" name="start-classes-btn" class="btn btn-secondary" title="Kontynuuj zapisy"> <i class="fa fa-play"></i> Kontynuuj zapisy </a>
|
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="{{ route('user_preview_classes', [$classes_item->id]) }}" name="preview-classes-btn" class="btn btn-primary" title="Zobacz podgląd sali"> <i class="fa fa-television"></i> Zobacz salę </a>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<button type="button" name="delete-classes-btn" class="btn btn-danger" data-toggle="modal" data-target="#classesConfirmationModal-{{ $classes_item->id }}" title="Usuń zajęcia"> <i class="fa fa-trash-o"></i> Usuń </button>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@include('user.delete_confirmation_classes', [$classes_item])
|
|
|
|
@endforeach
|
|
|
|
</table>
|
|
|
|
</div>
|
2019-12-01 23:36:12 +01:00
|
|
|
@endforeach
|
2019-12-13 23:28:16 +01:00
|
|
|
</div>
|
2019-12-01 23:36:12 +01:00
|
|
|
@else
|
2019-12-13 23:28:16 +01:00
|
|
|
<div class="card-body">
|
|
|
|
<p> Brak zajęć. </p>
|
|
|
|
</div>
|
2019-12-01 23:36:12 +01:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|