room seeds updated, larger rooms maps updated

This commit is contained in:
s416422 2019-12-20 23:21:31 +01:00
parent 70f0248b8f
commit ea0afdb671
8 changed files with 178 additions and 119 deletions

View File

@ -104,8 +104,15 @@ class UserClassesController extends Controller
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));
if($room_rows > 4) { //max 4 rows on one page
$multi_parts = true;
$parts_number = ceil($room_rows/4);
} else {
$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]); 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]);
@ -139,12 +146,14 @@ class UserClassesController extends Controller
if(!$room_arrangement) { if(!$room_arrangement) {
$room_arrangement = Room::where('name', 'Inna sala')->first()->arrangement; $room_arrangement = Room::where('name', 'Inna sala')->first()->arrangement;
} }
if(count(explode("++", $room_arrangement)) > 4) { $room_rows = count(explode("++", $room_arrangement));
$twoparts = true; if($room_rows > 4) { //max 4 rows on one page
$multi_parts = true;
$parts_number = ceil($room_rows/4);
} else { } else {
$twoparts = false; $multi_parts = false;
} }
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, 'twoparts' => $twoparts]); 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)
@ -175,12 +184,14 @@ class UserClassesController extends Controller
if(!$room_arrangement) { if(!$room_arrangement) {
$room_arrangement = Room::where('name', 'Inna sala')->first()->arrangement; $room_arrangement = Room::where('name', 'Inna sala')->first()->arrangement;
} }
if(count(explode("++", $room_arrangement)) > 4) { $room_rows = count(explode("++", $room_arrangement));
$twoparts = true; if($room_rows > 4) { //max 4 rows on one page
$multi_parts = true;
$parts_number = ceil($room_rows/4);
} else { } else {
$twoparts = 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, 'twoparts' => $twoparts]); 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

