test mode divided into teas and quick mode, room preview added to test mode, scrollable attendances list

This commit is contained in:
s416422 2020-01-17 17:10:54 +01:00
parent 6d8cffc9c5
commit 3f9880d313
19 changed files with 184 additions and 120 deletions

View File

@ -4,5 +4,6 @@
atcheck$ php artisan migrate:fresh atcheck$ php artisan migrate:fresh
atcheck$ php artisan db:seed atcheck$ php artisan db:seed
atcheck$ composer dump-autoload atcheck$ composer dump-autoload
atcheck$ php artisan cache:clear && php artisan route:clear && php artisan config:clear && php artisan view:clear
atcheck$ php artisan serve atcheck$ php artisan serve
``` ```

View File

@ -7,6 +7,6 @@ use Illuminate\Database\Eloquent\Model;
class Classes extends Model class Classes extends Model
{ {
protected $fillable = [ protected $fillable = [
'subject_id', 'date', 'classes_code', 'test_mode' 'subject_id', 'date', 'classes_code', 'mode'
]; ];
} }

View File

@ -41,11 +41,11 @@ class UserClassesController extends Controller
{ {
$subject_id = $request->input('subject_id'); $subject_id = $request->input('subject_id');
$date = $request->input('date'); $date = $request->input('date');
$test_mode = $request->input('test_mode'); $mode = $request->input('mode');
$classes_id = Classes::create([ $classes_id = Classes::create([
'subject_id' => $subject_id, 'subject_id' => $subject_id,
'date' => $date, 'date' => $date,
'test_mode' => $test_mode 'mode' => $mode
])->id; ])->id;
return redirect(route('user_start_classes', ['classes_id' => $classes_id])); return redirect(route('user_start_classes', ['classes_id' => $classes_id]));
} }
@ -73,48 +73,47 @@ class UserClassesController extends Controller
$classes->refresh(); $classes->refresh();
} }
$userCache = new UserCache(); // $userCache = new UserCache();
$cache = $userCache->get($classes_code); // $cache = $userCache->get($classes_code);
if($cache) { // if($cache) {
$student_id_number = $cache->index; // $student_id_number = $cache->index;
$student_name = $cache->name; // $student_name = $cache->name;
$student_surname = $cache->surname; // $student_surname = $cache->surname;
$classes = DB::table("classes")->where("classes_code", $cache->classcode)->first(); // $classes = DB::table("classes")->where("classes_code", $cache->classcode)->first();
$attendances = Attendance::where('classes_id', $classes->id)->get(); // $attendances = Attendance::where('classes_id', $classes->id)->get();
$seat_numbers = $attendances->pluck('seat_number')->toArray(); // $seat_numbers = $attendances->pluck('seat_number')->toArray();
$subject = Subject::find($classes->subject_id); // $subject = Subject::find($classes->subject_id);
//
if($classes->test_mode) { // if($classes->test_mode) {
$room_capacity = Room::find($subject->room_id)->capacity; // $room_capacity = Room::find($subject->room_id)->capacity;
$random_seat = rand(1, $room_capacity); // $random_seat = rand(1, $room_capacity);
while(in_array($random_seat, $seat_numbers)) { // while(in_array($random_seat, $seat_numbers)) {
$random_seat = rand(1, $room_capacity); // $random_seat = rand(1, $room_capacity);
} // }
Attendance::create([ // Attendance::create([
'classes_id' => $classes->id, // 'classes_id' => $classes->id,
'student_id_number' => $student_id_number, // 'student_id_number' => $student_id_number,
'student_name' => $student_name, // 'student_name' => $student_name,
'student_surname' => $student_surname, // 'student_surname' => $student_surname,
'seat_number' => $random_seat // 'seat_number' => $random_seat
]); // ]);
return view('map.summary_map', ['student_name' => $student_name, 'student_surname' => $student_surname, 'seat_number' => $random_seat, 'student_id_number' => $student_id_number, 'classes_id' => $classes->id]); // return view('map.summary_map', ['student_name' => $student_name, 'student_surname' => $student_surname, 'seat_number' => $random_seat, 'student_id_number' => $student_id_number, 'classes_id' => $classes->id]);
} // }
//
$room_arrangement = Room::find($subject->room_id)->arrangement; // $room_arrangement = Room::find($subject->room_id)->arrangement;
if(!$room_arrangement) { // if(!$room_arrangement) {
$room_arrangement = Room::where('name', 'Inna sala')->first()->arrangement; // $room_arrangement = Room::where('name', 'Inna sala')->first()->arrangement;
} // }
$room_rows = count(explode("++", $room_arrangement)); // $room_rows = count(explode("++", $room_arrangement));
if($room_rows > 4) { //max 4 rows on one page // if($room_rows > 4) { //max 4 rows on one page
$multi_parts = true; // $multi_parts = true;
$parts_number = ceil($room_rows/4); // $parts_number = ceil($room_rows/4);
} else { // } else {
$multi_parts = false; // $multi_parts = false;
} // }
$userCache->delete($cache->classcode); // $userCache->delete($cache->classcode);
return view('map.seat_map', ['student_name' => $student_name, 'student_surname' => $student_surname, 'student_id_number' => $student_id_number, 'classes_id' => $classes->id, 'seat_numbers' => $seat_numbers, 'room_arrangement' => $room_arrangement, 'multi_parts' => $multi_parts, 'parts_number' =>$parts_number]); // return view('map.seat_map', ['student_name' => $student_name, 'student_surname' => $student_surname, 'student_id_number' => $student_id_number, 'classes_id' => $classes->id, 'seat_numbers' => $seat_numbers, 'room_arrangement' => $room_arrangement, 'multi_parts' => $multi_parts, 'parts_number' =>$parts_number]);
} // }
return view('map.start_map', ['classes_code' => $classes_code, 'classes' => $classes]); return view('map.start_map', ['classes_code' => $classes_code, 'classes' => $classes]);
} }
@ -124,24 +123,21 @@ class UserClassesController extends Controller
$student_name = $request->input('student_name'); $student_name = $request->input('student_name');
$student_surname = $request->input('student_surname'); $student_surname = $request->input('student_surname');
$classes = Classes::find($request->get('classes_id')); $classes = Classes::find($request->get('classes_id'));
$attendances = Attendance::where('classes_id', $classes->id)->get();
$seat_numbers = $attendances->pluck('seat_number')->toArray(); if($classes->mode == 'quick') {
$subject = Subject::find($classes->subject_id);
if($classes->test_mode) {
$room_capacity = Room::find($subject->room_id)->capacity;
$random_seat = rand(1, $room_capacity);
while(in_array($random_seat, $seat_numbers)) {
$random_seat = rand(1, $room_capacity);
}
Attendance::create([ Attendance::create([
'classes_id' => $classes->id, 'classes_id' => $classes->id,
'student_id_number' => $student_id_number, 'student_id_number' => $student_id_number,
'student_name' => $student_name, 'student_name' => $student_name,
'student_surname' => $student_surname, 'student_surname' => $student_surname,
'seat_number' => $random_seat 'seat_number' => null
]); ]);
return view('map.summary_map', ['student_name' => $student_name, 'student_surname' => $student_surname, 'seat_number' => $random_seat, 'student_id_number' => $student_id_number, 'classes_id' => $classes->id]); return view('map.summary_map', ['student_name' => $student_name, 'student_surname' => $student_surname, 'seat_number' => null, 'student_id_number' => $student_id_number, 'classes_id' => $classes->id, 'mode' => 'quick']);
}
} else {
$attendances = Attendance::where('classes_id', $classes->id)->get();
$seat_numbers = $attendances->pluck('seat_number')->toArray();
$subject = Subject::find($classes->subject_id);
$room_arrangement = Room::find($subject->room_id)->arrangement; $room_arrangement = Room::find($subject->room_id)->arrangement;
if(!$room_arrangement) { if(!$room_arrangement) {
$room_arrangement = Room::where('name', 'Inna sala')->first()->arrangement; $room_arrangement = Room::where('name', 'Inna sala')->first()->arrangement;
@ -152,8 +148,19 @@ class UserClassesController extends Controller
$parts_number = ceil($room_rows/4); $parts_number = ceil($room_rows/4);
} else { } else {
$multi_parts = false; $multi_parts = false;
$parts_number = 1;
}
if($classes->mode == 'test') {
$room_capacity = Room::find($subject->room_id)->capacity;
$random_seat = rand(1, $room_capacity);
while(in_array($random_seat, $seat_numbers)) {
$random_seat = rand(1, $room_capacity);
}
return view('map.seat_map', ['student_name' => $student_name, 'student_surname' => $student_surname, 'seat_number' => $random_seat, 'student_id_number' => $student_id_number, 'classes_id' => $classes->id, 'seat_numbers' => $seat_numbers, 'room_arrangement' => $room_arrangement, 'multi_parts' => $multi_parts, 'parts_number' =>$parts_number, 'mode' => 'test', 'random_seat' => $random_seat]);
}
return view('map.seat_map', ['student_name' => $student_name, 'student_surname' => $student_surname, 'student_id_number' => $student_id_number, 'classes_id' => $classes->id, 'seat_numbers' => $seat_numbers, 'room_arrangement' => $room_arrangement, 'multi_parts' => $multi_parts, 'parts_number' =>$parts_number, 'mode' => null]);
} }
return view('map.seat_map', ['student_name' => $student_name, 'student_surname' => $student_surname, 'student_id_number' => $student_id_number, 'classes_id' => $classes->id, 'seat_numbers' => $seat_numbers, 'room_arrangement' => $room_arrangement, 'multi_parts' => $multi_parts, 'parts_number' =>$parts_number]);
} }
public function save_classes_data(Request $request) public function save_classes_data(Request $request)
@ -191,7 +198,8 @@ class UserClassesController extends Controller
} else { } else {
$multi_parts = false; $multi_parts = false;
} }
}
return view('user.user_preview_classes', ['classes_id' => $classes_id, 'room_arrangement' => $room_arrangement, 'attendances' => $attendances, 'seat_numbers' => $seat_numbers, 'orderBy' => $orderBy, 'orderDirection' => $orderDirection, 'multi_parts' => $multi_parts, 'parts_number' =>$parts_number]); return view('user.user_preview_classes', ['classes_id' => $classes_id, 'room_arrangement' => $room_arrangement, 'attendances' => $attendances, 'seat_numbers' => $seat_numbers, 'orderBy' => $orderBy, 'orderDirection' => $orderDirection, 'multi_parts' => $multi_parts, 'parts_number' =>$parts_number]);
}
} }
} }

