<? session_start();
include("../comun/conexion3.php");
include("../comun/conex_ver.php");
include("../comun/funciones.php");

$link_impo=con_impo();$link=con_ver();

$tmp= explode('/', dirname(__FILE__)) ; 
$directorio_principal= $tmp[4];	
include("constantes.php"); 
    
	
$referencia = $_GET[referencia]; 
$referencia = str_replace("\'","'",$referencia);
$referencia_cliente = $_GET[referencia_cliente]; 
$referencia_cliente = str_replace("\'","'",$referencia_cliente);
global $tbulk,$tweight,$tnetweight;
global $tipos_de_imo;
global $buque,$viaje,$ets,$cliente,$booking_naviera,$pod,$naviera,$almacen,$procedencia_vacio,$almacen_consolidacion,$desde,$hacia,$tipo_mercancia,$pedimento,$linea,$contenedor,$dimension,$sello,$tipo,$tara,$destino_final,$liberado;
global $r0,$r1,$r2,$r3,$r4,$r5,$r6,$r7;
global $un;
DATOSBOOKING($link,$link_impo,$referencia_cliente);
con_impo();
$q1=data($link_impo,"select files from datosexpint where referencia_interteam = '".$referencia_cliente."' or referencia_interteam = '".$referencia."'");

 
fpeso_bruto($link,$link_impo,'',0,$referencia_cliente);
$peso_neto_con_tara=$tara+$tweight;	 

$exportad = mysqli_query($link,"select distinct exportador from detallebooking where referencia_cliente = '".trim($referencia_cliente)."'");
	while($rw=mysqli_fetch_array($exportad)){
		$exportador.= $rw[0].'<br>';
	}
 
?>
<page backtop="5mm" backbottom="10mm" backleft="10mm" backright="10mm">
    <page_header>
<table style="width: 100%; ">
            <tr>
                <td style="text-align: left;    width: 15%">&nbsp;</td>
                <td style="text-align: center;    width: 70%"><span style="text-align:center;font-size: 20px; font-weight: bold">LOGISTICA PORTUARIA DE ALTAMIRA, S.A. DE C.V.</span>
                
</td>
                <td style="text-align: right;    width: 15%">&nbsp;</td>
            </tr>
      </table>
    </page_header>
    <page_footer>
<table style="width: 100%; border: solid 1px black;">
            <tr> 
 <td width="41%" align="left" style="text-align: left;    width: 50%; ">
        <span style="font-size:9px"><?=$DIRECCION3[$directorio_principal]?></span>

        </td>
                <td width="31%" style="text-align: center;    width: 45%;font-size:9px"><?=$TELEFONO[$directorio_principal]?></td>
                <td width="28%" style="text-align: right;    width: 25%">P&Aacute;GINA [[page_cu]]/[[page_nb]]</td>
            </tr>
      </table>
    </page_footer>
 <br /> 
 <div align="center"><span style="text-align: left;    width: 30%"><img src="<?="https://".$_SERVER["SERVER_NAME"]?>/<?=$directorio_principal?>/images/logo_lpv.jpg" />
 
 </span> </div>
 <br />  
 
 <?
 
$almacen = strpos($almacen,'INFRAESTRUCTURA PORTUARIA MEXICANA S.A. DE C.V.')!==false ? 'INFRAESTRUCTURA PORTUARIA MEXICANA S.A. DE C.V.' : $almacen;
$almacen = strpos($almacen,'ALTAMIRA TERMINAL PORTUARIA S.A. DE C.V.')!==false ? 'ALTAMIRA TERMINAL PORTUARIA S.A. DE C.V.' : $almacen;
$almacen = strpos($almacen,'ALTAMIRA TERMINAL MULTIMODAL')!==false ? 'ALTAMIRA TERMINAL MULTIMODAL' : $almacen;
$almacen = strpos($almacen,'ALPASA')!==false ? 'ALPASA' : $almacen;
 
