map preview added, nav updated

This commit is contained in:
s416422 2019-12-13 23:28:16 +01:00
parent de06beeb6d
commit 9df9c7cb4e
25 changed files with 705 additions and 367 deletions

View File

@ -17,7 +17,7 @@ class UserAttendancesController extends Controller
$user_id = Auth::id();
$subjects = Subject::where('user_id', $user_id)->get();
$subjects_ids = $subjects->pluck('id')->toArray();
$classes = Classes::whereIn('subject_id', $subjects_ids)->get();
$classes = Classes::whereIn('subject_id', $subjects_ids)->orderBy('created_at','DESC')->get();
$classes_ids = $classes->pluck('id')->toArray();
$attendances = Attendance::whereIn('classes_id', $classes_ids)->get();
$attendances_grouped = $attendances->groupBy($groupBy);

View File

@ -19,12 +19,12 @@ class UserClassesController extends Controller
$user_id = Auth::id();
$subjects = Subject::where('user_id', $user_id)->get();
$subjects_ids = $subjects->pluck('id')->toArray();
$classes = Classes::whereIn('subject_id', $subjects_ids)->get();
$classes = Classes::whereIn('subject_id', $subjects_ids)->orderBy('created_at','DESC')->get();
foreach($classes as $classes_item) {
$current_date = date('Y-m-d H:i:s');
$classes_date = $classes_item->date;
$classes_date = $classes_item->created_at;
$hours_difference = checkHoursDifference($classes_date, $current_date);
if ($hours_difference > 24) {
if ($hours_difference > 1.5) {
$classes_item->classes_code = null;
$classes_item->save();
$classes_item->refresh();
@ -103,4 +103,18 @@ class UserClassesController extends Controller
]);
return view('map.summary_map', ['student_name' => $student_name, 'student_surname' => $student_surname, 'seat_number' => $seat_number, 'student_id_number' => $student_id_number, 'classes_id' => $classes_id]);
}
public function preview_classes($classes_id)
{
if(!$classes_id == 0) {
$classes = Classes::find($classes_id);
$attendances = Attendance::where('classes_id', $classes->id)->get();
$subject = Subject::find($classes->subject_id);
$room_arrangement = Room::find($subject->room_id)->arrangement;
if(!$room_arrangement) {
$room_arrangement = Room::where('name', 'Inna sala')->first()->arrangement;
}
}
return view('user.user_preview_classes', ['classes_id' => $classes_id, 'room_arrangement' => $room_arrangement, 'attendances' => $attendances]);
}
}

View File

