<?php	
  include("../clases/BDConexion.php");
  include("../clases/clsPer.php");
  include("Funciones.php");
  include("stilos/config.inc.php");
  include("funcion/funciones.php");
  session_start();
  $objPer=new clsPer;
  session_register("pasajes");
  session_register("cargac");
  if($borrar==1){
  $pasajes = array();
  $cargac = array();
  }
  /* if($cod=="x"){
  $resultado=$objPer->getCodMani();
  $filas=$objPer->NextRow($resultado);
  $cod_man=$filas['valor_e'].getNumCeros($filas['valor']);
  } */
$rscab=$objPer->getCabMan($cod_man,$via);	
$rowcab=$objPer->NextRow($rscab);
?>
<? //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_personal.php";
$enviao="enviar.php?cod_man=$cod_man&dest_ruta=$dest_ruta&orig_ruta=$orig_ruta";
?>
<script>
function volverB(form)
{
location.reload('<? echo $envia1 ?>');
}
function volver(form)
{
location.reload('<? echo $envia ?>');
}
function volver1(form)
{
location.reload('<? echo $enviao ?>');
}
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.fecha_man.value==""){
		alert("Debe Ingresar la Fecha");
		form1.orig_ruta.focus;
		return;		
	    }
		if(form1.orig_ruta.value)
		{
		form1.submit();
		}
		//form1.submit();
}
function enviar_url2(form,url)
{		
		/*if(form1.fecha_man.value==""){
		alert("Debe Ingresar la Fecha");
		form1.fecha_man.focus;
		return;		
	    }
		if(form1.orig_ruta.value)
		{
		form1.submit();
		}*/
		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="922" 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="872" background="../estilo_tabla/parte_sup_cen.gif" valign="bottom">
      <div align="left" class="lblTitulo" >Manifiesto </div></td>
    <td width="25"><img src="../estilo_tabla/parte_sup_der.gif" width="25" height="25" border="0" usemap="#MapMap"></td>
  </tr>
  <tr>
    <td  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
	<form name="form1" method="post" action="cvp_manifiesto.php?cod_man=<? echo $cod_man?>&fecha_man=<? echo $fecha_man?>&orig_ruta=<? echo $orig_ruta?>&dest_ruta=<? echo $dest_ruta?>&num=<? echo $num?>&valor=<? echo $filas['valor']?>&via=<? echo $via?>">
    <td background="../estilo_tabla/parte_med_cen.gif"><div align="center">
      
        <table width="863" border="0" cellspacing="0" cellpadding="0">
          <tr class="lblCampo">
            <td colspan="6">&nbsp; </td>
          </tr>
          <tr class="lblCampo">
            <td><div align="right">Via</div></td>
            <td>&nbsp;</td>
            <td><div align="left"><?=$rowcab['via']?>
            </div></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr class="lblCampo">
            <td width="142"><div align="right">N&ordm; de Manifiesto </div></td>
            <td width="5"><div align="left">:</div></td>
            <td width="181"><div align="left">
              <?=$rowcab['cod_man']?>
            </div></td>
            <td width="64"><div align="right">Fecha</div></td>
            <td width="6"><div align="left">:</div></td>
            <td width="465"><div align="left">
              <?=$rowcab['fecha_man']?>
                </div></td>
          </tr>
          
          <tr class="lblCampo">
            <td><div align="right">Origen</div></td>
            <td><div align="left">:</div></td>
            <td><div align="left">
              <?=$rowcab['origen']?>
            </div></td>
            <td><div align="right">Destino</div></td>
            <td><div align="left">:</div></td>
            <td>
              <?=$rowcab['destino']?>
              <input name="valor" type="hidden" id="valor3" size="3" value="<? echo $filas['valor']?>">            </td>
          </tr>
          <tr class="lblCampo">
            <td><div align="left"></div></td>
            <td><div align="left"></div></td>
            <td><div align="left"> </div></td>
            <td>&nbsp;</td>
            <td><div align="left"></div></td>
            <td>&nbsp;</td>
          </tr>
          <tr class="lblCampo">
            <td colspan="6">
			<div align="left">			  </div>
			</td>
            </tr>
          
          <tr class="lblCampo">
            <td colspan="6">			
			<div align="left">
			<iframe name="detalle" src="p_manifiesto_plata_detalle_edit.php?num=<? echo $num?>&tipo_trans=<? echo $tipo_trans?>&mat_trans=<? echo $mat_trans?>&foco=<? echo $foco?>&q=<?=$q?>&cod_man=<?=$cod_man?>&via=<?=$via?>" width="820" height="400" marginheight="0" marginwidth="0" frameborder="0" scrolling="yes"></iframe>
			</div>
			</td>
            </tr>
        </table>
      
    </div></td>
	</form>
    <td background="../estilo_tabla/parte_med_der.gif">&nbsp;</td>
  </tr>
  <tr>
    <td  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
	<form name="form2" method="post" action="procesos/p_manifiesto_editar_grabar.php">
    <td background="../estilo_tabla/parte_med_cen.gif">
	
      <table width="660" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="3"><div align="left">
            <table width="635" border="0" cellspacing="0" cellpadding="0">
              <tr class="lblCampo" valign="top">
                <td width="118"><div align="right"></div></td>
                <td width="10">&nbsp;</td>
                <td width="507"><div align="left">
                </div></td>
              </tr>
            </table>
          </div></td>
          </tr>
        <tr>
          <td width="220"><div align="right">
              <input name="button" type="submit" style="<?=$stylo['st2']?>" class="botira" value=".: Actualizar :.">
          </div></td>
          <td width="220"><div align="center">
            <input name="cod_man" type="hidden" id="cod_man" value="<? echo $cod_man?>" size="5">            
            <input name="orig_ruta" type="hidden" id="orig_ruta" value="<?=$rowcab['origen']?>" size="5">
            <input name="dest_ruta" type="hidden" id="dest_ruta" value="<?=$rowcab['destino']?>" size="5">
            <input name="cod_ruta" type="hidden" id="cod_ruta" value="<? echo $cod_ruta?>" size="5">
            <input name="fecha_man" type="hidden" id="fecha_man" value="<? echo $fecha_man?>" size="5">
            <input name="carga_max" type="hidden" id="carga_max" value="<? echo $rowcab['cargat_trans']?>" size="5">
			<input name="textfield3222" type="hidden" value="<? echo $tcant_trans?>" size="5">
			<input name="mat_trans" type="hidden" size="5" id="mat_trans" value="<? echo $mat_trans?>">
            <input name="testimado_ruta" type="hidden" size="5" id="testimado_ruta" value="<? echo $testimado_ruta?>">			
            <? 
			echo $_SESSION['carga']=$capcarg_trans;
			?>
			<? 
			$_SESSION['totaltrip']=$tcant_trans;
			?>
            <input name="valor" type="hidden" id="valor" size="3" value="<? echo $valor?>">
            <input name="via" type="hidden" size="3" id="via" value="<? echo $via?>">
            <input name="hora" type="hidden" id="hora" value="<? echo date("H:i:s")?>">
            <input name="fecha_ruta" type="hidden" size="5" id="fecha_ruta" value="<? echo $fecha_ruta?>">
            <input name="codigo_man" type="hidden" size="5" id="codigo_man" value="<?=$codigo_man?>">
          </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>
    </td></form>
    <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>
<map name="MapMap">
  <area shape="rect" coords="3,4,23,21" href="fondo.php">
</map>



</body>
</html>

