Muchas conexiones con la base de datos.
Ahora se pueden añadir sesiones (para una sala, cine y fecha predeterminada en el codigo). El "escoger" la pelicula es simplemente meter el id de la pelicula en cuestion. La lista de sesiones en la vista de las sesiones hace recibe un array desde la base de datos (para una sala,cine y fecha predeterminada en el codigo). Lo que muestra la tabla tambien es solo la id de la pelicula.
This commit is contained in:
@ -1,13 +1,18 @@
|
||||
<?php
|
||||
require('./includes/room_dto.php');
|
||||
require('./includes/session_dto.php');
|
||||
|
||||
//Login form validate:
|
||||
require_once('./includes/listSessions.php');
|
||||
$sessionList = new ListSessions("1", "1", "2021-04-10");
|
||||
|
||||
?>
|
||||
<input type="date" name="fecha" min="2021-01-01" max="2031-12-31">
|
||||
<input type="date" name="fecha" min="2021-01-01" max="2031-12-31">
|
||||
<?php
|
||||
$r1 = new RoomDTO(0,20,20);
|
||||
$r2 = new RoomDTO(1,10,30);
|
||||
$r3 = new RoomDTO(2,30,10);
|
||||
$r4 = new RoomDTO(3,15,15);
|
||||
$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);
|
||||
$rooms = array($r1, $r2, $r3, $r4);
|
||||
|
||||
function drawRooms($ros){
|
||||
@ -25,15 +30,10 @@
|
||||
?>
|
||||
</div>
|
||||
<div class="column side">
|
||||
<?php
|
||||
$s1 = new SessionDTO(0,"HOY","10:00","9,99€","normal","Los vengativos: final del juego");
|
||||
$s2 = new SessionDTO(1,"HOY","12:00","10€","3D","Los vengativos: final del juego");
|
||||
$s3 = new SessionDTO(2,"HOY","14:00","10€","subtitulado","Los vengativos: final del juego");
|
||||
$s4 = new SessionDTO(3,"HOY","16:00","9,99€","normal","Los vengativos: final del juego");
|
||||
$s5 = new SessionDTO(4,"HOY","18:00","9,99€","normal","Los vengativos: final del juego");
|
||||
$s6 = new SessionDTO(5,"HOY","20:00","20€","4D","Los vengativos: final del juego");
|
||||
$sessions = array($s1, $s2, $s3, $s4, $s5, $s6);
|
||||
|
||||
<?php
|
||||
$sessionList->filterList();
|
||||
$sessions = $sessionList->getArray();
|
||||
|
||||
function drawSessions($ses){
|
||||
|
||||
echo "
|
||||
@ -41,28 +41,28 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Hora</th>
|
||||
<th>Película</th>
|
||||
<th>Tipo</th>
|
||||
<th>idPelícula</th>
|
||||
<th>Formato</th>
|
||||
<th>Precio</th>
|
||||
<!-- <th>Opción</th> --> <!-- HAY QUE ELIMINAR ESTA COLUMNA, COMO EXPLICÓ IVÁN EN CLASE, -->
|
||||
<!-- LAS TABLAS TIENEN EL PROBLEMA DE QUE CON MUCHAS COLUMNAS SE EXPANDEN FUERA DE LOS LÍMITES -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>";
|
||||
foreach($ses as $s){
|
||||
echo "
|
||||
<tr>
|
||||
<td>" . $s->getStartTime() . "</td>
|
||||
<td>" . $s->getFilm() . "</td>
|
||||
<td>" . $s->getFormat() . "</td>
|
||||
<td>". $s->getSeatPrice() . "</td>
|
||||
<!-- <td> <button type=\"button\" onClick=\"Javascript:window.location.href = 'index.php?edit_sessions=true';\")\">Editar</button> </td> -->
|
||||
<!-- LA SOLUCIÓN PUEDE SER PONER EN ELACE DE EDICIÓN EN CADA UNO DE LOS ELEMENTOS DE LA COLUMNA -->
|
||||
</tr>";
|
||||
|
||||
<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>"
|
||||
;
|
||||
}
|
||||
echo "<tbody>
|
||||
</table>\n";
|
||||
echo "<a href=\"index.php?state=edit_session&option=new\" class='button large'>Añadir</a>";
|
||||
echo "<a href=\"./?state=edit_session&option=new\" class='button large'>Añadir</a>";
|
||||
}
|
||||
drawSessions($sessions);
|
||||
?>
|
||||
|
Reference in New Issue
Block a user