View File

@ -18,7 +18,7 @@ class CreateClassesTable extends Migration
$table->integer('subject_id'); $table->integer('subject_id');
$table->date('date'); $table->date('date');
$table->string('classes_code')->nullable(); $table->string('classes_code')->nullable();
$table->boolean('test_mode')->nullable(); $table->string('mode')->nullable();
$table->timestamps(); $table->timestamps();
}); });
} }

View File

@ -19,7 +19,7 @@ class CreateAttendancesTable extends Migration
$table->integer('student_id_number'); $table->integer('student_id_number');
$table->string('student_name'); $table->string('student_name');
$table->string('student_surname'); $table->string('student_surname');
$table->integer('seat_number'); $table->integer('seat_number')->nullable();
$table->text('notes')->nullable(); $table->text('notes')->nullable();
$table->timestamps(); $table->timestamps();
}); });

View File

@ -14,13 +14,13 @@ class ClassesTableSeeder extends Seeder
DB::table('classes')->insert([ DB::table('classes')->insert([
'subject_id' => 1, 'subject_id' => 1,
'date' => '2019-12-02', 'date' => '2019-12-02',
'test_mode' => false 'mode' => null
]); ]);
DB::table('classes')->insert([ DB::table('classes')->insert([
'subject_id' => 2, 'subject_id' => 2,
'date' => '2019-12-02', 'date' => '2019-12-02',
'test_mode' => false 'mode' => null
]); ]);
} }
} }

