Add files via upload
This commit is contained in:
parent
3e7378d9d9
commit
79ae1b24db
@ -39,12 +39,7 @@
|
||||
public function allFilmData(){
|
||||
$sql = sprintf( "SELECT * FROM film ");
|
||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||
|
||||
while($fila=mysqli_fetch_array($resul)){
|
||||
$films[] = $this->loadFilm($fila["id"], $fila["tittle"], $fila["duration"], $fila["language"], $fila["description"]);
|
||||
}
|
||||
$resul->free();
|
||||
return $films;
|
||||
return $resul;
|
||||
}
|
||||
|
||||
//Returns a query to get all films tittles.
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
include_once('film_dao.php');
|
||||
include_once('film_dto.php');
|
||||
include_once('../assets/php/form.php');
|
||||
|
||||
class FormFilm extends Form {
|
||||
@ -63,8 +64,10 @@ class FormFilm extends Form {
|
||||
$this->correct =false;
|
||||
}
|
||||
else{
|
||||
$bd->createFilm(null, $tittle,$duration,$language,$description);
|
||||
$resul=$bd->createFilm(null, $tittle,$duration,$language,$description);
|
||||
$resul->free();
|
||||
}
|
||||
$exist->free();
|
||||
}
|
||||
else{
|
||||
$this->correct =false;
|
||||
@ -72,7 +75,7 @@ class FormFilm extends Form {
|
||||
} else if ($option == "del"){
|
||||
//Primero comprobar si existe una pelicula con el mismo id
|
||||
$exist = $bd-> FilmData($id);
|
||||
if( mysqli_num_rows($exist) != 0){
|
||||
if( mysqli_num_rows($exist) == 1){
|
||||
$bd->deleteFilm($id);
|
||||
}
|
||||
else{
|
||||
@ -83,21 +86,28 @@ class FormFilm extends Form {
|
||||
if(!empty($tittle)&&$duration>0&&!empty($language)&&!empty($description)){
|
||||
//comprobar si existe una pelicula con el mismo id
|
||||
$exist = $bd-> FilmData($id);
|
||||
if( mysqli_num_rows($exist) != 0){
|
||||
$bd->editFilm($id,$tittle,$duration,$language,$description);
|
||||
if( mysqli_num_rows($exist) == 1){
|
||||
$resul = $bd->editFilm($id,$tittle,$duration,$language,$description);
|
||||
$resul->free();
|
||||
}
|
||||
else{
|
||||
$this->correct =false;
|
||||
}
|
||||
$exist->free();
|
||||
}
|
||||
else{
|
||||
$this->correct =false;
|
||||
}
|
||||
} else if($this->option == "show") {
|
||||
$this->array = $bd->allFilmData();
|
||||
$resul = $bd->allFilmData();
|
||||
while($fila=mysqli_fetch_assoc($resul)){
|
||||
$this->array = new FilmDTO($fila["id"], $fila["tittle"], $fila["duration"], $fila["language"], $fila["description"]);
|
||||
}
|
||||
$resul->free();
|
||||
}
|
||||
else {$this->correct = false;}
|
||||
}
|
||||
$bd->__destruct();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -41,23 +41,18 @@
|
||||
<!-- Left Sidebar -->
|
||||
<div class="sidebar left">
|
||||
<ul>
|
||||
<li>Funcionalidad:</li>
|
||||
<ul>
|
||||
<li><a href="index.php?state=">Subfuncionalidad </a></li>
|
||||
<li><a href="index.php?state=">Subfuncionalidad</a></li>
|
||||
</ul><br />
|
||||
<li>Ver como:</li>
|
||||
<ul>
|
||||
<li><a href="index.php?state=">Usuario no registrado</a></li>
|
||||
<li><a href="index.php?state=">Usuario registrado</a></li>
|
||||
<li><a href="index.php?state=">Gerente</a></li>
|
||||
<li><a href="index.php?state=un">Usuario no registrado</a></li>
|
||||
<li><a href="index.php?state=ur">Usuario registrado</a></li>
|
||||
<li><a href="index.php?state=ag">Gerente</a></li>
|
||||
</ul><br />
|
||||
<li>Añadir/Editar/Eliminar:</li>
|
||||
<ul>
|
||||
<li><a href="index.php?state=mc">Cines</a></li>
|
||||
<li><a href="index.php?state=mf">Películas</a></li>
|
||||
<li><a href="index.php?state=">Promociones</a></li>
|
||||
<li><a href="index.php?state=">Gerente</a></li>
|
||||
<li><a href="index.php?state=md">Promociones</a></li>
|
||||
<li><a href="index.php?state=mg">Gerente</a></li>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
require('./includes/film_dto.php');
|
||||
require('./includes/formFilm.php');
|
||||
include_once('./includes/film_dto.php');
|
||||
include_once('./includes/formFilm.php');
|
||||
/*$f1 = new FilmDTO(1000,"Los vengadores",183,"español","");
|
||||
$f2 = new FilmDTO(2001,"Mecernarios",140,"español","");
|
||||
$f3 = new FilmDTO(3022,"Monster hunter",104,"español","");
|
||||
|
@ -1,21 +1,30 @@
|
||||
<?php
|
||||
class Panel {
|
||||
public $state;
|
||||
|
||||
function __construct($panel){
|
||||
public $login;
|
||||
function __construct($panel, $login){
|
||||
$this->state = $panel;
|
||||
$this->login= $login;
|
||||
}
|
||||
|
||||
function showPanel() {
|
||||
if($this->login){
|
||||
switch($this->state) {
|
||||
case 'uf': require('updateFilm.php');break;
|
||||
case 'mc': require('manage_cinemas.php'); break;
|
||||
case 'mf': require('manage_films.php'); break;
|
||||
case 'md': require('manage_discounts.php'); break;
|
||||
case 'mm': require('manage_managers.php'); break;
|
||||
case 'uf': require_once('updateFilm.php');break;
|
||||
case 'mc': /*require_once('manage_cinemas.php')*/;echo"<h1>En construcción</h1>"; break;
|
||||
case 'mf': require_once('manage_films.php'); break;
|
||||
case 'md': /*require_once('manage_discounts.php')*/;echo"<h1>En construcción</h1>"; break;
|
||||
case 'mm': /*require_once('manage_managers.php')*/;echo"<h1>En construcción</h1>"; break;
|
||||
case 'un': echo"<h1>En construcción</h1>"; break;
|
||||
case 'ur': echo"<h1>En construcción</h1>";; break;
|
||||
case 'ag': echo"<h1>En construcción</h1>";; break;
|
||||
default: echo "<h1>BIENVENIDO AL PANEL DE ADMINISTRADOR</h1>"; break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<h1>NO TIENES PERMISOS DE ADMINISTRADOR</h1>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
include_once('./includes/film_dto.php');
|
||||
require_once('../assets/php/dao.php');
|
||||
include_once('./includes/formFilm.php');
|
||||
|
||||
if(isset($_POST['edit_film'])) {
|
||||
@ -30,7 +30,6 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>';
|
||||
|
||||
}
|
||||
else if(isset($_POST['delete_film'])) {
|
||||
echo'<div class="column size">
|
||||
|
Loading…
Reference in New Issue
Block a user