"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($i = 1; $i <= $rows; $i++){ for($j = 1; $j <= $cols; $j++){ $seats_map[$i][$j] = $seats[$i]->getState(); } } $html ='
'; for($j = 1; $j <= $cols; $j++){ $html .= ' | '.$j.' | '; } $html .= '|
---|---|---|
'.$i.' | '; for($j = 1; $j <= $cols; $j++){ if($seats_map[$i][$j] >= 0){ $html .= '';} else { $html .= ' | ';} } $html .=' |