@ -11100,3 +11100,96 @@ a.text-dark:focus {
}
}
.full-height {
height: 100%;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.title {
font-size: 84px;
}
.links > a {
color: #636b6f;
padding: 0 25px;
font-size: 13px;
font-weight: 600;
letter-spacing: .1rem;
text-decoration: none;
text-transform: uppercase;
}
.m-b-md {
margin-bottom: 30px;
}
.content {
text-align: center;
color: #636b6f;
}
#app {
display: flex;
flex-direction: column;
}
.container, .py-4 {
height: 100%;
}
/*.btn-custom {*/
/*border: none;*/
/*border-bottom: 1px solid lightgrey;*/
/*background-color: white;*/
/*color: #1e3572;*/
/*}*/
.custom-header {
display: flex;
justify-content: space-between;
}
.add-subject, .add-attendance {
display: none;
}
.add-subject.open, .add-attendance.open {
display: block;
}
.card-body {
margin-top: 30px;
}
.classes-form {
margin-bottom: 50px;
}
.map-buttons {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
.subjects-table {
margin-bottom: 50px;
}
.seat-wrapper {
display: flex;
flex-direction: column;
}
.main-seat-text {
font-size: 50px;
}
.navbar-nav.ml-auto {
justify-content: flex-end;
width: 100%;
}
.no-margin-top {
margin-top: 0;
}
.nav-link {
margin-left: 30px;
transition: transform 0.3s;
}
.nav-link:hover {
transform: scale(1.1);
}

View File

@ -1,6 +1,3 @@
body {
font-family: monospace, sans-serif;
}
.wrapper {
text-align: center;
@ -54,3 +51,35 @@ button:active {
box-shadow: 0 0 #b85a5b;
background-color: #3654ff;
}
.checkout-button {
margin: 10px 0;
font-size: 14px;
background-color: #5d7cd3;
border-radius: 3px;
border: 0;
padding: 15px 40px;
display: inline-block;
text-align: center;
box-shadow:0px 4px 0px #1e3572;
font-family: monospace;
}
.checkout-button:hover {
box-shadow: 0 0 rgb(103, 88, 184);
background-color: #3654c9;
cursor: pointer;
}
.checkout-button:active {
top: 4px;
box-shadow: 0 0 #b85a5b;
background-color: #3654ff;
}
a.checkout-button {
color: black;
text-decoration: none;
}
.add-mn-btn {
display: none;
}

View File

@ -13,28 +13,24 @@ body {
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.czytnik {
display: inline-block;
text-align: center;
position: absolute;
left: 50%;
bottom: -20%;
transform: translate(-50%, -10%);
background-color: rgba(139, 152, 172, 0.856);
box-shadow: 0 0 rgb(103, 88, 184);
background-color: #3654c9;
padding: 30px 40px;
font-family: monospace;
font-size: 30px;
display: none;
width: 70%;
}
.czytnik:hover {
box-shadow: 0 0 rgb(103, 88, 184);
background-color: #3654c9;
cursor: progress;
.czytnik.open {
display: block;
}
.code-p {
text-align: center;
}
@ -103,3 +99,46 @@ body {
padding: 20px 0;
}
}
.checkout-button {
margin: 10px 0;
font-size: 14px;
background-color: #5d7cd3;
border-radius: 3px;
border: 0;
padding: 15px 40px;
display: inline-block;
text-align: center;
box-shadow:0px 4px 0px #1e3572;
font-family: monospace;
}
.checkout-button:hover {
box-shadow: 0 0 rgb(103, 88, 184);
background-color: #3654c9;
cursor: pointer;
}
.checkout-button:active {
top: 4px;
box-shadow: 0 0 #b85a5b;
background-color: #3654ff;
}
a.checkout-button {
color: black;
text-decoration: none;
}
.map-buttons {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
.seat-wrapper {
display: flex;
flex-direction: column;
}
.main-seat-text {
font-size: 70px;
text-align: center;
}

View File

@ -0,0 +1,40 @@
.add-mn-btn, .end-button {
display: none;
}
.preview-page-content {
display: flex;
justify-content: center;
align-items: flex-start;
height: 100%;
padding: auto;
padding-top: 50px;
}
.preview-attendance-table {
width: 40%;
padding-left: 50px;
}
.seat-chart-wrapper {
width: 60%;
}
.preview-attendance-table, .seat-chart-wrapper {
margin: 0 30px;
}
.seatCharts-space {
background-color: unset!important;
}
.seatCharts-container {
width: 100%!important;
}
.seatCharts-row {
width: 100%!important;
height: 130px!important;
}
.seatCharts-cell {
width: 120px!important;
height: 120px!important;
line-height: 60px!important;
}
.preview-name {
color: rgba(0,0,0,0.7);
}

View File

@ -124,7 +124,7 @@ span.seatCharts-legendDescription {
margin: 10px 0;
font-size: 14px;
background-color: #5d7cd3;
border-radius: 2px;
border-radius: 3px;
border: 0;
padding: 15px 40px;
display: inline-block;
@ -155,3 +155,11 @@ a.checkout-button {
margin-left: 0;
padding-left: 0;
}
.add-mn-btn {
display: none;
}
.seat-p {
font-weight: bold;
margin-bottom: 0;
font-size: 20px;
}

25
public/js/custom.js Normal file
View File

@ -0,0 +1,25 @@
$(document).ready(function(){
$('.add-mn-btn').on('click', function () {
console.log($('.add-mn-btn'));
$('.czytnik').toggleClass('open');
});
$('.add-subject-btn').on('click', function () {
$('.add-subject').toggleClass('open');
if ($('.add-subject').first().hasClass('open')) {
$(this).text('Anuluj')
} else {
$(this).text('Dodaj nowy')
}
});
$('.add-attendance-btn').on('click', function () {
$('.add-attendance').toggleClass('open');
if ($('.add-attendance').first().hasClass('open')) {
$(this).text('Anuluj')
} else {
$(this).text('Dodaj nowy wpis')
}
});
});

View File

@ -24,8 +24,8 @@
settings = {
animate : false, //requires jQuery UI
naming : {
top : true,
left : true,
top : false,
left : false,
getId : function(character, row, column) {
return row + '_' + column;
},

View File

@ -0,0 +1,28 @@
function assignPlaces() {
const attendances = $('.attendance-id');
attendances.each(function() {
const seat_number = $(this).attr('id').split('++')[0];
const name = $(this).attr('id').split('++')[1];
const surname = $(this).attr('id').split('++')[2];
const map_seat = $('#seat-map').find(`#${seat_number}`);
map_seat.html(`<b>${seat_number}</b><br><span class="preview-name">${name} ${surname}</span>`)
map_seat.on('mouseover', () => {
map_seat.css('backgroundColor', 'lightgrey');
$(this).css('backgroundColor', 'lightgrey');
}).on('mouseleave', () => {
map_seat.css('backgroundColor', '#a8b9bd');
$(this).css('backgroundColor', 'unset');
});
$(this).on('mouseover', () => {
map_seat.css('backgroundColor', 'lightgrey');
$(this).css('backgroundColor', 'lightgrey');
}).on('mouseleave', () => {
map_seat.css('backgroundColor', '#a8b9bd');
$(this).css('backgroundColor', 'unset');
})
})
}
$(document).ready(function(){
assignPlaces();
});

View File

@ -5,9 +5,7 @@ $(document).ready(function() {
var $cart = $('#selected-seats'),
seatNumber = '',
placeNumber = ('#sel-seat'),
$counter = $('#counter'),
$name = $('#studentName'),
$total = $('#total'),
sc = $('#seat-map').seatCharts({
map: seat_map,
@ -21,6 +19,7 @@ $(document).ready(function() {
naming : {
rows: ['','','',''],
top : false,
left: false,
getLabel : function (character, row, column) {
if (row === '1') {
return column;

View File

@ -57,6 +57,7 @@
<th> ID przedmoitu </th>
<th> Nazwa przedmiotu </th>
<th> Data </th>
<th> Kod </th>
<th></th>
<th></th>
</tr>
@ -67,6 +68,7 @@
<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>
<td> {{ $classes_item->classes_code }}</td>
<td>
<a href="{{ route('admin_delete_classes', [$classes_item->id]) }}" name="delete-classes-btn" class="btn btn-danger"> Usuń </a>
</td>

View File

@ -3,29 +3,54 @@
@section('title') Strona Główna @endsection
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card">
<div class="card-header">Mój Panel</div>
<div class="card-body">
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
@auth
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card">
<div class="card-body no-margin-top">
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
@endif
@section('user_content')
<h4> Garść przydatnych informacji </h4>
<p> W zakładce <b>Moje przedmioty</b> znajdują się przedmioty, których jesteś prowadzącym.
<br>Możesz tam także dodać nowy przedmiot.
</p>
<p></p>
<p> Sprawdzanie obecności możesz rozpocząć w zakładce <b>Sprawdź obecność</b>.
<br> Po rozpoczęciu zapisów zostanie wygenerowany i wyświetlony na ekranie kod weryfikacyjny.
Należy go wprowadzić do programu obsługującego odczyt danych z legitymacji studenckich.
Kod jest ważny 1,5 godziny od momentu utworzenia zajęć.
Dopóki kod jest aktywny, zapisy można przerywać i ponownie kontynuować, gdy zajdzie taka potrzeba.
<br> W tej zakładce znajdziesz także listę wszystkich minionych zajęć.
<br> W każdym momencie możesz zobaczyć podgląd sali i listę obecności dla konkretnych zajęć.
</p>
<p>
Dane dotyczące obecności znajdziesz także w zakładce <b>Obecności</b>.
</p>
@stop
@yield('user_content')
</div>
</div>
@endif
</div>
<div class="card-body">
<a href="{{ route('user_subjects') }}" class="btn btn-primary"> Moje przedmioty </a>
{{--<a href="{{ route('user_classes') }}" class="btn btn-primary"> My classes </a>--}}
<a href="{{ route('user_classes') }}" class="btn btn-primary"> Sprawdź obecność </a>
<a href="{{ route('user_attendances') }}" class="btn btn-primary"> Obecności </a>
</div>
<div class="card-body">
@yield('user_content')
</div>
</div>
</div>
</div>
</div>
</div>
@else
<div class="container flex-center">
<div class="row justify-content-center">
<div class="flex-center position-ref full-height">
<div class="content">
<div class="title m-b-md">
@CHECK
</div>
<h2>Witaj!</h2>
</div>
</div>
</div>
</div>
@endauth
@endsection

View File

@ -11,6 +11,8 @@
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
<script src="{{ asset('js/custom.js') }}" defer></script>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
@ -19,6 +21,8 @@
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link rel="shortcut icon" href="{{ asset('img/favicon.png') }}">
@yield('main_meta')
</head>
<body>
<div id="app">
@ -34,7 +38,6 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- Left Side Of Navbar -->
<ul class="navbar-nav mr-auto">
</ul>
<!-- Right Side Of Navbar -->
@ -50,6 +53,9 @@
</li>
@endif
@else
<a href="{{ route('user_subjects') }}" class="nav-link"> Moje przedmioty </a>
<a href="{{ route('user_classes') }}" class="nav-link"> Sprawdź obecność </a>
<a href="{{ route('user_attendances') }}" class="nav-link"> Obecności </a>
@if (Auth::user()->is_Admin)
<li class="nav-item">
<a class="nav-link" href="{{ route('admin') }}">{{ __('Panel admina') }}</a>

View File

@ -3,20 +3,128 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.14.0.css">
<link rel="stylesheet" href="{{ asset('js/app.js') }}">
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<script type="text/javascript" src="{{ asset('js/app.js') }}"></script>
<script src="http://code.jquery.com/qunit/qunit-1.14.0.js"></script>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="{{ asset('js/map/jquery.seat-charts.min.js') }}"></script>
<link rel="stylesheet" type="text/css" href="{{ asset('css/map/seatchart.css') }}">
<script type="text/javascript" src="{{ asset('js/custom.js') }}"></script>
<link rel="shortcut icon" href="{{ asset('img/favicon.png') }}">
<title> @CHECK | @yield('map_title') </title>
@yield('map_meta')
</head>
<body>
<div id="app">
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
@CHECK
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- Left Side Of Navbar -->
<ul class="navbar-nav mr-auto">
</ul>
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Authentication Links -->
@guest
<li class="nav-item">
<a class="nav-link" href="{{ route('login') }}">{{ __('Zaloguj się') }}</a>
</li>
@if (Route::has('register'))
<li class="nav-item">
<a class="nav-link" href="{{ route('register') }}">{{ __('Zarejestruj się') }}</a>
</li>
@endif
@else
<a href="{{ route('user_subjects') }}" class="nav-link"> Moje przedmioty </a>
<a href="{{ route('user_classes') }}" class="nav-link"> Sprawdź obecność </a>
<a href="{{ route('user_attendances') }}" class="nav-link"> Obecności </a>
@if (Auth::user()->is_Admin)
<li class="nav-item">
<a class="nav-link" href="{{ route('admin') }}">{{ __('Panel admina') }}</a>
</li>
@endif
<li class="nav-item dropdown">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
{{ Auth::user()->name }} {{ Auth::user()->surname }} <span class="caret"></span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
{{ __('Wyloguj się') }}
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
</div>
</li>
@endguest
</ul>
</div>
</div>
</nav>
</div>
{{--<main class="py-4">--}}
{{--<div class="container">--}}
{{--@auth--}}
{{--<div class="container">--}}
{{--<div class="row justify-content-center">--}}
{{--<div class="col-md-12">--}}
{{--<div class="card">--}}
{{--<div class="card-header">Mój Panel</div>--}}
{{--<div class="card-body">--}}
{{--@if (session('status'))--}}
{{--<div class="alert alert-success" role="alert">--}}
{{--{{ session('status') }}--}}
{{--</div>--}}
{{--@endif--}}
{{--</div>--}}
{{--<div class="card-body">--}}
{{--<a href="{{ route('user_subjects') }}" class="btn btn-primary"> Moje przedmioty </a>--}}
{{--<a href="{{ route('user_classes') }}" class="btn btn-primary"> My classes </a>--}}
{{--<a href="{{ route('user_classes') }}" class="btn btn-primary"> Sprawdź obecność </a>--}}
{{--<a href="{{ route('user_attendances') }}" class="btn btn-primary"> Obecności </a>--}}
{{--<a href="{{ route('user_preview_classes', [0]) }}" name="preview-classes-btn" class="btn btn-primary"> Podgląd sali </a>--}}
{{--</div>--}}
{{--<div class="card-body">--}}
{{--@yield('user_content')--}}
{{--</div>--}}
{{--</div>--}}
{{--</div>--}}
{{--</div>--}}
{{--</div>--}}
{{--@else--}}
{{--<div class="container flex-center">--}}
{{--<div class="row justify-content-center">--}}
{{--<div class="flex-center position-ref full-height">--}}
{{--<div class="content">--}}
{{--<div class="title m-b-md">--}}
{{--@CHECK--}}
{{--</div>--}}
{{--<h2>Witaj!</h2>--}}
{{--</div>--}}
{{--</div>--}}
{{--</div>--}}
{{--</div>--}}
{{--@endauth--}}
{{--</div>--}}
{{--</main>--}}
<div class="wrapper">
<a href="{{ route('user_classes') }}" class="checkout-button end-button"> Zakończ zapisy </a>
<div class="map-buttons">
<a href="{{ route('user_classes') }}" class="checkout-button end-button"> Zakończ zapisy </a>
<button type="button" class="checkout-button end-button add-mn-btn"> Dodaj studenta ręcznie </button>
</div>
@yield('map_content')
</div>

View File

@ -2,20 +2,23 @@
@section('title') Wybór miejsca @endsection
@section('map_meta')
<meta name="csrf-token" content="{{ csrf_token() }}">
<script type="text/javascript" src="{{ asset('js/map/jquery.seat-charts.min.js') }}"></script>
<link rel="stylesheet" type="text/css" href="{{ asset('css/map/jquery.seat-charts.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/map/seatchart.css') }}">
<script type="text/javascript" src="{{ asset('js/map/seatchart.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/map/seatchart-custom.js') }}"></script>
@endsection
@section('map_content')
<div class="seat-chart-wrapper">
<div id="seat-map">
<div class="front-indicator">{{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->name }},
{{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->weekday }}
{{ App\Classes::find($classes_id)->date }} {{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->time }},
<b>sala {{ App\Room::find(App\Subject::find(App\Classes::find($classes_id)->subject_id)->room_id)->name }}</b></div>
<div class="front-indicator">
<p class="seat-p">
{{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->name }},
{{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->weekday }}
{{ App\Classes::find($classes_id)->date }} {{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->time }},
<b>sala {{ App\Room::find(App\Subject::find(App\Classes::find($classes_id)->subject_id)->room_id)->name }}</b>
</p>
</div>
</div>
</div>
<br/>

View File

@ -3,32 +3,30 @@
@section('title') Wybór miejsca @endsection
@section('map_meta')
<link rel="stylesheet" type="text/css" href="{{ asset('css/map/przylozlegitke.css') }}">
<script type="text/javascript" src="{{ asset('js/map/przylozlegitke.js') }}"></script>
@endsection
@section('map_content')
<p class="code-p"> <b>Kod:</b> {{ $classes_code }}</p>
<h1 class="main-text">Przyłóż legitymację do czytnika</h1>
<h1 class="main-text main-seat-text">Przyłóż legitymację do czytnika</h1>
<div class="czytnik">
<h3> CZYTNIK </h3>
<form method="POST" action="{{ route('user_start_classes_verified') }}" class="test-form">
<div>
<label for="classes_code"> Kod: </label>
<input type="text" name="classes_code" id="classes_code">
<input type="text" name="classes_code" id="classes_code" value="{{ $classes_code }}" required>
</div>
<div>
<label for="student_id_number"> ID studenta: </label>
<input type="number" name="student_id_number" id="student_id_number">
<input type="number" name="student_id_number" id="student_id_number" required>
</div>
<div>
<label for="student_name"> Imię studenta: </label>
<input type="text" name="student_name" id="student_name">
<input type="text" name="student_name" id="student_name" required>
</div>
<div>
<label for="student_surname"> Nazwisko studenta: </label>
<input type="text" name="student_surname" id="student_surname">
<input type="text" name="student_surname" id="student_surname" required>
</div>
<button type="submit" class="checkout-button"> Wyślij requesta </button>
<button type="submit" class="checkout-button"> Dodaj studenta </button>
</form>
</div>
@endsection

View File

@ -3,7 +3,6 @@
@section('title') Wybór miejsca @endsection
@section('map_meta')
<link rel="stylesheet" type="text/css" href="{{ asset('css/map/koncowastrona.css') }}">
<script type="text/javascript" src="{{ asset('js/map/seatchart.js') }}"></script>
@endsection
@section('map_content')
@ -13,5 +12,5 @@
<h3>wybrane miejsce:</h3>
<ul id="sel-seat"> {{ $seat_number }}</ul>
<a href="{{ route('user_start_classes', [$classes_id]) }}"><button type="button" class="checkout-button">Przejdź do strony głównej &raquo;</button></a>
<a href="{{ route('user_start_classes', [$classes_id]) }}"><button type="button" class="checkout-button">Następny student &raquo;</button></a>
@endsection

View File

@ -5,108 +5,111 @@
@section('user_content')
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card-body">
<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">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="student_id" class="col-md-4 col-form-label text-md-right">{{ __('ID studenta') }}</label>
<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">
<label for="student_name" class="col-md-4 col-form-label text-md-right">{{ __('Imię studenta') }}</label>
<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">
<label for="student_surname" class="col-md-4 col-form-label text-md-right">{{ __('Nazwisko studenta') }}</label>
<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">
<label for="seat_number" class="col-md-4 col-form-label text-md-right">{{ __('Nr miejsca') }}</label>
<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">
{{ __('Dodaj') }}
</button>
</div>
</div>
</form>
<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>
</div>
<div class="card-body">
@if ($attendances->count() > 0)
<h4 class="card-header"> Wszystkie obecności: ({{ $attendances->count() }}) </h4>
<div class="card-body">
<span> Grupuj: </span>
<a href="{{ route('user_attendances', ['classes_id']) }}" class="btn btn-primary"> po nazwie zajęć </a>
<a href="{{ route('user_attendances', ['student_id_number']) }}" class="btn btn-primary"> po ID studenta </a>
<a href="{{ route('user_attendances', ['seat_number']) }}" class="btn btn-primary"> po numerze miejsca </a>
</div>
<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">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="student_id" class="col-md-4 col-form-label text-md-right">{{ __('Nr indeksu studenta') }}</label>
<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">
<label for="student_name" class="col-md-4 col-form-label text-md-right">{{ __('Imię studenta') }}</label>
<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">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="student_surname" class="col-md-4 col-form-label text-md-right">{{ __('Nazwisko studenta') }}</label>
<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">
<strong>{{ $message }}</strong>
</span>
@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">
<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">
{{ __('Dodaj') }}
</button>
</div>
</div>
</form>
</div>
@if ($attendances->count() > 0)
<div class="card-body">
<span> Grupuj: </span>
<a href="{{ route('user_attendances', ['classes_id']) }}" class="btn btn-primary"> po nazwie zajęć </a>
<a href="{{ route('user_attendances', ['student_id_number']) }}" class="btn btn-primary"> po numerze indeksu </a>
<a href="{{ route('user_attendances', ['seat_number']) }}" class="btn btn-primary"> po numerze miejsca </a>
</div>
<div class="card-body">
@foreach ($attendances_grouped as $attendances_group_name => $attendances_list)
@if($attendances_group_name)
@if($grouped_by == 'classes_id')
@ -120,10 +123,10 @@
<h5 class="card-title"> Inne ({{ $attendances_list->count() }})</h5>
@endif
<table class="table table-striped">
<table class="table table-striped subjects-table">
<tr class="thead-dark">
<th> Nazwa zajęc </th>
<th> ID studenta </th>
<th> Nazwa zajęć </th>
<th> Nr indeksu </th>
<th> Imię studenta </th>
<th> Nazwisko studenta </th>
<th> Nr miejsca </th>
@ -141,17 +144,17 @@
<td>
<a href="{{ route('user_delete_attendance', [$attendance->id]) }}" name="delete-attendance-btn" class="btn btn-danger"> Usuń </a>
</td>
{{--<td>--}}
{{--<a href="{{ route('user_edit_attendance', [$attendance->id]) }}" name="edit-attendance-btn" class="btn btn-secondary"> Edytuj </a>--}}
{{--</td>--}}
</tr>
@endforeach
</table>
@endforeach
@else
</div>
@else
<div class="card-body">
<p> Brak zarejestrowantch obecności. </p>
@endif
</div>
</div>
@endif
</div>
</div>
@endsection

View File

@ -5,9 +5,11 @@
@section('user_content')
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card-header custom-header">
<h4> Sprawdź obecność </h4>
</div>
<div class="card-body">
<h4 class="card-header"> Sprawdź obecność </h4>
<form method="POST" action="{{ route('user_add_classes') }}">
<form method="POST" action="{{ route('user_add_classes') }}" class="classes-form">
@csrf
<div class="form-group row">
@ -32,7 +34,7 @@
<label for="date" class="col-md-4 col-form-label text-md-right">{{ __('Data') }}</label>
<div class="col-md-6">
<input id="date" type="date" class="form-control @error('date') is-invalid @enderror" name="date" value="{{ $defaultDate }}" autocomplete="date">
<input id="date" type="date" class="form-control @error('date') is-invalid @enderror" name="date" value="{{ $defaultDate }}" required autocomplete="date">
@error('date')
<span class="invalid-feedback" role="alert">
@ -51,16 +53,18 @@
</div>
</form>
</div>
<div>
@if ($classes->count() > 0)
<h4 class="card-header"> Moje zajęcia: ({{ $classes->count() }}) </h4>
@if ($classes->count() > 0)
<div class="card-header custom-header">
<h4> Moje zajęcia: ({{ $classes->count() }}) </h4>
</div>
<div class="card-body">
<span> Grupuj: </span>
<a href="{{ route('user_classes', ['subject_id']) }}" class="btn btn-primary"> po nazwie przedmiotu </a>
<a href="{{ route('user_classes', ['date']) }}" class="btn btn-primary"> po dacie </a>
</div>
<div class="card-body">
<span> Grupuj: </span>
<a href="{{ route('user_classes', ['subject_id']) }}" class="btn btn-primary"> po nazwie przedmiotu </a>
<a href="{{ route('user_classes', ['date']) }}" class="btn btn-primary"> po dacie </a>
</div>
<div class="card-body">
@foreach ($classes_grouped as $classes_group_name => $classes_list)
@if($classes_group_name)
@if($grouped_by == 'subject_id')
@ -72,7 +76,7 @@
@else
<h5 class="card-title"> Inne ({{ $classes_list->count() }})</h5>
@endif
<table class="table table-striped">
<table class="table table-striped subjects-table">
<tr class="thead-dark">
<th> Nazwa przedmiotu </th>
<th> Data </th>
@ -90,6 +94,9 @@
<a href="{{ route('user_start_classes', [$classes_item->id]) }}" name="start-classes-btn" class="btn btn-warning"> Kontynuuj zapisy </a>
@endif
</td>
<td>
<a href="{{ route('user_preview_classes', [$classes_item->id]) }}" name="preview-classes-btn" class="btn btn-info"> Zobacz podgląd sali </a>
</td>
<td>
<a href="{{ route('user_delete_classes', [$classes_item->id]) }}" name="delete-classes-btn" class="btn btn-danger"> Usuń </a>
</td>
@ -97,10 +104,12 @@
@endforeach
</table>
@endforeach
</div>
@else
<p> Brak zajęć. </p>
<div class="card-body">
<p> Brak zajęć. </p>
</div>
@endif
</div>
</div>
</div>
@endsection

View File

@ -1,37 +0,0 @@
@extends('home')
@section('title') Mój Panel - Zajęcia @endsection
@section('user_content')
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card-body">
<p> {{ App\Subject::find($classes->subject_id)->name }}, {{ $classes->date }} {{ App\Subject::find($classes->subject_id)->time }}</p>
@if(!$verified)
<p>
Wprowadź poniższy kod do programu:
</p>
<p> {{ $classes_code }}</p>
@else
<p> Połączono prawidłowo.</p>
<p> Zajęcia odbywają się w sali {{ $room }}.</p>
@if($attendances)
<p> Aktualna liczba studentów w sali: {{ $attendances->count() }}</p>
<br><br>
@foreach($attendances as $attendance)
<p> Student ID number: {{ $attendance->student_id_number }}</p>
<p> Student name: {{ $attendance->student_name }}</p>
<p> Student surname: {{ $attendance->student_surname }}</p>
<p> Seat number: {{ $attendance->seat_number }}</p>
<br><br>
@endforeach
@else
<p> Aktualna liczba studentów w sali: 0</p>
<br><br>
@endif
@endif
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,52 @@
@extends('layouts.map')
@section('title') Podgląd sali @endsection
@section('map_meta')
<script type="text/javascript" src="{{ asset('js/map/jquery.seat-charts.min.js') }}"></script>
<link rel="stylesheet" type="text/css" href="{{ asset('css/map/jquery.seat-charts.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/map/seatchart.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/map/seatchart-preview.css') }}">
<script type="text/javascript" src="{{ asset('js/map/seatchart.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/map/seatchart-preview.js') }}"></script>
@endsection
@section('map_content')
<div class="front-indicator">
<p class="seat-p">
{{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->name }},
{{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->weekday }}
{{ App\Classes::find($classes_id)->date }} {{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->time }},
<b>sala {{ App\Room::find(App\Subject::find(App\Classes::find($classes_id)->subject_id)->room_id)->name }}</b>
</p>
</div>
<div class="preview-page-content">
<div class="preview-attendance-table">
<div class="card-header custom-header">
<h4> Lista obecności </h4>
</div>
<table class="table subjects-table">
<tr class="thead-light">
<th> Nr indeksu </th>
<th> Imię studenta </th>
<th> Nazwisko studenta </th>
<th> Nr miejsca </th>
</tr>
@foreach ($attendances as $attendance)
<tr class="attendance-id" id="{{ $attendance->seat_number }}++{{ $attendance->student_name}}++{{ $attendance->student_surname}}">
<td> {{ $attendance->student_id_number }} </td>
<td> {{ $attendance->student_name}}</td>
<td> {{ $attendance->student_surname}}</td>
<td> {{ $attendance->seat_number }} </td>
</tr>
@endforeach
</table>
</div>
<div class="seat-chart-wrapper">
<div id="seat-map"></div>
<input type="hidden" class="room_arrangement" name="room_arrangement" id="room_arrangement" value="{{ $room_arrangement }}">
</div>
</div>
@endsection

View File

@ -5,8 +5,13 @@
@section('user_content')
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card-body">
<h4 class="card-header"> Dodaj nowy przedmiot </h4>
<div class="card-header custom-header">
<h4> Moje przedmioty: ({{ $subjects->count() }}) </h4>
<button type="button" class="btn btn-primary btn-custom add-subject-btn"> Dodaj nowy </button>
</div>
<div class="card-body add-subject">
<h5> Dodaj nowy przedmiot </h5>
<form method="POST" action="{{ route('user_add_subject') }}">
@csrf
<div class="form-group row">
@ -17,37 +22,18 @@
@error('name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
{{--<div class="form-group row">--}}
{{--<label for="type" class="col-md-4 col-form-label text-md-right">{{ __('Type') }}</label>--}}
{{--<div class="col-md-6">--}}
{{--<select id="type" class="form-control @error('type') is-invalid @enderror" name="type">--}}
{{--<option label="-- select type -- "></option>--}}
{{--@foreach ($types as $type)--}}
{{--<option value="{{ $type }}">{{ $type }}</option>--}}
{{--@endforeach--}}
{{--</select>--}}
{{--@error('type')--}}
{{--<span class="invalid-feedback" role="alert">--}}
{{--<strong>{{ $message }}</strong>--}}
{{--</span>--}}
{{--@enderror--}}
{{--</div>--}}
{{--</div>--}}
<div class="form-group row">
<label for="weekday" class="col-md-4 col-form-label text-md-right">{{ __('Dzień tygodnia') }}</label>
<div class="col-md-6">
<select id="weekday" class="form-control @error('weekday') is-invalid @enderror" name="weekday">
<select id="weekday" class="form-control @error('weekday') is-invalid @enderror" name="weekday" required>
<option label="-- select day of the week -- "></option>
@foreach ($weekdays as $weekday)
@if ($weekday == $defaultWeekday)
@ -61,8 +47,8 @@
@error('weekday')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
@ -71,12 +57,12 @@
<label for="time" class="col-md-4 col-form-label text-md-right">{{ __('Godzina') }}</label>
<div class="col-md-6">
<input id="time" type="time" class="form-control @error('time') is-invalid @enderror" name="time" value="{{ $defaultTime }}" autocomplete="time">
<input id="time" type="time" class="form-control @error('time') is-invalid @enderror" name="time" value="{{ $defaultTime }}" required autocomplete="time">
@error('time')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
@ -93,8 +79,8 @@
@error('room_id')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
@ -103,12 +89,12 @@
<label for="user_id" class="col-md-4 col-form-label text-md-right">{{ __('Prowadzący') }}</label>
<div class="col-md-6">
<input id="user_id" type="text" class="@error('user_id') is-invalid @enderror form-control-plaintext" name="user_id" value="{{ Auth::user()->name }} {{ Auth::user()->surname }}" readonly>
<input id="user_id" type="text" class="@error('user_id') is-invalid @enderror form-control-plaintext" name="user_id" value="{{ Auth::user()->name }} {{ Auth::user()->surname }}" required readonly>
@error('user_id')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
@ -122,19 +108,17 @@
</div>
</form>
</div>
<div class="card-body">
@if ($subjects->count() > 0)
<h4 class="card-header"> Moje przedmioty: ({{ $subjects->count() }}) </h4>
<div class="card-body">
<span> Grupuj: </span>
<a href="{{ route('user_subjects', ['name']) }}" class="btn btn-primary"> po nazwie </a>
{{--<a href="{{ route('user_subjects', ['type']) }}" class="btn btn-primary"> Type </a>--}}
<a href="{{ route('user_subjects', ['weekday']) }}" class="btn btn-primary"> po dniu tygodnia </a>
<a href="{{ route('user_subjects', ['time']) }}" class="btn btn-primary"> po godzinie </a>
<a href="{{ route('user_subjects', ['room_id']) }}" class="btn btn-primary"> Room </a>
</div>
@if ($subjects->count() > 0)
<div class="card-body">
<span> Grupuj: </span>
<a href="{{ route('user_subjects', ['name']) }}" class="btn btn-primary btn-custom"> po nazwie </a>
{{--<a href="{{ route('user_subjects', ['type']) }}" class="btn btn-primary"> Type </a>--}}
<a href="{{ route('user_subjects', ['weekday']) }}" class="btn btn-primary btn-custom"> po dniu tygodnia </a>
<a href="{{ route('user_subjects', ['time']) }}" class="btn btn-primary btn-custom"> po godzinie </a>
<a href="{{ route('user_subjects', ['room_id']) }}" class="btn btn-primary btn-custom"> po sali </a>
</div>
<div class="card-body">
@foreach ($subjects_grouped as $subject_group_name => $subjects_list)
@if($subject_group_name)
@if($grouped_by == 'room_id')
@ -145,7 +129,7 @@
@else
<h5 class="card-title"> Inne ({{ $subjects_list->count() }})</h5>
@endif
<table class="table table-striped">
<table class="table table-striped subjects-table">
<tr class="thead-dark">
<th> Nazwa </th>
{{--<th> Type </th>--}}
@ -174,10 +158,12 @@
@endforeach
</table>
@endforeach
@else
</div>
@else
<div class="card-body">
<p> Brak przedmiotów. </p>
@endif
</div>
</div>
@endif
</div>
</div>
@endsection

View File

@ -1,92 +0,0 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>@CHECK</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
<link rel="shortcut icon" href="{{ asset('img/favicon.png') }}">
<!-- Styles -->
<style>
html, body {
background-color: #fff;
color: #636b6f;
font-family: 'Nunito', sans-serif;
font-weight: 200;
height: 100vh;
margin: 0;
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.top-right {
position: absolute;
right: 10px;
top: 18px;
}
.content {
text-align: center;
}
.title {
font-size: 84px;
}
.links > a {
color: #636b6f;
padding: 0 25px;
font-size: 13px;
font-weight: 600;
letter-spacing: .1rem;
text-decoration: none;
text-transform: uppercase;
}
.m-b-md {
margin-bottom: 30px;
}
</style>
</head>
<body>
<div class="flex-center position-ref full-height">
@if (Route::has('login'))
<div class="top-right links">
@auth
<a href="{{ url('/home') }}">Strona Główna</a>
@else
<a href="{{ route('login') }}">Zaloguj się</a>
@if (Route::has('register'))
<a href="{{ route('register') }}">Zarejestruj się</a>
@endif
@endauth
</div>
@endif
<div class="content">
<div class="title m-b-md">
@CHECK
</div>
<h2>Witaj!</h2>
</div>
</div>
</body>
</html>

View File

@ -12,7 +12,7 @@
*/
Route::get('/', function () {
return view('welcome');
return view('home');
});
Auth::routes();
@ -58,6 +58,7 @@ Route::group(array('prefix' => 'user', 'namespace' => 'User'), function() { //TO
Route::get('/classes/start/{classes_id}', 'UserClassesController@start_classes')->name('user_start_classes');
Route::post('/classes/start', 'UserClassesController@start_classes_verified')->name('user_start_classes_verified')->middleware('classesCode');
Route::post('/classes/save', 'UserClassesController@save_classes_data')->name('user_save_classes_data');
Route::get('/classes/preview/{classes_id?}', 'UserClassesController@preview_classes')->name('user_preview_classes');
Route::group(array('prefix' => 'add'), function() {
Route::post('/subject', 'UserSubjectsController@add_subject')->name('user_add_subject');