From 1f6cd81724585465f74f1d8b607fc4905b92f1e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mu=C3=B1oz=20Garcia?= <73303506+danimu03@users.noreply.github.com> Date: Fri, 4 Jun 2021 09:14:36 +0200 Subject: [PATCH] updates --- assets/php/includes/cinema_dao.php | 1 + assets/php/includes/film_dao.php | 1 + assets/php/includes/promotion_dao.php | 13 +++++++------ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/assets/php/includes/cinema_dao.php b/assets/php/includes/cinema_dao.php index b590fa2..c97d96a 100644 --- a/assets/php/includes/cinema_dao.php +++ b/assets/php/includes/cinema_dao.php @@ -57,6 +57,7 @@ return $cinema; } + //Returns if exist a cinema with that id public function existCinema($id){ $id = $this->mysqli->real_escape_string($id); diff --git a/assets/php/includes/film_dao.php b/assets/php/includes/film_dao.php index 45d433b..6cdae93 100644 --- a/assets/php/includes/film_dao.php +++ b/assets/php/includes/film_dao.php @@ -47,6 +47,7 @@ return $film; } + //Returns if exist a Film with this id public function existFilm($id){ $id = $this->mysqli->real_escape_string($id); diff --git a/assets/php/includes/promotion_dao.php b/assets/php/includes/promotion_dao.php index 8bcec14..7c0b510 100644 --- a/assets/php/includes/promotion_dao.php +++ b/assets/php/includes/promotion_dao.php @@ -21,7 +21,7 @@ } - //Returns a query to get All the films. + //Returns a query to get All the promotion. public function allPromotionData(){ $sql = sprintf( "SELECT * FROM promotion "); $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); @@ -33,21 +33,21 @@ return $promotions; } - //Returns a film data . + //Returns a promotion data by code. public function GetPromotion($code){ $sql = sprintf( "SELECT * FROM promotion WHERE promotion.code = '%s'", $code ); $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); return $resul; } - //Returns a film data . + //Returns a promotion data by id. public function promotionData($id){ $sql = sprintf( "SELECT * FROM promotion WHERE promotion.id = '%d'", $id); $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); return $resul; } - //Deleted film by "id". + //Deleted promotion by "id". public function deletePromotion($id){ $sql = sprintf( "DELETE FROM promotion WHERE promotion.id = '%d' ;",$id); @@ -56,7 +56,7 @@ return $resul; } - //Edit a film. + //Edit a promotion with new img. public function editPromotion($id, $tittle, $description, $code, $active, $img){ $sql = sprintf( "UPDATE promotion SET tittle = '%s' , description = '%s', code ='%s' , active ='%s', img = '%s' WHERE promotion.id = '%d';", @@ -67,6 +67,7 @@ return $resul; } + //Edit a promotion without new img. public function editPromotionNoImg($id, $tittle, $description, $code, $active){ $sql = sprintf( "UPDATE promotion SET tittle = '%s' , description = '%s', code ='%s' , active ='%s' WHERE promotion.id = '%d';", @@ -77,7 +78,7 @@ return $resul; } - //Returns a film data . + //Returns a promotion data as object. public function GetPromotionObj($code){ $sql = sprintf( "SELECT * FROM promotion WHERE promotion.code = '%s'", $code ); $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');