<?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;
  if($via=='F' || $via=='0'){
  
  $transper_d = array();  
  
  }
?>
<? //include "sc_lib_ventana.php"?>

<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>

<? 
$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');
}

</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.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.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="504" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="550"><div align="left">
      <table width="500" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="180"><div align="center">Tipo</div></td>
          <td width="157"><div align="center">Fecha Inicial </div></td>
          <td width="165"><div align="center">Fecha Termino </div></td>
          <td width="125"><div align="center">Costo Diario </div></td>
          <td width="48"><div align="center"></div></td>
        </tr>
        <tr>
          <td><div align="center">
              <select name="tipoper" id="tipoper">
                <option value="Piloto">Piloto</option>
                <option value="Copiloto">Copiloto</option>
                <option value="Mecanico">Mecanico</option>
              </select>
          </div></td>
          <td><div align="center">
              <table width="134" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="67"><div align="left">
                      <input name="fechaini_tp" type="text" id="fechaini_tp" title="FORMATO dd/mm/AA" onKeyUp=fn(this.form,this) value="<? echo $fechaini_tp?>" size="12" maxlength="10">
                  </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.fechaini_tp');"> <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="134" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="67"><div align="left">
                      <input name="fechafin_tp" type="text" id="fechafin_tp" title="FORMATO dd/mm/AA" onKeyUp=fn(this.form,this) value="<? echo $fechafin_tp?>" size="12" maxlength="10">
                  </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.fechafin_tp');"> <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="costod" type="text" id="costod" value="0.00" size="15">
          </div></td>
          <td><div align="center">
            <input name="boton_agregar" type="button" id="boton_agregar" value="&gt;&gt;" class="botira" style="<?=$stylo['st2']?>" title="Agregar a la Lista">
            <!-- <a href="#" onClick="enviarDatos()"><img src="../imagenes/btn_siguiente.gif" width="25" height="25" border="0"></a> --></div></td>
        </tr>
      </table>
      </div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><div id="lista_tp">
      <? //include('p_transper_detalle.php');?>
    </div></td>
  </tr>
  <tr>
    <td><div align="center">
    </div></td>
  </tr>
  <? if($via=='A'){?>
  <? }
  if($via=='A' || $via=='F'){
  ?>
  <? }?>
</table>
</body>
</html>