?>
 
 <div align="justify" style="text-align:center;width:100%; max-width:100%; font-size:14px"> 
 <b>SOLICITUD DE INGRESO DE CARGA PELIGROSA A <?=$almacen?></b>
 </div>
 <br />
 
 
 <div align="left" style="text-align: left;width: 100%">
 <b><U><!--INTERNACIONAL DE CONTENEDORES ASOCIADOS DE VERACRUZ, S.A. DE C.V.--></U><BR />
 PRESENTE</b>
 </div>
 <br />
 
 <div align="left" style="width:100%; max-width:100%">
 <?=$CIUDAD[$directorio_principal]?> a <?php echo date('d').'/'.mesador(date('m')).'/'.date('Y'); ?>
 </div>
 <br />
 
 <div align="left" style="width:100%; max-width:100%"> 
 Por  medio de la presente y conforme a los requisitos señalados en el párrafo 5.1 de  la NOM-033-SCT4-1996, notifico el arribo de las siguientes mercancías  peligrosas a la instalación portuaria el día <?=$liberado?>
 </div>
 <br /><br />
 
 <table style="width: 100%; border: solid 1px #5544DD;border-collapse:collapse; font-size:10px" align="left" >
 
   <tr>
     <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:103px;max-width:103px"><b>CONTENEDOR</b></div></td>
     <td   style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:70px;max-width:70px"><b>LINEA</b></div></td>
     <td   style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:70px;max-width:70px"><b>MED</b></div></td>
     <td   style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:70px; max-width:70px"><b>TIPO</b></div></td>
     <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:105px;max-width:105px"><b>SELLOS</b></div></td>
     <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:95px;max-width:95px"><b>PESO NETO KGS</b></div></td>
     <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:80px;max-width:80px"><b>TARA</b></div></td>
     <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:95px;max-width:95px"><b>PESO BRUTO KGS</b></div></td>
   </tr>
  
   <tr>
     <td  style="text-align: left; border: solid 1px #55DD44;"><div style="width:103px;max-width:103px">
       <?=$contenedor?>
     </div></td>
     <td   style="text-align: left; border: solid 1px #55DD44;"><div style="width:70px;max-width:70px"><span style="width:40px;max-width:40px">
       <?=$linea?>
     </span></div></td>
     <td   style="text-align: left; border: solid 1px #55DD44;"><div style="width:70px;max-width:70px"><?=$dimension?></div></td>
     <td   style="text-align: left; border: solid 1px #55DD44;"><div style="width:70px; max-width:70px">
       <?=$tipo?>
     </div></td>
     <td  style="text-align: left; border: solid 1px #55DD44;"><div style="width:105px;max-width:105px"><span style="width:200px; text-align:center">
       <?=$sello?>
     </span></div></td>
     <td  style="text-align: left; border: solid 1px #55DD44;"><div style="width:95px;max-width:95px"><?= $tweight!='' ? number_format($tweight,2) : '';?></div></td>
     <td  style="text-align: left; border: solid 1px #55DD44;"><div style="width:80px;max-width:80px"><?=$tara!='' ? number_format($tara,2):''?></div></td>
     <td  style="text-align: left; border: solid 1px #55DD44;"><div style="width:95px;max-width:95px"><?= $peso_neto_con_tara!='' ? number_format($peso_neto_con_tara,2) : '';?></div></td>
   </tr>
   
 </table>
 <br />
   
   <br />
   
    <table style="width: 100%; border: solid 1px #5544DD;border-collapse:collapse; font-size:10px" align="left" >
      <tr>
        <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:165px;max-width:165px"><b>NOMBRE DEL PRODUCTO</b></div></td>
        <td   style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:70px;max-width:70px"><b>FLASH POINT</b></div></td>
        <td   style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:90px;max-width:90px"><b>PACKING GROUP</b></div></td>
        <td   style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:70px;max-width:70px"><b>RIESGO SECUNDARIO</b></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:70px;max-width:70px"><b>PESO NETO</b></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:70px;max-width:70px"><b>PESO BRUTO</b></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:70px;max-width:70px"><b>CANTIDAD DE BULTOS</b></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:40px;max-width:40px"><b>IMO</b></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC"><div style="width:40px;max-width:40px"><b>UN</b></div></td>
      </tr>
      
       <?
	$merc = mysqli_query($link,"select * from detallebooking where referencia_cliente = '".$referencia_cliente."'");
	
	
	
	while($rm=mysqli_fetch_array($merc)){?>
    
      <tr>
        <td  style="text-align: left; border: solid 1px #55DD44;"><div style="width:165px;max-width:165px"><?=strtoupper($rm[nombre_producto])?></div></td>
        <td   style="text-align: left; border: solid 1px #55DD44;"><div style="width:70px;max-width:70px"><?=$rm[flash_point]?></div></td>
        <td   style="text-align: left; border: solid 1px #55DD44;"><div style="width:90px;max-width:90px"><?=$rm[packing_group]?></div></td>
        <td   style="text-align: left; border: solid 1px #55DD44;"><div style="width:70px;max-width:70px"><?=$rm[riesgo_secundario]?></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;"><div style="width:70px;max-width:70px"><?=$rm[peso_neto]?></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;"><div style="width:70px;max-width:70px"><?=$rm[peso_bruto]?></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;"><div style="width:70px;max-width:70px"><?=$rm[cantidad_bultos]?></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;"><div style="width:40px;max-width:40px"><?=$rm[imo]?></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;"><div style="width:40px;max-width:40px"><?=$rm[un]?></div></td>
      </tr>
     <? } ?>
    </table>
