<? session_start();
include("header.php");
require_once("comun/conex_ver.php");
require_once("comun/conexion3.php");
require_once("comun/funciones.php");
$link_impo=con_impo();$link=con_ver();
 
$booking_interteam = $_GET[booking_interteam];
 

if(strpos($booking_interteam,'EXIT')!==false){
	 
	$bl1 = data($link_impo,"SELECT D.pol,D.pol_country,D.finaldestination,D.referencia_interteam, D.pod, D.pod_country, D.vessel, D.voyage
	FROM datosexpint D
	INNER JOIN bookingexpint B ON D.files = B.files
	AND B.booking_interteam LIKE '".$booking_interteam."' AND B.booking_interteam<>'' and D.id>8500
	LIMIT 10");
	 
	$referencia_cliente = $bl1[referencia_interteam];
	$viaje[pod]=$bl1[pod].', '.$bl1[pod_country];
	$viaje[pol]=$bl1[pol].', '.$bl1[pol_country];
	$viaje[finaldestination]=$bl1[finaldestination];
	$viaje[vessel]=$bl1[vessel];
	$viaje[voyage]=$bl1[voyage];
	
	$bl2 = data($link ,"SELECT referencia_lpv FROM datosbooking where referencia_cliente = '$referencia_cliente'");
	$referencia = $bl2[referencia_lpv]; 
}else{

 
$bl1 = data($link ,"SELECT D.pol,D.finaldestination,D.referencia_cliente,D.referencia_lpv, D.pod, D.vessel, D.voyage
	FROM datosbooking D
	INNER JOIN booking_ssl B ON D.referencia_cliente = B.referencia_cliente
	AND B.booking_ssl LIKE '".$booking_interteam."' AND B.booking_ssl<>'' LIMIT 10"); 
	 
	$referencia_cliente = $bl1[referencia_cliente];
	$referencia = $bl1[referencia_lpv];
	$viaje[pod]=$bl1[pod];
	$viaje[pol]=$bl1[pol];
	$viaje[finaldestination]=$bl1[finaldestination];
	$viaje[vessel]=$bl1[vessel];
	$viaje[voyage]=$bl1[voyage];
 
 
}

 
$dimensiones = mysqli_query($link ,"select DISTINCT id_partida,numero_bultos,largo,ancho,alto,hora_registro_ingreso,fecha_recepcion from dimensiones where booking = '".$booking_interteam."' ");
 
$total=0;
while($rd=mysqli_fetch_array($dimensiones)){
	$hora_registro_ingreso=$rd[hora_registro_ingreso];
	$fecha_recepcion=$rd[fecha_recepcion];
	 	 
	$numero_bultos[]=$rd[numero_bultos];
	$largo[]=$rd[largo];
	$ancho[]=$rd[ancho];
	$alto[]=$rd[alto];
	$volumen[]=number_format(($rd[largo]/100) * ($rd[alto]/100) * ($rd[ancho]/100) * $rd[numero_bultos],3);
	$total+=($rd[largo]/100) * ($rd[alto]/100) * ($rd[ancho]/100) * $rd[numero_bultos];
}
?> 
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
 
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/validator.js"></script>
<script type="text/javascript" src="js/funciones.js"></script>
 
<script>
 

function fix(fixNumber, decimalPlaces)
{
var div = Math.pow(10,decimalPlaces);
fixNumber = Math.round(fixNumber * div) / div;
return fixNumber.toFixed(3);
}



function Guardar(){ 
	var laDatos = valores_forma(document.forma);

		$.post( "guarda_bl3.php",
				$(laDatos),
				function FuncionRecepcion(respuesta) {
					var laRespuesta = eval('(' + respuesta + ')');
					if ( laRespuesta != null ) {
						var laActions = laRespuesta["actions"];
						var liIdx;
						for ( liIdx=0 ; liIdx<laActions.length ; liIdx++ )
							eval( laActions[liIdx] );
					}
				});
		//}

 
}

</script>   

<style>
#dhtmltooltip{
position: absolute;
width: 150px;
border: 2px solid black;
padding: 2px;
background-color: lightyellow;
visibility: hidden;
z-index: 100;
/*Remove below line to remove shadow. Below line should always appear last within this CSS*/
filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135);
}
</style>
<div id="dhtmltooltip"></div>
<? include("tooltip.php");?>

