<?php
	include("stilos/config.inc.php");
	include("../clases/BDConexion.php");
 
  include("../clases/clsPer.php");
  include("Funciones.php");
  include("funcion/funciones.php");
  session_start();
  $objPer=new clsPer;
  $resultado=$objPer->getCodRuta();
  $filas=$objPer->NextRow($resultado);
  $cod_ruta=$filas['valor_e'].getNumCeros($filas['valor']);
  $horasal_ruta=date("H:i:s");
  $horallega_ruta=date("H:i:s");
?>
<? //include "sc_lib_ventana.php"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><MMString:LoadString id="insertbar/formsHidden" /></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">

<link href="Estilos.css" rel="stylesheet" type="text/css">

<link href="stilos/Estilos.css" rel="stylesheet" type="text/css">
<SCRIPT language=JavaScript src="js/calendario.js"></SCRIPT>
<script type="text/javascript" src="js/ajax.js"></script>
<script language="JavaScript"> 
<!--
//sURL,x,y
function Abrir_Ventanapopup1(sURL,x,y) { 
/*var especificaciones="top=0, left=0, toolbar=no,location=no, status=yes,menubar=no,scrollbars=no, resizable=no, width=1,height=1" 
var titulo="Titulo"
window.open(el_url,titulo,especificaciones);*/ 

if (!window.focus) return;
			var par;
			par = "width=" +x + ",height="+y+","
			par = par + "dependent=no,scrollbars=yes,resizable=no"
			par = par + "menubar=no,toolbar=no,status=yes"
			var ventana = window.open(sURL,"Ver",par)
			ventana.focus();
}
//--> 
</script>
<? 
$envia="fondo.php?k=$k&razonsocial=$razonsocial&distrito=$distrito";
$envia1="cvp_emp.php";
?>
<script>
function volverB(form)
{
location.reload('<? echo $envia1 ?>');
}
function volver(form)
{
location.reload('<? echo $envia ?>');
}
var vent = null;
function foco() {
   if (vent != null)
       vent.focus();
}
function cerrar() {
   vent = null;
}

</script>
<script language="JavaScript">
function selecciona(form)
{
 if(form.botones1.value)
  {
   form.zonasi.disabled=true;
  }
}

function cierra(form)
{
location.reload('../ventana.php');
}
function activainter(form)
{
   form.pais2.disabled=false;
   form.ciudad2.disabled=false;
   form.nacionalidad2.disabled=false;
   form.btn_ver2.disabled=false;
   form.btn_nuevo2.disabled=false;
   
   form.pais.value="";
   form.pais.disabled=true;
   form.ciudad.value="";
   form.ciudad.disabled=true;
   form.nacionalidad.value="";
   form.nacionalidad.disabled=true;
   form.idciudad1.value="";
   form.btn_ver1.disabled=true;
   form.btn_nuevo1.disabled=true;
}
</script>
<SCRIPT LANGUAGE=javascript>
function fn(form,field)
{
var next=0, found=false
var f=form
if(event.keyCode!=13) return;
for(var i=0;i<f.length;i++) {
if(field.name==f.item(i).name){
next=i+1;
found=true
break;
}
}
while(found){
if( f.item(next).disabled==false && f.item(next).type!='hidden'){
f.item(next).focus();
break;
}
else{
if(next<f.length-1)
next=next+1;
else
break;
}
}
}
</SCRIPT>
<script>
function enviar_url(form,url)
{

		if(form1.cod_ruta.value==""){
		alert("Debe Ingresar el codigo de la ruta");
		form1.cod_ruta.focus();
		return;		
	    }
		if(form1.orig_ruta.value=="0"){
		alert("Debe Ingresar el origen del lugar");
		form1.orig_ruta.focus();
		return;		
	    }
		
		if(form1.dest_ruta.value==""){
		alert("Debe Ingresar el destino del lugar");
		form1.dest_ruta.focus();
		return;		
	    }
		if(form1.mat_trans.value==""){
		alert("Debe Ingresar el transporte");
		form1.mat_trans.focus();
		return;		
	    }
		if(form1.fecha_ruta.value==""){
		alert("Debe Ingresar la fecha");
		form1.fecha_ruta.focus();
		return;		
	    }
		if(form1.testimado_ruta.value==""){
		alert("Debe Ingresar la fecha estimada");
		form1.testimado_ruta.focus();
		return;		
	    }
		if(form1.horasal_ruta.value==""){
		alert("Debe Ingresar la hora");
		form1.horasal_ruta.focus();
		return;		
	    }
		if(form1.button.value)
		{
		form1.submit();
		}
}
</script>
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
</head>

<body bgcolor="<?=$c_fondo['fondo']?>" onfocus="foco()" background="../imagenes/fondo.jpg">
<table width="550" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="135"><div align="left">Transporte
    </div></td>
    <td colspan="3"><div align="left">
      <select name="mat_trans" id="select" onkeyup=fn(this.form,this)>
        
        <? 
						echo $objPer->getCboTransVia($via);
						?>
      </select>
    </div></td>
  </tr>
  <? if($via=='A'){?>
  <tr>
    <td><div align="left">Arranque </div></td>
    <td width="248"><div align="left">
      <input name="hora_arra" type="text" id="hora_aire2" value="<? echo $hora_arra?>" size="10" maxlength="8">
    </div></td>
    <td width="72"><div align="left">Apagado</div></td>
    <td width="95"><div align="left">      <input name="hora_apag" type="text" id="hora_ater3" value="<? echo $hora_apag?>" size="10" maxlength="8">
    </div></td>
  </tr>
  <? }
  if($via=='A' || $via=='F'){
  ?>
  <tr>
    <td>Salida</td>
    <td>    <input name="horasal_ruta" type="text" id="horasal_ruta2" value="<? echo $horasal_ruta?>" size="10" maxlength="8"></td>
    <td>Llegada</td>
    <td><input name="horallega_ruta" type="text" id="horallega_ruta" value="<? echo $horallega_ruta?>" size="10" maxlength="8"></td>
  </tr>
  <? }?>
</table>
</body>
</html>

