<%@include file="/WEB-INF/includeTemplate.inc"%>
<%@taglib prefix="form" uri="/WEB-INF/tld/spring-form.tld"%>
<%@taglib prefix="tiles" uri="/WEB-INF/tld/tiles-jsp.tld"%>
<section>
	<div class="container-fluid">
		<div id="id_capa"></div>
		<form:form  method="post"  cssClass="form-horizontal" modelAttribute="empresa" id="formEmpresa">
			<input type="hidden" id="eliminar" value="${eliminar}" />
		    <input type="hidden" id="idExpediente" name="idExpediente" value="${idExpediente}"></input> 
			<c:if test="${!empty empresa}">
		        <form:hidden path="idEmpresa" value="${empresa.idEmpresa}"/>    
		    </c:if>
		    <div class="row">
		        <div class="col-xs-6 form-group">
		            <form:label path="nombre"><spring:message code="empresa.nombre" text="Nombre"/></form:label>
		            <c:choose>
					    <c:when test="${(tipo =='TITULAR') || (tipo =='REPRESENTANTE')}">
					  		<form:input type="text" path="nombre" class="form-control"  value="${empresa.nombre}" readonly="true" />		
					    </c:when>
					    <c:otherwise>
					    	<form:input type="text" path="nombre" class="form-control"  value="${empresa.nombre}" maxlength="260" />					 
						</c:otherwise>
					</c:choose>	
		        </div>
		        <div class="col-xs-6 form-group">
		            <form:label path="nif"><spring:message code="empresa.nif" text="NIF"/></form:label>
		             <c:choose>
					    <c:when test="${(tipo =='TITULAR') || (tipo =='REPRESENTANTE')}">
					  		<form:input type="text" path="nif" class="form-control"  value="${empresa.nif}" readonly="true" />		
					    </c:when>
					    <c:otherwise>
					    	<form:input type="text" path="nif" class="form-control"  value="${empresa.nif}" maxlength="65"/>					 
						</c:otherwise>
					</c:choose>				
		        </div>
		     </div>
		     <div class="row">
		      <c:if test="${hayTipoSMS == 'S'}">		
		            <div class="col-xs-6 form-group">
		                <label style="margin-left: 17px;"><spring:message code="empresa.telefonos" text="Lista télefonos de contactos"/></label>      
			                <ul class="quitarPunto">
			                	<c:forEach items="${empresa.canalesAvisos}" var="canalAvisoItem">
				                	<c:if test="${canalAvisoItem.tiposCanalAviso.idTipoCanalAviso==1}">
					                    <li><i class="fa fa-phone" aria-hidden="true"></i>${canalAvisoItem.canalAviso}</li>
					                </c:if>   
			                    </c:forEach>	
			                </ul>	
		          	 </div>
	           </c:if>
	           <c:if test="${hayTipoEMAIL == 'S'}">	
	           <div class="col-xs-6 form-group">
	                <label style="margin-left: 17px;"><spring:message code="empresa.emails" text="Emails"/></label>
		                <ul class="quitarPunto">
		               		 <c:forEach items="${empresa.canalesAvisos}" var="canalAvisoItem">
			                	<c:if test="${canalAvisoItem.tiposCanalAviso.idTipoCanalAviso==2}">
			                    	<li><i class="fa fa-envelope-o" aria-hidden="true"></i>${canalAvisoItem.canalAviso}</li>
			                    </c:if>   
		                    </c:forEach>   
		              </ul>	
	            </div>
	          </c:if>  
         	</div>
		 </form:form>
		    <c:choose>
			    <c:when test="${(tipo =='TITULAR') || (tipo =='REPRESENTANTE')}">
			    </c:when>
			    <c:otherwise>
			   	<div id="space"></div>
					 <div class="modal-footer">
				  		<button type="button" class="btn btn-primary" data-dismiss="modal"><spring:message code="boton.guardar"/></button>
					 </div>				 
				</c:otherwise>
			</c:choose>	
	</div>
</section>