<form id="forma" name="forma" >

<span style="color:#00AF4B">&nbsp;Modificaci&oacute;n de BL &raquo;</span><br />
<table width="921" style="line-height:22px"  >
 
  <tr>
    <td colspan="2">
      
      <a onclick="Guardar()" style="color:#00AF4B;text-align:center;text-decoration:underline;">Guardar BL</a>&nbsp;&nbsp;&nbsp;&nbsp;
      
      <? if($booking_interteam!=''){?>
            <a id="regresar" style="cursor:auto;color:#00AF4B;text-align:center;text-decoration:underline;" href="avisos/index.php?booking=<?=$booking_interteam?>">Regresar</a>
      <? } ?>
      
    </tr>
  <tr>
    <td><b>DIMENSIONES</b></td>

    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2"><table width="348" border="1" id="dataTable">
      <tr align="center" style="font-size:12px">
        <td width="19"><div align="left"></div></td>
        <td width="51"><div align="left">N. bultos</div></td>
        <td width="45"><div align="left">Largo</div></td>
        <td width="73"><div align="left">Ancho</div></td>
        <td width="53"><div align="left">Alto</div></td>
        <td width="67"><div align="left">Volumen</div></td>
      </tr>
      
      <script>
	  function calculos(){
		  var tot=0;
		  for(k=0;k<10;k++){
			  if(document.getElementById('largo['+k+']')){
					  if(document.getElementById('largo['+k+']').value*1!=0 && 
					  document.getElementById('ancho['+k+']').value*1!=0 && 
					  document.getElementById('alto['+k+']').value*1!=0 && 
					  document.getElementById('numero_bultos['+k+']').value*1!=0){
						  
					  document.getElementById('volumen['+k+']').value=(document.getElementById('largo['+k+']').value*1/100)*
					  (document.getElementById('ancho['+k+']').value*1/100)*
					  (document.getElementById('alto['+k+']').value*1/100)*
					  document.getElementById('numero_bultos['+k+']').value*1;
					   
					  tot+=document.getElementById('volumen['+k+']').value*1;
					   document.getElementById('volumen['+k+']').value=fix(document.getElementById('volumen['+k+']').value,3);
					  }
			  }
		  }
		  document.getElementById('spanTotal').innerHTML=fix(tot,3);
			
	  }
	  </script>
      <tr>
        <td align="center"><div align="left">1</div></td>
        <td align="center"><div align="left">
          <input type="text" name="numero_bultos[0]" onblur="calculos()" style="text-align:right" id="numero_bultos[0]" size="5" value="<?=$numero_bultos[0]?>"/>
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="largo[0]" id="largo[0]" onblur="calculos()" size="5" style="text-align:right" value="<?=$largo[0]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="ancho[0]" id="ancho[0]" onblur="calculos()" size="5" style="text-align:right"value="<?=$ancho[0]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="alto[0]" id="alto[0]" onblur="calculos()" size="5" style="text-align:right" value="<?=$alto[0]?>"/>
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="volumen[0]" id="volumen[0]" size="5" style="text-align:right"  value="<?=$volumen[0]?>"/>
        </div></td>
      </tr>
      <tr>
        <td align="center"><div align="left">2</div></td>
        <td align="center"><div align="left">
          <input type="text" name="numero_bultos[1]" onblur="calculos()" id="numero_bultos[1]" style="text-align:right" size="5" value="<?=$numero_bultos[1]?>"/>
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="largo[1]" onblur="calculos()" id="largo[1]" size="5" style="text-align:right" value="<?=$largo[1]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="ancho[1]" onblur="calculos()" id="ancho[1]" size="5" style="text-align:right" value="<?=$ancho[1]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="alto[1]" onblur="calculos()" id="alto[1]" size="5" style="text-align:right"  value="<?=$alto[1]?>"/>
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="volumen[1]" id="volumen[1]" size="5"  style="text-align:right" value="<?=$volumen[1]?>"/>
        </div></td>
      </tr>
      <tr>
        <td align="center"><div align="left">3</div></td>
        <td align="center"><div align="left">
          <input type="text" onblur="calculos()" name="numero_bultos[2]" style="text-align:right" id="numero_bultos[2]" size="5" value="<?=$numero_bultos[2]?>"/>
        </div></td>
        <td align="center"><div align="left">
          <input type="text" onblur="calculos()" name="largo[2]" id="largo[2]" style="text-align:right" size="5" value="<?=$largo[2]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" onblur="calculos()" name="ancho[2]" id="ancho[2]" style="text-align:right" size="5" value="<?=$ancho[2]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" onblur="calculos()" name="alto[2]" id="alto[2]" style="text-align:right" size="5"  value="<?=$alto[2]?>"/>
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="volumen[2]" id="volumen[2]"  size="5" style="text-align:right" value="<?=$volumen[2]?>"/>
        </div></td>
      </tr>
      <tr>
        <td align="center"><div align="left">4</div></td>
        <td align="center"><div align="left">
          <input type="text" onblur="calculos()" name="numero_bultos[3]" style="text-align:right" id="numero_bultos[3]" size="5" value="<?=$numero_bultos[3]?>"/>
        </div></td>
        <td align="center"><div align="left">
          <input type="text" onblur="calculos()" name="largo[3]" style="text-align:right" id="largo[3]" size="5" value="<?=$largo[3]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" onblur="calculos()" name="ancho[3]" style="text-align:right" id="ancho[3]" size="5" value="<?=$ancho[3]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" onblur="calculos()" name="alto[3]" style="text-align:right" id="alto[3]" size="5"  value="<?=$alto[3]?>"/>
        </div></td>
        <td align="center"><div align="left">
          <input type="text" size="5" name="volumen[3]" id="volumen[3]" style="text-align:right" value="<?=$volumen[3]?>"/>
        </div></td>
      </tr>
      <tr>
        <td align="center"><div align="left">5</div></td>
        <td align="center"><div align="left">
          <input type="text" onblur="calculos()" style="text-align:right" name="numero_bultos[4]" id="numero_bultos[4]" size="5" value="<?=$numero_bultos[4]?>"/>
        </div></td>
        <td align="center"><div align="left">
          <input type="text" onblur="calculos()" style="text-align:right" name="largo[4]" id="largo[4]" size="5" value="<?=$largo[4]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" onblur="calculos()" style="text-align:right" name="ancho[4]" id="ancho[4]" size="5" value="<?=$ancho[4]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" onblur="calculos()" style="text-align:right" name="alto[4]" id="alto[4]" size="5"  value="<?=$alto[4]?>"/>
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="volumen[4]" id="volumen[4]" style="text-align:right" size="5"  value="<?=$volumen[4]?>"/>
        </div></td>
      </tr>
      
      
      <? if(count($numero_bultos)>5 ){ 
	  //echo 'cantidad '.count($numero_bultos);
	  $be=6;
	  for($q=5;$q<count($numero_bultos);$q++){
	  ?>
      <tr>
        <td align="center"><div align="left">
          <?=$be?>
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="numero_bultos[<?=$q?>]" id="numero_bultos[<?=$q?>]" size="5" style="text-align:right"  value="<?=$numero_bultos[$q]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="largo[<?=$q?>]" id="largo[<?=$q?>]" size="5" style="text-align:right"  value="<?=$largo[$q]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="ancho[<?=$q?>]" id="ancho[<?=$q?>]" size="5" style="text-align:right"  value="<?=$ancho[$q]?>" />
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="alto[<?=$q?>]" id="alto[<?=$q?>]" size="5" style="text-align:right"   value="<?=$alto[$q]?>"/>
        </div></td>
        <td align="center"><div align="left">
          <input type="text" name="volumen[<?=$q?>]" id="volumen[<?=$q?>]"  style="text-align:right"  size="5"  value="<?=$volumen[$q]?>"/>
        </div></td>
      </tr>
     <? $be++; } } ?>
      
    </table>
    <br />
    VOLUMEN TOTAL: <span id="spanTotal"><?=number_format($total,3)?></span>
    </td>
    </tr>
 
  <tr>
    <td colspan="2">
    Ingrese el numero de bultos para poder guardar cada linea de dimensiones<br />
    <input type="button" class="" value="Agregar linea" onclick="addRow1('dataTable');" />
    
    </td>
  </tr>
  
  
 <!-- <tr>
    <td>ID BL</td>
    <td><input type="text" class="aa" name="id_bl" id="id_bl" size="40" value="<?=$bl[idhbl]?>"/></td>
  </tr>-->
  <tr>
    <td width="226" id="t_nombre">BOOKING</td>
    <td width="683"><input type="text" class="aa" name="booking" id="booking"  size="40" value="<?=$booking_interteam?>"/></td>
    
  </tr>
 
  <tr>
    <td width="226" id="t_nombre">REFERENCIA CLIENTE</td>
    <td><input type="text" class="aa" name="referencia" id="referencia" disabled="disabled" size="40" value="<?=$referencia_cliente?>"/></td>
  </tr>
  
  <tr >
    <td id="t_nombre2">REFERENCIA PUERTO</td>
    <td>
 
    <input type="text" class="aa" name="referencia2" id="referencia2" disabled="disabled" size="40" value="<?=$referencia?>" /></td>
  </tr>
  <!--<tr>
    <td>PEDIMENTO NO</td>
    <td><input type="text" class="aa" name="pedimento_no" id="pedimento_no" size="40" value="<?=$bl[pedimento_no]?>"  /></td>
  </tr>-->
  <tr>
    <td>VESSEL/VOYAGE</td>
    <td><input type="text" class="aa" name="vessel" id="vessel" size="40" disabled="disabled" value="<?=trim($viaje[vessel]).' '.trim($viaje[voyage])  ?>"  /></td>
  </tr>
 
  <tr>
    <td>PORT OF LOADING</td>
    <td><input type="text" class="aa" name="pol" id="pol" size="40" disabled="disabled" 
    value="<?= $viaje[pol] ?>"  /></td>
  </tr>
  <tr>
    <td>FINAL DESTINATION</td>
    <td><input type="text" class="aa" name="final_destination" id="final_destination" size="40"  disabled="disabled" value="<?=$viaje[finaldestination]?>" /></td>
  </tr>
  <tr>
    <td>PORT OF DISCHARGE</td>
    <td><input type="text" class="aa" name="pod" id="pod" size="40" disabled="disabled" value="<?=$viaje[pod]?>" /></td>
  </tr>
  	
  <tr>
    <td  valign="top">FECHA DE RECEPCION</td>
    <td ><input type="text" ondblclick="this.value=''" class="aa" name="fecha_recepcion" id="fecha_recepcion" size="40" value="<?=$fecha_recepcion?>"  onclick="displayCalendar(document.getElementById('fecha_recepcion'),'yyyy-mm-dd',this)" readonly="readonly" /></td>
  </tr>
  <tr>
    <td  valign="top">HORA REGISTRO INGRESO</td>
    <?
	$tmp=explode(':',$hora_registro_ingreso);
	$hora=$tmp[0];$minutos=$tmp[1];
	?>
    <td ><input type="text" class="aa"  onkeypress="if(this.value.length==2){document.getElementById('minutos').focus();}" name="hora" onmouseover="ddrivetip('Ingrese la hora en formato de 24 horas ','yellow', 330)" onmouseout="hideddrivetip()" id="hora" size="2" value="<?=$hora?>" maxlength="2"  />
      :
      <input type="text" class="aa"  name="minutos" id="minutos" size="2" value="<?=$minutos?>" maxlength="2"  /></td>
  </tr>
   <!-- 
  <tr>
    <td >PEDIMENTO</td>
    <td ><input type="text" class="aa" name="pedimento" id="pedimento" size="40" value="<?=$bl[pedimento]?>" maxlength="100"/></td>
  </tr>
  <tr>
    <td >CONSECUTIVO</td>
    <td ><input type="text" class="aa" name="tarja" <?=($bl[ultimo_update_golmex]!='0000-00-00 00:00:00' and $bl[ultimo_update_golmex]!='') ? 'style="border:1px solid green"' : ''?> id="tarja" size="40" value="<?=$bl[tarja]?>" /></td>
  </tr>
  <tr>
    <td  valign="top">TARJA RECEPCION</td>
    <td ><input type="text" class="aa" <?=($bl[ultimo_update_golmex]!='0000-00-00 00:00:00' and $bl[ultimo_update_golmex]!='') ? 'style="border:1px solid green"' : ''?> name="tarja_recepcion" id="tarja_recepcion" size="40" value="<?=$bl[tarja_recepcion]?>"   /></td>
  </tr>
  
  
  <tr>
    <td  valign="top">TARJA AVERIA</td>
    <td ><input type="text" class="aa" <?=($bl[ultimo_update_golmex]!='0000-00-00 00:00:00' and $bl[ultimo_update_golmex]!='') ? 'style="border:1px solid green"' : ''?> name="tarja_averia" id="tarja_averia" size="40" value="<?=$bl[tarja_averia]?>"  /></td>
  </tr>
  <tr>
    <td  valign="top">BULTOS AVERIADOS</td>
    <td ><input type="text" class="aa" <?=($bl[ultimo_update_golmex]!='0000-00-00 00:00:00' and $bl[ultimo_update_golmex]!='') ? 'style="border:1px solid green"' : ''?> name="bultos_averiados" id="bultos_averiados" size="40" value="<?=$bl[bultos_averiados]?>"  /></td>
  </tr>
  <tr>
    <td  valign="top">TIPO DE AVERIA</td>
    <td ><input type="text" class="aa" <?=($bl[ultimo_update_golmex]!='0000-00-00 00:00:00' and $bl[ultimo_update_golmex]!='') ? 'style="border:1px solid green"' : ''?> name="tipo_averia" id="tipo_averia" size="40" value="<?=$bl[tipo_averia]?>"  /></td>
  </tr>
  <tr>
    <td  valign="top">FECHA DE RECEPCION</td>
    <td ><input type="text" <?=($bl[ultimo_update_golmex]!='0000-00-00 00:00:00' and $bl[ultimo_update_golmex]!='') ? 'style="border:1px solid green"' : ''?> ondblclick="this.value=''" class="aa" name="fecha_recepcion" id="fecha_recepcion" size="40" value="<?=$bl[fecha_recepcion]?>"  onClick="displayCalendar(document.getElementById('fecha_recepcion'),'yyyy-mm-dd',this)" readonly="readonly" /></td>
  </tr>
  <tr>
    <td  valign="top">HORA REGISTRO INGRESO</td>
    <?
	$tmp=explode(':',$bl[hora_registro_ingreso]);
	$hora=$tmp[0];$minutos=$tmp[1];
	?>
    <td ><input type="text" <?=($bl[ultimo_update_golmex]!='0000-00-00 00:00:00' and $bl[ultimo_update_golmex]!='') ? 'style="border:1px solid green"' : ''?> class="aa" onkeypress="if(this.value.length==2){document.getElementById('minutos').focus();}" name="hora" onMouseover="ddrivetip('Ingrese la hora en formato de 24 horas ','yellow', 330)" onMouseout="hideddrivetip()" id="hora" size="2" value="<?=$hora?>" maxlength="2"  />:<input type="text" <?=($bl[ultimo_update_golmex]!='0000-00-00 00:00:00' and $bl[ultimo_update_golmex]!='') ? 'style="border:1px solid green"' : ''?> class="aa" name="minutos" id="minutos" size="2" value="<?=$minutos?>" maxlength="2"  /></td>
  </tr>
  <tr>
    <td  valign="top">FECHA DE CONSOLIDACION</td>
    <td ><input type="text" ondblclick="this.value=''" <?=($bl[ultimo_update_golmex]!='0000-00-00 00:00:00' and $bl[ultimo_update_golmex]!='') ? 'style="border:1px solid green"' : ''?> class="aa" name="fecha_salida" id="fecha_salida" size="40" value="<?=$bl[fecha_salida]?>"  onclick="displayCalendar(document.getElementById('fecha_salida'),'yyyy-mm-dd',this)" readonly="readonly" /></td>
  </tr>
  <tr>
    <td  valign="top">POSICION EN ALMACEN</td>
    <td ><input type="text" class="aa" name="posicion_almacen" <?=($bl[ultimo_update_golmex]!='0000-00-00 00:00:00' and $bl[ultimo_update_golmex]!='') ? 'style="border:1px solid green"' : ''?> id="posicion_almacen" size="40" value="<?=$bl[posicion_almacen]?>" /></td>
  </tr>
  <tr>
    <td  valign="top">COMENTARIOS</td>
    <td >
      <textarea cols="42" rows="5" id="comentarios" name="comentarios" class="aa"><?=$bl[comentarios]?></textarea>
      </td>
  </tr>
  <tr>
    <td colspan="2" >&nbsp;</td>
  </tr>
   
  <tr>
    <td width="226"><b>SHIPPER</b></td>
    <td>&nbsp;</td>
  </tr>
  
  <tr>
    <td width="226">NAME</td>
    <td><input type="text" class="aa" name="shipper1" id="shipper1" size="40" value="<?=$bl[shipper]?>"  /></td>
  </tr>
  
  <tr>
    <td>ADDRESS</td>
    <td><input type="text" class="aa" name="shipper2" id="shipper2" size="40" value="<?=$bl[shipper2]?>" /></td>
  </tr>
  <tr>
    <td>PO BOX, CITY &amp; COUNTRY</td>
    <td><input type="text" class="aa" name="shipper3" id="shipper3" size="40" value="<?=$bl[shipper3]?>" /></td>
  </tr>
  <tr>
    <td>RFC</td>
    <td><input type="text" class="aa" name="shipper4" id="shipper4" size="40" value="<?=$bl[shipper4]?>" /></td>
  </tr>
  <tr>
    <td>CTC</td>
    <td><input type="text" class="aa" name="shipper5" id="shipper5" size="40" value="<?=$bl[shipper5]?>" /></td>
  </tr>
  <tr>
    <td>PHONE</td>
    <td><input type="text" class="aa" name="shipper6" id="shipper6" size="40" value="<?=$bl[shipper6]?>" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td id="t_nombre"><b>CONSIGNEE</b></td>
    <td>&nbsp;</td>
    </tr>
  <tr>
    <td>NAME      </td>
    <td><input type="text" class="aa" name="consignee1" id="consignee1" size="40" value="<?=$bl[consignee]?>" /></td>
    </tr>
  <tr>
    <td>ADDRESS</td>
    <td><input type="text" class="aa" name="consignee2" id="consignee2" size="40" value="<?=$bl[consignee2]?>" /></td>
  </tr>
  <tr>
    <td>PO BOX, CITY &amp; COUNTRY</td>
    <td><input type="text" class="aa" name="consignee3" id="consignee3" size="40" value="<?=$bl[consignee3]?>" /></td>
  </tr>
  <tr>
    <td>RFC</td>
    <td><input type="text" class="aa" name="consignee4" id="consignee4" size="40"  value="<?=$bl[consignee4]?>"/></td>
  </tr>
  <tr>
    <td>CTC</td>
    <td><input type="text" class="aa" name="consignee5" id="consignee5" size="40" value="<?=$bl[consignee5]?>" /></td>
  </tr>
  <tr>
    <td width="226">PHONE</td>
    <td><input type="text" class="aa" name="consignee6" id="consignee6" size="40" value="<?=$bl[consignee6]?>" /></td>
  </tr>
   
  <tr>
    <td colspan="2" >&nbsp;</td>
  </tr>
  <tr>
    <td id="t_nombre"><b>NOTIFY </b>
      <input name="chk_copy" id="chk_copy" type="checkbox" title="Copy from consignee"  
      onclick="if(this.checked){
      $('#notify1').val($('#consignee1').val());
      $('#notify2').val($('#consignee2').val());
      $('#notify3').val($('#consignee3').val());
      $('#notify4').val($('#consignee4').val());
      $('#notify5').val($('#consignee5').val());
      $('#notify6').val($('#consignee6').val());
      }else{
      $('#notify1').val('');
      $('#notify2').val('');
      $('#notify3').val('');
      $('#notify4').val('');
      $('#notify5').val('');
      $('#notify6').val('');
      }" /></td>
    <td>&nbsp;</td>
    </tr>
  <tr>
    <td>NAME</td>
    <td><input type="text" class="aa" name="notify1" id="notify1" size="40" value="<?=$bl[notify]?>" /></td>
    </tr>
  <tr>
    <td>ADDRESS</td>
    <td><input type="text" class="aa" name="notify2" id="notify2" size="40" value="<?=$bl[notify2]?>" /></td>
    </tr>
  <tr>
    <td>PO BOX, CITY &amp; COUNTRY</td>
    <td><input type="text" class="aa" name="notify3" id="notify3" size="40" value="<?=$bl[notify3]?>" /></td>
    </tr>
  <tr>
    <td>RFC</td>
    <td><input type="text" class="aa" name="notify4" id="notify4" size="40" value="<?=$bl[notify4]?>" /></td>
    </tr>
  <tr>
    <td>CTC</td>
    <td><input type="text" class="aa" name="notify5" id="notify5" size="40" value="<?=$bl[notify5]?>" /></td>
    </tr>
  <tr>
    <td>PHONE</td>
    <td><input type="text" class="aa" name="notify6" id="notify6" size="40" value="<?=$bl[notify6]?>" /></td>
    </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>CARGO</b></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>MARKS</td>
    <td><input type="text" class="aa" name="marks" id="marks" size="40" value="<?=$partida[markandnos]?>" /></td>
  </tr>
  <tr>
    <td>QUANTITY</td>
    <td><input type="text" class="aa" name="quantity" id="quantity" size="40" value="<?=$partida[bulk]?>" /></td>
  </tr>
  <tr>
    <td valign="top">TYPE OF BULKS</td>
    <td> 
    <? $q_embalajes = mysqli_query($link ,"select * from embalajes order by nombre_embalaje");
	   ?>
       <select class="aa" name="type_of_bulks" id="type_of_bulks" />
       <option value=""></option>
       <?
	   while($rq_embalajes=mysqli_fetch_array($q_embalajes)){
	   ?>
       <option value="<?=$rq_embalajes[nombre_embalaje]?>"><?=$rq_embalajes[nombre_embalaje]?></option>
       
       <? } ?>
       <option value="<?=$partida[type_of_bulks]?>" selected="selected"><?=$partida[type_of_bulks]?></option>
       </select>
    
    </td>
  </tr>
 
  <tr>
    <td valign="top">DESCRIPTION OF GOODS<BR /> DECLARED BY SHIPPER <img align="absbottom" src="images/info_gray.png" title="Por favor escriba en inglés la descripción de la mercancía, dado que las compañías navieras sólo aceptan este idioma para esta descripción. // Please write in english language the description of goods, as Shipping Lines only accept english for this description." alt="" onMouseover="ddrivetip('Por favor escriba en inglés la descripción de la mercancía, dado que las compañías navieras sólo aceptan este idioma para esta descripción. // Please write in english language the description of goods, as Shipping Lines only accept english for this description.','yellow', 300)"
