<? 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,$almacen_consolidacion;
global $r0,$r1,$r2,$r3,$r4,$r5,$r6,$r7;
DATOSBOOKING($link,$link_impo,$referencia_cliente);
 
$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;
ftipos_imo($link,$referencia_cliente);

regimen($link,$referencia_cliente);

?>
<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: 67%"><span style="text-align:center;font-size: 20px; font-weight: bold"><?=$LOGISTICA[$directorio_principal]?></span>
                
</td>
                <td style="text-align: right;    width: 18%">REF. <?=$referencia?> <br /><?=$referencia_cliente ?></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" />
 <!--<img src="<? //="https://".$_SERVER["SERVER_NAME"]?>/ATM/images/logo-aduana.jpg" />-->
 
 </span> </div>
 <br />  
 <div align="right"><span style="text-align: right;    width: 15%"><?=$CIUDAD[$directorio_principal]?> a <?php echo date('d').'/'.mesador(date('m')).'/'.date('Y'); ?></span></div>
  <?
 
$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="left"><span style="text-align: left;width: 15%"><b><u><?=$almacen?></u><br />PRESENTE</b></span></div>
 
 <br />
 
  <div align="justify" style="width:100%; max-width:100%"> 
 POR MEDIO DE LA PRESENTE Y CON FUNDAMENTO EN EL ART. 15 FRACCION VI DE LA LEY ADUANERA EN VIGOR, SOLICITO EL TRASLADO DEL (LOS ) SIGUIENTE (S) CONTENEDOR (ES) DE:
 </div>
 
 <br />
 
<table style="width: 100%;">
   <tr> 
   <td style="text-align: CENTER;width: 50%;"><B>IMPORTACION</B></td>
    <td style="text-align: CENTER;width: 1%"></td>
   <td style="text-align: center;width: 40%;"><B>EXPORTACION XXXXXXXX</B></td>
   </tr>
</table>
  <br /> 
 <table style="width: 100%;" >
   <tr> 
   <td style="text-align: right;width: 30%;"><B>REGIMEN</B></td>
   <td style="text-align: center;width: 5%;border: solid 1px black;"><B><?=$r0?></B></td>
   <td style="text-align: center;width: 5%;border: solid 1px black;"><B><?=$r1?></B></td>
   <td style="text-align: center;width: 5%;border: solid 1px black;"><B><?=$r2?> </B></td>
   <td style="text-align: center;width: 5%;border: solid 1px black;"><B><?=$r3?> </B></td>
   <td style="text-align: center;width: 5%;border: solid 1px black;"><B><?=$r4?> </B></td>
   <td style="text-align: center;width: 5%;border: solid 1px black;"><B><?=$r5?> </B></td>
   <td style="text-align: center;width: 5%;border: solid 1px black;"><B><?=$r6?> </B></td>
   <td style="text-align: center;width: 5%;border: solid 1px black;"><B><?=$r7?> </B></td>
   </tr>
</table>

 
 <br /><br />
  
