Add files via upload

This commit is contained in:
OscarRui 2021-04-11 19:08:22 +02:00 committed by GitHub
parent b072147e03
commit da43c0a16a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 2 deletions

View File

@ -15,7 +15,7 @@
public function createRoom($id, $idcinema, $numCol, $numRows){
$sql = sprintf( "INSERT INTO rooms( id, idcinema, numCol, numRows)
VALUES ( '%s', '%s', '%i', '%i')",
VALUES ( '%d', '%d', '%i', '%i')",
$id, $idcinema, $numCol, $numRows );
return $sql;
@ -34,6 +34,29 @@
return new RoomDTO($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;
}
}
?>

View File

@ -31,6 +31,30 @@
return $resul;
}
//Edit Session.
public function editSession($id, $idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format){
$sql = sprintf( "UPDATE `session`
SET `idfilm` = '%d' , `idhall` = '%d', `idcinema` = '%d', `date` = '%s',
`start_time` = '%s', `seat_price` = '%d', `format` = '%s'
WHERE `session`.`id` = '%d';",
$idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format, $id);
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
return $resul;
}
//Delete Session.
public function deleteSession($id){
$sql = sprintf( "DELETE FROM `session` WHERE `session`.`id` = '%d'",$id);
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
return $resul;
}
//Returns a query to check if the session in this cinema, hall and scheudle exists.
public function selectSession($cinema, $hall, $start, $date){
if($start == null){
@ -48,7 +72,6 @@
//Create a new Session Data Transfer Object.
public function loadSession( $id, $idfilm, $idhall, $date, $startTime, $seatPrice, $format){
return new SessionDTO( $id, $idfilm, $idhall, $date, $startTime, $seatPrice, $format);