update
This commit is contained in:
parent
530d51a9c9
commit
39a8ef2ff5
@ -8,14 +8,16 @@
|
|||||||
private $_duration; //Film duration.
|
private $_duration; //Film duration.
|
||||||
private $_language; //Film language.
|
private $_language; //Film language.
|
||||||
private $_description; //Film description.
|
private $_description; //Film description.
|
||||||
|
private $_img;
|
||||||
|
|
||||||
//Constructor:
|
//Constructor:
|
||||||
function __construct($id, $tittle, $duration, $language, $description){
|
function __construct($id, $tittle, $duration, $language, $description, $img){
|
||||||
$this->_id = $id;
|
$this->_id = $id;
|
||||||
$this->_tittle = $tittle;
|
$this->_tittle = $tittle;
|
||||||
$this->_duration = $duration;
|
$this->_duration = $duration;
|
||||||
$this->_language = $language;
|
$this->_language = $language;
|
||||||
$this->_description = $description;
|
$this->_description = $description;
|
||||||
|
$this->_img = $img;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Methods:
|
//Methods:
|
||||||
@ -31,5 +33,7 @@
|
|||||||
public function getLanguage(){return $this->_language;}
|
public function getLanguage(){return $this->_language;}
|
||||||
public function setDescription($description){ $this->_description = $description;}
|
public function setDescription($description){ $this->_description = $description;}
|
||||||
public function getDescription(){return $this->_description;}
|
public function getDescription(){return $this->_description;}
|
||||||
|
public function setImg($img){ $this->_img = $img;}
|
||||||
|
public function getImg(){return $this->_img;}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
@ -15,10 +15,10 @@
|
|||||||
//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, $description, $img){
|
||||||
$sql = sprintf( "INSERT INTO `film`( `id`, `tittle`, `duration`, `language`,`description`)
|
$sql = sprintf( "INSERT INTO `film`( `id`, `tittle`, `duration`, `language`,`description`, `img`)
|
||||||
VALUES ( '%d', '%s', '%d', '%s','%s')",
|
VALUES ( '%d', '%s', '%d', '%s','%s', '%s')",
|
||||||
$id, $tittle, $duration, $language, $description);
|
$id, $tittle, $duration, $language, $description, $img);
|
||||||
|
|
||||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||||
return $resul;
|
return $resul;
|
||||||
@ -44,7 +44,7 @@
|
|||||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||||
|
|
||||||
while($fila=$resul->fetch_assoc()){
|
while($fila=$resul->fetch_assoc()){
|
||||||
$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"], $fila["img"]);
|
||||||
}
|
}
|
||||||
$resul->free();
|
$resul->free();
|
||||||
return $films;
|
return $films;
|
||||||
@ -84,10 +84,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Edit a film.
|
//Edit a film.
|
||||||
public function editFilm($id, $tittle, $duration, $language,$description){
|
public function editFilm($id, $tittle, $duration, $language,$description,$img){
|
||||||
$sql = sprintf( "UPDATE film SET tittle = '%s' , duration = '%d', language ='%s' , description ='%s'
|
$sql = sprintf( "UPDATE film SET tittle = '%s' , duration = '%d', language ='%s' , description ='%s', img ='%s'
|
||||||
WHERE film.id = '%d';",
|
WHERE film.id = '%d';",
|
||||||
$tittle, $duration, $language, $description, $id);
|
$tittle, $duration, $language, $description, $img, $id);
|
||||||
|
|
||||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||||
|
|
||||||
@ -95,8 +95,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,$description, $img){
|
||||||
return new Film( $id, $tittle, $duration, $language,$description);
|
return new Film( $id, $tittle, $duration, $language,$description, $img);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user