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

<%@page import="it.cedaf.icare.customers.zcommod.ZcommodModuleInfo" %>

<script type="text/javascript">

	function downloadFile(excel) {
		var params = 'excel=' + (excel ? 'true' : 'false');
		params += '&nomeFile=' + cpGetMasterColumnValueOfCurrentRow('nomeFile');
		params += '&nomeFileLog=' + cpGetMasterColumnValueOfCurrentRow('nomeFileLog');
		shellDownload('it.cedaf.icare.customers.zcommod.control.action.BandoCRAImportAccessiFileProvider', params);
	}
	
	function deleteAccessiBandoCRA() {
		var params = 'id=' + cpGetMasterColumnValueOfCurrentRow('id') + '&verify=true';
		var response = jsLoadString('it.cedaf.icare.customers.zcommod.control.action.BandoCRAImportAccessiDeleteExecutor', params);
		if (response == '<%=ZcommodModuleInfo.CRA_DELETE_ACCESSI_ERROR%>') {
			alert('Il record non pu� essere eliminato perch� verrebbero cancellati degli accessi/prestazioni da interventi gi� liquidati.');
			return;
		}
		var msg = response == '<%=ZcommodModuleInfo.CRA_DELETE_ACCESSI_ALERT%>' ? 
			"Eliminando il record verranno eliminati anche tutti gli accessi/prestazioni importati con esso.\nContinuare?": 
			"Il record selezionato verr� eliminato.\nContinuare?";
		if (!confirm(msg)) return;
		var params = 'id=' + cpGetMasterColumnValueOfCurrentRow('id');
		response = jsLoadString('it.cedaf.icare.customers.zcommod.control.action.BandoCRAImportAccessiDeleteExecutor', params);
		if (response == '<%=ZcommodModuleInfo.CRA_DELETE_ACCESSI_OK%>') {
			cpReload();
		} else {
			alert(response);
		}		
	}
</script>


<shell:fieldset title="Informazioni sulle importazioni accessi effettuate">
	<bui:out modes="view">
	<table border="0" cellspacing="3" cellpadding="0" >
 		<tr>
			<td class="form-label">
				<shell:label prop="dataCaricamento" />
			</td>
			<td class="form-values">
				<j:tile name="shell.plaintext" prop="dataCaricamento" />					
			</td>
 		</tr> 		
 		<tr>
			<td class="form-label">
				<shell:label prop="esito" />
			</td>
			<td class="form-values">
				<j:tile name="shell.plaintext" prop="esito" />	
			</td>
		</tr>
		<tr>
			<td class="form-label">
				<shell:label prop="tipoIntervento" />
			</td>
			<td class="form-values">
				<j:tile name="shell.plaintext" prop="tipoIntervento" />	
			</td>
		</tr>
		<tr>
			<td class="form-label">
				<shell:label prop="strutturaInserimento" />
			</td>
			<td class="form-values">
				<j:tile name="shell.plaintext" prop="strutturaInserimento" />	
			</td>
		</tr>
		<tr>
			<td class="form-label">
				<shell:label prop="periodo" />
			</td>
			<td class="form-values">
				dal <j:tile name="shell.plaintext" prop="periodoRiferimentoDa" /> al <j:tile name="shell.plaintext" prop="periodoRiferimentoA" />	
			</td>
		</tr>
		<tr>
			<td></td>
			<td class="form-values">
				<br/>
				<shell:button id="sh_tb__downloadExcel" text="Download del file Excel" img="commons.doc_edit_small" title="Download del file Excel" href="javascript: downloadFile(true);" enabled="false" ext="true" />
				&nbsp;&nbsp;
				<shell:button id="sh_tb__downloadLog" text="Download del file di log" img="commons.doc_edit_small" title="Download del file di log" href="javascript: downloadFile(false);" enabled="false" ext="true" />	
			</td>
		</tr>			
	</table>
	</bui:out>
</shell:fieldset>