parent
75e56e378f
commit
6d7795563e
@ -20,7 +20,7 @@
|
|||||||
<input type="text" name="language" id="language" value='.$_REQUEST['language'].' />
|
<input type="text" name="language" id="language" value='.$_REQUEST['language'].' />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<input type="text" name="description" id="description" value="'.$_REQUEST['description'].'"/>
|
<input type="text" name="description" id="description" value='.$_REQUEST['description'].'/>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('../assets/php/dao.php');
|
require_once($prefix.'assets/php/dao.php');
|
||||||
include_once('film_dto.php');
|
include_once('film_dto.php');
|
||||||
|
|
||||||
class Film_DAO extends DAO {
|
class Film_DAO extends DAO {
|
||||||
@ -12,11 +12,11 @@
|
|||||||
//Methods:
|
//Methods:
|
||||||
|
|
||||||
//Create a new Session.
|
//Create a new Session.
|
||||||
public function createFilm($id, $tittle, $duration, $language,$description){
|
public function createFilm($id, $tittle, $duration, $language){
|
||||||
|
|
||||||
$sql = sprintf( "INSERT INTO `film`( `id`, `tittle`, `duration`, `language`,`description`)
|
$sql = sprintf( "INSERT INTO film( $id, $tittle, $duration, $language)
|
||||||
VALUES ( '%d', '%s', '%d', '%s','%s')",
|
VALUES ( '%d', '%s', '%d', '%s')",
|
||||||
$id, $tittle, $duration, $language,$description);
|
$id, $tittle, $duration, $language);
|
||||||
|
|
||||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||||
|
|
||||||
@ -40,7 +40,7 @@
|
|||||||
$films[] = $this->loadFilm($fila["id"], $fila["tittle"], $fila["duration"], $fila["language"], $fila["description"]);
|
$films[] = $this->loadFilm($fila["id"], $fila["tittle"], $fila["duration"], $fila["language"], $fila["description"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $films;
|
return $resul;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Returns a query to get all films tittles.
|
//Returns a query to get all films tittles.
|
||||||
@ -87,8 +87,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Create a new film Data Transfer Object.
|
//Create a new film Data Transfer Object.
|
||||||
public function loadFilm($id, $tittle, $duration, $language,$description){
|
public function loadFilm($id, $tittle, $duration, $language){
|
||||||
return new Film_DTO( $id, $tittle, $duration, $language,$description);
|
return new FilmDTO( $id, $tittle, $duration, $language);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ class FormFilm extends Form {
|
|||||||
|
|
||||||
//Habria que validar todo para que encaje en la base de datos
|
//Habria que validar todo para que encaje en la base de datos
|
||||||
|
|
||||||
$bd = new Film_DAO('complucine');
|
$bd = new FilmDAO('complucine');
|
||||||
if($bd ){
|
if($bd ){
|
||||||
if($option == "new"){
|
if($option == "new"){
|
||||||
$bd->createFilm(null, $title,$duration,$languaje,$description);
|
$bd->createFilm(null, $title,$duration,$languaje,$description);
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
require_once('../panel_admin/panelAdmin.php');
|
require_once('../panel_admin/panelAdmin.php');
|
||||||
$template = new Template();
|
$template = new Template();
|
||||||
|
|
||||||
if(isset($_SESSION["login"]) && $_SESSION["rol"] == "admin") $login = true;
|
|
||||||
|
|
||||||
if(isset($_REQUEST['state'])) {
|
if(isset($_REQUEST['state'])) {
|
||||||
$panel = new Panel($_REQUEST['state']);
|
$panel = new Panel($_REQUEST['state']);
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
</table>';
|
</table>';
|
||||||
}
|
}
|
||||||
function addFilm(){
|
function addFilm(){
|
||||||
echo'<div class="column left">
|
echo'<div class="column size">
|
||||||
<h2>Añadir pelicula</h2>
|
<h2>Añadir pelicula</h2>
|
||||||
<form method="post" action="add_film.php">
|
<form method="post" action="add_film.php">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
Loading…
Reference in New Issue
Block a user