<br />
    <br />
 <table align="left" width="100%" style="border: solid 1px #5544DD;border-collapse:collapse;" >
     
<tr>
<td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC""><div style="width:100px; text-align:center"><strong>BOOKING</strong></div></td>
<td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC""><div style="width:100px; text-align:center"><strong>BUQUE</strong></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC""><div style="width:200PX; text-align:center"><strong>PUERTO DE DESCARGA</strong></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC""><div style="width:198px;text-align:center"><strong>DESTINO FINAL</strong></div></td>
        <td   style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC""><div style="width:100px;text-align:center"><strong>NO DE VIAJE</strong></div></td>
    </tr>
  
      <tr>
        <td  style="text-align: left; border: solid 1px #55DD44;">
		<div style="width:100px; text-align:center">
		  <?=$booking_naviera?>
		</div>
        </td>
        <td  style="text-align: left; border: solid 1px #55DD44;">
        <div style="width:100px; text-align:center"><? echo $buque;
             ?></div>  
        </td>
        <td  style="text-align: left; border: solid 1px #55DD44;">
        <div style="width:200px; text-align:center"><? echo $pod;?></div>  
        </td>
             <td  style="text-align: left; border: solid 1px #55DD44;">
        <div style="width:198px; text-align:center"><? echo $destino_final;?></div>  
        </td>
             <td  style="text-align: left; border: solid 1px #55DD44;">
        <div style="width:100px; text-align:center"><? echo $viaje;?></div>  
        </td>
      </tr>
     
     
    </table>
    
    <br />
    <br />
  
<div style="width:100%; max-width:100%; text-align:left"> 
        <span style="font-weight:bold">EXPORTADOR:</span>&nbsp;<br /><?=$exportador ?><br>
</div>
<br /><br />
        
<div style="width:100%; max-width:100%; text-align:left"> 
        Ag. Aduanal / Naviero: &nbsp; <b><u><?=$LOGISTICA[$directorio_principal]?></u></b>  
        &nbsp;&nbsp;RFC: <b><u><?=$RFC[$directorio_principal]?></u></b> <br />
        
        Domicilio: &nbsp; <b><u><?=$DIRECCION_COMPLETA[$directorio_principal]?></u></b> &nbsp;&nbsp;TEL: <b><u><?=$TELEFONO_COMPLETO[$directorio_principal]?>							
        </u></b> 
</div>
  
<br /><br /><br /><br /><br /><br /><br /><br />
<div style="width:100%; max-width:100%; text-align:center"> 
     <span style="font-weight:bold">
     <U><?=$_SESSION[nombre_usuario] ?></U><br />CD <?=$_SESSION[gafete] ?><BR /><BR />
     FIRMA DEL REPRESENTANTE	<br />
     </span>
</div> 
 
</page>
 
