2021-03-26 15:45:16 +01:00
|
|
|
<?php
|
2021-04-08 18:01:35 +02:00
|
|
|
require('./includes/room_dto.php');
|
|
|
|
require('./includes/session_dto.php');
|
2021-04-10 20:54:56 +02:00
|
|
|
|
|
|
|
//Login form validate:
|
|
|
|
require_once('./includes/listSessions.php');
|
|
|
|
$sessionList = new ListSessions("1", "1", "2021-04-10");
|
|
|
|
|
2021-04-08 09:59:11 +02:00
|
|
|
?>
|
2021-04-10 20:54:56 +02:00
|
|
|
<input type="date" name="fecha" min="2021-01-01" max="2031-12-31">
|
2021-04-08 09:59:11 +02:00
|
|
|
<?php
|
2021-04-10 20:54:56 +02:00
|
|
|
$r1 = new RoomDTO(0,20,20,30);
|
|
|
|
$r2 = new RoomDTO(1,10,30,30);
|
|
|
|
$r3 = new RoomDTO(2,30,10,30);
|
|
|
|
$r4 = new RoomDTO(3,15,15,30);
|
2021-04-08 09:59:11 +02:00
|
|
|
$rooms = array($r1, $r2, $r3, $r4);
|
|
|
|
|
|
|
|
function drawRooms($ros){
|
|
|
|
echo "<table>";
|
|
|
|
foreach($ros as $r){
|
|
|
|
echo "
|
|
|
|
<tr>
|
|
|
|
<td> <button type=\"button\"> Sala ". $r->getId() ."</button> </td>
|
|
|
|
</tr>";
|
|
|
|
}
|
|
|
|
echo "
|
|
|
|
</table>\n";
|
|
|
|
}
|
|
|
|
drawRooms($rooms);
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<div class="column side">
|
2021-04-10 20:54:56 +02:00
|
|
|
<?php
|
|
|
|
$sessionList->filterList();
|
|
|
|
$sessions = $sessionList->getArray();
|
|
|
|
|
2021-04-08 09:59:11 +02:00
|
|
|
function drawSessions($ses){
|
|
|
|
|
|
|
|
echo "
|
|
|
|
<table class='alt'>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Hora</th>
|
2021-04-10 20:54:56 +02:00
|
|
|
<th>idPelícula</th>
|
|
|
|
<th>Formato</th>
|
2021-04-08 09:59:11 +02:00
|
|
|
<th>Precio</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>";
|
|
|
|
foreach($ses as $s){
|
|
|
|
echo "
|
2021-04-10 20:54:56 +02:00
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td><a href=\"./?state=edit_session&option=edit\">" . $s->getStartTime() . "</a></td>
|
|
|
|
<td><a href=\"./?state=edit_session&option=edit\">" . $s->getIdfilm() . "</a></td>
|
|
|
|
<td><a href=\"./?state=edit_session&option=edit\">" . $s->getFormat() . "</a></td>
|
|
|
|
<td><a href=\"./?state=edit_session&option=edit\">". $s->getSeatPrice() . "</a></td>
|
|
|
|
|
|
|
|
</tr>"
|
|
|
|
;
|
2021-04-08 09:59:11 +02:00
|
|
|
}
|
|
|
|
echo "<tbody>
|
|
|
|
</table>\n";
|
2021-04-10 20:54:56 +02:00
|
|
|
echo "<a href=\"./?state=edit_session&option=new\" class='button large'>Añadir</a>";
|
2021-04-08 09:59:11 +02:00
|
|
|
}
|
|
|
|
drawSessions($sessions);
|
|
|
|
?>
|
2021-04-08 18:01:35 +02:00
|
|
|
</div>
|