"confirm.php"); parent::__construct('formSelectSeat', $options); } protected function generaCamposFormulario($datos, $errores = array()){ // Se generan los mensajes de error, si existen. $htmlErroresGlobales = self::generaListaErroresGlobales($errores); $errorSeat = self::createMensajeError($errores, 'seats', 'span', array('class' => 'error')); $sessionDAO = new SessionDAO("complucine"); $session = $sessionDAO->sessionData($_POST["sessions"]); $hallDAO = new HallDAO("complucine"); $hall = $hallDAO->HallData($session->getIdhall()); $seatDAO = new SeatDAO("complucine"); $seats = $seatDAO->getAllSeats($session->getIdhall(), $session->getIdcinema()); $rows = $hall->getNumRows(); $cols = $hall->getNumCol(); //$seats = $hall->getTotalSeats(); $seats_map = array(); for($x = 0; $x < $hall->getTotalSeats(); $x++){ for($i = 0; $i < $rows; $i++){ for($j = 0; $j < $cols; $j++){ $seats_map[$i][$j] = $seats[$x]->getState(); } } } $html ='

Seleccionar un Asiento


Pantalla

'; for($j = 1; $j <= $cols; $j++){ $html .= ' '; } $html .= ''; for($i = 1; $i <= $rows; $i++){ $html .= ' '; for($j = 1; $j <= $cols; $j++){ if($seats_map[$i][$j] >= 0){ $html .= ' ';} else { $html .= ' ';} } $html .=''; } $html .= '
'.$j.'
'.$i.'
'; //Pay button: $pay = ' '; return '
'.$html.'
'.$pay.'
'; } protected function procesaFormulario($datos){ $result = array(); if (count($result) === 0) { $result = "confirm.php"; } return $result; } } ?>