This commit is contained in:
Olga 2019-12-09 14:22:04 +01:00
commit de06beeb6d
19 changed files with 205 additions and 181 deletions

View File

@ -7,6 +7,6 @@ use Illuminate\Database\Eloquent\Model;
class Attendance extends Model
{
protected $fillable = [
'classes_id', 'student_id_number', 'student_name', 'student_surname', 'seat_number'
'classes_id', 'student_id_number', 'student_name', 'student_surname', 'seat_number', 'notes'
];
}

View File

@ -8,6 +8,7 @@ use Illuminate\Http\Request;
use App\Subject;
use App\Classes;
use App\Room;
use Illuminate\Support\Facades\Auth;
@ -67,7 +68,6 @@ class UserClassesController extends Controller
$classes->save();
$classes->refresh();
}
return view('map.start_map', ['classes_code' => $classes_code, 'classes' => $classes]);
}
@ -79,7 +79,12 @@ class UserClassesController extends Controller
$classes = Classes::find($request->get('classes_id'));
$attendances = Attendance::where('classes_id', $classes->id)->get();
$seat_numbers = $attendances->pluck('seat_number')->toArray();
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]);
$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('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]);
}
public function save_classes_data(Request $request)

View File

@ -18,13 +18,13 @@ class UserSubjectsController extends Controller
$user_id = Auth::id();
$subjects = Subject::where('user_id', $user_id)->get();
$subjects_grouped = $subjects->groupBy($groupBy);
// $rooms = Room::all();
$rooms = Room::all();
$weekdays = ['Poniedziałek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota', 'Niedziela'];
// $types = ['Lecture', 'Excercises', 'Labs', 'Other'];
$defaultTime = date("H:i");
$defaultWeekday = $weekdays[date('w')-1];
return view('user.user_subjects', ['subjects' => $subjects, 'weekdays' => $weekdays,
'subjects_grouped' => $subjects_grouped, 'grouped_by' => $groupBy, 'defaultTime' => $defaultTime, 'defaultWeekday' => $defaultWeekday]);
'subjects_grouped' => $subjects_grouped, 'grouped_by' => $groupBy, 'defaultTime' => $defaultTime, 'defaultWeekday' => $defaultWeekday, 'rooms' => $rooms]);
}
public function add_subject(Request $request)
@ -33,14 +33,14 @@ class UserSubjectsController extends Controller
// $type = $request->input('type');
$weekday = $request->input('weekday');
$time = $request->input('time');
// $room_id = $request->input('room_id');
$room_id = $request->input('room_id');
$user_id_n = Auth::id();
Subject::create([
'name' => $name,
// 'type' => $type,
'weekday'=> $weekday,
'time' => $time,
// 'room_id' => $room_id,
'room_id' => $room_id,
'user_id' => $user_id_n
]);
return redirect(route('user_subjects'));

View File

@ -19,7 +19,7 @@ class CreateSubjectsTable extends Migration
// $table->string('type')->nullable();
$table->string('weekday')->nullable();
$table->string('time')->nullable();
// $table->integer('room_id');
$table->integer('room_id');
$table->integer('user_id');
$table->timestamps();
});

View File

@ -17,7 +17,7 @@ class CreateRoomsTable extends Migration
$table->bigIncrements('id')->unique();
$table->string('name')->unique();
$table->integer('capacity')->nullable();
$table->string('arrangement')->nullable();
$table->text('arrangement')->nullable();
$table->timestamps();
});
}

View File

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

View File

