<%@include file="/WEB-INF/includeTemplate.inc"%>	
<%@page import="com.ejie.x38.security.UserCredentials"%>
<%@page import="java.util.*" %> 
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="form" uri="/WEB-INF/tld/spring-form.tld"%>
<%@page import="com.ejie.ab63.comun.Constantes"%>
<section>
	<div class="container"> 
		<!-- Incluimos la jsp que contiene las pestanas -->
		<jsp:include page="../pestanas.jsp" />
		
		<input type="hidden" id="flagSearchFolder" value="${flagSearchFolder}"/>
		<input type="hidden" id="urlab61" name="urlab61" value="${urlab61}"/>
		<input type="hidden" id="ab61_folderID" name="ab61_folderID" value="${ab61_folderID}"/>
		<input type="hidden" id="recargarPagina" value="0"/>
		<input type="hidden" id="isEsencial" name="isEsencial" value="${isEsencial}"/>
		
		<div id="id_capa"></div>
		<div id="feedbackAsociarEstablecimiento"></div>
		<div class="row">
			<div class="col-xs-4">
				<label class="required"><spring:message code="cambiospendientes.numRegistro"/></label>
				<div class="input-group">
					<input id="changeIdentificador" type="text" class="form-control" value="${ identificadorEstablecimiento }" ${isEnableSaveButton == true and isEnableChangeNreg == true ? '' : 'readonly="readonly"' } >
					<span class="input-group-addon">&nbsp;&nbsp;&nbsp;</span>
					<button id="btnChangeIdentificador" type="button" class="btn btn-primary" ${isEnableSaveButton == true and isEnableChangeNreg == true ? '' : 'disabled="disabled"' }><spring:message code="cambiospendientes.cambiarNumero"/></button>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-6"> 
				<h2 class="color-primary-3"><spring:message code="fexpediente.formComparacion.censo"/><hr/></h2>
			</div>
			<div class="col-md-6">
				 <h2 class="color-primary-3"><spring:message code="fexpediente.formComparacion.solicitud"/><hr/></h2>
			</div>
		</div>
		<div id="cambiosAcordeon" class="ui-accordion ui-widget ui-helper-reset">
			<c:forEach var="section" items="${sections}">
				<h1 data-section-update="${section.tipoSection}" data-section-id="${section.idSection}" class="accordion-header ui-accordion-header ui-helper-reset ui-state-default ui-accordion-icons ui-corner-all ${section.hasChanges ? 'markChange' : ''}">
					<a href="#"><spring:message code="cambiospendientes.titulo.${section.tipoSection}"/> </a>
				</h1>
				<div data-section-update="${section.tipoSection}" data-section-id="${section.idSection}" class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom accordion_height_auto">
					<div class="row">
						<div class="col-xs-12">
							<div class="row">
								<div class="ml-auto">
									<button ${isEnableSaveButton and section.hasChanges? '' : 'disabled="disabled"'} data-section-update="${section.tipoSection}" data-section-id="${section.idSection}" type="button" class="btn btn-primary btn-circle btn-lg grabarSection" data-toggle="tooltip" data-placement="bottom" title='<spring:message code="fexpediente.guardar.${titleButtons}"/>'>
										<i class="fa fa-floppy-o" aria-hidden="true"></i>
									</button>
								</div>
							</div>
						</div>
						<c:forEach var="field" items="${section.listFields}">
							<div class="col-xs-6">
								<label><spring:message code="cambiospendientes.${field.label}"/></label>${field.typeField eq 'checkbox' ? '<br/>' : '' }
								<c:if test="${field.typeField ne 'checkbox' }">
									<c:if test="${empty field.oldDescValue}">
										<input type="text" disabled="disabled" name="${field.label}" class="form-control oldElement" value="${field.oldValue}" />
									</c:if>
									<c:if test="${not empty field.oldDescValue}">
										<input type="text" disabled="disabled" name="${field.label}" class="form-control  oldElement" value="${field.oldDescValue}" />
									</c:if>
								</c:if>
								<c:if test="${field.typeField eq 'checkbox' }">
									<input type="text" disabled="disabled" name="${field.label}" class="form-control  oldElement ${field.typeField eq 'date' ? 'rup_date' : '' }" value='<spring:message code="establecimiento.${field.oldValue eq '1' ? 'si' : 'no'}" />' />
								</c:if>
							</div>
							<div class="col-xs-6 ">
								<label><spring:message code="cambiospendientes.${field.label}"/></label>${field.typeField eq 'checkbox' ? '<br/>' : '' }
								<c:if test="${field.typeField ne 'checkbox' }">
									<c:if test="${empty field.newDescValue}">
										<input type="text" disabled="disabled" name="${field.label}" class="form-control  ${field.hasChanges ? 'markChange' : '' }" value="${field.newValue}" />
									</c:if>
									<c:if test="${not empty field.newDescValue}">
										<input type="text" disabled="disabled" name="${field.label}" class="form-control  ${field.hasChanges ? 'markChange' : '' }" value="${field.newDescValue}" />
										
									</c:if>
								</c:if>
								<c:if test="${field.typeField eq 'checkbox' }">
									<input type="text" disabled="disabled" name="${field.label}" class="form-control  ${field.hasChanges ? 'markChange' : '' } ${field.typeField eq 'date' ? 'rup_date' : '' }" value='<spring:message code="establecimiento.${field.newValue eq '1' ? 'si' : 'no'}" />' />
									
								</c:if>
							</div>
						</c:forEach>
					</div>
				</div>
			</c:forEach>
		</div>
	</div>	 				
</section>
<div id="space"></div>


