From b6025fc79cf70baf26844da75d7d1d77ddea852e Mon Sep 17 00:00:00 2001
From: OscarRui <79144467+OscarRui@users.noreply.github.com>
Date: Tue, 11 May 2021 19:38:22 +0200
Subject: [PATCH] =?UTF-8?q?Cambio=20sesiones=20a=C3=B1a/edit/elim=20para?=
=?UTF-8?q?=20uso=20del=20Form?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
panel_manager/panel_manager.php | 44 ++++++---------------------------
1 file changed, 7 insertions(+), 37 deletions(-)
diff --git a/panel_manager/panel_manager.php b/panel_manager/panel_manager.php
index f7ff636..a0e0426 100644
--- a/panel_manager/panel_manager.php
+++ b/panel_manager/panel_manager.php
@@ -183,48 +183,18 @@
}
static function new_session(){
- echo "inicio";
- if(isset($_POST["new_session"])){
-
- $data = array("option" => "new_session","hall" => $_POST['hall'],"cinema" => $_SESSION["cinema"],"date" => $_POST['date']);
-
- }else if(isset($_POST["select_film"])){
-
- $film = array("idfilm" => $_POST["id"],"tittle" => $_POST["tittle"], "description" => $_POST["description"], "duration" => $_POST["duration"]);
- $data = array("option" => "new_session","hall" => $_POST['hall'],"cinema" => $_SESSION["cinema"],"date" => $_POST['date'],"film" => $film, "start" => $_POST['start']
- , "price" => $_POST['price'], "format" => $_POST['format']);
- }
-
- if($data){
- $panel = '
Crear una sesión.
- '.FormSession::generaCampoFormulario($data, null);
- }else $panel = self::warning();
-
+ $formSession = new FormSession("new_session");
+
+ $panel = 'Crear una sesion.
'
+ .$formSession->gestiona();
return $panel;
}
static function edit_session(){
- if(isset($_POST["edit_session"])){
-
- $_SESSION["or_hall"] = "";
- $_SESSION["or_date"] = "";
- $_SESSION["or_start"] = "";
+ $formSession = new FormSession("edit_session");
- $film = Session::getThisSessionFilm($_POST["film"]);
- $data = array("option" => "edit_session","hall" => $_POST["hall"],"cinema" => $_SESSION["cinema"],"date" => $_POST['date'],"film" => $film,
- "start" => $_POST['start'],"price" => $_POST['price'],"format" => $_POST['format']);
-
- }else if(isset($_SESSION["session"])){
- $film = array("idfilm" => $_POST["id"],"tittle" => $_POST["tittle"], "description" => $_POST["description"], "duration" => $_POST["duration"]);
-
- $data = array("option" => "edit_session","hall" => $_POST['hall'],"cinema" => $_SESSION["cinema"],"date" => $_POST['date'],"film" => $film, "start" => $_POST['start']
- , "price" => $_POST['price'], "format" => $_POST['format']);
- }
-
- if($data){
- $panel = 'Editar una sesión.
- '.FormSession::generaCampoFormulario($data, null);
- } else $panel = self::warning();
+ $panel = 'Editar una sesion.
'
+ .$formSession->gestiona();
return $panel;
}