From d00c212e078c410114bde9a20f1740a3733d72d8 Mon Sep 17 00:00:00 2001
From: Markines16 <80280295+Markines16@users.noreply.github.com>
Date: Thu, 6 May 2021 23:25:38 +0200
Subject: [PATCH] Esta comentado las opciones de sesion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Hay un fallo con film.php que esperamos arreglarlo mañana con el join en sesion y el template
---
panel_manager/includes/formHall.php | 60 ++++++++++++++++++++++----
panel_manager/includes/formSession.php | 3 +-
panel_manager/includes/manager.css | 50 +++++++++++++++++++++
panel_manager/includes/processForm.php | 14 +++++-
panel_manager/index.php | 4 +-
panel_manager/panel_manager.php | 20 ++++-----
6 files changed, 125 insertions(+), 26 deletions(-)
create mode 100644 panel_manager/includes/manager.css
diff --git a/panel_manager/includes/formHall.php b/panel_manager/includes/formHall.php
index fdb13ca..5834471 100644
--- a/panel_manager/includes/formHall.php
+++ b/panel_manager/includes/formHall.php
@@ -12,24 +12,66 @@ class FormHall extends Form {
public static function generaCampoFormulario($data, $errores = array()){
$number = $data['number'] ?? '';
- $rows = $data['rows'] ?? '';
- $cols = $data['cols'] ?? '';
+ $rows = $data['rows'] ?? '14';
+ $cols = $data['cols'] ?? '8';
$seats = $data['seats'] ?? '';
- $htmlform .= '
';
- return $htmlform;
+
+
+
+ ';
+ return $htmlform;
}
//Methods:
diff --git a/panel_manager/includes/formSession.php b/panel_manager/includes/formSession.php
index 43d1157..54d3679 100644
--- a/panel_manager/includes/formSession.php
+++ b/panel_manager/includes/formSession.php
@@ -101,5 +101,4 @@ class FormSession extends Form {
}
}
-?>
-
+?>
\ No newline at end of file
diff --git a/panel_manager/includes/manager.css b/panel_manager/includes/manager.css
new file mode 100644
index 0000000..16900d0
--- /dev/null
+++ b/panel_manager/includes/manager.css
@@ -0,0 +1,50 @@
+h3.table_title{
+ text-align: center;
+ margin-bottom: 1em;
+}
+
+table.seat {
+ border: solid 10px #1f2c3d;
+ text-align: center;
+ background-color: rgba(215, 215, 215, 1);
+}
+
+table.seat tbody tr:nth-child(2n + 1) {
+ background-color: rgba(204, 255, 204, 0);
+}
+
+table.seat th{
+ font-size: 0.9em;
+ padding: 0.30em 0.30em 0.30em 0.30em;
+ border-bottom: solid 2px #1f2c3d;
+}
+
+table.seat th:first-child {
+ border-right: solid 2px #1f2c3d;
+}
+
+table.seat td {
+ padding: 0.35em 0.35em;
+}
+
+table.seat td:first-child {
+ font-size: 0.9em;
+ padding: 0.30em 0.30em 0.30em 0.30em;
+ font-weight: 600;
+ border-right: solid 2px #1f2c3d;
+}
+
+.check_box {
+ display:none;
+}
+
+.check_box+label{
+ background:url('../../img/seat_red.png') no-repeat;
+ height: 16px;
+ width: 16px;
+ display:inline-block;
+}
+
+.check_box:checked+label{
+ background:url('../../img/seat_green.png') no-repeat;
+}
\ No newline at end of file
diff --git a/panel_manager/includes/processForm.php b/panel_manager/includes/processForm.php
index 2f5148c..b37b038 100644
--- a/panel_manager/includes/processForm.php
+++ b/panel_manager/includes/processForm.php
@@ -7,7 +7,16 @@
include_once('formSession.php');
if(isset($_POST['new_hall'])){
- $data = array("option" => "new_hall","number" => $_POST["number"],"cols" => $_POST["cols"],"rows" => $_POST["rows"], "cinema" => $_SESSION["cinema"]);
+ $data = array("option" => "new_hall","number" => $_POST["number"],"cols" => $_POST["cols"],"rows" => $_POST["rows"], "cinema" => $_SESSION["cinema"], "seats" => 0);
+ //Check what checkboxs are seats or not
+ for($i = 1;$i<=$data["rows"];$i++){
+ for($j=1; $j<=$data["cols"]; $j++){
+ if(!empty($_POST['checkbox'.$i.$j.''])){
+ $data[$i][$j] = $_POST['checkbox'.$i.$j.''];
+ $data["seats"]++;
+ } else $data[$i][$j] = "-1";
+ }
+ }
FormHall::processesForm($data);
}
@@ -16,7 +25,7 @@
,"price" => $_POST["price"],"format" => $_POST["format"],"repeat" => $_POST["repeat"], "cinema" => $_SESSION["cinema"]);
FormSession::processesForm($data);
}
-
+
if(isset($_POST['edit_session'])){
$data = array("option" => "edit_session","film" => $_POST["film"],"hall" => $_POST["hall"],"date" => $_POST["date"],"start" => $_POST["start"]
,"price" => $_POST["price"],"format" => $_POST["format"],"repeat" => $_POST["repeat"], "cinema" => $_SESSION["cinema"]
@@ -29,4 +38,5 @@
,"date"=> $_POST["origin_date"],"start"=> $_POST["origin_start"]);
FormSession::processesForm($data);
}
+
?>
\ No newline at end of file
diff --git a/panel_manager/index.php b/panel_manager/index.php
index 011064e..6a8da3f 100644
--- a/panel_manager/index.php
+++ b/panel_manager/index.php
@@ -7,7 +7,7 @@
require_once('../assets/php/config.php');
//Controller file:
include_once('panel_manager.php');
-
+
if($_SESSION["login"] && $_SESSION["rol"] === "manager"){
$_SESSION["cinema"] = "1";
switch($_GET["state"]){
@@ -64,9 +64,11 @@
CompluCine - FDI-cines
-->
+
print_head();
+
?>
diff --git a/panel_manager/panel_manager.php b/panel_manager/panel_manager.php
index a3f1de1..99cc9a7 100644
--- a/panel_manager/panel_manager.php
+++ b/panel_manager/panel_manager.php
@@ -1,8 +1,8 @@
"new_hall");
- $panel = '
-
-
Crear una sala.
- '. FormHall::generaCampoFormulario($data, null).'
-
- '."\n";
+ $data = array("option" => "new_hall", "cols" => $_POST["cols"], "rows" => $_POST["rows"]);
+ $panel = 'Crear una sala.
+ '. FormHall::generaCampoFormulario($data, null);
return $panel;
}
@@ -88,7 +84,7 @@
return $panel;
}
-
+ /*
static function manage_sessions(){
//Base filtering values
$date = isset($_POST['date']) ? $_POST['date'] : date("Y-m-d");
@@ -178,11 +174,11 @@
}
static function edit_session(){
- $data = array("option" => "edit_session","hall" => $_POST["hall"],"cinema" => $_SESSION["cinema"],"date" => $_POST['date'],"film" => $_POST['film'],"start" => $_POST['start'],"price" => $_POST['price'],"format" => $_POST['format']);
+ /*$data = array("option" => "edit_session","hall" => $_POST["hall"],"cinema" => $_SESSION["cinema"],"date" => $_POST['date'],"film" => $_POST['film'],"start" => $_POST['start'],"price" => $_POST['price'],"format" => $_POST['format']);
$panel = 'Editar una sesión.
'.FormSession::generaCampoFormulario($data, null);
return $panel;
- }
+ }*/
}
?>
\ No newline at end of file