Add files via upload
This commit is contained in:
parent
b072147e03
commit
da43c0a16a
@ -15,7 +15,7 @@
|
|||||||
public function createRoom($id, $idcinema, $numCol, $numRows){
|
public function createRoom($id, $idcinema, $numCol, $numRows){
|
||||||
|
|
||||||
$sql = sprintf( "INSERT INTO rooms( 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 );
|
$id, $idcinema, $numCol, $numRows );
|
||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
@ -34,6 +34,29 @@
|
|||||||
return new RoomDTO($id, $idcinema, $numCol, $numRows);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@ -31,6 +31,30 @@
|
|||||||
return $resul;
|
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.
|
//Returns a query to check if the session in this cinema, hall and scheudle exists.
|
||||||
public function selectSession($cinema, $hall, $start, $date){
|
public function selectSession($cinema, $hall, $start, $date){
|
||||||
if($start == null){
|
if($start == null){
|
||||||
@ -48,7 +72,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Create a new Session Data Transfer Object.
|
//Create a new Session Data Transfer Object.
|
||||||
public function loadSession( $id, $idfilm, $idhall, $date, $startTime, $seatPrice, $format){
|
public function loadSession( $id, $idfilm, $idhall, $date, $startTime, $seatPrice, $format){
|
||||||
return new SessionDTO( $id, $idfilm, $idhall, $date, $startTime, $seatPrice, $format);
|
return new SessionDTO( $id, $idfilm, $idhall, $date, $startTime, $seatPrice, $format);
|
||||||
|
Loading…
Reference in New Issue
Block a user