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