@ -13,7 +13,7 @@ class DatabaseSeeder extends Seeder
{
$this->call([
UsersTableSeeder::class,
// RoomsTableSeeder::class,
RoomsTableSeeder::class,
SubjectsTableSeeder::class,
ClassesTableSeeder::class,
AttendancesTableSeeder::class,

View File

@ -12,61 +12,76 @@ class RoomsTableSeeder extends Seeder
public function run()
{
$rooms = [
array('name' => 'A0-1', 'capacity' => 30),
array('name' => 'A0-11', 'capacity' => 24),
array('name' => 'A0-12', 'capacity' => 24),
array('name' => 'A0-3', 'capacity' => 13),
array('name' => 'A0-5', 'capacity' => 13),
array('name' => 'A1-14/15', 'capacity' => 25),
array('name' => 'A1-16/17', 'capacity' => 25),
array('name' => 'A1-18', 'capacity' => 13),
array('name' => 'A1-20', 'capacity' => 13),
array('name' => 'A1-22/23', 'capacity' => 25),
array('name' => 'A1-24/25', 'capacity' => 25),
array('name' => 'A1-33 (Sala RW)', 'capacity' => 64),
array('name' => 'A2-1', 'capacity' => 24),
array('name' => 'A2-10', 'capacity' => 34),
array('name' => 'A2-11', 'capacity' => 34),
array('name' => 'A2-12', 'capacity' => 34),
array('name' => 'A2-14', 'capacity' => 48),
array('name' => 'A2-19', 'capacity' => 48),
array('name' => 'A2-2', 'capacity' => 34),
array('name' => 'A2-20', 'capacity' => 32),
array('name' => 'A2-21', 'capacity' => 48),
array('name' => 'A2-22', 'capacity' => 48),
array('name' => 'A2-23', 'capacity' => 48),
array('name' => 'A2-24', 'capacity' => 48),
array('name' => 'A2-3', 'capacity' => 24),
array('name' => 'A2-4', 'capacity' => 24),
array('name' => 'A2-5', 'capacity' => 24),
array('name' => 'A2-8', 'capacity' => 24),
array('name' => 'A2-9', 'capacity' => 34),
array('name' => 'Aula A', 'capacity' => 196),
array('name' => 'Aula B', 'capacity' => 117),
array('name' => 'Aula C', 'capacity' => 117),
array('name' => 'B1-06', 'capacity' => 4),
array('name' => 'B1-07/08', 'capacity' => 16),
array('name' => 'B1-37', 'capacity' => 18),
array('name' => 'B1-38', 'capacity' => 12),
array('name' => 'B2-08/09', 'capacity' => 16),
array('name' => 'B2-38', 'capacity' => 15),
array('name' => 'B2-39', 'capacity' => 12),
array('name' => 'B2-44', 'capacity' => 4),
array('name' => 'B3-08/09', 'capacity' => 16),
array('name' => 'B3-38', 'capacity' => 18),
array('name' => 'B3-39', 'capacity' => 18),
array('name' => 'B3-49', 'capacity' => 12),
array('name' => 'C2-3', 'capacity' => 1),
array('name' => 'D-1', 'capacity' => 22),
array('name' => 'D-2', 'capacity' => 21),
array('name' => 'D-3', 'capacity' => 22),
array('name' => 'Klub Profesorski', 'capacity' => null)
array('name' => 'A0-1', 'capacity' => 30, 'arrangement' =>
'c[1,1]c[2,2]c[3,3]c[4,4]c[5,5]c[6,6]++_++c[7,7]c[8,8]c[9,9]c[10,10]c[11,11]c[12,12]++c[13,13]c[14,14]c[15,15]c[16,16]c[17,17]c[18,18]'
),
array('name' => 'A0-11', 'capacity' => 24, 'arrangement' =>
'__c[3,3]c[4,4]c[5,5]c[6,6]++c[7,7]c[8,8]_c[10,10]c[11,11]c[12,12]++c[13,13]c[14,14]c[15,15]c[16,16]c[17,17]c[18,18]'
),
array('name' => 'A0-12', 'capacity' => 24, 'arrangement' => ''),
array('name' => 'A0-3', 'capacity' => 13, 'arrangement' => ''),
array('name' => 'A0-5', 'capacity' => 13, 'arrangement' => ''),
array('name' => 'A1-14/15', 'capacity' => 25, 'arrangement' =>
'c[1,1]c[2,2]c[3,3]c[4,4]c[5,5]++_++c[6,6]c[7,7]c[8,8]c[9,9]++c[10,10]c[11,11]c[12,12]c[13,13]++_++c[14,14]c[15,15]c[16,16]c[17,17]++_++c[18,18]c[19,19]c[20,20]c[21,21]++c[22,22]c[23,23]c[24,24]c[25,25]'
),
array('name' => 'A1-16/17', 'capacity' => 25, 'arrangement' =>
'c[1,1]c[2,2]c[3,3]c[4,4]c[5,5]++_++c[6,6]c[7,7]c[8,8]c[9,9]++c[10,10]c[11,11]c[12,12]c[13,13]++_++c[14,14]c[15,15]c[16,16]c[17,17]++_++c[18,18]c[19,19]c[20,20]c[21,21]++c[22,22]c[23,23]c[24,24]c[25,25]'
),
array('name' => 'A1-18', 'capacity' => 13, 'arrangement' => ''),
array('name' => 'A1-20', 'capacity' => 13, 'arrangement' => ''),
array('name' => 'A1-22/23', 'capacity' => 25, 'arrangement' =>
'c[1,1]c[2,2]c[3,3]c[4,4]c[5,5]++_++c[6,6]c[7,7]c[8,8]c[9,9]++c[10,10]c[11,11]c[12,12]c[13,13]++_++c[14,14]c[15,15]c[16,16]c[17,17]++_++c[18,18]c[19,19]c[20,20]c[21,21]++c[22,22]c[23,23]c[24,24]c[25,25]'
),
array('name' => 'A1-24/25', 'capacity' => 25, 'arrangement' =>
'c[1,1]c[2,2]c[3,3]c[4,4]c[5,5]++_++c[6,6]c[7,7]c[8,8]c[9,9]++c[10,10]c[11,11]c[12,12]c[13,13]++_++c[14,14]c[15,15]c[16,16]c[17,17]++_++c[18,18]c[19,19]c[20,20]c[21,21]++c[22,22]c[23,23]c[24,24]c[25,25]'
),
array('name' => 'A1-33 (Sala RW)', 'capacity' => 64, 'arrangement' => ''),
array('name' => 'A2-1', 'capacity' => 24, 'arrangement' => ''),
array('name' => 'A2-10', 'capacity' => 34, 'arrangement' => ''),
array('name' => 'A2-11', 'capacity' => 34, 'arrangement' => ''),
array('name' => 'A2-12', 'capacity' => 34, 'arrangement' => ''),
array('name' => 'A2-14', 'capacity' => 48, 'arrangement' => ''),
array('name' => 'A2-19', 'capacity' => 48, 'arrangement' => ''),
array('name' => 'A2-2', 'capacity' => 34, 'arrangement' => ''),
array('name' => 'A2-20', 'capacity' => 32, 'arrangement' => ''),
array('name' => 'A2-21', 'capacity' => 48, 'arrangement' => ''),
array('name' => 'A2-22', 'capacity' => 48, 'arrangement' => ''),
array('name' => 'A2-23', 'capacity' => 48, 'arrangement' => ''),
array('name' => 'A2-24', 'capacity' => 48, 'arrangement' => ''),
array('name' => 'A2-3', 'capacity' => 24, 'arrangement' => ''),
array('name' => 'A2-4', 'capacity' => 24, 'arrangement' => ''),
array('name' => 'A2-5', 'capacity' => 24, 'arrangement' => ''),
array('name' => 'A2-8', 'capacity' => 24, 'arrangement' => ''),
array('name' => 'A2-9', 'capacity' => 34, 'arrangement' => ''),
array('name' => 'Aula A', 'capacity' => 196, 'arrangement' => ''),
array('name' => 'Aula B', 'capacity' => 117, 'arrangement' => ''),
array('name' => 'Aula C', 'capacity' => 117, 'arrangement' => ''),
array('name' => 'B1-06', 'capacity' => 4, 'arrangement' => ''),
array('name' => 'B1-07/08', 'capacity' => 16, 'arrangement' => ''),
array('name' => 'B1-37', 'capacity' => 18, 'arrangement' => ''),
array('name' => 'B1-38', 'capacity' => 12, 'arrangement' => ''),
array('name' => 'B2-08/09', 'capacity' => 16, 'arrangement' => ''),
array('name' => 'B2-38', 'capacity' => 15, 'arrangement' => ''),
array('name' => 'B2-39', 'capacity' => 12, 'arrangement' => ''),
array('name' => 'B2-44', 'capacity' => 4, 'arrangement' => ''),
array('name' => 'B3-08/09', 'capacity' => 16, 'arrangement' => ''),
array('name' => 'B3-38', 'capacity' => 18, 'arrangement' => ''),
array('name' => 'B3-39', 'capacity' => 18, 'arrangement' => ''),
array('name' => 'B3-49', 'capacity' => 12, 'arrangement' => ''),
array('name' => 'C2-3', 'capacity' => 1, 'arrangement' => ''),
array('name' => 'D-1', 'capacity' => 22, 'arrangement' => ''),
array('name' => 'D-2', 'capacity' => 21, 'arrangement' => ''),
array('name' => 'D-3', 'capacity' => 22, 'arrangement' => ''),
array('name' => 'Klub Profesorski', 'capacity' => null, 'arrangement' => ''),
array('name' => 'Inna sala', 'capacity' => null, 'arrangement' =>
'c[1,1]c[2,2]c[3,3]c[4,4]c[5,5]++_++c[6,6]c[7,7]c[8,8]c[9,9]++c[10,10]c[11,11]c[12,12]c[13,13]++_++c[14,14]c[15,15]c[16,16]c[17,17]++_++c[18,18]c[19,19]c[20,20]c[21,21]++c[22,22]c[23,23]c[24,24]c[25,25]'
)
];
foreach ($rooms as $room) {
DB::table('rooms')->insert([
'name' => $room['name'],
'capacity' => $room['capacity'],
'arrangement' => ''
'arrangement' => $room['arrangement']
]);
}
}

View File

@ -15,6 +15,7 @@ class SubjectsTableSeeder extends Seeder
'name' => 'Systemy Informatyczne UA0',
'weekday' => 'Poniedziałek',
'time' => '15:30',
'room_id' => 1,
'user_id' => 2
]);
@ -22,6 +23,7 @@ class SubjectsTableSeeder extends Seeder
'name' => 'Systemy Informatyczne UA0',
'weekday' => 'Wtorek',
'time' => '17:15',
'room_id' => 2,
'user_id' => 3
]);
}

