<?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->getArtPed01($cod_rda);
  $fila=$objPer->NextRow($resultado);   
  $cantidad_a=$fila['cantidad_a'];
  $cantidad_r=$fila['cantidad_r'];
  $num_guia=$fila['num_guia'];
  $despachador=$fila['despachador'];
  $fdespacho=extraerfechanormal($fila['fdespacho']);
  $freceptor=extraerfechanormal($fila['freceptor']);
  $via=$fila['via'];
  $nave=$fila['nave'];
  $destino=$fila['destino'];
  $odespacho=$fila['odespacho'];
  $oreceptor=$fila['oreceptor'];
  $rconforme=$fila['estado'];
  $receptor=$fila['receptor'];
  
?>

<!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"> 
<!--
function Abrir_Ventanapopup1(sURL,x,y) { 
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>
<script language="JavaScript"> 
<!--
function Abrir_Ventanapopup2(sURL,x,y) { 
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,"Nuevo",par)
			ventana.focus();
}
//--> 
</script>
<? 
$envia="fondo.php?k=$k&razonsocial=$razonsocial&distrito=$distrito";
$envia1="cvp_personal.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_per.value==""){
		alert("Debe Ingresar el codigo del personal");
		form1.cod_per.focus();
		return;		
	    }
		if(form1.nom_per.value==""){
		alert("Debe Ingresar el codigo del personal");
		form1.nom_per.focus;
		return;		
	    }
		if(form1.appat_per.value==""){
		alert("Debe Ingresar el apellido paterno del personal");
		form1.appat_per.focus;
		return;		
	    }
		if(form1.apmat_per.value==""){
		alert("Debe Ingresar el apellido materno del personal");
		form1.apmat_per.focus;
		return;		
	    }
		if(form1.fnac_per.value==""){
		alert("Debe Ingresar la fecha de nacimiento del personal");
		form1.fnac_per.focus;
		return;		
	    }
		if(form1.cod_emp.value==""){
		alert("Debe Ingresar la empresa del personal");
		form1.cod_emp.focus;
		return;		
	    }
		if(form1.cod_pais.value==""){
		alert("Debe Ingresar el pais del personal");
		form1.cod_pais.focus;
		return;		
	    }
		if(form1.fono_per.value==""){
		alert("Debe Ingresar el telefono del personal");
		form1.fono_per.focus;
		return;		
	    }
		if(form1.cargo_per.value==""){
		alert("Debe Ingresar el cargo del personal");
		form1.cargo_per.focus;
		return;		
	    }
		if(form1.dociden_per.value==""){
		alert("Debe Ingresar el doc de identidad del personal");
		form1.dociden_per.focus;
		return;		
	    }
		if(form1.peso_per.value==""){
		alert("Debe Ingresar el peso del personal");
		form1.peso_per.focus;
		return;		
	    }*/
		if(form1.button.value)
		{
		form1.submit();
		}
}
</script>
<script>
function poner_imagen()
{
imagen1=new Image;
imagen1.src=document.form1.foto.value;
document.imagenes['foto'].src=imagen1.src;
}
</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 name="form1" method="post" action="procesos/cvp_recepcion_ped_grabar.php" enctype="multipart/form-data">
          <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" >Receptor</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="120"><div align="left">Responsable</div></td>
                      <td width="5"><div align="left">:</div></td>
                      <td colspan="4"><div align="left">
                      </div>                        
                      <div align="left">
                        <input name="receptor" type="text" size="35" id="cantidad_p2" value="<? echo $receptor?>">
                      </div>                      <div align="right"></div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Cantidad Pedida </div></td>
                      <td>&nbsp;</td>
                      <td><div align="left">
                        <input name="cantidad_p" type="text" id="cantidad_p" value="<? echo $cantidad_p?>" size="5" readonly>
                      </div></td>
                      <td><div align="right">Cantidad Atendida </div></td>
                      <td>&nbsp;</td>
                      <td><div align="left">
                        <input name="cantidad_a" type="text" id="cantidad_a" value="<? echo $cantidad_a?>" size="5" readonly>
                      </div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Fecha Recepcion </div></td>
                      <td><div align="left">:</div></td>
                      <td width="100"><div align="left">
                        <table width="100" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="83"><div align="left">
                              <input name="freceptor" type="text" class="lblForm1" id="fnac_per5" onKeyUp=fn(this.form,this) value="<? echo $freceptor?>" size="12" maxlength="10" >
                            </div></td>
                            <td width="10">&nbsp;</td>
                            <td width="99"><div align="left">
							<a onMouseOver="window.status='Calendario';return true;" onMouseOut="window.status='';return true;"  href="javascript:show_calendar('form1.freceptor');">
					        <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0">
					        </a>
							</div></td>
                          </tr>
                        </table>
                      </div></td>
                      <td width="133"><div align="right">N&ordm; de Guia </div></td>
                      <td width="4"><div align="left">:</div></td>
                      <td width="317"><input name="num_guia" type="text" id="num_guia" value="<? echo $num_guia?>" size="25" readonly>
                        <span class="lblForm">                        </span>                        </td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Despachador</td>
                      <td>&nbsp;</td>
                      <td colspan="4"><div align="left">
                        <input name="despachador" type="text" id="despachador" value="<? echo $despachador?>" size="35" readonly>
                      </div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Via</td>
                      <td>&nbsp;</td>
                      <td><select name="via" id="via" disabled>
                        <option value="A" <? if($via=="A"){?> selected <? }?>>AEREA</option>
                        <option value="F" <? if($via=="F"){?> selected <? }?>>FLUVIAL</option>
                      </select></td>
                      <td><div align="right">Transporte</div></td>
                      <td>&nbsp;</td>
                      <td><div align="left"><span class="lblForm">
                        <select name="nave" id="select2" onkeyup=fn(this.form,this) disabled>
                          <option value="0" <? if($nave=="0"){?> selected <? }?>>Ninguno</option>
                          <? 
						echo $objPer->getCboTrans($nave);
						?>
                        </select>
                      </span></div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Destino</div></td>
                      <td>&nbsp;</td>
                      <td><div align="left"><span class="lblForm">
                        <select name="destino" id="select3" disabled>
                          <option value="0" <? if($destino=="0"){?> selected <? }?>>Seleccionar</option>
                          <? 
						    echo $objPer->getCboLugarNN($destino);
						?>
                        </select>
                      </span>
                      </div></td>
                      <td><div align="right">Conformidad</div></td>
                      <td>&nbsp;</td>
                      <td><div align="left">
                        <select name="rconforme" id="rconforme">
                          <option value="C" <? if($rconforme=="C"){?> selected <? }?>>SI</option>
                          <option value="D" <? if($rconforme=="D"){?> selected <? }?>>NO</option>
                        </select>
                      </div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Observaciones</td>
                      <td>&nbsp;</td>
                      <td colspan="4"><textarea name="oreceptor" cols="50" rows="3" id="textarea"><? echo $oreceptor?></textarea>                      </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_recepcion_ped_grabar.php')">
                              </div></td>
                              <td width="220"><div align="center">                                
							  <input name="cod_rda" type="hidden" id="cod_rda" value="<? echo $cod_rda?>" size="3">
							  <input name="tipo" type="hidden" id="tipo" value="<? echo $tipo?>">
                                <input name="campo1" type="hidden" id="campo1" value="<? echo $campo1?>">
                                <input name="campo2" type="hidden" id="campo2" value="<? echo $campo2?>">
</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="20"></td>
              <td background="../estilo_tabla/parte_inf_cen.gif">&nbsp;</td>
              <td><img src="../estilo_tabla/parte_inf_der.gif" width="25" height="20"></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>

