From 27d651223cd6f82d5bbf2fd959c9155bc161b7d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Mon, 3 May 2021 01:19:08 +0200 Subject: [PATCH] Delete cinema_dao.php --- panel_admin/includes/cinema_dao.php | 66 ----------------------------- 1 file changed, 66 deletions(-) delete mode 100644 panel_admin/includes/cinema_dao.php diff --git a/panel_admin/includes/cinema_dao.php b/panel_admin/includes/cinema_dao.php deleted file mode 100644 index 966f6f2..0000000 --- a/panel_admin/includes/cinema_dao.php +++ /dev/null @@ -1,66 +0,0 @@ -get_prefix(); - include_once($prefix.'assets/php/dao.php'); - - class Cinema_DAO extends DAO { - - //Constructor: - function __construct($bd_name){ - parent::__construct($bd_name); - } - - //Methods: - - //Create a new Session. - public function createCinema($id, $name, $direction, $phone){ - $sql = sprintf( "INSERT INTO `cinema`( `id`, `name`, `direction`, `phone`) - VALUES ( '%d', '%s', '%s', '%s')", - $id, $name, $direction, $phone); - - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - return $resul; - } - - - //Returns a query to get All the films. - public function allCinemaData(){ - $sql = sprintf( "SELECT * FROM cinema "); - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - - while($fila=$resul->fetch_assoc()){ - $films[] = $this->loadCinema($fila["id"], $fila["name"], $fila["direction"], $fila["phone"]); - } - $resul->free(); - return $films; - } - - //Deleted film by "id". - public function deleteCinema($id){ - $sql = sprintf( "DELETE FROM cinema WHERE cinema.id = '%d' ;",$id); - - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - - return $resul; - } - - //Edit a film. - public function editCinema($id, $name, $direction, $phone){ - $sql = sprintf( "UPDATE cinema SET name = '%s' , direction = '%s', phone ='%s' - WHERE cinema.id = '%d';", - $name, $direction, $phone, $id); - - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - - return $resul; - } - - //Create a new film Data Transfer Object. - public function loadCinema($id, $name, $direction, $phone){ - return new Cinema($id, $name, $direction, $phone); - } - - } - -?>