onMouseout="hideddrivetip()" /></td>
    <td> 
      <textarea class="aa" name="description" id="description"   cols="45" rows="5"><?=$partida[cargo]?></textarea>
      
      </td>
  </tr>
  <tr>
    <td  valign="top">IMO</td>
    <td ><input type="text" class="aa" name="imo" id="imo" size="40" value="<?=$partida[imo]?>" onMouseover="ddrivetip('INGRESAR EL NUMERO DE IMO, SI SON VARIOS SEPARAR CON COMAS','yellow', 300)"
onMouseout="hideddrivetip()" /></td>
  </tr>
  <tr>
    <td align="left">NUMBER OF PIECES CONTAINED</td>
    <td><input type="text" class="aa" name="no_piezas" id="no_piezas" size="40"  value="<?=$partida[number_of_pieces]?>" /></td>
  </tr>
  <tr>
    <td>GROSS WEIGHT KGS.</td>
    <td><input type="text" class="aa" name="gross_weight" id="gross_weight" size="40" value="<?=$partida[weight]?>" /></td>
  </tr>
 
  <tr>
    <td>VOLUME</td>
    <td><input type="text" class="aa" name="volume" id="volume" size="40" value="<?=$partida[measurement]?>" /></td>
  </tr>
  <tr>
    <td>HARMONIZED CODE</td>
    <td><input type="text" class="aa" name="harmonized_code" id="harmonized_code" size="40" value="<?=$partida[harmonized_code]?>" /></td>
  </tr>
 
  <tr>
    <td  valign="top">CORRECCIONES INDICADAS</td>
    <td ><textarea cols="42" rows="5" id="correcciones" name="correcciones" class="aa"><?=$partida[correcciones]?></textarea></td>
  </tr>-->
 
 </table>

<br />
  
</form>
 
