<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>
<%@ taglib prefix="jdt" uri="http://www.jenia.org/jsf/dataTools"%>

<html>
<%@include file="/paginas/comum/head.jsp"%>
<body>
<f:view>

	<%@include file="/paginas/comum/cabecalho.jsp"%>

	<f:verbatim>
		<style type="text/css">
.colunaIngredientes {
	width: 200px;
}
</style>
	</f:verbatim>

<h1>Sua Pizza</h1>

	<h:outputText value="Sua pizza foi incluida no pedido:" />
	<br/>
	<br/>		
	<t:dataTable id="list" rows="40" value="#{enderecoControlador.pedido.pizzas}" var="pizza" rowIndexVar="indicePizza"
			border="1" >
		<h:column>
			<h:outputText value="Pizza"/>
			<h:outputText value=" #{pizza.nome}"/>
			<h:outputText value=" #{indicePizza + 1}"/>
		</h:column>
		<h:column>
					
			<t:dataTable id="list2" rows="40" value="#{pizza.ingredientes}" var="ingrediente" rowIndexVar="indiceIngrediente">
				<h:column>
					<h:outputText value="#{indiceIngrediente + 1} - "/>
					<h:outputText value="#{ingrediente.nome}" />
				</h:column>
			</t:dataTable>
		</h:column>
		<h:column>
		
			<h:outputText value="#{pizza.precoDouble}">
				<f:convertNumber type="currency" maxFractionDigits="2" minFractionDigits="2" minIntegerDigits="1"/>
			</h:outputText>
		</h:column>		
	</t:dataTable>
		
	<br/>	 
 	<b>
 	Total do Pedido:
	<h:outputText value="#{enderecoControlador.pedido.totalPedidoDouble}" >
		<f:convertNumber type="currency" maxFractionDigits="2" minFractionDigits="2" minIntegerDigits="1"/>
	</h:outputText>
	</b>

	<br><br>
	<h:outputText value="Para adicionar outra pizza, clique " />
	<h:outputLink id="linkEnderecoParaMontarPizza"
		value="#{facesContext.externalContext.requestContextPath}/paginas/pizza/montar_pizza.jsf">
		<h:outputText value=" Aqui!" />
	</h:outputLink>
	<br><br>
	<h:form id="formFimPedido">
		<h:outputText value="Para fechar o pedido, clique " />
		<h:commandLink id="linkFecharPedido" action="#{montarPizzaControlador.fecharPedido}">
			<h:outputText value=" Aqui!" />
		</h:commandLink>
	</h:form >
</f:view>
<%@include file="/paginas/comum/rodape.jsp"%>
</body>
</html>