<%@ page language="java"%> 

<%@ page import="java.util.*,javax.sql.*,java.sql.*,javax.naming.*,java.text.*,m05bClasses.*, m05bObjects.*" %>
<HTML>
<%
	// _______________________________XLNETs______________________________________
	// Evaluar variable de session que indica si esta conectado a XLNets
	if ((session.getAttribute("objetoSeguridad")) == null)  { 
		// Verificar que no ha transcurrido el tiempo de sesion (web.xml) %>
			<%@ include file="/m05bControlAcceso.inc"%> <%
	} 
%>	
	<%@ include file="/m05bIdioma.inc"%>


<HEAD>
	<title><%= resTit.getString("titCTKPDFResultadoKm")%></title>
    <link rel="stylesheet" href="<%=m05bConstantesPaginas.PATH_ESTILOS%>/m05bestilos.css" type="text/css">	
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
</HEAD>	
	
<%	String desde=request.getParameter("Desde");
	String hasta=request.getParameter("Hasta");
	m05bComun miComun = new m05bComun();
	String srcPDF = miComun.leerPropiedad("PDF.CTKTotalKm") + "?Desde=" + desde + "&Hasta=" + hasta; %>
<%
			// Meter valores al objeto para despues usarlo en la impresion del CTK
		m05bCTK objCTK = new m05bCTK();
		// NUMERO DE VEHICULOS
			// Total
			objCTK.setCTK_elem(request.getParameter("TotalA"),0,0);
			objCTK.setCTK_elem(request.getParameter("TotalB"),0,1);
			objCTK.setCTK_elem(request.getParameter("TotalC"),0,2);
			objCTK.setCTK_elem(request.getParameter("TotalD"),0,3);
			objCTK.setCTK_elem(request.getParameter("TotalRA"),0,4);
			objCTK.setCTK_elem(request.getParameter("TotalRB"),0,5);
			objCTK.setCTK_elem(request.getParameter("Total"),0,6);
			objCTK.setCTK_elem(request.getParameter("TotalObs"),0,7);
			// Media
			objCTK.setCTK_elem(request.getParameter("MediaA"),1,0);
			objCTK.setCTK_elem(request.getParameter("MediaB"),1,1);
			objCTK.setCTK_elem(request.getParameter("MediaC"),1,2);
			objCTK.setCTK_elem(request.getParameter("MediaD"),1,3);
			objCTK.setCTK_elem(request.getParameter("MediaRA"),1,4);
			objCTK.setCTK_elem(request.getParameter("MediaRB"),1,5);			
			objCTK.setCTK_elem(request.getParameter("Media"),1,6);
			objCTK.setCTK_elem(request.getParameter("MediaObs"),1,7);
			// Km
			objCTK.setCTK_elem(request.getParameter("KmA"),2,0);
			objCTK.setCTK_elem(request.getParameter("KmB"),2,1);
			objCTK.setCTK_elem(request.getParameter("KmC"),2,2);
			objCTK.setCTK_elem(request.getParameter("KmD"),2,3);
			objCTK.setCTK_elem(request.getParameter("KmRA"),2,4);
			objCTK.setCTK_elem(request.getParameter("KmRB"),2,5);			
			objCTK.setCTK_elem(request.getParameter("Km"),2,6);
			objCTK.setCTK_elem(request.getParameter("KmObs"),2,7);
			// Amortizacion
			objCTK.setCTK_elem(request.getParameter("AmortA"),3,0);
			objCTK.setCTK_elem(request.getParameter("AmortB"),3,1);
			objCTK.setCTK_elem(request.getParameter("AmortC"),3,2);
			objCTK.setCTK_elem(request.getParameter("AmortD"),3,3);
			objCTK.setCTK_elem(request.getParameter("AmortRA"),3,4);
			objCTK.setCTK_elem(request.getParameter("AmortRB"),3,5);			
			objCTK.setCTK_elem(request.getParameter("Amort"),3,6);
			objCTK.setCTK_elem(request.getParameter("AmortObs"),3,7);
			// Combustible
			objCTK.setCTK_elem(request.getParameter("CombusA"),4,0);
			objCTK.setCTK_elem(request.getParameter("CombusB"),4,1);
			objCTK.setCTK_elem(request.getParameter("CombusC"),4,2);
			objCTK.setCTK_elem(request.getParameter("CombusD"),4,3);
			objCTK.setCTK_elem(request.getParameter("CombusRA"),4,4);
			objCTK.setCTK_elem(request.getParameter("CombusRB"),4,5);
			objCTK.setCTK_elem(request.getParameter("Combus"),4,6);
			objCTK.setCTK_elem(request.getParameter("CombusObs"),4,7);
		// GASTOS DE TALLER
			// N. Intervenciones Taller Propio
			objCTK.setCTK_elem(request.getParameter("IntervA"),5,0);
			objCTK.setCTK_elem(request.getParameter("IntervB"),5,1);
			objCTK.setCTK_elem(request.getParameter("IntervC"),5,2);
			objCTK.setCTK_elem(request.getParameter("IntervD"),5,3);
			objCTK.setCTK_elem(request.getParameter("IntervRA"),5,4);
			objCTK.setCTK_elem(request.getParameter("IntervRB"),5,5);			
			objCTK.setCTK_elem(request.getParameter("Interv"),5,6);
			objCTK.setCTK_elem(request.getParameter("IntervObs"),5,7);
			// Proporcion Reparto Gastos Taller
			objCTK.setCTK_elem(request.getParameter("RepartoA"),6,0);
			objCTK.setCTK_elem(request.getParameter("RepartoB"),6,1);
			objCTK.setCTK_elem(request.getParameter("RepartoC"),6,2);
			objCTK.setCTK_elem(request.getParameter("RepartoD"),6,3);
			objCTK.setCTK_elem(request.getParameter("RepartoRA"),6,4);
			objCTK.setCTK_elem(request.getParameter("RepartoRB"),6,5);			
			objCTK.setCTK_elem(request.getParameter("Reparto"),6,6);
			objCTK.setCTK_elem(request.getParameter("RepartoObs"),6,7);
			// Suministros Taller
			objCTK.setCTK_elem(request.getParameter("SuministA"),7,0);
			objCTK.setCTK_elem(request.getParameter("SuministB"),7,1);
			objCTK.setCTK_elem(request.getParameter("SuministC"),7,2);
			objCTK.setCTK_elem(request.getParameter("SuministD"),7,3);
			objCTK.setCTK_elem(request.getParameter("SuministRA"),7,4);
			objCTK.setCTK_elem(request.getParameter("SuministRB"),7,5);			
			objCTK.setCTK_elem(request.getParameter("Suminist"),7,6);
			objCTK.setCTK_elem(request.getParameter("SuministObs"),7,7);
			// Amortiz. Equipo Taller
			objCTK.setCTK_elem(request.getParameter("AmortTallerA"),8,0);
			objCTK.setCTK_elem(request.getParameter("AmortTallerB"),8,1);
			objCTK.setCTK_elem(request.getParameter("AmortTallerC"),8,2);
			objCTK.setCTK_elem(request.getParameter("AmortTallerD"),8,3);
			objCTK.setCTK_elem(request.getParameter("AmortTallerRA"),8,4);
			objCTK.setCTK_elem(request.getParameter("AmortTallerRB"),8,5);			
			objCTK.setCTK_elem(request.getParameter("AmortTaller"),8,6);
			objCTK.setCTK_elem(request.getParameter("AmortTallerObs"),8,7);
			// Otros Gastos Taller Propio
			objCTK.setCTK_elem(request.getParameter("OtrosA"),9,0);
			objCTK.setCTK_elem(request.getParameter("OtrosB"),9,1);
			objCTK.setCTK_elem(request.getParameter("OtrosC"),9,2);
			objCTK.setCTK_elem(request.getParameter("OtrosD"),9,3);
			objCTK.setCTK_elem(request.getParameter("OtrosRA"),9,4);
			objCTK.setCTK_elem(request.getParameter("OtrosRB"),9,5);			
			objCTK.setCTK_elem(request.getParameter("Otros"),9,6);
			objCTK.setCTK_elem(request.getParameter("OtrosObs"),9,7);
			// Gastos Talleres Externos
			objCTK.setCTK_elem(request.getParameter("ExternA"),10,0);
			objCTK.setCTK_elem(request.getParameter("ExternB"),10,1);
			objCTK.setCTK_elem(request.getParameter("ExternC"),10,2);
			objCTK.setCTK_elem(request.getParameter("ExternD"),10,3);
			objCTK.setCTK_elem(request.getParameter("ExternRA"),10,4);
			objCTK.setCTK_elem(request.getParameter("ExternRB"),10,5);			
			objCTK.setCTK_elem(request.getParameter("Extern"),10,6);
			objCTK.setCTK_elem(request.getParameter("ExternObs"),10,7);
		// GASTOS DE PERSONAL
			// Plantilla Media Total PM
			objCTK.setCTK_elem(request.getParameter("PlantTotalA"),11,0);
			objCTK.setCTK_elem(request.getParameter("PlantTotalB"),11,1);
			objCTK.setCTK_elem(request.getParameter("PlantTotalC"),11,2);
			objCTK.setCTK_elem(request.getParameter("PlantTotalD"),11,3);
			objCTK.setCTK_elem(request.getParameter("PlantTotalRA"),11,4);
			objCTK.setCTK_elem(request.getParameter("PlantTotalRB"),11,5);
			objCTK.setCTK_elem(request.getParameter("PlantTotal"),11,6);
			objCTK.setCTK_elem(request.getParameter("PlantTotalObs"),11,7);
			// Total Gastos de Personal
			objCTK.setCTK_elem(request.getParameter("PersonalA"),12,0);
			objCTK.setCTK_elem(request.getParameter("PersonalB"),12,1);
			objCTK.setCTK_elem(request.getParameter("PersonalC"),12,2);
			objCTK.setCTK_elem(request.getParameter("PersonalD"),12,3);
			objCTK.setCTK_elem(request.getParameter("PersonalRA"),12,4);
			objCTK.setCTK_elem(request.getParameter("PersonalRB"),12,5);			
			objCTK.setCTK_elem(request.getParameter("Personal"),12,6);
			objCTK.setCTK_elem(request.getParameter("PersonalObs"),12,7);
			// Plantilla Media Taller
			objCTK.setCTK_elem(request.getParameter("PlantMediaA"),13,0);
			objCTK.setCTK_elem(request.getParameter("PlantMediaB"),13,1);
			objCTK.setCTK_elem(request.getParameter("PlantMediaC"),13,2);
			objCTK.setCTK_elem(request.getParameter("PlantMediaD"),13,3);
			objCTK.setCTK_elem(request.getParameter("PlantMediaRA"),13,4);
			objCTK.setCTK_elem(request.getParameter("PlantMediaRB"),13,5);			
			objCTK.setCTK_elem(request.getParameter("PlantMedia"),13,6);
			objCTK.setCTK_elem(request.getParameter("PlantMediaObs"),13,7);
			// Plantilla Media Admon.
			objCTK.setCTK_elem(request.getParameter("PlantAdmonA"),14,0);
			objCTK.setCTK_elem(request.getParameter("PlantAdmonB"),14,1);
			objCTK.setCTK_elem(request.getParameter("PlantAdmonC"),14,2);
			objCTK.setCTK_elem(request.getParameter("PlantAdmonD"),14,3);
			objCTK.setCTK_elem(request.getParameter("PlantAdmonRA"),14,4);
			objCTK.setCTK_elem(request.getParameter("PlantAdmonRB"),14,5);			
			objCTK.setCTK_elem(request.getParameter("PlantAdmon"),14,6);
			objCTK.setCTK_elem(request.getParameter("PlantAdmonObs"),14,7);
			// Prima Anual Seguro
			objCTK.setCTK_elem(request.getParameter("PrimaA"),15,0);
			objCTK.setCTK_elem(request.getParameter("PrimaB"),15,1);
			objCTK.setCTK_elem(request.getParameter("PrimaC"),15,2);
			objCTK.setCTK_elem(request.getParameter("PrimaD"),15,3);
			objCTK.setCTK_elem(request.getParameter("PrimaRA"),15,4);
			objCTK.setCTK_elem(request.getParameter("PrimaRB"),15,5);			
			objCTK.setCTK_elem(request.getParameter("Prima"),15,6);
			objCTK.setCTK_elem(request.getParameter("PrimaObs"),15,7);
			// ITV
			objCTK.setCTK_elem(request.getParameter("ItvA"),16,0);
			objCTK.setCTK_elem(request.getParameter("ItvB"),16,1);
			objCTK.setCTK_elem(request.getParameter("ItvC"),16,2);
			objCTK.setCTK_elem(request.getParameter("ItvD"),16,3);
			objCTK.setCTK_elem(request.getParameter("ItvRA"),16,4);
			objCTK.setCTK_elem(request.getParameter("ItvRB"),16,5);			
			objCTK.setCTK_elem(request.getParameter("Itv"),16,6);
			objCTK.setCTK_elem(request.getParameter("ItvObs"),16,7);
			// Impuestos
			objCTK.setCTK_elem(request.getParameter("ImpuestosA"),17,0);
			objCTK.setCTK_elem(request.getParameter("ImpuestosB"),17,1);
			objCTK.setCTK_elem(request.getParameter("ImpuestosC"),17,2);
			objCTK.setCTK_elem(request.getParameter("ImpuestosD"),17,3);
			objCTK.setCTK_elem(request.getParameter("ImpuestosRA"),17,4);
			objCTK.setCTK_elem(request.getParameter("ImpuestosRB"),17,5);
			objCTK.setCTK_elem(request.getParameter("Impuestos"),17,6);
			objCTK.setCTK_elem(request.getParameter("ImpuestosObs"),17,7);
			// Renting			
			objCTK.setCTK_elem(request.getParameter("RentingA"),18,0);
			objCTK.setCTK_elem(request.getParameter("RentingB"),18,1);
			objCTK.setCTK_elem(request.getParameter("RentingC"),18,2);
			objCTK.setCTK_elem(request.getParameter("RentingD"),18,3);
			objCTK.setCTK_elem(request.getParameter("RentingRA"),18,4);
			objCTK.setCTK_elem(request.getParameter("RentingRB"),18,5);
			objCTK.setCTK_elem(request.getParameter("Renting"),18,6);
			objCTK.setCTK_elem(request.getParameter("RentingObs"),18,7);
		 session.setAttribute("CTK",objCTK);
	   
