From ff7c9d103dfff750477a9af9c589ff752c1e830a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Tue, 8 Jun 2021 15:10:08 +0200 Subject: [PATCH] Add files via upload --- panel_admin/includes/formAddCinema.php | 2 +- panel_admin/includes/formAddFilm.php | 2 +- panel_admin/includes/formAddManager.php | 2 +- panel_admin/includes/formAddPromotion.php | 2 +- panel_admin/includes/formDeleteCinema.php | 2 +- panel_admin/includes/formDeleteFilm.php | 2 +- panel_admin/includes/formDeleteManager.php | 2 +- panel_admin/includes/formDeletePromotion.php | 2 +- panel_admin/includes/formEditCinema.php | 2 +- panel_admin/includes/formEditFilm.php | 4 +-- panel_admin/includes/formEditManager.php | 4 +-- panel_admin/includes/formEditPromotion.php | 2 +- panel_admin/index.php | 32 +++++++++++--------- 13 files changed, 32 insertions(+), 28 deletions(-) diff --git a/panel_admin/includes/formAddCinema.php b/panel_admin/includes/formAddCinema.php index a33ad50..65620aa 100644 --- a/panel_admin/includes/formAddCinema.php +++ b/panel_admin/includes/formAddCinema.php @@ -8,7 +8,7 @@ include_once('../assets/php/form.php'); class formAddCinema extends Form{ public function __construct(){ - $op = array("action"=>"./?state=mc&option=a"); + $op = array("action"=>"./?state=mc"); parent::__construct('formAddCinema',$op); } diff --git a/panel_admin/includes/formAddFilm.php b/panel_admin/includes/formAddFilm.php index 748febe..cc2ac35 100644 --- a/panel_admin/includes/formAddFilm.php +++ b/panel_admin/includes/formAddFilm.php @@ -11,7 +11,7 @@ class formAddFilm extends Form{ const EXTENSIONS = array('gif','jpg','jpe','jpeg','png'); public function __construct() { - $options = array("action" => "./?state=mf&option=a", 'enctype' => 'multipart/form-data'); + $options = array("action" => "./?state=mf", 'enctype' => 'multipart/form-data'); parent::__construct('formAddFilm', $options); } diff --git a/panel_admin/includes/formAddManager.php b/panel_admin/includes/formAddManager.php index e03ab12..10a942f 100644 --- a/panel_admin/includes/formAddManager.php +++ b/panel_admin/includes/formAddManager.php @@ -12,7 +12,7 @@ class formAddManager extends Form{ const HTML5_EMAIL_REGEXP = '^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$'; public function __construct() { - $options = array("action" => "./?state=mg&option=a"); + $options = array("action" => "./?state=mg"); parent::__construct('formAddManager', $options); } diff --git a/panel_admin/includes/formAddPromotion.php b/panel_admin/includes/formAddPromotion.php index ec44ddb..97916b4 100644 --- a/panel_admin/includes/formAddPromotion.php +++ b/panel_admin/includes/formAddPromotion.php @@ -11,7 +11,7 @@ class formAddPromotion extends Form{ const EXTENSIONS = array('gif','jpg','jpe','jpeg','png'); public function __construct() { - $options = array("action" => "./?state=mp&option=a", 'enctype' => 'multipart/form-data'); + $options = array("action" => "./?state=mp", 'enctype' => 'multipart/form-data'); parent::__construct('formAddPromotion', $options); } diff --git a/panel_admin/includes/formDeleteCinema.php b/panel_admin/includes/formDeleteCinema.php index 1319976..a861176 100644 --- a/panel_admin/includes/formDeleteCinema.php +++ b/panel_admin/includes/formDeleteCinema.php @@ -8,7 +8,7 @@ include_once('../assets/php/form.php'); class formDeleteCinema extends Form{ public function __construct(){ - $op = array("action"=>"./?state=mc&option=d"); + $op = array("action"=>"./?state=mc"); parent::__construct('formAddCinema',$op); } diff --git a/panel_admin/includes/formDeleteFilm.php b/panel_admin/includes/formDeleteFilm.php index 0fd4fc0..8bc90aa 100644 --- a/panel_admin/includes/formDeleteFilm.php +++ b/panel_admin/includes/formDeleteFilm.php @@ -10,7 +10,7 @@ class formDeleteFilm extends Form{ const HTML5_EMAIL_REGEXP = '^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$'; public function __construct() { - $options = array("action" => "./?state=mf&option=d"); + $options = array("action" => "./?state=mf"); parent::__construct('formDeleteFilm', $options); } diff --git a/panel_admin/includes/formDeleteManager.php b/panel_admin/includes/formDeleteManager.php index 2a36b2b..fd0e3a8 100644 --- a/panel_admin/includes/formDeleteManager.php +++ b/panel_admin/includes/formDeleteManager.php @@ -10,7 +10,7 @@ class formDeleteManager extends Form{ const HTML5_EMAIL_REGEXP = '^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$'; public function __construct() { - $options = array("action" => "./?state=mg&option=d"); + $options = array("action" => "./?state=mg"); parent::__construct('formDeleteManager', $options); } diff --git a/panel_admin/includes/formDeletePromotion.php b/panel_admin/includes/formDeletePromotion.php index ad56c4e..3e07dda 100644 --- a/panel_admin/includes/formDeletePromotion.php +++ b/panel_admin/includes/formDeletePromotion.php @@ -10,7 +10,7 @@ class formDeletePromotion extends Form{ public function __construct() { - $op = array("action" => "./?state=mp&option=d"); + $op = array("action" => "./?state=mp"); parent::__construct('formEditPromotion', $op); } diff --git a/panel_admin/includes/formEditCinema.php b/panel_admin/includes/formEditCinema.php index c6631fd..8e66d8a 100644 --- a/panel_admin/includes/formEditCinema.php +++ b/panel_admin/includes/formEditCinema.php @@ -8,7 +8,7 @@ include_once('../assets/php/form.php'); class formEditCinema extends Form{ public function __construct(){ - $op = array("action"=>"./?state=mc&option=e"); + $op = array("action"=>"./?state=mc"); parent::__construct('formAddCinema',$op); } diff --git a/panel_admin/includes/formEditFilm.php b/panel_admin/includes/formEditFilm.php index 6d5a60c..b9ba5e2 100644 --- a/panel_admin/includes/formEditFilm.php +++ b/panel_admin/includes/formEditFilm.php @@ -12,7 +12,7 @@ class formEditFilm extends Form{ const EXTENSIONS = array('gif','jpg','jpe','jpeg','png'); public function __construct() { - $options = array("action" => "./?state=mf&option=e", 'enctype' => 'multipart/form-data'); + $options = array("action" => "./?state=mf", 'enctype' => 'multipart/form-data'); parent::__construct('formEditFilm', $options); } @@ -137,7 +137,7 @@ class formEditFilm extends Form{
"; - //$result = './?state=mf'; + //$result = './?state=mf'; }else { $result['img'] = 'El archivo tiene un nombre o tipo no soportado'; diff --git a/panel_admin/includes/formEditManager.php b/panel_admin/includes/formEditManager.php index 136cf4c..8e76a38 100644 --- a/panel_admin/includes/formEditManager.php +++ b/panel_admin/includes/formEditManager.php @@ -11,7 +11,7 @@ class formEditManager extends Form{ const HTML5_EMAIL_REGEXP = '^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$'; public function __construct() { - $options = array("action" => "./?state=mg&option=e"); + $options = array("action" => "./?state=mg"); parent::__construct('formEditManager', $options); } @@ -69,7 +69,7 @@ class formEditManager extends Form{
"; - //$result = './?state=mg'; + // $result = './?state=mg'; } else{ diff --git a/panel_admin/includes/formEditPromotion.php b/panel_admin/includes/formEditPromotion.php index 80627b4..ad99dee 100644 --- a/panel_admin/includes/formEditPromotion.php +++ b/panel_admin/includes/formEditPromotion.php @@ -12,7 +12,7 @@ class formEditPromotion extends Form{ const EXTENSIONS = array('gif','jpg','jpe','jpeg','png'); public function __construct() { - $options = array("action" => "./?state=mp&option=e", 'enctype' => 'multipart/form-data'); + $options = array("action" => "./?state=mp", 'enctype' => 'multipart/form-data'); parent::__construct('formEditPromotion', $options); } diff --git a/panel_admin/index.php b/panel_admin/index.php index 2ffeb32..5b388e7 100644 --- a/panel_admin/index.php +++ b/panel_admin/index.php @@ -9,10 +9,10 @@ if(!isset($_GET["state"])) $_GET["state"] =null; switch($_GET["state"]){ - case 'mc': if(isset($_POST['edit_cinema']) || (isset($_GET['option']) && ($_GET['option'] == 'e'))) { + case 'mc': if(isset($_POST['edit_cinema'])) { $reply=AdminPanel::editCinema(); } - else if(isset($_POST['delete_cinema']) || (isset($_GET['option']) && ($_GET['option'] == 'd'))) { + else if(isset($_POST['delete_cinema'])) { $reply=AdminPanel::deleteCinema(); } else { @@ -26,42 +26,46 @@ } } } - else if(!isset($_GET['option']) || ($_GET['option'] == 'a')) { + else { $reply=AdminPanel::addCinema(); $reply.= ($template->print_cinemas()); - }}; break; - case 'mf': if(isset($_POST['edit_film']) || (isset($_GET['option']) && ($_GET['option'] == 'e'))) { + } + }; + break; + case 'mf': if(isset($_POST['edit_film'])) { $reply=AdminPanel::editFilm(); } - else if(isset($_POST['delete_film']) || (isset($_GET['option']) && ($_GET['option'] == 'd'))) { + else if(isset($_POST['delete_film'])) { $reply=AdminPanel::deleteFilm(); } - else if(!isset($_GET['option']) || ($_GET['option'] == 'a')) { + else { $reply=AdminPanel::addFilm(); $reply.= $template->print_fimls(); - }; + }; break; case 'mp': - if(isset($_POST['edit_promotion']) || (isset($_GET['option']) && ($_GET['option'] == 'e'))) { + if(isset($_POST['edit_promotion'])) { $reply=AdminPanel::editPromotion(); } - else if(isset($_POST['delete_promotion']) || (isset($_GET['option']) && ($_GET['option'] == 'd'))) { + else if(isset($_POST['delete_promotion'])) { $reply=AdminPanel::deletePromotion(); } - else if(!isset($_GET['option']) || ($_GET['option'] == 'a')) { + else { $reply=AdminPanel::addPromotion(); $reply.=AdminPanel::print_promotions(); + }; break; - case 'mg': if(isset($_POST['edit_manager']) || (isset($_GET['option']) && ($_GET['option'] == 'e'))) { + case 'mg': if(isset($_POST['edit_manager'])) { $reply=AdminPanel::editManager(); } - else if(isset($_POST['delete_manager']) || (isset($_GET['option']) && ($_GET['option'] == 'd'))) { + else if(isset($_POST['delete_manager'])) { $reply=AdminPanel::deleteManager(); } - else if(isset($_POST['add_manager']) || (isset($_GET['option']) && ($_GET['option'] == 'a'))) { + else if(isset($_POST['add_manager'])) { $reply=AdminPanel::addManager(); } + else { $reply=AdminPanel::print_managers(); $reply.=AdminPanel::showAddBotton();