<?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");
  
  
  session_register("control1");
 
  if($borrar==1){
  $control1 = array();  
  }
$nombre_p="codigo_ruta";
$objPer->UpdateParametro($nombre_p,$filas['valor']);
?>
<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/ajax2.js"></script>
<script language="javascript" src="ajax4.js"></script>
<? 
$envia="cvp_rutas_v.php?borrar=1";
$envia1="fondo.php";
$ir_manifiesto="fondo.php?cod_ruta";
?>
<script language="JavaScript">
function NuevoFormu(form)
{
location.reload('<? echo $envia ?>');
}
function salir(form)
{
location.reload('<? echo $envia1 ?>');
}
function GenerarManifiesto(cod)
{
location.reload('<? echo $ir_manifiesto?>='+cod);
}
function desabilitado(){
document.form1.boton_man.disabled = true;
document.form1.boton_grabar.disabled = true;
document.form1.boton_nuevo.disabled = true;
document.form1.boton_salir.disabled = true;
}
function habilitado(){
document.form1.boton_man.disabled = true;
document.form1.boton_grabar.disabled = false;
}
function habilitadoselect(){
document.form1.boton_grabar.disabled = false;
document.form1.boton_salir.disabled = false;
}
</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 GenerarManifiesto()
{
		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 onLoad="desabilitado()" bgcolor="<?=$c_fondo['fondo']?>">
<table width="844" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr valign="top" >
    <td width="741" height="25" colspan="4">
    <div align="left" ></div></td>
  </tr>
  <tr class="lblCampo" >
    <td colspan="4"><div align="center">
        <form name="form1" method="post" action="p_manifiesto_dinamico.php" enctype="multipart/form-data">
		
          <table width="842" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="25"><img src="../estilo_tabla/parte_sup_izq.gif" width="25" height="25"></td>
              <td width="792" background="../estilo_tabla/parte_sup_cen.gif" valign="bottom">
                <div align="left" class="lblTitulo" >Registro de PLan de Viaje </div></td>
              <td width="25"><img src="../estilo_tabla/parte_sup_der.gif" width="25" height="25" border="0" usemap="#Map"></td>
            </tr>
            <tr>
              <td  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
              <td  height="86" background="../estilo_tabla/parte_med_cen.gif"><div align="center">
                  <table width="785" border="0" cellspacing="0" cellpadding="0">
                    <tr class="lblCampo">
                      <td colspan="6"><input name="dir" type="hidden" id="dir" value="1"> <input name="borrar" type="hidden" id="borrar" value="1"></td>
                    </tr>
                    <tr class="lblCampo">
                      <td width="128"><div align="left">Codigo de Viaje </div></td>
                      <td width="4"><div align="left">:</div></td>
                      <td width="193"><div align="left">
                          <input name="cod_ruta" type="text" id="apellidos2" onkeyup=fn(this.form,this) value="<? echo $cod_ruta?>" size="20" readonly>
                          <input name="valor_ruta" type="hidden" id="valor" size="3" value="<?=$filas['valor']?>" readonly>
                          <input name="tiporuta" type="hidden" id="tiporuta3" value="1">
                          <input name="activo_ruta" type="hidden" id="activo_ruta4" onKeyUp=fn(this.form,this) value="1" size="5">
                          <input name="retorno" type="hidden" id="retorno" value="1">
</div></td>
                      <td width="121"><div align="right">Via</div></td>
                      <td width="5"><div align="left">:</div></td>
                      <td width="228"><select name="via" id="select2" onChange="enviar1(this.options[this.options.selectedIndex].value);habilitadoselect()">
                        <option value="0" >Seleccione</option>
                        <option value="A" <? if($via=='A'){?> selected <? }?>>Aerea</option>
                        <option value="F" <? if($via=='F'){?> selected <? }?>>Fluvial</option>
                      </select>					  
					  </td>
                    </tr>
                    
                    <tr class="lblCampo">
                      <td colspan="6"><div id="Cuerpo" align="left"></div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td colspan="6"><div align="center">
                        <table width="520" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="117"><div align="right">
                                <input name="boton_grabar" type="button" class="botira" id="boton_grabar" style="<?=$stylo['st2']?>" onClick="enviarDatosGrabar()" value=".::  Grabar  ::.">
                            </div></td>
                            <td width="130"><div align="center">
                                <input name="boton_man" type="button" class="botira" id="boton_man" style="<?=$stylo['st2']?>" onClick="GenerarManifiesto();" value=".:: Manifiesto ::.">
                            </div></td>
                            <td width="133"><div align="center">
                                <input name="boton_nuevo" type="button" class="botira" id="boton_nuevo" style="<?=$stylo['st2']?>" onClick="NuevoFormu(this.form)" value=".::    Nuevo    ::.">
                            </div></td>
                            <td width="140"><div align="left">
                                <input name="boton_salir" type="button" class="botira" id="boton_salir" style="<?=$stylo['st2']?>" onClick="salir(this.form);" value=".::      Salir     ::.">
                            </div></td>
                          </tr>
                        </table>
                      </div></td>
                    </tr>
                  </table>
              </div></td>
              <td background="../estilo_tabla/parte_med_der.gif">&nbsp;</td>
            </tr>
            <tr>
              <td><img src="../estilo_tabla/parte_inf_izq.gif" width="25" height="25"></td>
              <td background="../estilo_tabla/parte_inf_cen.gif"><div align="right"><a href="p_manifiesto_dinamico.php?dir=1"></a></div></td>
              <td><img src="../estilo_tabla/parte_inf_der.gif" width="25" height="25"></td>
            </tr>
          </table>
		  
        </form>
    </div></td>
  </tr>
  <tr valign="top" class="lblCampo" >
    <td colspan="4">
    <div align="center"> </div></td>
  </tr>
</table>
<map name="Map">
  <area shape="rect" coords="3,4,23,21" href="fondo.php">
</map>
</body>
</html>

