Add files via upload

This commit is contained in:
Fernando Méndez 2021-04-30 20:49:21 +02:00 committed by GitHub
parent a873ead5db
commit 22c329bb5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 289 additions and 85 deletions

View File

@ -0,0 +1,37 @@
<?php
include_once('film_dto_interface.php');
class Film_DTO implements FilmDTO {
//Attributes:
private $_id; //Film ID.
private $_tittle; //Film tittle.
private $_duration; //Film duration.
private $_language; //Film language.
private $_description; //Film description.
//Constructor:
function __construct($id, $tittle, $duration, $language, $description){
$this->_id = $id;
$this->_tittle = $tittle;
$this->_duration = $duration;
$this->_language = $language;
$this->_description = $description;
}
//Methods:
//Getters && Setters:
public function setId($id){ $this->_id = $id; }
public function getId(){ return $this->_id; }
public function setTittle($tittle) {$this->_tittle = $tittle; }
public function getTittle(){return $this->_tittle;}
public function setDuration($duration){$this->_duration = $duration; }
public function getDuration() {return $this->_duration;}
public function setLanguage($language) {$this->_language = $language; }
public function getLanguage(){return $this->_language;}
public function setDescription($description){ $this->_description = $description;}
public function getDescription(){return $this->_description;}
}
?>

View File

@ -0,0 +1,14 @@
<?php
interface FilmDTO {
public function setId($id);
public function getId();
public function setTittle($tittle);
public function getTittle();
public function setDuration($duration);
public function getDuration();
public function setLanguage($language);
public function getLanguage();
public function setDescription($description);
public function getDescription();
}
?>

View File