BIN
public/img/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

View File

@ -31,7 +31,6 @@ function checkForUnavailablePlaces() {
unavailablePlaces.push($(this).val());
});
console.log(unavailablePlaces);
const allPlaces = $('.seatCharts-seat.seatCharts-cell.available');
if(unavailablePlaces){
allPlaces.each(function(){

View File

@ -1,105 +1,102 @@
var firstSeatLabel = 1;
$(document).ready(function() {
var $cart = $('#selected-seats'),
seatNumber = '',
placeNumber = ('#sel-seat'),
$counter = $('#counter'),
$name = $('#studentName'),
$total = $('#total'),
sc = $('#seat-map').seatCharts({
map: [
'c[1,1]c[2,2]c[3,3]c[4,4]c[5,5]c[6,6]',
'_',
'c[7,7]c[8,8]c[9,9]c[10,10]c[11,11]c[12,12]',
'c[13,13]c[14,14]c[15,15]c[16,16]c[17,17]c[18,18]',
],
seats: {
$(document).ready(function() {
const seat_map = $('#room_arrangement').val().split('++');
var $cart = $('#selected-seats'),
seatNumber = '',
placeNumber = ('#sel-seat'),
$counter = $('#counter'),
$name = $('#studentName'),
$total = $('#total'),
sc = $('#seat-map').seatCharts({
map: seat_map,
seats: {
h: {
price : 2500,
classes : 'student-class',
category: 'Student Seat'
},
},
naming : {
price : 2500,
classes : 'student-class',
category: 'Student Seat'
},
},
naming : {
rows: ['','','',''],
top : false,
getLabel : function (character, row, column) {
if (row == '1') {
top : false,
getLabel : function (character, row, column) {
if (row === '1') {
return column;
} else if (row == '2') {
} else if (row === '2') {
return column;
} else if (row == '3') {
} else if (row === '3') {
return column;
}
},
},
legend : {
node : $('#legend'),
items : [
},
},
legend : {
node : $('#legend'),
items : [
[ 'c', 'available', 'Dostępne miejsce'],
[ 'f', 'unavailable', 'Zajęte miejsce']
]
},
click: function () {
if (this.status() == 'available' && recalculateTotal(sc) < 1) {
//let's create a new <li> which we'll add to the cart items
$('<span> '+this.settings.label+ '</span>')
.attr('id', 'cart-item-'+this.settings.id)
.data('seatId', this.settings.id)
.appendTo($cart);
]
},
click: function () {
if (this.status() == 'available' && recalculateTotal(sc) < 1) {
//let's create a new <li> which we'll add to the cart items
$('<span> '+this.settings.label+ '</span>')
.attr('id', 'cart-item-'+this.settings.id)
.data('seatId', this.settings.id)
.appendTo($cart);
seatNumber = 'rząd: ' + this.settings.row + ' miejsce: ' + this.settings.label;
localStorage.setItem('myElement', seatNumber);
/*
* Lets update the counter and total
*
* .find function will not find the current seat, because it will change its stauts only after return
* 'selected'. This is why we have to add 1 to the length and the current seat price to the total.
*/
$counter.text(sc.find('selected').length+1);
$total.text(recalculateTotal(sc)+1);
return 'selected';
} else if (this.status() == 'selected') {
//update the counter
$counter.text(sc.find('selected').length-1);
//and total
$total.text(recalculateTotal(sc)-1);
//remove the item from our cart
$('#cart-item-'+this.settings.id).remove();
$('#item-'+this.settings.id).remove();
//seat has been vacated
return 'available';
} else if (this.status() == 'unavailable') {
//seat has been already booked
return 'unavailable';
} else {
return this.style();
}
}
});
seatNumber = 'rząd: ' + this.settings.row + ' miejsce: ' + this.settings.label;
localStorage.setItem('myElement', seatNumber);
/*
* Lets update the counter and total
*
* .find function will not find the current seat, because it will change its stauts only after return
* 'selected'. This is why we have to add 1 to the length and the current seat price to the total.
*/
$counter.text(sc.find('selected').length+1);
$total.text(recalculateTotal(sc)+1);
//this will handle "[cancel]" link clicks
$('#selected-seats').on('click', '.cancel-cart-item', function () {
//let's just trigger Click event on the appropriate seat, so we don't have to repeat the logic here
sc.get($(this).parents('li:first').data('seatId')).click();
});
return 'selected';
} else if (this.status() == 'selected') {
//update the counter
$counter.text(sc.find('selected').length-1);
//and total
$total.text(recalculateTotal(sc)-1);
//let's pretend some seats have already been booked
//sc.get(['1_2', '4_1', '7_1', '7_2']).status('unavailable');
});
//remove the item from our cart
$('#cart-item-'+this.settings.id).remove();
$('#item-'+this.settings.id).remove();
function recalculateTotal(sc) {
var total = 0;
//basically find every selected seat and sum its price
sc.find('selected').each(function () {
total += 1;//this.data().price;
});
return total;
//seat has been vacated
return 'available';
} else if (this.status() == 'unavailable') {
//seat has been already booked
return 'unavailable';
} else {
return this.style();
}
}
});
//this will handle "[cancel]" link clicks
$('#selected-seats').on('click', '.cancel-cart-item', function () {
//let's just trigger Click event on the appropriate seat, so we don't have to repeat the logic here
sc.get($(this).parents('li:first').data('seatId')).click();
});
//let's pretend some seats have already been booked
//sc.get(['1_2', '4_1', '7_1', '7_2']).status('unavailable');
});
function recalculateTotal(sc) {
var total = 0;
//basically find every selected seat and sum its price
sc.find('selected').each(function () {
total += 1;//this.data().price;
});
return total;
}

View File

@ -18,6 +18,7 @@
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link rel="shortcut icon" href="{{ asset('img/favicon.png') }}">
</head>
<body>
<div id="app">

View File

@ -8,6 +8,7 @@
<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') }}">
<link rel="shortcut icon" href="{{ asset('img/favicon.png') }}">
<title> @CHECK | @yield('map_title') </title>
@yield('map_meta')
</head>

View File

@ -13,7 +13,9 @@
<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 }}</div>
{{ 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>
</div>
<br/>
@ -26,11 +28,10 @@
<h3>Wybrane miejsce:
<span id="selected-seats"></span>
</h3>
@foreach($seat_numbers as $seat_number)
<input type="hidden" class="unavailable_place" value="{{ $seat_number }}">
@endforeach
<input type="hidden" class="room_arrangement" name="room_arrangement" id="room_arrangement" value="{{ $room_arrangement }}">
<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="{{ $student_name }}" class="student_name" name="student_name">

View File

@ -133,7 +133,7 @@
@foreach ($attendances_list as $attendance)
<tr>
<td> {{ App\Subject::find(App\Classes::find($attendance->classes_id)->subject_id)->name }},
{{ App\Classes::find($attendance->classes_id)-> date }} {{ App\Subject::find(App\Classes::find($attendance->classes_id)->subject_id)->time }} </td>
{{ App\Classes::find($attendance->classes_id)-> date }} {{ App\Subject::find(App\Classes::find($attendance->classes_id)->subject_id)->time }}, sala {{ App\Room::find(App\Subject::find(App\Classes::find($attendance->classes_id)->subject_id)->room_id)->name }} </td>
<td> {{ $attendance->student_id_number }} </td>
<td> {{ $attendance->student_name}}</td>
<td> {{ $attendance->student_surname}}</td>
@ -141,9 +141,9 @@
<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>
{{--<td>--}}
{{--<a href="{{ route('user_edit_attendance', [$attendance->id]) }}" name="edit-attendance-btn" class="btn btn-secondary"> Edytuj </a>--}}
{{--</td>--}}
</tr>
@endforeach
</table>

View File

@ -16,7 +16,7 @@
<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)
<option value="{{ $subject->id }}">{{ $subject->name }}, {{ $subject->weekday }} {{ $subject->time }}</option>
<option value="{{ $subject->id }}">{{ $subject->name }}, {{ $subject->weekday }} {{ $subject->time }}, sala {{ App\Room::find($subject->room_id)->name }}</option>
@endforeach
</select>
@ -83,7 +83,7 @@
@foreach ($classes_list as $classes_item)
<tr>
<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 }}</td>
{{ 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 }}</td>
<td> {{ $classes_item->date }} </td>
<td>
@if($classes_item->classes_code)

View File

@ -81,23 +81,23 @@
</div>
</div>
{{--<div class="form-group row">--}}
{{--<label for="room_id" class="col-md-4 col-form-label text-md-right">{{ __('Room') }}</label>--}}
<div class="form-group row">
<label for="room_id" class="col-md-4 col-form-label text-md-right">{{ __('Sala') }}</label>
{{--<div class="col-md-6">--}}
{{--<select id="room_id" class="form-control @error('room_id') is-invalid @enderror" name="room_id" required>--}}
{{--@foreach ($rooms as $room)--}}
{{--<option value="{{ $room->id }}">{{ $room->name }}</option>--}}
{{--@endforeach--}}
{{--</select>--}}
<div class="col-md-6">
<select id="room_id" class="form-control @error('room_id') is-invalid @enderror" name="room_id" required>
@foreach ($rooms as $room)
<option value="{{ $room->id }}">{{ $room->name }}</option>
@endforeach
</select>
{{--@error('room_id')--}}
{{--<span class="invalid-feedback" role="alert">--}}
{{--<strong>{{ $message }}</strong>--}}
{{--</span>--}}
{{--@enderror--}}
{{--</div>--}}
{{--</div>--}}
@error('room_id')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row">
<label for="user_id" class="col-md-4 col-form-label text-md-right">{{ __('Prowadzący') }}</label>
@ -132,7 +132,7 @@
{{--<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>--}}
<a href="{{ route('user_subjects', ['room_id']) }}" class="btn btn-primary"> Room </a>
</div>
@foreach ($subjects_grouped as $subject_group_name => $subjects_list)
@ -152,7 +152,7 @@
<th> Dzień tygodnia </th>
<th> Godzina </th>
<th> Prowadzący </th>
{{--<th> Room </th>--}}
<th> Sala </th>
<th></th>
<th></th>
</tr>
@ -163,13 +163,13 @@
<td> {{ $subject->weekday }} </td>
<td> {{ $subject->time }} </td>
<td> {{ App\User::find($subject->user_id)->name }} {{ App\User::find($subject->user_id)->surname }}</td>
{{--<td> {{ App\Room::find($subject->room_id)->name }} </td>--}}
<td> {{ App\Room::find($subject->room_id)->name }} </td>
<td>
<a href="{{ route('user_delete_subject', [$subject->id]) }}" name="delete-subject-btn" class="btn btn-danger"> Usuń </a>
</td>
<td>
<a href="{{ route('user_edit_subject', [$subject->id]) }}" name="edit-subject-btn" class="btn btn-secondary"> Edytuj </a>
</td>
{{--<td>--}}
{{--<a href="{{ route('user_edit_subject', [$subject->id]) }}" name="edit-subject-btn" class="btn btn-secondary"> Edytuj </a>--}}
{{--</td>--}}
</tr>
@endforeach
</table>

View File

@ -8,6 +8,8 @@
<!-- 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>