@ -13,22 +13,22 @@ class RoomsTableSeeder extends Seeder
{ {
$rooms = [ $rooms = [
array('name' => 'A0-1', 'capacity' => 30, 'arrangement' => 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]' '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]'
), ),
array('name' => 'A0-11', 'capacity' => 24, 'arrangement' => 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]' '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]'
), ),
array('name' => 'A0-12', 'capacity' => 24, 'arrangement' => ''), array('name' => 'A0-12', 'capacity' => 24, '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]'),
array('name' => 'A0-3', 'capacity' => 13, 'arrangement' => ''), array('name' => 'A0-3', 'capacity' => 13, '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]'),
array('name' => 'A0-5', 'capacity' => 13, 'arrangement' => ''), array('name' => 'A0-5', 'capacity' => 13, '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]'),
array('name' => 'A1-14/15', 'capacity' => 25, '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]' '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' => 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]' '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-18', 'capacity' => 13, '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]'),
array('name' => 'A1-20', 'capacity' => 13, 'arrangement' => ''), array('name' => 'A1-20', 'capacity' => 13, '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]'),
array('name' => 'A1-22/23', 'capacity' => 25, '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]' '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]'
), ),
@ -36,45 +36,45 @@ class RoomsTableSeeder extends Seeder
'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]' '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' => 'A1-33 (Sala RW)', 'capacity' => 64, 'arrangement' => ''),
array('name' => 'A2-1', 'capacity' => 24, 'arrangement' => ''), array('name' => 'A2-1', 'capacity' => 24, '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]'),
array('name' => 'A2-10', 'capacity' => 34, 'arrangement' => ''), array('name' => 'A2-10', 'capacity' => 34, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]'),
array('name' => 'A2-11', 'capacity' => 34, 'arrangement' => ''), array('name' => 'A2-11', 'capacity' => 34, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]'),
array('name' => 'A2-12', 'capacity' => 34, 'arrangement' => ''), array('name' => 'A2-12', 'capacity' => 34, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]'),
array('name' => 'A2-14', 'capacity' => 48, 'arrangement' => ''), array('name' => 'A2-14', 'capacity' => 48, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]++c[35,35]c[36,36]c[37,37]c[38,38]c[39,39]c[40,40]++c[41,41]c[42,42]c[43,43]c[44,44]++c[45,45]c[46,46]c[47,47]c[48][48]'),
array('name' => 'A2-19', 'capacity' => 48, 'arrangement' => ''), array('name' => 'A2-19', 'capacity' => 48, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]++c[35,35]c[36,36]c[37,37]c[38,38]c[39,39]c[40,40]++c[41,41]c[42,42]c[43,43]c[44,44]++c[45,45]c[46,46]c[47,47]c[48][48]'),
array('name' => 'A2-2', 'capacity' => 34, 'arrangement' => ''), array('name' => 'A2-2', 'capacity' => 34, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]'),
array('name' => 'A2-20', 'capacity' => 32, 'arrangement' => ''), array('name' => 'A2-20', 'capacity' => 32, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]'),
array('name' => 'A2-21', 'capacity' => 48, 'arrangement' => ''), array('name' => 'A2-21', 'capacity' => 48, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]++c[35,35]c[36,36]c[37,37]c[38,38]c[39,39]c[40,40]++c[41,41]c[42,42]c[43,43]c[44,44]++c[45,45]c[46,46]c[47,47]c[48][48]'),
array('name' => 'A2-22', 'capacity' => 48, 'arrangement' => ''), array('name' => 'A2-22', 'capacity' => 48, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]++c[35,35]c[36,36]c[37,37]c[38,38]c[39,39]c[40,40]++c[41,41]c[42,42]c[43,43]c[44,44]++c[45,45]c[46,46]c[47,47]c[48][48]'),
array('name' => 'A2-23', 'capacity' => 48, 'arrangement' => ''), array('name' => 'A2-23', 'capacity' => 48, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]++c[35,35]c[36,36]c[37,37]c[38,38]c[39,39]c[40,40]++c[41,41]c[42,42]c[43,43]c[44,44]++c[45,45]c[46,46]c[47,47]c[48][48]'),
array('name' => 'A2-24', 'capacity' => 48, 'arrangement' => ''), array('name' => 'A2-24', 'capacity' => 48, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]++c[35,35]c[36,36]c[37,37]c[38,38]c[39,39]c[40,40]++c[41,41]c[42,42]c[43,43]c[44,44]++c[45,45]c[46,46]c[47,47]c[48][48]'),
array('name' => 'A2-3', 'capacity' => 24, 'arrangement' => ''), array('name' => 'A2-3', 'capacity' => 24, '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]'),
array('name' => 'A2-4', 'capacity' => 24, 'arrangement' => ''), array('name' => 'A2-4', 'capacity' => 24, '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]'),
array('name' => 'A2-5', 'capacity' => 24, 'arrangement' => ''), array('name' => 'A2-5', 'capacity' => 24, '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]'),
array('name' => 'A2-8', 'capacity' => 24, 'arrangement' => ''), array('name' => 'A2-8', 'capacity' => 24, '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]'),
array('name' => 'A2-9', 'capacity' => 34, 'arrangement' => ''), array('name' => 'A2-9', 'capacity' => 34, 'arrangement' => ''),
array('name' => 'Aula A', 'capacity' => 196, 'arrangement' => ''), array('name' => 'Aula A', 'capacity' => 196, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]++c[35,35]c[36,36]c[37,37]c[38,38]c[39,39]c[40,40]++c[41,41]c[42,42]c[43,43]c[44,44]++c[45,45]c[46,46]c[47,47]c[48,48]c[49,49]c[50,50]++c[51,51]c[52,52]c[53,53]c[54,54]++c[55,55]c[56,56]c[57,57]c[58,58]c[59,59]c[60,60]++c[61,61]c[62,62]c[63,63]c[64,64]++c[65,65]c[66,66]c[67,67]c[68,68]c[69,69]c[70,70]++c[71,71]c[72,72]c[73,73]c[74,74]++c[75,75]c[76,76]c[77,77]c[78,78]c[79,79]c[80,80]++c[81,81]c[82,82]c[83,83]c[84,84]++c[85,85]c[86,86]c[87,87]c[88,88]c[89,89]c[90,90]++c[91,91]c[92,92]c[93,93]c[94,94]++c[95,95]c[96,96]c[97,97]c[98,98]c[99,99]c[100,100]++c[101,101]c[102,102]c[103,103]c[104,104]++c[105,105]c[106,106]c[107,107]c[108,108]c[109,109]c[110,110]++c[111,111]c[112,112]c[113,113]c[114,114]++c[115,115]c[116,116]c[117,117]c[118, 118]c[119,119]c[120,120]++c[121,121]c[122,122]c[123,123]c[124,124]++c[125,125]c[126,126]c[127,127]c[128,128]c[129,129]c[130,130]++c[131,131]c[132,132]c[133,133]c[134,134]++c[135,135]c[136,136]c[137,137]c[138,138]c[139,139]c[140,140]++c[141,141]c[142,142]c[143,143]c[144,144]++c[145,145]c[146,146]c[147,147]c[148,148]c[149,149]c[150,150]++c[151,151]c[152,152]c[153,153]c[154,154]++c[155,155]c[156,156]c[157,157]c[158,158]c[159,159]c[160,160]++c[161,161]c[162,162]c[163,163]c[164,164]++c[165,165]c[166,166]c[167,167]c[168,168]c[169,169]c[170,170]++c[171,171]c[172,172]c[173,173]c[174,174]++c[175,175]c[176,176]c[177,177]c[178,178]c[179,179]c[180,180]++c[181,181]c[182,182]c[183,183]c[184,184]++c[185,185]c[186,186]c[187,187]c[188,188]c[189,189]c[190,190]++c[191,191]c[192,192]c[193,193]c[194,194]++c[195,195]c[196,196]'),
array('name' => 'Aula B', 'capacity' => 117, 'arrangement' => ''), array('name' => 'Aula B', 'capacity' => 117, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]++c[35,35]c[36,36]c[37,37]c[38,38]c[39,39]c[40,40]++c[41,41]c[42,42]c[43,43]c[44,44]++c[45,45]c[46,46]c[47,47]c[48,48]c[49,49]c[50,50]++c[51,51]c[52,52]c[53,53]c[54,54]++c[55,55]c[56,56]c[57,57]c[58,58]c[59,59]c[60,60]++c[61,61]c[62,62]c[63,63]c[64,64]++c[65,65]c[66,66]c[67,67]c[68,68]c[69,69]c[70,70]++c[71,71]c[72,72]c[73,73]c[74,74]++c[75,75]c[76,76]c[77,77]c[78,78]c[79,79]c[80,80]++c[81,81]c[82,82]c[83,83]c[84,84]++c[85,85]c[86,86]c[87,87]c[88,88]c[89,89]c[90,90]++c[91,91]c[92,92]c[93,93]c[94,94]++c[95,95]c[96,96]c[97,97]c[98,98]c[99,99]c[100,100]++c[101,101]c[102,102]c[103,103]c[104,104]++c[105,105]c[106,106]c[107,107]c[108,108]c[109,109]c[110,110]++c[111,111]c[112,112]c[113,113]c[114,114]++c[115,115]c[116,116]c[117,117]'),
array('name' => 'Aula C', 'capacity' => 117, 'arrangement' => ''), array('name' => 'Aula C', 'capacity' => 117, '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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]++c[31,31]c[32,32]c[33,33]c[34,34]++c[35,35]c[36,36]c[37,37]c[38,38]c[39,39]c[40,40]++c[41,41]c[42,42]c[43,43]c[44,44]++c[45,45]c[46,46]c[47,47]c[48,48]c[49,49]c[50,50]++c[51,51]c[52,52]c[53,53]c[54,54]++c[55,55]c[56,56]c[57,57]c[58,58]c[59,59]c[60,60]++c[61,61]c[62,62]c[63,63]c[64,64]++c[65,65]c[66,66]c[67,67]c[68,68]c[69,69]c[70,70]++c[71,71]c[72,72]c[73,73]c[74,74]++c[75,75]c[76,76]c[77,77]c[78,78]c[79,79]c[80,80]++c[81,81]c[82,82]c[83,83]c[84,84]++c[85,85]c[86,86]c[87,87]c[88,88]c[89,89]c[90,90]++c[91,91]c[92,92]c[93,93]c[94,94]++c[95,95]c[96,96]c[97,97]c[98,98]c[99,99]c[100,100]++c[101,101]c[102,102]c[103,103]c[104,104]++c[105,105]c[106,106]c[107,107]c[108,108]c[109,109]c[110,110]++c[111,111]c[112,112]c[113,113]c[114,114]++c[115,115]c[116,116]c[117,117]'),
array('name' => 'B1-06', 'capacity' => 4, 'arrangement' => ''), array('name' => 'B1-06', 'capacity' => 4, 'arrangement' => 'c[1,1]c[2,2]c[3,3]c[4,4]'),
array('name' => 'B1-07/08', 'capacity' => 16, 'arrangement' => ''), array('name' => 'B1-07/08', 'capacity' => 16, '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]'),
array('name' => 'B1-37', 'capacity' => 18, 'arrangement' => ''), array('name' => 'B1-37', 'capacity' => 18, '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' => 'B1-38', 'capacity' => 12, 'arrangement' => ''), array('name' => 'B1-38', 'capacity' => 12, '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]'),
array('name' => 'B2-08/09', 'capacity' => 16, 'arrangement' => ''), array('name' => 'B2-08/09', 'capacity' => 16, '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]'),
array('name' => 'B2-38', 'capacity' => 15, 'arrangement' => ''), array('name' => 'B2-38', 'capacity' => 15, '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]'),
array('name' => 'B2-39', 'capacity' => 12, 'arrangement' => ''), array('name' => 'B2-39', 'capacity' => 12, '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]'),
array('name' => 'B2-44', 'capacity' => 4, 'arrangement' => ''), array('name' => 'B2-44', 'capacity' => 4, 'arrangement' => 'c[1,1]c[2,2]c[3,3]c[4,4]'),
array('name' => 'B3-08/09', 'capacity' => 16, 'arrangement' => ''), array('name' => 'B3-08/09', 'capacity' => 16, '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]'),
array('name' => 'B3-38', 'capacity' => 18, 'arrangement' => ''), array('name' => 'B3-38', 'capacity' => 18, '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' => 'B3-39', 'capacity' => 18, 'arrangement' => ''), array('name' => 'B3-39', 'capacity' => 18, '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' => 'B3-49', 'capacity' => 12, 'arrangement' => ''), array('name' => 'B3-49', 'capacity' => 12, '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]'),
array('name' => 'C2-3', 'capacity' => 1, 'arrangement' => ''), array('name' => 'C2-3', 'capacity' => 1, 'arrangement' => 'c[1,1]'),
array('name' => 'D-1', 'capacity' => 22, 'arrangement' => ''), array('name' => 'D-1', 'capacity' => 22, '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]'),
array('name' => 'D-2', 'capacity' => 21, 'arrangement' => ''), array('name' => 'D-2', 'capacity' => 21, '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]'),
array('name' => 'D-3', 'capacity' => 22, 'arrangement' => ''), array('name' => 'D-3', 'capacity' => 22, '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]'),
array('name' => 'Klub Profesorski', 'capacity' => null, 'arrangement' => ''), array('name' => 'Klub Profesorski', '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]++c[19,19]c[20,20]c[21,21]c[22,22]c[23,23]c[24,24]++_++c[25,25]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]'),
array('name' => 'Inna sala', 'capacity' => null, 'arrangement' => array('name' => 'Inna sala', '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]c[19,19]c[20,20]c[21,21]++c[22,22]c[23,23]c[24,24]c[25,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]c[26,26]c[27,27]c[28,28]c[29,29]c[30,30]'
) )
]; ];
foreach ($rooms as $room) { foreach ($rooms as $room) {

View File

@ -35,7 +35,7 @@ div.seatCharts-seat:focus {
} }
div.seatCharts-space { div.seatCharts-space {
background-color: white; background-color: unset;
} }
div.seatCharts-row { div.seatCharts-row {

View File

@ -18,10 +18,6 @@
width: 60%; width: 60%;
} }
div.seatCharts-space {
background-color: unset;
}
div.seatCharts-row { div.seatCharts-row {
height: 150px; height: 150px;
justify-content: flex-start; justify-content: flex-start;

View File

@ -1,19 +1,23 @@
function assignPlaces() { function assignPlaces() {
const attendances = $('.attendance-id'); const attendances = $('.attendance-id');
const twoparts = $('#twoparts').val(); const multi_parts = $('#multi_parts').val();
attendances.each(function() { attendances.each(function() {
const seat_number = $(this).attr('id').split('++')[0]; const seat_number = $(this).attr('id').split('++')[0];
const name = $(this).attr('id').split('++')[1]; const name = $(this).attr('id').split('++')[1];
const surname = $(this).attr('id').split('++')[2]; const surname = $(this).attr('id').split('++')[2];
let map_seat = ''; let map_seat = '';
if(!twoparts) { if(!multi_parts) {
map_seat = $('#seat-map').find(`#${seat_number}`); map_seat = $('#seat-map').find(`#${seat_number}`);
} else { } else {
map_seat = $('#seat-map-first').find(`#${seat_number}`); const parts_number = $('#multi_parts_number').val();
if (!map_seat.length) { let index = 0;
map_seat = $('#seat-map-second').find(`#${seat_number}`); map_seat = $('#seat-map-0').find(`#${seat_number}`);
while (!map_seat.length && index < parts_number) {
index++;
map_seat = $(`#seat-map-${index}`).find(`#${seat_number}`);
} }
} }
console.log(map_seat);
map_seat.html(`<b>${seat_number}</b> <br><span class="preview-name">${name} ${surname}</span>`); map_seat.html(`<b>${seat_number}</b> <br><span class="preview-name">${name} ${surname}</span>`);
map_seat.on('mouseover', () => { map_seat.on('mouseover', () => {
map_seat.css('backgroundColor', 'lightgrey'); map_seat.css('backgroundColor', 'lightgrey');

View File

@ -28,7 +28,7 @@ $(document).ready(function() {
seat_selected = true; seat_selected = true;
return 'selected'; return 'selected';
} else if (this.status() === 'selected') { } else if (this.status() === 'selected') {
//remove the item from our cart //remove the item from our cart and make this seat available
$('#cart-item-' + this.settings.id).remove(); $('#cart-item-' + this.settings.id).remove();
$('#item-' + this.settings.id).remove(); $('#item-' + this.settings.id).remove();
seat_selected = false; seat_selected = false;
@ -47,12 +47,47 @@ $(document).ready(function() {
}); });
} }
function createTwoPartsMap(seat_rows_first, seat_rows_second, seat_container_first, seat_container_second) { function createMultiPartsMap(parts_number, seat_map) {
let $cart = $('#selected-seats'); let $cart = $('#selected-seats');
let seat_selected = false; let seat_selected = false;
seat_container_first.seatCharts({ // divide all rows into carousel slides
map: seat_rows_first, let parts_elements = []; // slides elements
let parts_rows = []; // sets of rows for slides
const per_page = 4; // max number of rows on one slide
let first_index = 0;
let last_index = 4;
for(let i=0; i<parts_number; i++) {
parts_elements[i] = $(`#seat-map-${i}`);
if(seat_map[first_index] === '_') {
seat_map.splice(first_index, 1) // remove unnecessary first row of every set if it's blank
}
parts_rows[i] = seat_map.slice(first_index, last_index);
first_index = last_index;
last_index = last_index + per_page;
}
const last_rows = parts_rows[parts_rows.length-1]; // the last set of rows
// check if the last slide does not contains only blank rows
if((last_rows.length === 1 && last_rows[0] === '_' ) || last_rows.length === 0){ // if there are no rows on the last slide or if the only row is blank
const row_index = parts_rows.indexOf(last_rows);
if (row_index > -1) {
parts_elements[row_index].parent().remove(); // remove unnecessary slide from node
parts_rows.splice(row_index, 1); // remove unnecessary rows from list
parts_elements.splice(row_index, 1); // remove unnecessary slide from list
}
} else if(last_rows.length < 4) { // fill the last slide to 4 rows
const diff = 4 - last_rows.length;
for(let i=0; i<diff; i++) {
last_rows.push('_');
}
}
// execute seatchart function for the first slide manually to have the legend
parts_elements[0].seatCharts({
map: parts_rows[0],
naming: { naming: {
rows: ['', '', '', ''], rows: ['', '', '', ''],
top: false, top: false,
@ -88,8 +123,10 @@ $(document).ready(function() {
} }
}); });
seat_container_second.seatCharts({ // execute seatchart function for the rest slides
map: seat_rows_second, for(let i=1; i<parts_number; i++) {
parts_elements[i].seatCharts({
map: parts_rows[i],
naming: { naming: {
rows: ['', '', '', ''], rows: ['', '', '', ''],
top: false, top: false,
@ -118,20 +155,19 @@ $(document).ready(function() {
} }
}); });
}
$('#selected-seats').on('click', '.cancel-cart-item', function () { $('#selected-seats').on('click', '.cancel-cart-item', function () {
const id = $(this).parent().data('seatId'); const id = $(this).parent().data('seatId');
$('#twoparts-map').find(`#${id}`).click(); $('#multi_parts-map').find(`#${id}`).click();
}); });
} }
const seat_map = $('#room_arrangement').val().split('++'); const seat_map = $('#room_arrangement').val().split('++');
if (seat_map.length > 4) { if (seat_map.length > 4) {
const first_part = seat_map.slice(0, 4); const parts_number = $('#multi_parts_number').val();
const second_part = seat_map.slice(5); createMultiPartsMap(parts_number, seat_map)
const seats_container_first = $('#seat-map-first');
const seats_container_second = $('#seat-map-second');
createTwoPartsMap(first_part, second_part, seats_container_first, seats_container_second);
} else { } else {
const seats_container = $('#seat-map'); const seats_container = $('#seat-map');
createMap(seat_map, seats_container); createMap(seat_map, seats_container);

View File

@ -13,7 +13,7 @@
@section('content') @section('content')
<div class="wrapper"> <div class="wrapper">
<div class="seat-chart-wrapper"> <div class="seat-chart-wrapper">
@if($twoparts) @if($multi_parts)
<div class="front-indicator"> <div class="front-indicator">
<a href="{{ route('user_classes') }}" class="checkout-button end-button"> Powrót do listy zajęć </a> <a href="{{ route('user_classes') }}" class="checkout-button end-button"> Powrót do listy zajęć </a>
<p class="seat-p"> <p class="seat-p">
@ -24,13 +24,19 @@
</p> </p>
</div> </div>
<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">
<div class="carousel-inner" id="twoparts-map"> <div class="carousel-inner" id="multi_parts-map">
<input type="hidden" id="multi_parts_number" value="{{ $parts_number }}">
@foreach(range(0, $parts_number-1) as $index)
@if($index == 0)
<div class="carousel-item active"> <div class="carousel-item active">
<div id="seat-map-first"></div> <div id="seat-map-{{ $index }}"></div>
</div> </div>
@else
<div class="carousel-item"> <div class="carousel-item">
<div id="seat-map-second"></div> <div id="seat-map-{{ $index }}"></div>
</div> </div>
@endif
@endforeach
</div> </div>
<a class="carousel-control-prev" href="#map-carousel" role="button" data-slide="prev"> <a class="carousel-control-prev" href="#map-carousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="carousel-control-prev-icon" aria-hidden="true"></span>

View File

@ -52,15 +52,21 @@
</div> </div>
</div> </div>
<div class="seat-chart-wrapper"> <div class="seat-chart-wrapper">
@if($twoparts) @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">
<div class="carousel-inner" id="twoparts-map"> <div class="carousel-inner" id="multi_parts-map">
<input type="hidden" id="multi_parts_number" value="{{ $parts_number }}">
@foreach(range(0, $parts_number-1) as $index)
@if($index == 0)
<div class="carousel-item active"> <div class="carousel-item active">
<div id="seat-map-first"></div> <div id="seat-map-{{ $index }}"></div>
</div> </div>
@else
<div class="carousel-item"> <div class="carousel-item">
<div id="seat-map-second"></div> <div id="seat-map-{{ $index }}"></div>
</div> </div>
@endif
@endforeach
</div> </div>
<a class="carousel-control-prev" href="#map-carousel" role="button" data-slide="prev"> <a class="carousel-control-prev" href="#map-carousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="carousel-control-prev-icon" aria-hidden="true"></span>
@ -76,7 +82,7 @@
@endif @endif
</div> </div>
<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 }}">
<input type="hidden" class="twoparts" name="twoparts" id="twoparts" value="{{ $twoparts }}"> <input type="hidden" class="multi_parts" name="multi_parts" id="multi_parts" value="{{ $multi_parts }}">
@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