2021-03-26 15:45:16 +01:00
< ? php
2021-04-08 18:02:00 +02:00
require ( './includes/room_dto.php' );
2021-03-26 15:45:16 +01:00
$r1 = new RoomDTO ( 0 , 20 , 20 );
$r2 = new RoomDTO ( 1 , 10 , 30 );
$r3 = new RoomDTO ( 2 , 30 , 10 );
$r4 = new RoomDTO ( 3 , 15 , 15 );
$rooms = array ( $r1 , $r2 , $r3 , $r4 );
function drawRooms ( $ros ){
2021-03-29 01:04:21 +02:00
echo "
< table class = 'alt' >
< thead >
< tr >
< th > Sala </ th >
< th > Opción </ th >
</ tr >
</ thead >
< tbody > " ;
2021-03-26 15:45:16 +01:00
foreach ( $ros as $r ){
echo "
2021-03-29 01:04:21 +02:00
< tr >
<!-- AUN NO HEMOS VISTO JAVASCRIPT -->
<!-- ADEMÁS , AUNQUE USÁSEMOS JS , ESO NO SE HARÍA CON UN WINDOWS . LOCATION . HREF , DE MOMENTO , USAD LOS BOTONES COMO OS PONGO EL DE AÑADIR -->
<!--< td > < button type = \ " button \" > Sala " . $r -> getId () . " </button> </td> -->
< td >< a href = \ " \" class='button'>Sala " . $r -> getId () . " </a></td>
<!--< td > < button type = \ " button \" onClick= \" Javascript:window.location.href = 'index.php?edit_rooms=true'; \" ) \" >Editar</button> </td> MAL, POR LO MISMO-->
< td >< a href = \ " index.php?edit_rooms=true \" class='button'>Editar</a></td>
</ tr > " ;
2021-03-26 15:45:16 +01:00
}
2021-03-29 01:04:21 +02:00
echo " <tbody>
</ table > \n " ;
echo " <a href= \" index.php?edit_sessions=true \" class='button large'>Añadir</a> " ;
2021-03-26 15:45:16 +01:00
}
drawRooms ( $rooms );
2021-04-08 09:59:11 +02:00
?>
2021-04-08 18:02:00 +02:00
</ div >