View File

@ -11204,12 +11204,24 @@ main {
font-size: 85%; font-size: 85%;
} }
.test-mode-div { .mode-div {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
width: 100%;
} }
.test-mode-div input { .mode-div input {
width: 20px; width: 20px;
} }
.scrollable-div {
max-height: 500px;
overflow-y: auto;
-ms-overflow-style: none;
}
.scrollable-div::-webkit-scrollbar {
display: none;
}

View File

@ -31,8 +31,9 @@ $(document).ready(function(){
}); });
$(".modal").on("hidden.bs.modal", function(){ $(".modal").on("hidden.bs.modal", function(){
const originalText = $(this).find("#note_content_hidden").first().val(); const id = $(this).attr('id').split('-')[1];
$(this).find("#note_content").first().val(originalText); const originalText = $(this).find(`#note_content_hidden-${id}`).first().val();
$(this).find(`#note_content-${id}`).first().val(originalText);
}); });
$('#sort-select').on('change', function() { $('#sort-select').on('change', function() {

View File

@ -43,10 +43,34 @@ function checkForUnavailablePlaces() {
} }
$(document).ready(function(){ $(document).ready(function(){
checkForUnavailablePlaces();
toggleButtonAvailability();
$('.seatCharts-seat').on('click', function(){ $('.seatCharts-seat').on('click', function(){
toggleButtonAvailability(); toggleButtonAvailability();
savePlaceNumber(); savePlaceNumber();
}); });
var mode = $('#mode').val();
if(mode === 'test') {
var random_seat = $('#random_seat').val();
var allPlaces = $('.seatCharts-seat.seatCharts-cell');
var allSlides = $('.carousel-item');
var seat;
allPlaces.each(function(){
if($(this).text() === random_seat) {
$(this).click();
seat = $(this);
}
$(this).css('pointer-events', 'none');
$('.cancel-cart-item').remove();
});
allSlides.each(function() {
if($.contains($(this).get(0), $(seat).get(0))) {
$('#map-carousel').carousel($(this).index()-1);
}
});
setTimeout(function() {
$('#test-end-btn').click();
}, 7000);
} else {
checkForUnavailablePlaces();
toggleButtonAvailability();
}
}); });

View File

@ -66,20 +66,28 @@
<div class="booking-details"> <div class="booking-details">
<h2 id="studentName"> <span class="student_name"> {{ $student_name }} </span><span class="student_surname"> {{ $student_surname }} </span> </h2> <h2 id="studentName"> <span class="student_name"> {{ $student_name }} </span><span class="student_surname"> {{ $student_surname }} </span> </h2>
<h3 class="student_id_number"> {{ $student_id_number }}</h3> <h3 class="student_id_number"> {{ $student_id_number }}</h3>
<h3>Wybrane miejsce: <h3>Twoje miejsce:
<span id="selected-seats"></span> <span id="selected-seats"></span>
</h3> </h3>
@foreach($seat_numbers as $seat_number) @foreach($seat_numbers as $seat_number)
<input type="hidden" class="unavailable_place" value="{{ $seat_number }}"> <input type="hidden" class="unavailable_place" value="{{ $seat_number }}">
@endforeach @endforeach
<input type="hidden" class="room_arrangement" name="room_arrangement" id="room_arrangement" value="{{ $room_arrangement }}"> <input type="hidden" class="room_arrangement" name="room_arrangement" id="room_arrangement" value="{{ $room_arrangement }}">
@if($mode == 'test')
<input type="hidden" class="mode" name="mode" id="mode" value="{{ $mode }}">
<input type="hidden" class="random_seat" name="random_seat" id="random_seat" value="{{ $random_seat }}">
@endif
<form method="POST" action="{{ route('user_save_classes_data') }}"> <form method="POST" action="{{ route('user_save_classes_data') }}">
<input type="hidden" value="{{ $classes_id }}" class="classes_id" name="classes_id"> <input type="hidden" value="{{ $classes_id }}" class="classes_id" name="classes_id">
<input type="hidden" value="{{ $student_name }}" class="student_name" name="student_name"> <input type="hidden" value="{{ $student_name }}" class="student_name" name="student_name">
<input type="hidden" value="{{ $student_surname }}" class="student_surname" name="student_surname"> <input type="hidden" value="{{ $student_surname }}" class="student_surname" name="student_surname">
<input type="hidden" value="{{ $student_id_number }}" class="student_id_number" name="student_id_number"> <input type="hidden" value="{{ $student_id_number }}" class="student_id_number" name="student_id_number">
<input type="hidden" value="" class="seat_number" name="seat_number"> <input type="hidden" value="" class="seat_number" name="seat_number">
@if($mode == 'test')
<button type="submit" class="checkout-button" id="test-end-btn">Zakończ &raquo;</button>
@else
<button type="submit" class="checkout-button">Zapisz &raquo;</button> <button type="submit" class="checkout-button">Zapisz &raquo;</button>
@endif
</form> </form>
</div> </div>
</div> </div>

View File

@ -1,8 +1,8 @@
<div class="modal fade" id="noteModal-{{ $attendance->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="noteModal-{{ $attendance->id }}" tabindex="-1" role="dialog" aria-labelledby="noteModal-{{ $attendance->id }}" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">{{ $attendance->student_name }} {{ $attendance->student_surname }} ({{ $attendance->student_id_number }})</h5> <h5>{{ $attendance->student_name }} {{ $attendance->student_surname }} ({{ $attendance->student_id_number }})</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
@ -11,11 +11,11 @@
<form method="POST" action="{{ route('user_add_attendance_note') }}"> <form method="POST" action="{{ route('user_add_attendance_note') }}">
@csrf @csrf
<input type="hidden" class="form-control" id="attendance_id" name="attendance_id" value="{{ $attendance->id }}"> <input type="hidden" class="form-control" name="attendance_id" value="{{ $attendance->id }}">
<input type="hidden" id="note_content_hidden" name="note_content_hidden" value="{{ $attendance->notes }}"> <input type="hidden" id="note_content_hidden-{{ $attendance->id }}" name="note_content_hidden" value="{{ $attendance->notes }}">
<div class="form-group"> <div class="form-group">
<label for="note_content" class="col-form-label">Treść notatki:</label> <label for="note_content-{{ $attendance->id }}" class="col-form-label">Treść notatki:</label>
<textarea class="form-control" id="note_content" name="note_content">{{ $attendance->notes }}</textarea> <textarea class="form-control" id="note_content-{{ $attendance->id }}" name="note_content">{{ $attendance->notes }}</textarea>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" title="Anuluj"> Anuluj </button> <button type="button" class="btn btn-secondary" data-dismiss="modal" title="Anuluj"> Anuluj </button>

View File

@ -31,7 +31,7 @@
</td> </td>
@endif @endif
<td> <td>
<button type="button" name="delete-attendance-btn" class="btn btn-danger" data-toggle="modal" data-target="#attendanceConfirmationModal-{{ $attendance->id }}" title="Usuń wpis"> <i class="fa fa-trash-o"></i> Usuń </button> <button type="button" name="delete-attendance-btnc" class="btn btn-danger" data-toggle="modal" data-target="#attendanceConfirmationModal-{{ $attendance->id }}" title="Usuń wpis"> <i class="fa fa-trash-o"></i> Usuń </button>
</td> </td>
@else @else
<td> <td>

View File

@ -1,4 +1,4 @@
<div class="modal fade" id="attendanceConfirmationModal-{{ $attendance->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="attendanceConfirmationModal-{{ $attendance->id }}" tabindex="-1" role="dialog" aria-labelledby="attendanceConfirmationModal-{{ $attendance->id }}" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -14,7 +14,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" title="Anuluj"> Anuluj </button> <button type="button" class="btn btn-secondary" data-dismiss="modal" title="Anuluj"> Anuluj </button>
<a href="{{ route('user_delete_attendance', [$attendance->id]) }}" name="delete-attendance-btn" class="btn btn-danger" title="Usuń wpis"> Tak, usuń </a> <a href="{{ route('user_delete_attendance', [$attendance->id]) }}" name="delete-attendance-btn-{{ $attendance->id }}" class="btn btn-danger" title="Usuń wpis"> Tak, usuń </a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,4 +1,4 @@
<div class="modal fade" id="classesConfirmationModal-{{ $classes_item->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="classesConfirmationModal-{{ $classes_item->id }}" tabindex="-1" role="dialog" aria-labelledby="classesConfirmationModal-{{ $classes_item->id }}" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">

View File

@ -1,4 +1,4 @@
<div class="modal fade" id="subjectConfirmationModal-{{ $subject->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="subjectConfirmationModal-{{ $subject->id }}" tabindex="-1" role="dialog" aria-labelledby="subjectConfirmationModal-{{ $subject->id }}" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">

View File

@ -6,7 +6,7 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-12"> <div class="col-md-12">
<div class="card-header custom-header"> <div class="card-header custom-header">
<h4> Wszystkie obecności <span class="badge badge-secondary"> {{ $attendances->count() }} </span> </h4> <h4> Wszystkie obecności <span class="badge badge-secondary" title="Liczba wszystkich obecności"> {{ $attendances->count() }} </span> </h4>
<div> <div>
<a href="{{ route('user_export_grouped', [$grouped_by]) }}" class="btn btn-success btn-export" title="Wyeksportuj wszystko do xlsx"> <i class="fa fa-file-excel-o"></i> Wyeksportuj (.xlsx) </a> <a href="{{ route('user_export_grouped', [$grouped_by]) }}" class="btn btn-success btn-export" title="Wyeksportuj wszystko do xlsx"> <i class="fa fa-file-excel-o"></i> Wyeksportuj (.xlsx) </a>
<button type="button" class="btn btn-primary add-attendance-btn" title="Dodaj nowy wpis"> <i class="fa fa-plus"></i> Dodaj nowy wpis </button> <button type="button" class="btn btn-primary add-attendance-btn" title="Dodaj nowy wpis"> <i class="fa fa-plus"></i> Dodaj nowy wpis </button>
@ -135,12 +135,12 @@
@if($grouped_by == 'classes_id') @if($grouped_by == 'classes_id')
<h5 class="card-title"> {{ App\Subject::find(App\Classes::find($attendances_group_name)->subject_id)->name }}, <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 }} {{ App\Classes::find($attendances_group_name)-> date }} {{ App\Subject::find(App\Classes::find($attendances_group_name)->subject_id)->time }}
<span class="badge badge-secondary"> {{ $attendances_list->count() }}</span> </h5> <span class="badge badge-secondary" title="Liczba wszystkich obecności"> {{ $attendances_list->count() }}</span> </h5>
@else @else
<h5 class="card-title"> {{ $attendances_group_name }} <span class="badge badge-secondary"> {{ $attendances_list->count() }} </span> </h5> <h5 class="card-title"> {{ $attendances_group_name }} <span class="badge badge-secondary" title="Liczba wszystkich obecności"> {{ $attendances_list->count() }} </span> </h5>
@endif @endif
@else @else
<h5 class="card-title"> Inne <span class="badge badge-secondary"> {{ $attendances_list->count() }}</span></h5> <h5 class="card-title"> Inne <span class="badge badge-secondary" title="Liczba wszystkich obecności"> {{ $attendances_list->count() }}</span></h5>
@endif @endif
<div class="table-responsive"> <div class="table-responsive">
@include('user.attendances_table', ['attendances_list' => $attendances_list, 'export' => 0]) @include('user.attendances_table', ['attendances_list' => $attendances_list, 'export' => 0])

View File

@ -45,10 +45,13 @@
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="test_mode" class="col-md-4 col-form-label text-md-right form-check-label">{{ __('Tryb egzaminu') }}</label>
<div class="col-md-6 test-mode-div"> <div class="mode-div">
<input id="test_mode" type="checkbox" class="form-control" name="test_mode" value="true"> <label for="test-mode" class="col-md-4 col-form-label text-md-right form-check-label">{{ __('Tryb egzaminu') }}</label>
<input id="test-mode" type="checkbox" class="form-control" name="mode" value="test">
<label for="quick-mode" class="col-md-4 col-form-label text-md-right form-check-label">{{ __('Tryb szybki') }}</label>
<input id="quick-mode" type="checkbox" class="form-control" name="mode" value="quick">
</div> </div>
</div> </div>
@ -63,7 +66,7 @@
</div> </div>
@if ($classes->count() > 0) @if ($classes->count() > 0)
<div class="card-header custom-header"> <div class="card-header custom-header">
<h4> Moje zajęcia <span class="badge badge-secondary"> {{ $classes->count() }} </span> </h4> <h4> Moje zajęcia <span class="badge badge-secondary" title="Liczba zajęć"> {{ $classes->count() }} </span> </h4>
</div> </div>
<div class="card-body card-custom"> <div class="card-body card-custom">
@ -80,12 +83,12 @@
@if($classes_group_name) @if($classes_group_name)
@if($grouped_by == 'subject_id') @if($grouped_by == 'subject_id')
<h5 class="card-title"> {{ App\Subject::find($classes_group_name)->name }}, <h5 class="card-title"> {{ App\Subject::find($classes_group_name)->name }},
{{ App\Subject::find($classes_group_name)->weekday }} {{ App\Subject::find($classes_group_name)->time }} <span class="badge badge-secondary"> {{ $classes_list->count() }} </span> </h5> {{ 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>
@else @else
<h5 class="card-title"> {{ $classes_group_name }} <span class="badge badge-secondary"> {{ $classes_list->count() }} </span> </h5> <h5 class="card-title"> {{ $classes_group_name }} <span class="badge badge-secondary" title="Liczba zajęć"> {{ $classes_list->count() }} </span> </h5>
@endif @endif
@else @else
<h5 class="card-title"> Inne <span class="badge badge-secondary"> {{ $classes_list->count() }} </span></h5> <h5 class="card-title"> Inne <span class="badge badge-secondary" title="Liczba zajęć"> {{ $classes_list->count() }} </span></h5>
@endif @endif
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-borderless custom-table"> <table class="table table-striped table-borderless custom-table">
@ -100,9 +103,12 @@
<tr> <tr>
<td> {{ App\Subject::find($classes_item->subject_id)->name }}, <td> {{ App\Subject::find($classes_item->subject_id)->name }},
{{ 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 }} {{ 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 }}
@if($classes_item->test_mode) @if($classes_item->mode == 'test')
<span class="badge badge-warning" title="Zajęcia w trybie egzaminu"> Egzamin </span> <span class="badge badge-warning" title="Zajęcia w trybie egzaminu"> Egzamin </span>
@endif</td> @elseif($classes_item->mode == 'quick')
<span class="badge badge-info" title="Zajęcia w trybie szybkim"> Tylko obecność </span>
@endif
</td>
<td> {{ $classes_item->date }} </td> <td> {{ $classes_item->date }} </td>
<td> <td>
@if($classes_item->classes_code) @if($classes_item->classes_code)

View File

@ -21,8 +21,10 @@
{{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->weekday }} {{ 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 }}, {{ 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> <b>sala {{ App\Room::find(App\Subject::find(App\Classes::find($classes_id)->subject_id)->room_id)->name }}</b>
@if(App\Classes::find($classes_id)->test_mode) @if(App\Classes::find($classes_id)->mode == 'test')
<span class="badge badge-warning" title="Zajęcia w trybie egzaminu"> Egzamin </span> <span class="badge badge-warning" title="Zajęcia w trybie egzaminu"> Egzamin </span>
@elseif(App\Classes::find($classes_id)->mode == 'quick')
<span class="badge badge-info" title="Zajęcia w trybie szybkim"> Tylko obecność </span>
@endif @endif
</p> </p>
</div> </div>
@ -31,7 +33,7 @@
<div class="preview-page-content"> <div class="preview-page-content">
<div class="preview-attendance-table"> <div class="preview-attendance-table">
<div class="card-header custom-header"> <div class="card-header custom-header">
<h4> Lista obecności <span class="badge badge-secondary"> {{ $attendances->count() }} </span></h4> <h4> Lista obecności <span class="badge badge-secondary" title="Liczba osób w sali"> {{ $attendances->count() }} </span></h4>
<a href="{{ route('user_export', [$classes_id]) }}" class="btn btn-success btn-export" title="Wyeksportuj tabelę do xlsx"> <i class="fa fa-file-excel-o"></i> Wyeksportuj (.xlsx) </a> <a href="{{ route('user_export', [$classes_id]) }}" class="btn btn-success btn-export" title="Wyeksportuj tabelę do xlsx"> <i class="fa fa-file-excel-o"></i> Wyeksportuj (.xlsx) </a>
</div> </div>
<div class="card-body card-custom"> <div class="card-body card-custom">
@ -47,10 +49,12 @@
<option value="{{ route('user_preview_classes', ['classes_id' => $classes_id, 'orderBy' => 'seat_number', 'orderDirection' => 'DESC']) }}">po numerze miejsca malejąco</option> <option value="{{ route('user_preview_classes', ['classes_id' => $classes_id, 'orderBy' => 'seat_number', 'orderDirection' => 'DESC']) }}">po numerze miejsca malejąco</option>
</select> </select>
</div> </div>
<div class="scrollable-div">
<div class="table-responsive"> <div class="table-responsive">
@include('user.attendances_table_preview', ['attendances' => $attendances, 'export' => 0]) @include('user.attendances_table_preview', ['attendances' => $attendances, 'export' => 0])
</div> </div>
</div> </div>
</div>
<div class="seat-chart-wrapper"> <div class="seat-chart-wrapper">
@if($multi_parts) @if($multi_parts)
<div id="map-carousel" class="carousel slide" data-ride="carousel" data-interval="false" data-wrap="false"> <div id="map-carousel" class="carousel slide" data-ride="carousel" data-interval="false" data-wrap="false">

View File

@ -6,7 +6,7 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-12"> <div class="col-md-12">
<div class="card-header custom-header"> <div class="card-header custom-header">
<h4> Moje przedmioty <span class="badge badge-secondary"> {{ $subjects->count() }} </span></h4> <h4> Moje przedmioty <span class="badge badge-secondary" title="Liczba przedmiotów"> {{ $subjects->count() }} </span></h4>
<button type="button" class="btn btn-primary add-subject-btn" title="Dodaj nowy przedmiot"> <i class="fa fa-plus"></i> Dodaj nowy przedmiot </button> <button type="button" class="btn btn-primary add-subject-btn" title="Dodaj nowy przedmiot"> <i class="fa fa-plus"></i> Dodaj nowy przedmiot </button>
</div> </div>
@ -126,12 +126,12 @@
@foreach ($subjects_grouped as $subject_group_name => $subjects_list) @foreach ($subjects_grouped as $subject_group_name => $subjects_list)
@if($subject_group_name) @if($subject_group_name)
@if($grouped_by == 'room_id') @if($grouped_by == 'room_id')
<h5 class="card-title"> {{ App\Room::find($subject_group_name)->name }} <span class="badge badge-secondary"> {{ $subjects_list->count() }} </span></h5> <h5 class="card-title"> {{ App\Room::find($subject_group_name)->name }} <span class="badge badge-secondary" title="Liczba przedmiotów"> {{ $subjects_list->count() }} </span></h5>
@else @else
<h5 class="card-title"> {{ $subject_group_name }} <span class="badge badge-secondary"> {{ $subjects_list->count() }} </span></h5> <h5 class="card-title"> {{ $subject_group_name }} <span class="badge badge-secondary" title="Liczba przedmiotów"> {{ $subjects_list->count() }} </span></h5>
@endif @endif
@else @else
<h5 class="card-title"> Inne <span class="badge badge-secondary"> {{ $subjects_list->count() }} </span></h5> <h5 class="card-title"> Inne <span class="badge badge-secondary" title="Liczba przedmiotów"> {{ $subjects_list->count() }} </span></h5>
@endif @endif
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-borderless custom-table"> <table class="table table-striped table-borderless custom-table">