Add files via upload

This commit is contained in:
Fernando Méndez 2021-05-03 01:17:42 +02:00 committed by GitHub
parent 015b2ffcf8
commit 41000d9627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 283 additions and 297 deletions

View File

@ -218,7 +218,7 @@
//Print Films Cards:
function print_fimls(){
//List of the tittles of the movies:
//List of the movies:
require_once(__DIR__.'/common/film_dao.php');
$prefix= $this->get_prefix();
@ -360,7 +360,7 @@
}
function print_cinemas(){
//List of the tittles of the movies:
//List of the cinemas:
require_once(__DIR__.'/common/cinema_dao.php');
$prefix= $this->get_prefix();
@ -381,7 +381,9 @@
switch($this->page){
case "Panel de Administrador":
echo "<div class='column left'>
echo "<div class='row'>
<div class='column side'></div>
<div class='column middle'>
<table class='alt'>
<thead>
<tr>
@ -391,10 +393,10 @@
<th>Telefono</th>
</tr>
</thead>
<tbody>";
<tbody>
";
for($i = 0; $i < count($cinemas); $i++){
echo '
<tr>
echo '<tr>
<td>'. $ids[$i] .'</td>
<td>'. $names[$i] .'</td>
<td>'. $directions[$i] .'</td>
@ -417,12 +419,14 @@
<input type="submit" id="submit" value="Eliminar" name="delete_cinema" class="primary" />
</form>
</td>
</tr>';
</tr>
';
}
echo'<tbody>
echo'</tbody>
</table>
</div>';
echo "</div>\n";
</div>
<div class="column side"></div>
';
break;
}

View File

@ -21,23 +21,55 @@ class FormCinema extends Form {
public function getReply() {
if($this->correct){
if($this->option == "new"){
$this->reply = "<h1> Operacion realizada con exito </h1><hr />
$this->reply = "<div class='row'>
<div class='column side'></div>
<div class='column middle'>
<div class='code info'>
<h1> Operacion realizada con exito </h1><hr />
<p> Se ha añadido el cine correctamente en la base de datos.</p>
<a href='../panel_admin/index.php?state=mc'><button>Cerrar Mensaje</button></a>";
<a href='../panel_admin/index.php?state=mc'><button>Cerrar Mensaje</button></a>
</div>
<div class='column side'></div>
</div>
";
}else if($this->option == "edit"){
$this->reply = "<h1> Operacion realizada con exito </h1><hr />
$this->reply = "<div class='row'>
<div class='column side'></div>
<div class='column middle'>
<div class='code info'>
<h1> Operacion realizada con exito </h1><hr />
<p> Se ha editado el cine correctamente en la base de datos.</p>
<a href='../panel_admin/index.php?state=mc'><button>Cerrar Mensaje</button></a>";
<a href='../panel_admin/index.php?state=mc'><button>Cerrar Mensaje</button></a>
</div>
<div class='column side'></div>
</div>
";
}else if($this->option == "del"){
$this->reply = "<h1> Operacion realizada con exito </h1><hr />
$this->reply = "<div class='row'>
<div class='column side'></div>
<div class='column middle'>
<div class='code info'>
<h1> Operacion realizada con exito </h1><hr />
<p> Se ha eliminado el cine correctamente en la base de datos.</p>
<a href='../panel_admin/index.php?state=mc'><button>Cerrar Mensaje</button></a>";
<a href='../panel_admin/index.php?state=mc'><button>Cerrar Mensaje</button></a>
</div>
<div class='column side'></div>
</div>
";
}
} else {
$this->reply = "<h1> ERROR </h1><hr />
$this->reply = "<div class='row'>
<div class='column side'></div>
<div class='column middle'>
<div class='code info'>
<h1> ERROR </h1><hr />
<p> Ha habido un error en la operacion. Revisa los datos introducidos</p>
<a href='../panel_admin/index.php?state=mc'><button>Panel Admin</button></a>";
<a href='../panel_admin/index.php?state=mc'><button>Panel Admin</button></a>
</div>
<div class='column side'></div>
</div>
";
}
return $this->reply;

View File

@ -21,23 +21,52 @@ class FormFilm extends Form {
public function getReply() {
if($this->correct){
if($this->option == "new"){
$this->reply = "<h1> Operacion realizada con exito </h1><hr />
$this->reply = "<div class='row'>
<div class='column side'></div>
<div class='column middle'>
<div class='code info'>
<h1> Operacion realizada con exito </h1><hr />
<p> Se ha añadido la pelicula correctamente en la base de datos.</p>
<a href='../panel_admin/index.php?state=mf'><button>Cerrar Mensaje</button></a>";
<a href='../panel_admin/index.php?state=mf'><button>Cerrar Mensaje</button></a>
</div>
</div>
<div class='column side'></div>
</div>
";
}else if($this->option == "edit"){
$this->reply = "<h1> Operacion realizada con exito </h1><hr />
$this->reply = "<div class='row'>
<div class='column side'></div>
<div class='column middle'>
<div class='code info'>
<h1> Operacion realizada con exito </h1><hr />
<p> Se ha editado la pelicula correctamente en la base de datos.</p>
<a href='../panel_admin/index.php?state=mf'><button>Cerrar Mensaje</button></a>";
<a href='../panel_admin/index.php?state=mf'><button>Cerrar Mensaje</button></a>
</div>
</div>
<div class='column side'></div>
</div>
";
}else if($this->option == "del"){
$this->reply = "<h1> Operacion realizada con exito </h1><hr />
$this->reply = "<div class='row'>
<div class='column side'></div>
<div class='column middle'>
<div class='code info'>
<h1> Operacion realizada con exito </h1><hr />
<p> Se ha eliminado la pelicula correctamente en la base de datos.</p>
<a href='../panel_admin/index.php?state=mf'><button>Cerrar Mensaje</button></a>";
<a href='../panel_admin/index.php?state=mf'><button>Cerrar Mensaje</button></a>
</div>
</div>
<div class='column side'></div>
</div>
";
}
} else {
$this->reply = "<h1> ERROR </h1><hr />
$this->reply = "<div class='column middle'>
<h1>ERROR</h1><hr />
<p> Ha habido un error en la operacion. Revisa los datos introducidos</p>
<a href='../panel_admin/index.php?state=mf'><button>Panel Admin</button></a>";
<a href='../panel_admin/index.php?state=mf'><button>Panel Admin</button></a>
</div>";
}
return $this->reply;

View File

@ -13,8 +13,6 @@
else {
$panel = new Panel('', $login);
}
// IMPORTANTE:
// VERIFICAR QUE ES ADMIN, SI NO, MOSTRAR MENSAJE DE "ERROR"
?>
<!--

View File

@ -9,56 +9,11 @@
// View functions
/*function drawCinema(){
$cine = new Cinema_DAO("complucine");
$cinemas = $cine->allCinemaData();
echo "<div class='column left'>
<table class='alt'>
<thead>
<tr>
<th>Id</th>
<th>Nombre</th>
<th>Direccion</th>
<th>Telefono</th>
</tr>
</thead>
<tbody>";
foreach($cinemas as $f){
echo '
<tr>
<td>'. $f->getId() .'</td>
<td>'. $f->getName() .'</td>
<td>'. $f->getDirection() .'</td>
<td>'. $f->getPhone() .'</td>
<td>
<form method="post" action="index.php?state=mc">
<input name="id" type="hidden" value="'.$f->getId().'">
<input name="name" type="hidden" value="'.$f->getName().'">
<input name="direction" type="hidden" value="'.$f->getDirection().'">
<input name="phone" type="hidden" value="'.$f->getPhone().'">
<input type="submit" id="submit" value="Editar" name="edit_cinema" class="primary" />
</form>
</td>
<td>
<form method="post" action="index.php?state=mc">
<input name="id" type="hidden" value="'.$f->getId().'">
<input name="name" type="hidden" value="'.$f->getName().'">
<input name="direction" type="hidden" value="'.$f->getDirection().'">
<input name="phone" type="hidden" value="'.$f->getPhone().'">
<input type="submit" id="submit" value="Eliminar" name="delete_cinema" class="primary" />
</form>
</td>
</tr>';
}
echo'<tbody>
</table>
</div>';
}*/
function addCinema(){
echo'<div class="column">
echo' <div class="column side"></div>
<div class="column middle">
<h2>Añadir cine</h2>
<form method="post" action="index.php?state=mc">
<div class="row">
<fieldset id="cinema_form">
<legend>Datos del Cine</legend>
<div>
@ -75,13 +30,16 @@
<input type="submit" id="submit" value="Añadir cine" name="add_cinema" class="primary" />
<input type="reset" id="reset" value="Borrar" />
</div>
</div>
</form>
</div>';
</div>
<div class="column side"></div>
</div>
';
}
function deleteCinema() {
echo'<div class="column">
<h2>Editar cine</h2>
echo'<div class="column side"></div>
<div class="column middle">
<h2>Eliminar cine</h2>
<form method="post" action="index.php?state=mc">
<div class="row">
<fieldset id="cinema_form">
@ -98,10 +56,13 @@
</div>
</div>
</form>
</div>';
</div>
<div class="column side"></div>
';
}
function editCinema() {
echo'<div class="column">
echo'<div class="column side"></div>
<div class="column middle">
<h2>Editar cine</h2>
<form method="post" action="index.php?state=mc">
<div class="row">
@ -124,7 +85,9 @@
</div>
</div>
</form>
</div>';
</div>
<div class="column side"></div>
';
}
// Logic Functions

View File

@ -7,57 +7,9 @@
// View functions
/*function drawFilms(){
$film = new Film_DAO("complucine");
$films = $film->allFilmData();
echo "<div class='column left'>
<table class='alt'>
<thead>
<tr>
<th>Id</th>
<th>Título</th>
<th>Duracion</th>
<th>Idioma</th>
<th>Descripcion</th>
</tr>
</thead>
<tbody>";
foreach($films as $f){
echo '
<tr>
<td>'. $f->getId() .'</td>
<td>'. $f->getTittle() .'</td>
<td>'. $f->getDuration() .'</td>
<td>'. $f->getLanguage() .'</td>
<td>'. $f->getDescription().'</td>
<td>
<form method="post" action="index.php?state=mf">
<input name="id" type="hidden" value="'.$f->getId().'">
<input name="tittle" type="hidden" value="'.$f->getTittle().'">
<input name="duration" type="hidden" value="'.$f->getDuration().'">
<input name="language" type="hidden" value="'.$f->getLanguage().'">
<input name="description" type="hidden" value="'.$f->getDescription().'">
<input type="submit" id="submit" value="Editar" name="edit_film" class="primary" />
</form>
</td>
<td>
<form method="post" action="index.php?state=mf">
<input name="id" type="hidden" value="'.$f->getId().'">
<input name="tittle" type="hidden" value="'.$f->getTittle().'">
<input name="duration" type="hidden" value="'.$f->getDuration().'">
<input name="language" type="hidden" value="'.$f->getLanguage().'">
<input name="description" type="hidden" value="'.$f->getDescription().'">
<input type="submit" id="submit" value="Eliminar" name="delete_film" class="primary" />
</form>
</td>
</tr>';
}
echo'<tbody>
</table>
</div>';
}*/
function addFilm(){
echo'<div class="column">
echo'<div class="column side"></div>
<div class="column middle">
<h2>Añadir pelicula</h2>
<form method="post" action="index.php?state=mf">
<div class="row">
@ -82,10 +34,13 @@
</div>
</div>
</form>
</div>';
</div>
<div class="column side"></div>
';
}
function deleteFilm() {
echo'<div class="column">
echo'<div class="column side"></div>
<div class="column middle">
<h2>Editar pelicula</h2>
<form method="post" action="index.php?state=mf">
<div class="row">
@ -104,10 +59,13 @@
</div>
</div>
</form>
</div>';
</div>
<div class="column side"></div>
';
}
function editFilm() {
echo'<div class="column">
echo'<div class="column side"></div>
<div class="column middle">
<h2>Editar pelicula</h2>
<form method="post" action="index.php?state=mf">
<div class="row">
@ -133,7 +91,9 @@
</div>
</div>
</form>
</div>';
</div>
<div class="column side"></div>
';
}
// Logic Functions