%>

<BODY style="cursor: wait" onkeydown="cancelaEnter();" onload="document.body.style.cursor='default';document.all['general'].style.visibility='visible';document.all['general'].style.cursor='default';"  onunload="document.body.style.cursor='wait';document.all['general'].style.cursor='wait';">
<div  id="general" style="POSITION: absolute;visibility:hidden;cursor: wait">
  <form NAME="formCTKPDF" METHOD="POST">
	<TABLE class="general">
	  <tr>
	       <!--td width="90%" align="right"><INPUT TYPE="IMAGE" style="cursor:hand" VALUE="Retornar" ONCLICK="JavaScript:fncRetornar();" onMouseOver="top.status='Retornar'; return true" onMouseOut="top.status=''; return true" src="<%=m05bConstantesPaginas.PATH_IMAGENES%>/retornar.gif"></td-->
           <td width="90%" align="right"><input type="button" class="boton" name="<%= res.getString("etBOT_RETORNAR")%>" value="<%= res.getString("etBOT_RETORNAR")%>" ONCLICK="JavaScript:fncRetornar();return false;" onMouseOver="top.status='<%= res.getString("etBOT_STATUSRETORNAR")%>'; return false" onMouseOut="top.status=''; return false" /></td>				       
	  </tr>
	  <tr>
	    <td colspan="2">
			<embed name='pdfCTK' src='<%=srcPDF%>' type="application/pdf" width='736' height='500'></embed>
	  	</td>
	  </tr>
	</TABLE>
</form>
<script type="text/javascript" src="<%=m05bConstantesPaginas.PATH_SCRIPTS%>/m05bMsControl.js"></script>
 
</div>		  
</body>
<SCRIPT language=JavaScript>
		function fncRetornar() {
			var docu=document.formCTKPDF;
			docu.action="m05bResultadoCTKJsp.jsp?Desde=<%=desde%>&Hasta=<%=hasta%>&Mensaje=Temporal";
			docu.submit();
		}
</SCRIPT>
</html>