@ -1,6 +1,6 @@
<?php <?php
require_once('../assets/php/dao.php'); require_once('../assets/php/dao.php');
include_once('../panel_manager/includes/hall.php'); include_once('hall_dto.php');
class HallDAO extends DAO { class HallDAO extends DAO {
@ -42,7 +42,7 @@
//Create a new Hall Data Transfer Object. //Create a new Hall Data Transfer Object.
public function loadHall($number, $idcinema, $numrows, $numcolumns){ public function loadHall($number, $idcinema, $numrows, $numcolumns){
return new Hall($number, $idcinema, $numrows, $numcolumns); return new HallDTO($number, $idcinema, $numrows, $numcolumns);
} }
//Edit Hall. //Edit Hall.

View File

@ -0,0 +1,38 @@
<?php
include_once('hall_dto_interface.php');
class HallDTO implements HallsDTO {
//Attributes:
private $_number; //Room number.
private $_idcinema; //Cinema Id
private $_numRows; //Num rows.
private $_numCol; //Num columns.
//Constructor:
function __construct($number, $idcinema, $numRows, $numCol){
$this->_number = $number;
$this->_idcinema = $idcinema;
$this->_numRows = $numRows;
$this->_numCol = $numCol;
}
//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 setNumRows($numRows){ $this->_numRows = $numRows; }
public function getNumRows(){ return $this->_numRows; }
public function setNumCol($numCol){ $this->_numCol = $numCol; }
public function getNumCol(){ return $this->_numCol; }
}
?>

View File

@ -0,0 +1,12 @@
<?php
interface HallsDTO {
public function setNumber($number);
public function getNumber();
public function setIdcinema($idcinema);
public function getIdcinema();
public function setNumCol($numCol);
public function getNumCol();
public function setNumRows($numRows);
public function getNumRows();
}
?>

View File

@ -1,6 +1,6 @@
<?php <?php
require_once('../assets/php/dao.php'); require_once('../assets/php/dao.php');
include_once('../panel_manager/includes/session.php'); include_once('session_dto.php');
class SessionDAO extends DAO { class SessionDAO extends DAO {
//Constructor: //Constructor:
@ -98,7 +98,7 @@
//Create a new Session Data Transfer Object. //Create a new Session Data Transfer Object.
public function loadSession( $id, $idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format){ public function loadSession( $id, $idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format){
return new Session( $id, $idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format); return new SessionDTO( $id, $idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format);
} }
} }

View File

@ -0,0 +1,56 @@
<?php
include_once('session_dto_interface.php');
class SessionDTO implements SessionsDTO {
//Attributes:
private $_id;
private $_idfilm;
private $_idhall;
private $_idcinema;
private $_date;
private $_startTime;
private $_seatPrice;
private $_format;
//Constructor:
function __construct($id, $idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format){
$this->_id = $id;
$this->_idfilm = $idfilm;
$this->_idhall = $idhall;
$this->_idcinema = $idcinema;
$this->_date = $date;
$this->_startTime = $startTime;
$this->_seatPrice = $seatPrice;
$this->_format = $format;
}
//Methods:
//Getters && Setters:
public function setId($id){ $this->_id = $id; }
public function getId(){ return $this->_id; }
public function setIdfilm($idfilm){ $this->_idfilm = $idfilm; }
public function getIdfilm(){ return $this->_idfilm; }
public function setIdhall($idhall){ $this->_idhall = $idhall; }
public function getIdhall(){ return $this->_idhall; }
public function setIdcinema($cinema){ $this->_idcinema = $idcinema; }
public function getIdcinema(){ return $this->_idcinema; }
public function setDate($date){ $this->_date = $date; }
public function getDate(){ return $this->_date; }
public function setStartTime($startTime){ $this->_startTime = $startTime; }
public function getStartTime(){ return $this->_startTime; }
public function setSeatPrice($seatPrice){ $this->_seatPrice = $seatPrice; }
public function getSeatPrice(){ return $this->_seatPrice; }
public function setFormat($format){ $this->_format = $format; }
public function getFormat(){ return $this->_format; }
}
?>

View File

@ -0,0 +1,20 @@
<?php
interface SessionsDTO {
public function setId($id);
public function getId();
public function setIdfilm($idfilm);
public function getIdfilm();
public function setIdhall($film);
public function getIdhall();
public function setIdcinema($cinema);
public function getIdcinema();
public function setDate($date);
public function getDate();
public function setStartTime($startTime);
public function getStartTime();
public function setSeatPrice($seatPrice);
public function getSeatPrice();
public function setFormat($format);
public function getFormat();
}
?>

View File

@ -101,7 +101,7 @@
<a href='{$prefix}cinemas/'><li>Nuestros Cines</li></a> <a href='{$prefix}cinemas/'><li>Nuestros Cines</li></a>
<a href='{$prefix}fdicines/miembros/'><li>Quiénes somos</li></a> <a href='{$prefix}fdicines/miembros/'><li>Quiénes somos</li></a>
<a href='{$prefix}contacto/'><li>Contacto</li></a> <a href='{$prefix}contacto/'><li>Contacto</li></a>
<ul> </ul>
</li> </li>
</nav> </nav>
</div> </div>
@ -157,6 +157,75 @@
</div>\n"; </div>\n";
} }
//Print panel menu:
function print_panelMenu($panel){
$prefix = $this->prefix;
$menus = array("<a href='{$prefix}'><li>Panel Principal</li></a>");
switch($panel){
case "admin": array_push($menus, "<li>Ver como...
<ul>
<a href='./?state=un'><li>Usuario</li></a>
<a href='./?state=ur'><li>Usuario registrado</li></a>
<a href='./?state=ag'><li>Gerente</li></a>
</ul>
</li>");
array_push($menus, "<li>Modificar
<ul>
<a href='./?state=mc'><li>Cines</li></a>
<a href='./?state=mf'><li>Películas</li></a>
<a href='./?state=md'><li>Promociones</li></a>
<a href='./?state=mg'><li>Gerentes</li></a>
</ul>
</li>");
break;
case "manager": array_push($menus, "<li>Ver como...
<ul>
<a href='./?state=us_u'><li>Usuario</li></a>
<a href='./?state=us_r'><li>Usuario registrado</li></a>
</ul>
</li>");
array_push($menus, "<li>Modificar
<ul>
<a href='./?state=rooms'><li>Salas</li></a>
<a href='./?state=sessions'><li>Sesiones</li></a>
</ul>
</li>");
break;
case "user": array_push($menus, "<a href='{$prefix}'><li>Historial Compras</li></a>");
array_push($menus, "<a href='{$prefix}'><li>Datos Pago</li></a>");
array_push($menus, "<a href='{$prefix}'><li>Contraseña</li></a>");
array_push($menus, "<a href='{$prefix}'><li>Eliminar Usuario</li></a>");
break;
default: $menus = array(); break;
}
/*
<li>Menú
<ul>
<a href='{$prefix}'><li>Inicio</li></a>
<a href='{$prefix}showtimes/'><li>Cartelera</li></a>
<a href='{$prefix}cinemas/'><li>Nuestros Cines</li></a>
<a href='{$prefix}fdicines/miembros/'><li>Quiénes somos</li></a>
<a href='{$prefix}contacto/'><li>Contacto</li></a>
<ul>
</li>
*/
echo"<div class='header sub'>
<div class='menu'>
<nav>";
foreach($menus as $value){
echo $value;
}
echo"</nav>
</div>
</div>\n";
}
//Print session MSG: //Print session MSG:
function print_msg() { function print_msg() {
if(isset($_SESSION['message'])){ if(isset($_SESSION['message'])){

View File

@ -261,12 +261,12 @@
<tr> <tr>
<td>Práctica 2</td> <td>Práctica 2</td>
<td>15 de Abril de 2021</td> <td>15 de Abril de 2021</td>
<td>EN PROCESO</td> <td>ENTREGADO</td>
</tr> </tr>
<tr> <tr>
<td>Práctica 3</td> <td>Práctica 3</td>
<td>7 de Mayo de 2021</td> <td>7 de Mayo de 2021</td>
<td>PENDIENTE</td> <td>EN PROCESO</td>
</tr> </tr>
<tr> <tr>
<td>Entrega Final</td> <td>Entrega Final</td>

View File

@ -39,37 +39,18 @@
<!-- Panel --> <!-- Panel -->
<div class="row"> <div class="row">
<!-- Left Sidebar --> <!-- Panel Menu -->
<div class="sidebar left"> <?php
<ul> $template->print_panelMenu("admin");
<li>Ver como:</li> ?>
<ul>
<li><a href="index.php?state=un">Usuario no registrado</a></li>
<li><a href="index.php?state=ur">Usuario registrado</a></li>
<li><a href="index.php?state=ag">Gerente</a></li>
</ul><br />
<li>Añadir/Editar/Eliminar:</li>
<ul>
<li><a href="index.php?state=mc">Cines</a></li>
<li><a href="index.php?state=mf">Películas</a></li>
<li><a href="index.php?state=md">Promociones</a></li>
<li><a href="index.php?state=mg">Gerente</a></li>
</ul>
</ul>
</div>
<!-- Contents --> <!-- Contents -->
<div class="row"> <div class="row">
<div class="column side"></div> <?php
<div class="column middle"> $template->print_msg();
<?php $panel->showPanel();
$template->print_msg(); ?>
$panel->showPanel();
?>
</div>
<div class="column side"></div>
</div>
</div> </div>
</div>
<!-- Footer --> <!-- Footer -->
<?php <?php
$template->print_footer(); $template->print_footer();

View File

@ -17,7 +17,7 @@
$film->processesForm(null, null, null, null, null, "show"); $film->processesForm(null, null, null, null, null, "show");
function drawFilms($films){ function drawFilms($films){
echo " echo "<div class='column left'>
<table class='alt'> <table class='alt'>
<thead> <thead>
<tr> <tr>
@ -60,10 +60,11 @@
</tr>'; </tr>';
} }
echo'<tbody> echo'<tbody>
</table>'; </table>
</div>';
} }
function addFilm(){ function addFilm(){
echo'<div class="column size"> echo'<div class="column right">
<h2>Añadir pelicula</h2> <h2>Añadir pelicula</h2>
<form method="post" action="update_film.php"> <form method="post" action="update_film.php">
<div class="row"> <div class="row">

View File

@ -1,5 +1,9 @@
<div class="column side"></div>
<div class="column middle"> <div class="column middle">
<h1> Bienvenido al panel de Gerente </h1> <div class="code info">
<br> <h1> Bienvenido al panel de Gerente </h1>
<p> Espero que este pasando un buen dia <p> <br>
<p> Espero que este pasando un buen dia <p>
</div>
</div> </div>
<div class="column side"></div>

View File

@ -38,22 +38,11 @@
<!-- Panel --> <!-- Panel -->
<div class="row"> <div class="row">
<!--Left Sidebar --> <!-- Panel Menu -->
<div class="sidebar left"> <?php
<ul> $template->print_panelMenu("manager");
<li>Ver como:</li> ?>
<ul> <!--Contents -->
<li><a href='./?state=us_u'>Usuario no registrado</a></li>
<li><a href='./?state=us_r'>Usuario registrado</a></li>
</ul><br />
<li>Añadir/Editar/Eliminar:</li>
<ul>
<li><a href='./?state=rooms'>Salas</a></li>
<li><a href='./?state=sessions'>Sesiones</a></li>
</ul>
</ul>
</div>
<!--Contents -->
<div class="row"> <div class="row">
<?php $panel->showPanel(); ?> <?php $panel->showPanel(); ?>
</div> </div>

View File

@ -8,7 +8,8 @@
$rooms = array($r1, $r2, $r3, $r4); $rooms = array($r1, $r2, $r3, $r4);
function drawHalls($ros){ function drawHalls($ros){
echo " <p> Esta vista esta en desarrollo <p> echo " <div class='column side'></div>
<p> Esta vista esta en desarrollo <p>
<div class=\"column middle\"> <div class=\"column middle\">
<table class='alt'> <table class='alt'>
<thead> <thead>
@ -28,7 +29,8 @@
echo "<tbody> echo "<tbody>
</table>\n"; </table>\n";
echo "<a href=\"index.php?state=rooms\" class='button large'>Añadir</a> echo "<a href=\"index.php?state=rooms\" class='button large'>Añadir</a>
</div>"; </div>
<div class='column side'></div>";
} }
drawHalls($rooms); drawHalls($rooms);
?> ?>

View File

@ -29,7 +29,7 @@
echo" echo"
<!--Session Filter --> <!--Session Filter -->
<div class = \"column middle\"> <div class = \"column left\">
<form method=\"post\" id=\"addfilter\"> <form method=\"post\" id=\"addfilter\">
<input type=\"date\" name=\"date\" value=\"". $placeholder_date . "\" min=\"2021-01-01\" max=\"2031-12-31\"> <input type=\"date\" name=\"date\" value=\"". $placeholder_date . "\" min=\"2021-01-01\" max=\"2031-12-31\">
<select name=\"hall\" class=\"button large\">"; <select name=\"hall\" class=\"button large\">";
@ -53,7 +53,7 @@
function drawSessions($sessions,$bd){ function drawSessions($sessions,$bd){
echo " echo "
<!--Session List --> <!--Session List -->
<div class=\"column side\"> <div class=\"column right\">
<table class='alt'> <table class='alt'>
<thead> <thead>
<tr> <tr>

View File

@ -28,29 +28,10 @@
<!-- Panel --> <!-- Panel -->
<div class="row"> <div class="row">
<!-- Left Sidebar --> <!-- Panel Menu -->
<div class="sidebar left"> <?php
<ul> $template->print_panelMenu("user");
<li>Funcionalidad:</li> ?>
<ul>
<li>Subfuncionalidad</li>
<li>Subfuncionalidad</li>
</ul><br />
<li>Ver como:</li>
<ul>
<li>Usuario no registrado</li>
<li>Usuario registrado</li>
<li>Gerente</li>
</ul><br />
<li>Añadir/Editar/Eliminar:</li>
<ul>
<li>Cines</li>
<li>Películas</li>
<li>Promociones</li>
<li>Gerente</li>
</ul>
</ul>
</div>
<!-- Contents --> <!-- Contents -->
<div class="row"> <div class="row">
<div class="column side"></div> <div class="column side"></div>