<? if($directorio_principal=='ATM'){?>
 <table style="width: 80%;" align="left">
   <tr>
     <td rowspan="6" valign="top" style="text-align: left;width: 10%;"><b>DESDE </b></td>
     <td style="text-align: left;width: 25%;">IPM 
      <?= $desde == 'IPM' ? 'XXXXXXX' : ''?></td>
     <td rowspan="6" valign="top" style="text-align: left;width: 10%;"><b>HACIA </b></td>
     <td style="text-align: left;width: 25%;">IPM 
      <?= $hacia == 'IPM' ? 'XXXXXXX' : ''?></td>
    </tr>
   <tr>
     <td style="text-align: left;width: 25%;">ATM 
      <?= $desde == 'ATM' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">ATM 
      <?= $hacia == 'ATM' ? 'XXXXXXX' : ''?></td>
   </tr>
   <tr>
     <td style="text-align: left;width: 25%;">ATP 
      <?= $desde == 'ATP' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">ATP 
	 <?= $hacia == 'ATP' ? 'XXXXXXX' : ''?>
     </td>
   </tr>
   <tr>
     <td style="text-align: left;width: 25%;">ISTASA 
      <?= $desde == 'ISTASA' ? 'XXXXXXX' : ''?></td>
      <td style="text-align: left;width: 25%;">ISTASA 
      <?= $hacia == 'ISTASA' ? 'XXXXXXX' : ''?>
      </td>
   </tr>
   <tr>
     <td style="text-align: left;width: 25%;">ALPASA 
      <?= $desde == 'ALPASA' ? 'XXXXXXX' : ''?></td>
      <td style="text-align: left;width: 25%;">ALPASA 
      <?= $hacia == 'ALPASA' ? 'XXXXXXX' : ''?>
      </td>
   </tr>   
   <tr>
     <td style="text-align: left;width: 25%;">GRUPO CASTANEDA 
      <?= $desde == 'GRUPO CASTANEDA' ? 'XXXXXXX' : ''?></td>
      <td style="text-align: left;width: 25%;">GRUPO CASTANEDA 
      <?= $hacia == 'GRUPO CASTANEDA' ? 'XXXXXXX' : ''?>
      </td>
   </tr>
 </table>
<? }elseif($directorio_principal=='ZLO'){?>
<table style="width: 80%;" align="left">
   <tr>
     <td rowspan="9" valign="top" style="text-align: left;width: 10%;"><b>DESDE </b></td>
     <td style="text-align: left;width: 25%;">CEMEX 
      <?= $desde == 'CEMEX' ? 'XXXXXXX' : ''?></td>
     <td rowspan="9" valign="top" style="text-align: left;width: 10%;"><b>HACIA </b></td>
     <td style="text-align: left;width: 25%;">CEMEX 
      <?= $hacia == 'CEMEX' ? 'XXXXXXX' : ''?></td>
    </tr>
    
   <tr>
     <td style="text-align: left;width: 25%;">COMERCIALIZADORA LA JUNTA 
      <?= $desde == 'COMERCIALIZADORA LA JUNTA' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">COMERCIALIZADORA LA JUNTA 
      <?= $hacia == 'COMERCIALIZADORA LA JUNTA' ? 'XXXXXXX' : ''?></td>
   </tr>
  
   <tr>
     <td style="text-align: left;width: 25%;">CONTECON 
      <?= $desde == 'CONTECON' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">CONTECON 
      <?= $hacia == 'CONTECON' ? 'XXXXXXX' : ''?></td>
   </tr>

   <tr>
     <td style="text-align: left;width: 25%;">CORPORACION MULTIMODAL
      <?= $desde == 'CORPORACION MULTIMODAL' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">CORPORACION MULTIMODAL 
      <?= $hacia == 'CORPORACION MULTIMODAL' ? 'XXXXXXX' : ''?></td>
   </tr>

   <tr>
     <td style="text-align: left;width: 25%;">HASEZA
      <?= $desde == 'HASEZA' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">HASEZA
      <?= $hacia == 'HASEZA' ? 'XXXXXXX' : ''?></td>
   </tr>
 
   <tr>
     <td style="text-align: left;width: 25%;">MIP 
      <?= $desde == 'MIP' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">MIP 
      <?= $hacia == 'MIP' ? 'XXXXXXX' : ''?></td>
   </tr>
      
   <tr>
     <td style="text-align: left;width: 25%;">OCUPA 
      <?= $desde == 'OCUPA' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">OCUPA 
      <?= $hacia == 'OCUPA' ? 'XXXXXXX' : ''?></td>
   </tr>

   <tr>
     <td style="text-align: left;width: 25%;">SSA 
      <?= $desde == 'SSA' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">SSA 
      <?= $hacia == 'SSA' ? 'XXXXXXX' : ''?></td>
   </tr>

    
   <tr>
     <td style="text-align: left;width: 25%;">TIMSA 
      <?= $desde == 'TIMSA' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">TIMSA 
      <?= $hacia == 'TIMSA' ? 'XXXXXXX' : ''?></td>
   </tr>
 </table>
<? }elseif($directorio_principal=='VER'){?>
<table style="width: 80%;" align="left">
   <tr>
     <td rowspan="9" valign="top" style="text-align: left;width: 10%;"><b>DESDE </b></td>
     <td style="text-align: left;width: 25%;">API 
      <?= $desde == 'API' ? 'XXXXXXX' : ''?></td>
     <td rowspan="9" valign="top" style="text-align: left;width: 10%;"><b>HACIA </b></td>
     <td style="text-align: left;width: 25%;">API 
      <?= $hacia == 'API' ? 'XXXXXXX' : ''?></td>
    </tr>
   <tr>
     <td style="text-align: left;width: 25%;">ICAVE TEC I
      <?= $desde == 'ICAVE TEC I' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">ICAVE TEC I
      <?= $hacia == 'ICAVE TEC I' ? 'XXXXXXX' : ''?></td>
   </tr>
   <tr>
     <td style="text-align: left;width: 25%;">ICAVE TEC II
      <?= $desde == 'ICAVE TEC II' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">ICAVE TEC II
      <?= $hacia == 'ICAVE TEC II' ? 'XXXXXXX' : ''?></td>
   </tr>
   <tr>
     <td style="text-align: left;width: 25%;">CICE 
      <?= $desde == 'CICE' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">CICE 
       <?= $hacia == 'CICE' ? 'XXXXXXX' : ''?>
     </td>
   </tr>
   
   <tr>
     <td style="text-align: left;width: 25%;">CIF 
      <?= $desde == 'CIF' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">CIF 
       <?= $hacia == 'CIF' ? 'XXXXXXX' : ''?>
     </td>
   </tr>
   <tr>
     <td style="text-align: left;width: 25%;">GOLMEX <?= $desde == 'GOLMEX' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">GOLMEX <?= $hacia == 'GOLMEX' ? 'XXXXXXX' : ''?></td>
   </tr>
   
   <tr>
     <td style="text-align: left;width: 25%;">MUELLE 7 <?= $desde == 'MUELLE 7' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">MUELLE 7 <?= $hacia == 'MUELLE 7' ? 'XXXXXXX' : ''?></td>
   </tr>
    
   
   <tr>
     <td style="text-align: left;width: 25%;">RICSA <?= $desde == 'RICSA' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">RICSA <?= $hacia == 'RICSA' ? 'XXXXXXX' : ''?></td>
   </tr>
  
   <tr>
     <td style="text-align: left;width: 25%;">TMU CICE <?= $desde == 'TMU CICE' ? 'XXXXXXX' : ''?></td>
     <td style="text-align: left;width: 25%;">TMU CICE <?= $hacia == 'TMU CICE' ? 'XXXXXXX' : ''?></td>
   </tr> 
 
 </table>

<BR /> 
<? if($desde == 'GOLMEX'  and $hacia =='ICAVE'){?>
<div  style="width:100%; max-width:100%; text-align:center"> 
    <p style="font-weight:bold; font-size:16px; color:#F00; text-decoration:underline">IMPORTANTE: SE SOLICITA PESAJE VGM</p>
 </div><BR />
<? } ?> 
<? } ?>
<BR /><BR />
 <table align="left" width="80%" style="border: solid 1px #5544DD;border-collapse:collapse;" >
     
    <tr>
        <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC""><div style="width:200px; text-align:center"><strong>TAMA&Ntilde;O</strong></div></td>
        <td  style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC""><div style="width:200px;text-align:center"><strong>NUMERO DE CONTENEDOR</strong></div></td>
        <td   style="text-align: left; border: solid 1px #55DD44;background:#CCFFCC""><div style="width:200px;text-align:center"><strong>SELLOS</strong></div></td>
    </tr>
  
      <tr>
        <td  style="text-align: left; border: solid 1px #55DD44;">
		<div style="width:200px; text-align:center">
		<?=$dimension?> <?=$tipo?>
        </div>
        </td>
        <td  style="text-align: left; border: solid 1px #55DD44;">
        <div style="width:200px; text-align:center">
          <?=$contenedor?>
        </div>  
        </td>
        <td  style="text-align: left; border: solid 1px #55DD44;">
        <div style="width:200px; text-align:center">
          <?=$sello?>
        </div>  
        </td>
      </tr>
      
  </table>
      <BR />
      <table align="left" width="80%" >
      <tr>
        <td><div style="width:200px; text-align:LEFT"><strong>RECIBI 1 CONTENEDOR</strong></div></td>
        <td><div style="width:200px; text-align:right"><strong>BOOKING</strong></div></td>
        <td colspan="2"><div style="width:400px; text-align:left"><span style="text-align: left; border: solid 1px #55DD44;">
          <?=$booking_naviera?>
        </span></div>
        </td>
      </tr>
      <tr>
        <td colspan="2"  style="text-align: left;"><div style="width:400px; text-align:right"><strong>BUQUE</strong></div></td>
        <td colspan="2"  style="text-align: left; "><div style="width:400px; text-align:left"><? echo $buque;
             ?></div></td>
      </tr>
      <tr>
        <td colspan="2"  style="text-align: left;"><div style="width:400px; text-align:right"><strong>VIAJE</strong></div></td>
        <td colspan="2"  style="text-align: left; "><div style="width:400px; text-align:left"><? echo $viaje;?></div></td>
      </tr>
      <tr>
        <td colspan="2"  style="text-align: left;"><div style="width:400px; text-align:right"><strong>PUERTO DE DESCARGA</strong></div></td>
        <td colspan="2"  style="text-align: left; "><div style="width:400px; text-align:left"><? echo $pod;?></div></td>
      </tr>
      <tr>
        <td  style="text-align: left;"><div style="width:200px; text-align:LEFT"><strong><U><?=$_SESSION[nombre_usuario] ?><!--RUBEN VALERIO BENITEZ--></U></strong></div></td>
        <td  style="text-align: left;"><div style="width:200px; text-align:right"><strong>DESTINO FINAL</strong></div></td>
        <td colspan="2"  style="text-align: left; "><div style="width:400px; text-align:left"><? echo $destino_final;?></div></td>
      </tr>
      <tr>
        <td  style="text-align: left;"><div style="width:200px; text-align:LEFT"><strong>NOMBRE Y FIRMA</strong></div></td>
        <td  style="text-align: left;"><div style="width:200px; text-align:right"><strong>PESO KGS.</strong></div></td>
        <td colspan="2"  style="text-align: left; "><div style="width:400px; text-align:left">
          <?= $tweight!='' ? number_format($tweight,2) : '';?>
        </div></td>
      </tr>
      <tr>
        <td  style="text-align: left;"><div style="width:200px; text-align:LEFT"><strong>CD <?=$_SESSION[gafete] ?></strong></div></td>
        <td  style="text-align: left;"><div style="width:200px; text-align:right"><strong>TARA</strong></div></td>
        <td colspan="2"  style="text-align: left; "><div style="width:400px; text-align:left"><? echo number_format($tara,2);?></div></td>
      </tr>
      <tr>
        <td colspan="2"  style="text-align: left;"><div style="width:400px; text-align:right"><strong>PESO CON TARA</strong></div></td>
        <td colspan="2"  style="text-align: left; "><div style="width:400px; text-align:left"><span style="text-align: left; border: solid 1px #55DD44;">
          <?= $peso_neto_con_tara!='' ? number_format($peso_neto_con_tara,2) : '';?>
        </span></div></td>
      </tr>
      <tr>
        <td colspan="2"  style="text-align: left;"><div style="width:400px; text-align:right"><strong>LINEA</strong></div></td>
        <td colspan="2"  style="text-align: left; "><div style="width:400px; text-align:left"><? echo $linea;?></div></td>
      </tr>
      <tr>
        <td colspan="2"  style="text-align: left;"><div style="width:400px; text-align:right"><strong>NAVIERA</strong></div></td>
        <td colspan="2"  style="text-align: left; "><div style="width:400px; text-align:left"><? echo $naviera;?></div></td>
      </tr>
      <tr>
        <td colspan="2"  style="text-align: left;"><div style="width:400px; text-align:right"><strong>TIPOS DE CARGA</strong></div></td>
        <td colspan="2"  style="text-align: left; "><div style="width:400px; text-align:left"><? echo $tipo_mercancia;?></div></td>
      </tr>
      <tr>
        <td colspan="2"  style="text-align: left;"><div style="width:400px; text-align:right"><strong>TIPOS DE IMO</strong></div></td>
        <td colspan="2"  style="text-align: left; "><div style="width:400px; text-align:left"><? echo $tipos_de_imo;?></div></td>
      </tr>
     
     
    </table>
    
    <br />
    <br />
  <br /><br />
 <div  style="width:100%; max-width:100%; text-align:center"> 
    <p style="font-weight:bold">
    SELLO Y FECHA DE ENTREGA</p>
 
    <p style="font-weight:bold">&nbsp;</p>
    <p style="font-weight:bold">MUY ATENTAMENTE POR EL AGENTE ADUANAL<br />
      <?=$LOGISTICA[$directorio_principal]?>
    </p>
 </div>
 <br /><br />
</page>
 
