From 071bce7b71ac5fe4d0143fb78c2b5d448a86c99d Mon Sep 17 00:00:00 2001 From: marian1010 <79144276+marian1010@users.noreply.github.com> Date: Thu, 29 Apr 2021 10:46:33 +0200 Subject: [PATCH] delete --- panel_admin/includes/film_dao.php | 103 ------------------------------ 1 file changed, 103 deletions(-) delete mode 100644 panel_admin/includes/film_dao.php diff --git a/panel_admin/includes/film_dao.php b/panel_admin/includes/film_dao.php deleted file mode 100644 index 1bb9682..0000000 --- a/panel_admin/includes/film_dao.php +++ /dev/null @@ -1,103 +0,0 @@ -get_prefix(); - include_once($prefix.'assets/php/dao.php'); - - class Film_DAO extends DAO { - - //Constructor: - function __construct($bd_name){ - parent::__construct($bd_name); - } - - //Methods: - - //Create a new Session. - public function createFilm($id, $tittle, $duration, $language,$description){ - $sql = sprintf( "INSERT INTO `film`( `id`, `tittle`, `duration`, `language`,`description`) - VALUES ( '%d', '%s', '%d', '%s','%s')", - $id, $tittle, $duration, $language,$description); - - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - return $resul; - } - //Returns a film data . - public function GetFilm($tittle,$language){ - $sql = sprintf( "SELECT * FROM film WHERE film.tittle = '%s'AND film.language='%s'", $tittle,$language ); - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - return $resul; - } - - //Returns a query to get the film's data. - public function FilmData($id){ - $sql = sprintf( "SELECT * FROM film WHERE id = '%d'", $id ); - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - - return $resul; - } - - //Returns a query to get All the films. - public function allFilmData(){ - $sql = sprintf( "SELECT * FROM film "); - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - - while($fila=$resul->fetch_assoc()){ - $films[] = $this->loadFilm($fila["id"], $fila["tittle"], $fila["duration"], $fila["language"], $fila["description"]); - } - $resul->free(); - return $films; - } - - - //Returns a query to get all films tittles. - public function tittleFilmData(){ - $sql = sprintf( "SELECT DISTINCT tittle FROM film "); - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - - return $resul; - } - - //Returns a query to get all films descriptions. - public function descriptionFilmData(){ - $sql = sprintf( "SELECT description FROM film "); - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - - return $resul; - } - - /* - public function addFilm($films) { - $resul = mysqli_query($this->mysqli, $this->createFilm($film.getId(), $film.getTittle(), $film.getDuration(), $film.getLanguage(), $film.getDescription())) or die ('Error into query database'); - return $resul; - } - */ - - //Deleted film by "id". - public function deleteFilm($id){ - $sql = sprintf( "DELETE FROM film WHERE film.id = '%d' ;",$id); - - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - - return $resul; - } - - //Edit a film. - public function editFilm($id, $tittle, $duration, $language,$description){ - $sql = sprintf( "UPDATE film SET tittle = '%s' , duration = '%d', language ='%s' , description ='%s' - WHERE film.id = '%d';", - $tittle, $duration, $language, $description, $id); - - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - - return $resul; - } - - //Create a new film Data Transfer Object. - public function loadFilm($id, $tittle, $duration, $language,$description){ - return new Film_DTO( $id, $tittle, $duration, $language,$description); - } - - } - -?>