fix+add: seats + seat-chooser
This commit is contained in:
parent
2c6745e812
commit
b0cc5b5278
31 changed files with 808 additions and 115 deletions
|
@ -25,14 +25,20 @@ class SeatChooser extends Component
|
|||
}
|
||||
|
||||
public function matrixGenerate() {
|
||||
$matrix = [];
|
||||
for ($row = 1; $row <= $this->room->room_rows; $row++) {
|
||||
$matrix[$row] = [];
|
||||
for ($column = 1; $column <= $this->room->room_columns; $column++) {
|
||||
$matrix[$row][$column] = 0;
|
||||
// returns a matrix of seats
|
||||
$m = [];
|
||||
// first make empty matrix
|
||||
for ($i = 0; $i < $this->room->room_rows-1; $i++) {
|
||||
$m[$i] = [];
|
||||
for ($j = 0; $j < $this->room->room_columns-1; $j++) {
|
||||
$m[$i][$j] = null;
|
||||
}
|
||||
}
|
||||
return $matrix;
|
||||
$seats = $this->room->seats;
|
||||
foreach ($seats as $seat) {
|
||||
$m[$seat->seat_row][$seat->seat_column] = $seat;
|
||||
}
|
||||
return $m;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue