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 class Attendance extends Model
{ {
protected $fillable = [ 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\Subject;
use App\Classes; use App\Classes;
use App\Room;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@ -67,7 +68,6 @@ class UserClassesController extends Controller
$classes->save(); $classes->save();
$classes->refresh(); $classes->refresh();
} }
return view('map.start_map', ['classes_code' => $classes_code, 'classes' => $classes]); 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')); $classes = Classes::find($request->get('classes_id'));
$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();
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) public function save_classes_data(Request $request)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,6 +15,7 @@ class SubjectsTableSeeder extends Seeder
'name' => 'Systemy Informatyczne UA0', 'name' => 'Systemy Informatyczne UA0',
'weekday' => 'Poniedziałek', 'weekday' => 'Poniedziałek',
'time' => '15:30', 'time' => '15:30',
'room_id' => 1,
'user_id' => 2 'user_id' => 2
]); ]);
@ -22,6 +23,7 @@ class SubjectsTableSeeder extends Seeder
'name' => 'Systemy Informatyczne UA0', 'name' => 'Systemy Informatyczne UA0',
'weekday' => 'Wtorek', 'weekday' => 'Wtorek',
'time' => '17:15', 'time' => '17:15',
'room_id' => 2,
'user_id' => 3 '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()); unavailablePlaces.push($(this).val());
}); });
console.log(unavailablePlaces);
const allPlaces = $('.seatCharts-seat.seatCharts-cell.available'); const allPlaces = $('.seatCharts-seat.seatCharts-cell.available');
if(unavailablePlaces){ if(unavailablePlaces){
allPlaces.each(function(){ allPlaces.each(function(){

View File

@ -1,6 +1,8 @@
var firstSeatLabel = 1; var firstSeatLabel = 1;
$(document).ready(function() { $(document).ready(function() {
const seat_map = $('#room_arrangement').val().split('++');
var $cart = $('#selected-seats'), var $cart = $('#selected-seats'),
seatNumber = '', seatNumber = '',
placeNumber = ('#sel-seat'), placeNumber = ('#sel-seat'),
@ -8,12 +10,7 @@ var firstSeatLabel = 1;
$name = $('#studentName'), $name = $('#studentName'),
$total = $('#total'), $total = $('#total'),
sc = $('#seat-map').seatCharts({ sc = $('#seat-map').seatCharts({
map: [ map: seat_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: { seats: {
h: { h: {
price : 2500, price : 2500,
@ -25,11 +22,11 @@ var firstSeatLabel = 1;
rows: ['','','',''], rows: ['','','',''],
top : false, top : false,
getLabel : function (character, row, column) { getLabel : function (character, row, column) {
if (row == '1') { if (row === '1') {
return column; return column;
} else if (row == '2') { } else if (row === '2') {
return column; return column;
} else if (row == '3') { } else if (row === '3') {
return column; return column;
} }
}, },

View File

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

View File

@ -8,6 +8,7 @@
<script src="http://code.jquery.com/jquery-1.11.1.min.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> <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="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> <title> @CHECK | @yield('map_title') </title>
@yield('map_meta') @yield('map_meta')
</head> </head>

View File

@ -13,7 +13,9 @@
<div class="seat-chart-wrapper"> <div class="seat-chart-wrapper">
<div id="seat-map"> <div id="seat-map">
<div class="front-indicator">{{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->name }}, <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>
</div> </div>
<br/> <br/>
@ -26,11 +28,10 @@
<h3>Wybrane miejsce: <h3>Wybrane 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 }}">
<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">

View File

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

View File

@ -16,7 +16,7 @@
<div class="col-md-6"> <div class="col-md-6">
<select id="subject_id" class="form-control @error('subject_id') is-invalid @enderror" name="subject_id" required> <select id="subject_id" class="form-control @error('subject_id') is-invalid @enderror" name="subject_id" required>
@foreach ($subjects as $subject) @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 @endforeach
</select> </select>
@ -83,7 +83,7 @@
@foreach ($classes_list as $classes_item) @foreach ($classes_list as $classes_item)
<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 }}</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> {{ $classes_item->date }} </td>
<td> <td>
@if($classes_item->classes_code) @if($classes_item->classes_code)

View File

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

View File

@ -8,6 +8,8 @@
<!-- Fonts --> <!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
<link rel="shortcut icon" href="{{ asset('img/favicon.png') }}">
<!-- Styles --> <!-- Styles -->
<style> <style>