From 68860539dacbaf145c9fa5665f3f4cb53dcdc884 Mon Sep 17 00:00:00 2001 From: OscarRui <79144467+OscarRui@users.noreply.github.com> Date: Sun, 11 Apr 2021 19:54:18 +0200 Subject: [PATCH] Add files via upload --- panel_manager/includes/hall_dao.php | 64 +++++++++++++++++++ panel_manager/includes/hall_dto.php | 37 +++++++++++ panel_manager/includes/hall_dto_interface.php | 12 ++++ 3 files changed, 113 insertions(+) create mode 100644 panel_manager/includes/hall_dao.php create mode 100644 panel_manager/includes/hall_dto.php create mode 100644 panel_manager/includes/hall_dto_interface.php diff --git a/panel_manager/includes/hall_dao.php b/panel_manager/includes/hall_dao.php new file mode 100644 index 0000000..941f3a2 --- /dev/null +++ b/panel_manager/includes/hall_dao.php @@ -0,0 +1,64 @@ +mysqli, $sql) or die ('Error into query database'); + + return $resul; + } + + //Create a new Hall Data Transfer Object. + public function loadHall($id, $idcinema, $numCol, $numRows){ + return new HallDTO($id, $idcinema, $numCol, $numRows); + } + + //Edit Hall. + public function editHall($id, $idcinema, $numCol, $numRows){ + + $sql = sprintf( "UPDATE `hall` + SET `numrows` = '%i' , `numcolumns` = '%i' + WHERE `hall`.`number` = '%d' AND `hall`.`idcinema` = '%d';", + $numRows,$numCol,$id, $idcinema ); + + $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); + + return $resul; + } + + //Delete Hall. + public function deleteHall($id, $idcinema){ + + $sql = sprintf( "DELETE FROM `hall` WHERE `hall`.`number` = '%d' AND `hall`.`idcinema` = '%d';",$id,$idcinema); + + $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); + + return $resul; + } + + } + +?> \ No newline at end of file diff --git a/panel_manager/includes/hall_dto.php b/panel_manager/includes/hall_dto.php new file mode 100644 index 0000000..42d6c0e --- /dev/null +++ b/panel_manager/includes/hall_dto.php @@ -0,0 +1,37 @@ +_number = $number; + $this->_idcinema = $idcinema; + $this->_numCol = $numCol; + $this->_numRows = $numRows; + } + + //Methods: + + //Getters && Setters: + public function setNumber($number){ $this->_number = $number; } + public function getNumber(){ return $this->_number; } + + public function setIdcinema($idcinema){ $this->_idcinema = $idcinema; } + public function getIdcinema(){ return $this->_idcinema; } + + public function setNumCol($numCol){ $this->_numCol = $numCol; } + public function getNumCol(){ return $this->_numCol; } + + public function setNumRows($numRows){ $this->_numRows = $numRows; } + public function getNumRows(){ return $this->_numRows; } + + } +?> \ No newline at end of file diff --git a/panel_manager/includes/hall_dto_interface.php b/panel_manager/includes/hall_dto_interface.php new file mode 100644 index 0000000..0489026 --- /dev/null +++ b/panel_manager/includes/hall_dto_interface.php @@ -0,0 +1,12 @@ + \ No newline at end of file