Add files via upload

This commit is contained in:
Daniel Muñoz Garcia 2021-06-02 13:06:50 +02:00 committed by GitHub
parent 85c8313c1a
commit a67e7b9c23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 58 additions and 53 deletions

View File

@ -105,7 +105,9 @@ class formAddManager extends Form{
$html='';
for($i = 0; $i < count($users); $i++){
$html .= '
<input type="radio" name="id" value='.$ids[$i].' > <label> '.$ids[$i].', '.$usernames[$i].', '.$usernames[$key].'
<input type="radio" class="content-input" name="id" value="'.$ids[$i].'" id="'.$ids[$i].'"><label class="efe" for="'.$ids[$i].'"> '.$ids[$i].', '.$usernames[$i].
', '.$usernames[$key].
'
</label>
';
}
@ -129,7 +131,7 @@ class formAddManager extends Form{
$html = '';
for($i = 0; $i < count($cinemas); $i++){
$html.= '
<input type="radio" name="idcinema" value='.$ids[$i].' > <label> '.$ids[$i].', '.$names[$i].'
<input type="radio" class="content-input" name="idcinema" value="'.$ids[$i].'" id="'.$ids[$i].'"><label class="efe" for="'.$ids[$i].'"> '.$ids[$i].', '.$names[$i].'
</label>
';
}

View File

@ -17,7 +17,7 @@ class formDeleteCinema extends Form{
$htmlErroresGlobales = self::generaListaErroresGlobales($errores);
$errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error'));
$html = '<div class="column side"></div>
$html = '
<fieldset id = "cinema_form"><pre>'.$htmlErroresGlobales.'</pre>
<legend>¿Estás seguro de que quieres eliminar este cine?</legend>
<input type="hidden" name="id" value='.$_POST['id'].'/><pre>'.$errorId.'</pre>
@ -28,7 +28,6 @@ class formDeleteCinema extends Form{
<div class="actions">
<input type="submit" id="submit" value="Eliminar" name="delete_cinema" class="primary" />
<input type="submit" id="submit" value="Cancelar" class="primary" />
</div>
</div>';
return $html;
}

View File

@ -23,9 +23,9 @@ class formEditManager extends Form{
$errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error'));
$errorIdCinema = self::createMensajeError($errores, 'idcinema', 'span', array('class' => 'error'));
$html = '<div class="row">
$html = '
<h1>EDITAR GERENTE ID:'.$_POST['id'].'</h1>
<fieldset id="film_form"><pre>'.$htmlErroresGlobales.'</pre>
<fieldset><pre>'.$htmlErroresGlobales.'</pre>
<legend>Selecciona cine.</legend><pre>'.$errorIdCinema.'</pre>
<input type="hidden" name="id" value='.$_POST['id'].'/><pre>'.$errorId.'</pre>'
.$this->showCinemas().
@ -34,7 +34,6 @@ class formEditManager extends Form{
<input type="submit" id="submit" value="Seleccionar" name="edit_manager" class="primary" />
<input type="reset" id="reset" value="Borrar" />
</div>
</div>
</div>';
return $html;
@ -100,7 +99,7 @@ class formEditManager extends Form{
$html = '';
for($i = 0; $i < count($cinemas); $i++){
$html.= '
<input type="radio" name="idcinema" value='.$ids[$i].' > <label> '.$ids[$i].', '.$names[$i].'
<input type="radio" class="content-input" name="idcinema" value="'.$ids[$i].'" id="'.$ids[$i].'"><label class="efe" for="'.$ids[$i].'"> '.$ids[$i].', '.$names[$i].'
</label>
';
}

View File

@ -29,8 +29,7 @@ class formEditPromotion extends Form{
$errorImg = self::createMensajeError($errores, 'img', 'span', array('class' => 'error'));
$html = '<div class="row">
<fieldset id="promotion_form"><pre>'.$htmlErroresGlobales.'</pre>
<fieldset id="film_form">
<fieldset id="film_form"><pre>'.$htmlErroresGlobales.'</pre>
<legend>Datos de promocion</legend>
<input type="hidden" name="id" value='.$_POST['id'].'/>
<input type="text" name="tittle" id="tittle"value="'.$_POST['tittle'].'"required/><pre>'.$errorTittle.'</pre>

View File

@ -17,13 +17,14 @@
}
else {
if(isset($_GET["cinema"])){
// $reply = AdminPanel::showHalls($_GET["cinema"]);
/* if(isset($_GET["number"])) {
$reply = AdminPanel::showHalls($_GET["cinema"], $_GET["number"]);
if(isset($_GET["cinema"])){
if(isset($_GET["number"])) {
$reply = AdminPanel::showSessions($_GET["cinema"]);
}
else { */
else {
$reply = AdminPanel::showHalls($_GET["cinema"]);
//}
}
}
}
else {
$reply=AdminPanel::addCinema();
@ -66,8 +67,8 @@
}
else {
$reply=AdminPanel::showAddBotton();
$reply.=AdminPanel::print_managers();
$reply=AdminPanel::print_managers();
$reply.=AdminPanel::showAddBotton();
};
break;
case 'un':

View File

@ -118,7 +118,7 @@
<li> '. $hall->getNumber().'</li>
<li> '.$hall->getTotalSeats().' </li>
</a>
<a href="?state=mc&cinema='.$idCinema.'number='. $hall->getNumber().'">
<a href="?state=mc&cinema='.$idCinema.'&number=1">
<li> Sesiones </li>
</a>
</div>
@ -135,10 +135,39 @@
}
/* static function showSessions($idCinema, $hallNumber) {
static function showSessions($idCinema){
include_once('../assets/php/includes/hall.php');
include_once('../assets/php/includes/hall_dao.php');
include_once('../assets/php/includes/session_dao.php');
include_once('../assets/php/includes/session.php');
//Base filtering values
$date = $_POST['date'] ?? $_GET['date'] ?? date("Y-m-d");
$hall = $_POST['hall'] ?? $_GET['hall'] ?? "1";
//Session filter
$panel='<div class = "column left">
<form method="post" id="filter" action="?state=mc&cinema=1&number=1">
<input type="date" name="date" value="'.$date.'" min="2021-01-01" max="2031-12-31">
<select name="hall" class="button large">';
foreach(Hall::getListHalls($idCinema) as $hll){
if($hll->getNumber() == $hall){
$panel.= '
<option value="'. $hll->getNumber() .'"selected> Sala '. $hll->getNumber() .'</option> ';
}else{
$panel.= '
<option value="'. $hll->getNumber() .'"> Sala '. $hll->getNumber() .'</option>';
}
}
$panel.='
</select>
<input type="submit" name="filter" value="Filtrar" class="button large"/>
</form>
</div>
';
//Session list
$panel .=' <div class = "column right">';
$sessions = Session::getListSessions($hall,$manager->getIdcinema(),$date);
$sessions = Session::getListSessions($hall,$idCinema,$date);
if($sessions) {
$panel .='
@ -163,19 +192,6 @@
<td> '. str_replace('_', ' ', $film["tittle"]) .' </td>
<td> '.$session->getFormat().' </td>
<td> '.$session->getSeatPrice().' </td>
<form method="post" action="./?state=edit_session">
<input name="film" type="hidden" value="'.$session->getIdfilm().'">
<input name="tittle" type="hidden" value="'.$film["tittle"].'">
<input name="duration" type="hidden" value="'.$film["duration"].'">
<input name="language" type="hidden" value="'.$film["language"].'">
<input name="description" type="hidden" value="'.$film["description"].'">
<input name="hall" type="hidden" value="'.$session->getIdhall().'">
<input name="date" type="hidden" value="'.$session->getDate().'">
<input name="start" type="hidden" value="'.$session->getStartTime().'">
<input name="price" type="hidden" value="'.$session->getSeatPrice().'">
<input name="format" type="hidden" value="'.$session->getFormat().'">
<td> <input type="submit" id="submit" name ="edit_session" value="Editar" class="primary" /> </td>
</form>
</tr>';
}
$panel.='
@ -185,12 +201,10 @@
} else {
$panel.=' <h3> No hay ninguna sesion </h3>';
}
$panel.='
<input type="submit" name="new_session" form="filter" value="Añadir" class="button large" formaction="./?state=new_session">
</div>';
$panel.='</div>';
return $panel;
}*/
}
//Functions MANAGERS
@ -217,8 +231,6 @@
}
$reply= "<div class='row'>
<div class='column side'></div>
<div class='column middle'>
<ul class ='tablelist col7'>
<li class='title'>Id</li>
<li class='title'>IdCinema</li>
@ -258,8 +270,6 @@
$reply.='</ul>
</div>
<div class="column side"></div>
</div>
';
}
return $reply;
@ -295,12 +305,11 @@
$formEM = new formEditManager();
$htmlEForm = $formEM->gestiona();
return $reply= '<!-- EDIT MANAGER -->
<div class="column side"></div>
<div class="column middle">
<h3>EDITAR GERENTE</h3>
'.$htmlEForm.'
</div>
<div class="column side"></div>'."\n";
</div>';
}
static function deleteManager(){
@ -327,8 +336,7 @@
<div class="column middle">
<h3>AÑADIR PROMOCIÓN</h3>
'.$htmlAForm.'
</div>
<div class="column side"></div>'."\n";
</div>';
}
static function editPromotion(){
@ -378,7 +386,6 @@
}
$reply= "<div class='row'>
<div class='column middle'>
<ul class='tablelist col7'>
<li class='title'>Id</li>
<li class='title'>Título</li>
@ -423,8 +430,6 @@
$reply.='</ul>
</div>
<div class="column side"></div>
</div>
';
}
return $reply ;