Add files via upload
This commit is contained in:
@ -84,9 +84,6 @@ class formAddCinema extends Form{
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function test_input($input){
|
||||
return htmlspecialchars(trim(strip_tags($input)));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -33,7 +33,7 @@ class formAddFilm extends Form{
|
||||
<input type="number" name="duration" id="duration" placeholder="Duración" required/><pre>'.$errorDuration.'</pre>
|
||||
<input type="text" name="language" id="language" placeholder="Idioma" required/><pre>'.$errorLanguage.'</pre>
|
||||
<input type="text" name="description" id="description" placeholder="Descripción" required/><pre>'.$errorDescription.'</pre>
|
||||
<input type="file" name="archivo" id="archivo" /><pre>'.$errorImage.'</pre></p>
|
||||
<div class="file">Imagen promocional:<input type="file" name="file" id="file" placeholder="Imagen promocional" /></div><pre>'.$errorImage.'</pre></p>
|
||||
</fieldset>
|
||||
<div class="actions">
|
||||
<input type="submit" id="submit" value="Añadir pelicula" class="primary" />
|
||||
@ -156,10 +156,6 @@ class formAddFilm extends Form{
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function test_input($input){
|
||||
return htmlspecialchars(trim(strip_tags($input)));
|
||||
}
|
||||
|
||||
private function check_file_uploaded_name ($filename) {
|
||||
return (bool) ((mb_ereg_match('/^[0-9A-Z-_\.]+$/i',$filename) === 1) ? true : false );
|
||||
}
|
||||
|
@ -24,13 +24,12 @@ class formAddManager extends Form{
|
||||
$errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error'));
|
||||
$errorIdCinema = self::createMensajeError($errores, 'idcinema', 'span', array('class' => 'error'));
|
||||
|
||||
$html = '<div class="row">
|
||||
<fieldset id="film_form"><pre>'.$htmlErroresGlobales.'</pre>
|
||||
<legend>Selecciona usuario.</legend>'
|
||||
$html = '<fieldset id="film_form"><pre>'.$htmlErroresGlobales.'</pre>
|
||||
<legend>Selecciona usuario.</legend><pre>'.$errorId.'</pre>'
|
||||
.$this->showUsers().
|
||||
'</fieldset>
|
||||
<fieldset>
|
||||
<legend>Selecciona cine.</legend>'
|
||||
<legend>Selecciona cine.</legend><pre>'.$errorIdCinema.'</pre>'
|
||||
.$this->showCinemas().
|
||||
'</fieldset>
|
||||
<div class="actions">
|
||||
@ -38,7 +37,7 @@ class formAddManager extends Form{
|
||||
<input type="reset" id="reset" value="Borrar" />
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
';
|
||||
|
||||
return $html;
|
||||
}
|
||||
@ -53,7 +52,7 @@ class formAddManager extends Form{
|
||||
|
||||
$idcinema = $this->test_input($datos['idcinema']) ?? null;
|
||||
//||!mb_ereg_match(self::HTML5_EMAIL_REGEXP, $duration)
|
||||
if (is_null($idcinema)) {
|
||||
if (empty($idcinema)) {
|
||||
$result['idcinema'] = "ERROR. No existe un cine con ese ID";
|
||||
}
|
||||
|
||||
@ -88,10 +87,6 @@ class formAddManager extends Form{
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function test_input($input){
|
||||
return htmlspecialchars(trim(strip_tags($input)));
|
||||
}
|
||||
|
||||
private function showUsers() {
|
||||
$user = new UserDAO("complucine");
|
||||
$users = $user->allUsersNotM();
|
||||
|
@ -101,10 +101,6 @@ class formAddPromotion extends Form{
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function test_input($input){
|
||||
return htmlspecialchars(trim(strip_tags($input)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,9 +18,9 @@ class formDeleteCinema extends Form{
|
||||
$errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error'));
|
||||
|
||||
$html = '<div class="column side"></div>
|
||||
<fieldset id = "cinema_form">'.$htmlErroresGlobales.'</pre>
|
||||
<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'].'/>
|
||||
<input type="hidden" name="id" value='.$_POST['id'].'/><pre>'.$errorId.'</pre>
|
||||
<p>Name: '.$_POST['name'].' </p>
|
||||
<p>Dirección: '.$_POST['direction'].' </p>
|
||||
<p>Teléfono: '.$_POST['phone'].' </p>
|
||||
@ -70,9 +70,6 @@ class formDeleteCinema extends Form{
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function test_input($input){
|
||||
return htmlspecialchars(trim(strip_tags($input)));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -29,7 +29,7 @@ class formDeleteFilm extends Form{
|
||||
$html = '<div class="row">
|
||||
<fieldset id="film_form"><pre>'.$htmlErroresGlobales.'</pre>
|
||||
<legend>¿Estás seguro de que quieres eliminar esta pelicula?</legend>
|
||||
<input type="hidden" name="id" value='.$_POST['id'].'/>
|
||||
<input type="hidden" name="id" value='.$_POST['id'].'/><pre>'.$errorId.'</pre>
|
||||
<p>Id: '.$_POST['id'].' </p>
|
||||
<p>Título: '.$_POST['tittle'].' </p>
|
||||
<p>Duración: '.$_POST['duration'].' </p>
|
||||
@ -80,10 +80,6 @@ class formDeleteFilm extends Form{
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function test_input($input){
|
||||
return htmlspecialchars(trim(strip_tags($input)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ class formDeleteManager extends Form{
|
||||
|
||||
$html = '<div class="row">
|
||||
<fieldset id="manager_form"><pre>'.$htmlErroresGlobales.'</pre>
|
||||
<legend>¿Estás seguro de que quieres eliminar este gerente?</legend>
|
||||
<legend>¿Estás seguro de que quieres eliminar este gerente?</legend><pre>'.$errorId.'</pre>
|
||||
<input type="hidden" name="id" value='.$_POST['id'].'/>
|
||||
<p>Id: '.$_POST['id'].' </p>
|
||||
<p>IdCinema: '.$_POST['idcinema'].' </p>
|
||||
@ -75,10 +75,6 @@ class formDeleteManager extends Form{
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function test_input($input){
|
||||
return htmlspecialchars(trim(strip_tags($input)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ class formDeletePromotion extends Form{
|
||||
$html = '<div class="row">
|
||||
<fieldset id="promotion_form"><pre>'.$htmlErroresGlobales.'</pre>
|
||||
<legend>¿Estás seguro de que quieres eliminar esta promocion?</legend>
|
||||
<input type="hidden" name="id" value='.$_POST['id'].'/>
|
||||
<input type="hidden" name="id" value='.$_POST['id'].'/><pre>'.$errorId.'</pre>
|
||||
<p>Id: '.$_POST['id'].' </p>
|
||||
<p>Nombre: '.$_POST['tittle'].'</p>
|
||||
<p>Description:'.$_POST['description'].'</p>
|
||||
@ -84,12 +84,6 @@ class formDeletePromotion extends Form{
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function test_input($input){
|
||||
return htmlspecialchars(trim(strip_tags($input)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -93,9 +93,6 @@ class formEditCinema extends Form{
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function test_input($input){
|
||||
return htmlspecialchars(trim(strip_tags($input)));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -88,7 +88,7 @@ class formEditFilm extends Form{
|
||||
$bd = new Film_DAO("complucine");
|
||||
$exist = $bd-> FilmData($id);
|
||||
if( mysqli_num_rows($exist) == 1){
|
||||
$bd->editFilm($id,$tittle,$duration,$language,$description);
|
||||
$bd->editFilm($id, $tittle, $duration, $language, $description, $img = null /* Cambiar cuando se ñaladan las imágenes */);
|
||||
$_SESSION['message'] = "<div class='row'>
|
||||
<div class='column side'></div>
|
||||
<div class='column middle'>
|
||||
@ -110,12 +110,6 @@ class formEditFilm extends Form{
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function test_input($input){
|
||||
return htmlspecialchars(trim(strip_tags($input)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -26,8 +26,8 @@ class formEditManager extends Form{
|
||||
$html = '<div class="row">
|
||||
<h1>EDITAR GERENTE ID:'.$_POST['id'].'</h1>
|
||||
<fieldset id="film_form"><pre>'.$htmlErroresGlobales.'</pre>
|
||||
<legend>Selecciona cine.</legend>
|
||||
<input type="hidden" name="id" value='.$_POST['id'].'/>'
|
||||
<legend>Selecciona cine.</legend><pre>'.$errorIdCinema.'</pre>
|
||||
<input type="hidden" name="id" value='.$_POST['id'].'/><pre>'.$errorId.'</pre>'
|
||||
.$this->showCinemas().
|
||||
'</fieldset>
|
||||
<div class="actions">
|
||||
@ -83,11 +83,6 @@ class formEditManager extends Form{
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function test_input($input){
|
||||
return htmlspecialchars(trim(strip_tags($input)));
|
||||
}
|
||||
|
||||
|
||||
private function showCinemas() {
|
||||
$cine = new Cinema_DAO("complucine");
|
||||
$cinemas = $cine->allCinemaData();
|
||||
|
@ -109,10 +109,6 @@ class formEditPromotion extends Form{
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function test_input($input){
|
||||
return htmlspecialchars(trim(strip_tags($input)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
class Panel {
|
||||
private $state;
|
||||
private $login;
|
||||
private $prefix;
|
||||
|
||||
function __construct($panel, $login){
|
||||
$this->state = $panel;
|
||||
@ -9,6 +10,7 @@
|
||||
}
|
||||
|
||||
function showPanel($template) {
|
||||
$this->prefix = $template->get_prefix();
|
||||
if($this->login){
|
||||
switch($this->state) {
|
||||
case 'mc': if(isset($_POST['edit_cinema'])) {
|
||||
@ -62,14 +64,25 @@
|
||||
$this->print_managers();
|
||||
};
|
||||
break;
|
||||
case 'un': echo"<h1>En construcción</h1>"; break;
|
||||
case 'ur': echo"<h1>En construcción</h1>";; break;
|
||||
case 'ag': echo"<h1>En construcción</h1>";; break;
|
||||
default: echo "<h1>BIENVENIDO AL PANEL DE ADMINISTRADOR</h1>"; break;
|
||||
case 'un': echo"<div class='code info'><h1>En construcción</h1><hr /></div>"; break;
|
||||
case 'ur': echo"<div class='code info'><h1>En construcción</h1><hr /></div>"; break;
|
||||
case 'ag': echo"<div class='code info'><h1>En construcción</h1><hr /></div>"; break;
|
||||
default: echo '<div class="code info">
|
||||
<h1>Bienvenido al Panel de Administrador.</h1>
|
||||
<hr />
|
||||
</div>'."\n"; break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<h1>NO TIENES PERMISOS DE ADMINISTRADOR</h1>";
|
||||
echo '<div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<div class="code info">
|
||||
<h1>No tienes permiso de administrador.</h1><hr />
|
||||
<p>Inicia Sesión con una cuenta de administtación.</p>
|
||||
<a href="'.$this->prefix.'login/"><button>Iniciar Sesión</button></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column side"></div>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,20 +179,20 @@
|
||||
}
|
||||
}
|
||||
echo "<div class='row'>
|
||||
<div class='column side'></div>
|
||||
<div class='column middle'>
|
||||
<table class='alt'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>IdCinema</th>
|
||||
<th>Nombre</th>
|
||||
<th>Email</th>
|
||||
<th>Rol</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
";
|
||||
<div class='column side'></div>
|
||||
<div class='column middle'>
|
||||
<table class='alt'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>IdCinema</th>
|
||||
<th>Nombre</th>
|
||||
<th>Email</th>
|
||||
<th>Rol</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
";
|
||||
if(is_array($managers)){
|
||||
for($i = 0; $i < count($managers); $i++){
|
||||
echo '<tr>
|
||||
@ -213,10 +226,11 @@
|
||||
</table>
|
||||
</div>
|
||||
<div class="column side"></div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
function showAddBotton() {
|
||||
echo'<div class="column side"></div>
|
||||
echo' <div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<h2>Añadir gerente</h2>
|
||||
<form method="post" action="index.php?state=mg">
|
||||
@ -225,29 +239,33 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>';
|
||||
<div class="column side"></div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
function addManager(){
|
||||
include_once('./includes/formAddManager.php');
|
||||
$formAM = new formAddManager();
|
||||
$htmlAForm = $formAM->gestiona();
|
||||
echo '<!-- ADD MANAGER -->
|
||||
<div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<h3>AÑADIR GERENTE</h3>
|
||||
'.$htmlAForm.'
|
||||
</div>'."\n";
|
||||
</div>
|
||||
<div class="column side"></div>'."\n";
|
||||
}
|
||||
function editManager(){
|
||||
include_once('./includes/formEditManager.php');
|
||||
$formEM = new formEditManager();
|
||||
$htmlEForm = $formEM->gestiona();
|
||||
echo '<!-- EDIT MANAGER -->
|
||||
<div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<h3>EDITAR GERENTE</h3>
|
||||
'.$htmlEForm.'
|
||||
</div>'."\n";
|
||||
</div>
|
||||
<div class="column side"></div>'."\n";
|
||||
}
|
||||
|
||||
function deleteManager(){
|
||||
@ -255,11 +273,12 @@
|
||||
$formDM = new formDeleteManager();
|
||||
$htmlDForm = $formDM->gestiona();
|
||||
echo '<!-- DELETE MANAGER -->
|
||||
<div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<h3>ELIMINAR GERENTE</h3>
|
||||
'.$htmlDForm.'
|
||||
</div>'."\n";
|
||||
</div>
|
||||
<div class="column side"></div>'."\n";
|
||||
}
|
||||
|
||||
|
||||
@ -269,22 +288,24 @@
|
||||
$formAP = new formAddPromotion();
|
||||
$htmlAForm = $formAP->gestiona();
|
||||
echo '<!-- ADD PROMOTION -->
|
||||
<div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<h3>AÑADIR PROMOCIÓN</h3>
|
||||
'.$htmlAForm.'
|
||||
</div>'."\n";
|
||||
</div>
|
||||
<div class="column side"></div>'."\n";
|
||||
}
|
||||
function editPromotion(){
|
||||
include_once('./includes/formEditPromotion.php');
|
||||
$formEP = new formEditPromotion();
|
||||
$htmlEForm = $formEP->gestiona();
|
||||
echo '<!-- EDIT MANAGER -->
|
||||
<div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<h3>EDITAR PROMOCIÓN</h3>
|
||||
'.$htmlEForm.'
|
||||
</div>'."\n";
|
||||
</div>
|
||||
<div class="column side"></div>'."\n";
|
||||
}
|
||||
|
||||
function deletePromotion(){
|
||||
@ -318,8 +339,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
echo "<div class='row'>
|
||||
<div class='column side'></div>
|
||||
echo "
|
||||
<div class='column middle'>
|
||||
<table class='alt'>
|
||||
<thead>
|
||||
@ -368,7 +388,7 @@
|
||||
echo'</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="column side"></div>
|
||||
<div class="column side"></div>
|
||||
';
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user