<%@ include file="/project/include.jsp" %>

<script type="text/javascript">
	/**  */
	function onChangeDataInizio() {
		var selectTipoInt = document.getElementById('idTipoIntervento');
		if (selectTipoInt) {
			var dataInizio = document.getElementById('dataInizioCld').value;
			var dmKey = document.getElementById('dmKey').value;
			var selectedRow = document.getElementById('selectedRow').value;
			var params = 'dataRif=' + dataInizio;
			params += '&dmKey=' + dmKey;
			params += '&selectedRow=' + selectedRow;
	
			loadStandardSelectOptionsAndFill('idTipoIntervento', 
			'it.cedaf.icare.customers.zcompar.binding.requestbean.valuesetproviders.TipoInterventoDuplicazioneBuonoValueSetProvider(dataRif, dmKey, selectedRow)', 
			params, '');
		} else {
			return;
		}
	}

	/** */
	function duplicazioneIntBuono() {
		var form = document.getElementById('duplicazioneBuonoForm');
		juiceSubmitForm(form, -1);
	}


</script>

<j:form id="duplicazioneBuonoForm" name="duplicazioneBuonoAttivazione" event="duplicazioneBuono" enctype="multipart/form-data" method="POST" clientValidatorProvider="it.cedaf.juice.mvc.modules.shell.view.helper.JavascriptClientValidatorProvider">

	<j:bind prop="selectedRow">
		<j:hidden id="selectedRow"/>
	</j:bind>
	<j:bind prop="dmKey">
		<j:hidden id="dmKey"/>
	</j:bind>
	
	<br>
	<table border="0" cellpadding="0" cellspacing="3" width="100%">
		<tr>
      		<td class="form-label">
    			Data Inizio Intervento<span class="form-label-required">�*</span>
    		</td>
    		<td class="form-values">
		    	<j:bind prop="dataInizio">
					<j:text class="form-date" id="dataInizioCld" onChange="javascript:onChangeDataInizio(this);" />
					<shell:calendar inputId="dataInizioCld" />
					<shell:error />
				</j:bind>
		   	</td>
		</tr>
		<c:choose>
		    <c:when test="${!empty dto_showSceltaTipoIntervento && dto_showSceltaTipoIntervento == 'true'}">
				<tr>
		      		<td class="form-label">
		    			Tipo intervento<span class="form-label-required">�*</span>
		    		</td>
		    		<td class="form-values">
				    	<j:bind prop="tipoIntervento">
							<j:select class="form-input" id="idTipoIntervento" emptyOptionDescr="" />
							<shell:error />
						</j:bind>
				   	</td>
				</tr>
		    </c:when>    
		    <c:otherwise>
		        <j:bind prop="tipoIntervento">
					<j:hidden id="tipoIntervento"/>
				</j:bind>
		    </c:otherwise>
		</c:choose>

		<tr>
			<td>&nbsp;</td>
			<td style="padding: 15px 4px 5px 4px;">
				<button class="generic-button ui-state-default ui-corner-all" onclick="duplicazioneIntBuono(); return false;"><img src="${j:getResourceUrlOfModule('shell', 'img/misc/confirm-small.gif')}" width="16" height="16" border="0" align="absmiddle">&nbsp;Conferma</button> 													
			</td>
		</tr>							
	</table>
</j:form>