SW/panel_manager/includes/formHall.php

49 lines
1.5 KiB
PHP
Raw Normal View History

2021-04-26 22:40:34 +02:00
<?php
include_once($prefix.'assets/php/common/hall_dao.php');
include_once($prefix.'assets/php/form.php');
2021-04-26 22:40:34 +02:00
class FormHall extends Form {
//Constructor:
public function __construct() {
parent::__construct('formHall');
2021-04-26 22:40:34 +02:00
}
public static function generaCampoFormulario($data, $errores = array()){
$number = $data['number'] ?? '';
$rows = $data['rows'] ?? '';
$cols = $data['cols'] ?? '';
$seats = $data['seats'] ?? '';
$htmlform .= '<form method="post" id="'.$data['option'].'" action="./includes/processForm.php"\>
<fieldset>
<input type="number" name="number" value="'.$number.'" min="1" placeholder="Numero de la sala" required/> <br>
<input type="number" name="rows" value= "'.$rows.'" min="1" placeholder="Filas" required/><br>
<input type="number" name="cols" value= "'.$cols.'" min="1" placeholder="Columnas" required/><br>
<input type="number" name="seats" value= "'.$seats.'" min="1" placeholder="Total de butacas?" /><br>
';
if($data['option'] == "new_hall")
$htmlform .= '<button type="submit" name="new_hall" class="button large">Crear</button></div><br>';
$htmlform .= '
</fieldset>
</form>';
return $htmlform;
}
2021-04-26 22:40:34 +02:00
//Methods:
//Process form:
public static function processesForm($data){
if($data["option"] == "new_hall"){
$_SESSION['msg'] = Hall::create_hall($data);
header( "Location: ../?state=success" );
}else {
2021-05-04 22:26:24 +02:00
}
2021-04-26 22:40:34 +02:00
}
}
?>