<?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 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="740" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr valign="top" >
    <td height="25" colspan="4">
    <div align="left" ></div></td>
  </tr>
  <tr class="lblCampo" >
    <td colspan="4"><div align="center">
        <form action="procesos/cvp_ruta_grabar.php" method="post" enctype="multipart/form-data" name="form1">
          <table width="730" 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="680" background="../estilo_tabla/parte_sup_cen.gif" valign="bottom">
                <div align="left" class="lblTitulo" >Enviar Documento </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="679" border="0" cellspacing="0" cellpadding="0">
                    <tr class="lblCampo">
                      <td colspan="6">&nbsp; </td>
                    </tr>
                    <tr class="lblCampo">
                      <td width="128"><div align="left">Codigo de Ruta </div></td>
                      <td width="4"><div align="left">:</div></td>
                      <td colspan="4"><div align="left">
                          <input name="cod_ruta" type="text" id="apellidos2" onkeyup=fn(this.form,this) value="PER/CAR-" size="13">
                          <label>
                          <input name="textfield" type="text" value="0003" size="8">
                          </label>
                          <label>
                          <input name="textfield2" type="text" value="/RH-" size="8">
                          </label>
                          <label>
                          <input name="textfield3" type="text" value="0608" size="8">
                          </label>
                      </div>                        </td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Tipo Doc </td>
                      <td>&nbsp;</td>
                      <td width="186"><div align="left">
                        <select name="mat_trans" id="select3" onkeyup=fn(this.form,this)>
                          <option value="0">Ninguno</option>
                          <option value="1">Carta</option>
                          <option value="2">Memo</option>
                          <option value="3">Solicitud de Pago</option>
                        </select>
                      </div></td>
                      <td width="128">Confidencial</td>
                      <td width="5">&nbsp;</td>
                      <td width="228"><label>
                        <input type="checkbox" name="checkbox" value="checkbox">
                      </label></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Fecha</td>
                      <td>&nbsp;</td>
                      <td><label>
                        <input name="textfield4" type="text" value="12/06/2008" size="15">
                      </label></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Para</td>
                      <td>&nbsp;</td>
                      <td colspan="4"><label>
                        <input name="textfield5" type="text" size="30">
                      </label></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Referencia</td>
                      <td>&nbsp;</td>
                      <td colspan="4"><label>
                        <input name="textfield6" type="text" size="30">
                      </label></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Asunto</td>
                      <td>&nbsp;</td>
                      <td colspan="4"><input name="horasal_ruta" type="text" id="horasal_ruta" size="35" maxlength="8"></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Archivo</td>
                      <td>&nbsp;</td>
                      <td colspan="4"><label>
                        <input name="file" type="file" size="35">
                      </label></td>
                    </tr>
                    <tr class="normal">
                      <td colspan="6">
                        <hr align="left" size="1" color="#000000">                      </td>
                    </tr>
                    <tr class="normal">
                      <td colspan="6">
					    <div align="center">
					      <table width="660" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                              <td width="220"><div align="right">
                                <input name="button" type="button" style="<?=$stylo['st2']?>" class="botira" value=".:Grabar:." onClick="enviar_url(form1,'procesos/cvp_ruta_grabar.php')">
                              </div></td>
                              <td width="220"><div align="center">
                              </div></td>
                              <td width="220"><div align="left">
                                <input name="Submit2" type="button" style="<?=$stylo['st2']?>" class="botira" value=".: Salir :." onClick="volver(this.form);">
                              </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">&nbsp;</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>

