<?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");
?>

<html>
<head>
<title></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">
/* function desabilitado(){
document.form1.boton_man.disabled = true;
} */
</script>
</head>

<body  bgcolor="<?=$c_fondo['fondo']?>">
<table width="876" border="0" cellspacing="0" cellpadding="0">
  <tr class="lblCampo">
    <td width="135"><div align="left">Transporte
    </div></td>
    <td colspan="3"><div align="left">
      <select name="matricula" id="select" onkeyup=fn(this.form,this)>        
        <?=$objPer->getCboTransVia($via);?>
      </select>
    </div></td>
  </tr>
  <tr class="lblCampo">
  
    <td><div align="left">Fecha <? if($via=='A'){ echo "Salida";}else{ echo "Ruta";}?></div></td>
    <td width="161"><div align="left">
      <table width="80" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="67"><div align="left">
              <input name="fecha_ruta" type="text" value="<?=$fecha_ruta?>" size="12" maxlength="10" title="FORMATO dd/mm/AA">
          </div></td>
          <td width="10">&nbsp;</td>
          <td width="109"><div align="left"> 
		  <a onMouseOver="window.status='Calendario';return true;" onMouseOut="window.status='';return true;"  href="javascript:show_calendar('form1.fecha_ruta');"> 
		  <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0">		  </a> 
		  </div></td>
        </tr>
      </table>
    </div></td>
	<? if($via=='F'){?>
    <td width="105"><div align="left">Fecha LLegada </div></td>
    <td width="149"><div align="left">
      <table width="80" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="67"><div align="left">
              <input name="testimado_ruta" type="text" id="testimado_ruta2" onKeyUp=fn(this.form,this) value="<? echo $testimado_ruta?>" size="12" maxlength="10" title="FORMATO dd/mm/AA">
          </div></td>
          <td width="10">&nbsp;</td>
          <td width="109"><div align="left"> <a onMouseOver="window.status='Calendario';return true;" onMouseOut="window.status='';return true;"  href="javascript:show_calendar('form1.testimado_ruta');"> <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"> </a> </div></td>
        </tr>
      </table>
    </div></td>
	<? }?>
  </tr>
  <tr class="lblCampo">
    <td><div align="left">Numero de Vuelo </div></td>
    <td colspan="3"><div align="left">
      <select name="nv" id="nv">
	  <? for($nv=1;$nv<=15;$nv++){?>
        <option value="<?=$nv?>"><?=$nv?></option>
	  <? }?>
      </select>
      <input name="correo" type="hidden" id="correo" size="50">
    </div></td>
  </tr>
  <tr class="lblCampo">
    <td><div align="left">Archivo</div></td>
    <td colspan="3"><div align="left">
     <input name="file" type="hidden" id="file"><input name="importar" type="hidden" class="botira" id="importar" style="<?=$stylo['st2']?>" value="Importar" onClick="ImportarDatos()"> 
      
    </div></td>
  </tr>
  
  <tr>
    <td colspan="4"><div align="left">
      <table width="874" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" >
        <tr bgcolor="<?=$c_fondo_tr["fondo tr"]?>" class="lblCampoBlanco">
          <td height="13" colspan="2"><div align="center">Ruta</div></td>
          <td height="13" colspan="<? if($via=='A'){ echo 5;}elseif($via=='F'){ echo 2;}?>"><div align="center">Tiempo</div></td>
          <td width="42" rowspan="2"><div align="center">Combus</div></td>
          <td width="51" rowspan="2"><div align="center">Fact</div></td>
          <td width="96" rowspan="2"><div align="center">FechaSal</div></td>
          <td width="82" rowspan="2"><div align="center">Fechalle</div></td>
          <td width="28" rowspan="2"><div align="center">Pax</div></td>
          <td width="31" rowspan="2"><div align="center">Car</div></td>
          <td width="144" rowspan="2"><div align="center">Observacion</div></td>
          <td width="44" rowspan="2"><div align="center">Prog.</div></td>
          <td rowspan="2"><input name="vias" type="hidden" value="<?=$via?>" size="5"></td>
        </tr>
        <tr bgcolor="<?=$c_fondo_tr["fondo tr"]?>" class="lblCampoBlanco">
          <td height="13"><div align="center">De</div></td>
          <td><div align="center">Para</div></td>
          <? if($_POST['via']=='A'){?>
          <td><div align="center">HAR</div></td>
          <? }?>
          <td><div align="center">HSAL</div></td>
          <td width="27"><div align="center">HLLE</div></td>
		  <? if($_POST['via']=='A'){?>
          <td width="27"><div align="center">HDES</div></td>
          
          <td width="27"><div align="center">HAP</div></td>
          <? }?>
          </tr>
        <tr>
          <td width="72"><div align="center">
              <select name="origen" id="select7">
                <option value="0" <? if($origen=="0"){?> selected <? }?>>Origen</option>
                <?=$objPer->getCboLugaresDef($origen);?>
              </select>
          </div></td>
          <td width="77"><div align="center">
              <select name="destino" id="select6">
                <option value="0" <? if($destino=="0"){?> selected <? }?>>Destino</option>
                <?=$objPer->getCboLugaresDef($destino);?>
              </select>
          </div></td>
          <? if($_POST['via']=='A'){?>
          <td width="27"><div align="center">
              <input name="harranq_dch" type="text" id="harranq_dch" value="00:00" size="5" maxlength="5">
          </div></td>
          <? }else{?>
          <input name="harranq_dch" type="hidden" id="harranq_dch" value="00:00" size="8" maxlength="5">
          <? }?>
          <td width="27"><div align="center">
              <input name="haire_dch" type="text" id="haire_dch" value="00:00" size="5" maxlength="5">
          </div></td>
          <td>
            <div align="center">
              <input name="htierra_dch" type="text" id="htierra_dch" value="00:00" size="5" maxlength="5">
          </div></td>
		  <? if($_POST['via']=='A'){?>
          <td><div align="center">
            <input name="hdes" type="text" id="hdes" value="00:00" size="5" maxlength="5">
          </div></td>
          
          <td><div align="center">
              <input name="hapaga_dch" type="text" id="hapaga_dch" value="00:00" size="5" maxlength="5">
          </div></td>
          <? }else{?>
          <input name="hapaga_dch" type="hidden" id="hapaga_dch" value="00:00" size="8" maxlength="5">
		  <input name="hdes" type="hidden" id="hdes" value="00:00" size="5" maxlength="5">
          <? }?>
          <td>
            
            <div align="center">
              <input name="combustible" type="text" id="combustible2" value="0.00" size="8">
            </div>
            <div align="center"> </div>
            <div align="center"> </div>
            <div align="center"> </div>
            <div align="center"> </div>
            <div align="center"> </div>
            <div align="center"> </div>
            <div align="center"> </div>
            <div align="center"> </div>
            <div align="center"> </div>
            <div align="center"> </div>
            <div align="center"></div>
            <div align="center"> </div>
            <div align="center"> </div></td>
          <td><div align="center">
            <select name="facturable" id="select2">
              <option value="SI">SI</option>
              <option value="NO">NO</option>
            </select>
          </div></td>
          <td><div align="center">
            <table width="80" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="67"><div align="left">
                    <input name="fechasalida" type="text" onKeyUp=fn(this.form,this) value="<? echo $fechasalida?>" size="12" maxlength="10" title="FORMATO dd/mm/AA">
                </div></td>
                <td width="10">&nbsp;</td>
                <td width="109"><div align="left"> <a onMouseOver="window.status='Calendario';return true;" onMouseOut="window.status='';return true;"  href="javascript:show_calendar('form1.fechasalida');"> <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"> </a> </div></td>
              </tr>
            </table>
          </div></td>
          <td><div align="center">
            <table width="80" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="67"><div align="left">
                    <input name="fechallegada" type="text" onKeyUp=fn(this.form,this) value="<? echo $fechallegada?>" size="12" maxlength="10" title="FORMATO dd/mm/AA">
                </div></td>
                <td width="10">&nbsp;</td>
                <td width="109"><div align="left"> <a onMouseOver="window.status='Calendario';return true;" onMouseOut="window.status='';return true;"  href="javascript:show_calendar('form1.fechallegada');"> <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"> </a> </div></td>
              </tr>
            </table>
          </div></td>
          <td><div align="center">
            <input name="pax" type="text" id="pax" value="0" size="5">
          </div></td>
          <td><div align="center">
            <input name="carga" type="text" id="carga" value="0" size="5">
          </div></td>
          <td><div align="center">
            <textarea name="obser" cols="25" rows="2" id="textarea5"></textarea>
          </div></td>
          <td><div align="center">
            <select name="programado" id="programado">
              <option value="S" title="SI">S</option>
              <option value="N" title="NO">N</option>
              <option value="M" title="Mantenimiento">M</option>
              <option value="I" title="Indisponibilidad">I</option>
            </select>
          </div></td>
          <td width="38"><div align="center"><!-- <a href="#" onClick="enviarDatos()"><img src="../imagenes/btn_siguiente.gif" width="25" height="25" border="0"></a> --> 
            <input name="boton_agregar" type="button" id="boton_agregar" title="Agregar a la lista" onClick="enviarDatos()" value=">>" class="botira" style="<?=$stylo['st2']?>">
          </div>          </td>
        </tr>
        
        
      </table>
      </div></td>
  </tr>
  <tr>
    <td colspan="4">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="4"><div id="canasta">
      <? //include('p_rutas_detalle.php');?>
    </div></td>
  </tr>
  <tr>
    <td colspan="4">
      <div id="lugar_grabar1"></div></td>
  </tr>
</table>
</body>
</html>

