<?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;
 
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>.:: Reporte de Manifiestos ::.</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>
<? 
$envia="fondo.php?k=$k&razonsocial=$razonsocial&distrito=$distrito";
$envia1="cvp_personal.php";
?>
<!-- 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 onLoad="print();">
<table width="857" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td></td>
    <td  valign="bottom">&nbsp;</td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td  valign="bottom"><div align="left">
      <table width="728" border="0" cellpadding="0" cellspacing="0">
        <tr class="lblCampo" valign="top">
          <td width="231" valign="top">&nbsp;</td>
          <td width="287" valign="bottom"><div align="center" class="lblParrafo">OUTBOUND MANIFIEST </div></td>
          <td width="210"><div align="right"><img src="../imagenes/logo_perenco.GIF" width="180" height="70" border="0"></div></td>
        </tr>
      </table>
    </div></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td height="20"  valign="bottom"><div align="left"></div></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td  valign="bottom"><div align="left">
      <table width="724" border="0" cellspacing="0" cellpadding="0">
        <tr class="lblCampo">
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="2">&nbsp;</td>
          <td>&nbsp;</td>
          <td><div align="right">Manifiesto <span class="lblParrafo">N&ordm;<? echo $cod_man?></span> </div></td>
        </tr>
        <tr class="lblCampo">
          <td width="96"><div align="left">Transporte</div></td>
          <td width="152"><div align="left"><span class="lblParrafo"><? echo $mat_trans?>/<? echo $tipo_trans?></span></div></td>
          <td width="94"><div align="right">Fecha Salida </div></td>
          <td width="9"><div align="left" class="lblParrafo"></div></td>
          <td width="91"><div align="left"><? echo extraerfechanormal($fecha_ruta);?></div></td>
          <td width="87"><div align="right">Fecha Llegada</div></td>
          <td width="9"><div align="left"></div></td>
          <td width="186"><div align="left"><? echo extraerfechanormal($testimado_ruta);?></div></td>
        </tr>
        <tr class="lblCampo">
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><div align="right">Hora de salida </div></td>
          <td><div align="left">:</div></td>
          <td><div align="left"><? echo $horasal_ruta;?></div></td>
          <td><div align="right">Hora de Llegada </div></td>
          <td><div align="left">:</div></td>
          <td><div align="left"><? echo $horallega_ruta;?></div></td>
        </tr>
        
      </table>
    </div></td>
    <td></td>
  </tr>
  <tr>
    <td width="25"></td>
    <td width="730"  valign="bottom">
      <div align="left" class="lblTitulo" ></div></td>
    <td width="25"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>
      <div align="left">
        <table width="721" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
          <tr class="lblCampo" >
            <td width="24" rowspan="2"><div align="center" >Pax</div></td>
            <td colspan="2"><div align="center">Crew</div></td>
            <td width="92" rowspan="2"><div align="center">Company</div></td>
            <td width="82" rowspan="2"><div align="center">From</div></td>
            <td width="76" rowspan="2"><div align="center">Destination</div></td>
            <td colspan="3"><div align="center">Weight Kg </div></td>
          </tr>
          <tr class="lblCampo">
            <td width="205"><div align="center">Name/Descripcion</div></td>
            <td width="81"><div align="center">DNI/DOC</div></td>
            <td width="42"><div align="center">Peso Crew </div></td>
            <td width="44"><div align="center">Peso Eq. </div></td>
            <td width="55"><div align="center">Subtotal</div></td>
          </tr>
		  <?
		  $resultadot=$objPer->getTripuDatos($cod_man,$via);	
          while($filast=$objPer->NextRow($resultadot)){
		  $n1++;
		  ?>
          <tr class="lblCampo">
            <td><div align="center"><? echo $n1;?></div></td>
            <td><div align="left"><? echo $filast['nombres'];?></div></td>
            <td><div align="left"><? echo $filast['dociden_per'];?></div></td>
            <td><div align="left"><? echo $filast['razon_emp'];?></div></td>
            <td><div align="left"><? echo $filast['origen'];?></div></td>
            <td><div align="left"><? echo $filast['destino'];?></div></td>
            <td><div align="center"><? echo $pesopasst=$filast['peso_mpass'];
		  $pesopasstt=$pesopasstt+$pesopasst;
		  ?></div></td>
            <td><div align="center"><? echo $pesoeqt=$filast['pesoeq_mpass'];
		  $pesoeqtt=$pesoeqtt+$pesoeqt;
		  ?></div></td>
            <td><div align="center">
              <? 
		  echo $pesosubtt=$pesopasst+$pesoeqt;
		  $pesott=$pesott+$pesosubtt;
		  ?>
            </div></td>
          </tr>
		  <? 
		}
		$objPer->Liberar($resultadot);  
		?> 
          <tr class="lblCampo">
            <td colspan="6"><div align="right"><span class="lblParrafo">1</span> Total Crew </div></td>
            <td><div align="center"><? echo $pesopasstt;?></div></td>
            <td><div align="center"><? echo $pesoeqtt;?></div></td>
            <td><div align="center"><? echo $pesott;?></div></td>
          </tr>
        </table>
</div></td>
    <td >&nbsp;</td>
  </tr>
  <tr class="lblCampo">
    <td></td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  <tr class="lblCampo">
    <td></td>
    <td><div align="center">PASSENGERS</div></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td><div align="left">
      <table width="721" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
        <tr class="lblCampo">
          <td width="24" rowspan="2"><div align="center" >Pax</div></td>
          <td colspan="2"><div align="center">Crew</div></td>
          <td width="92" rowspan="2"><div align="center">Company</div></td>
          <td width="82" rowspan="2"><div align="center">From</div></td>
          <td width="76" rowspan="2"><div align="center">Destination</div></td>
          <td colspan="3"><div align="center">Weight Kg </div></td>
        </tr>
        <tr class="lblCampo">
          <td width="205"><div align="center">Name/Descripcion</div></td>
          <td width="81"><div align="center">DNI/DOC</div></td>
          <td width="42"><div align="center">Peso Pass. </div></td>
          <td width="44"><div align="center">Peso Eq. </div></td>
          <td width="55"><div align="center">Subtotal</div></td>
        </tr>
		<?
		  $resultadop=$objPer->getPassDatos($cod_man,$via);	
          while($filasp=$objPer->NextRow($resultadop)){
		  $n++;
		  ?>
        <tr class="lblCampo">
          <td><div align="center"><? echo $n;?></div></td>
          <td><div align="left"><? echo $filasp['nombres'];?></div></td>
          <td><div align="left"><? echo $filasp['dociden_per'];?></div></td>
          <td><div align="left"><? echo $filasp['razon_emp'];?></div></td>
          <td><div align="left"><? echo $filasp['origen'];?></div></td>
          <td><div align="left"><? echo $filasp['destino'];?></div></td>
          <td><div align="center">
		  <? echo $pesopass=$filasp['peso_mpass'];
		  $pesopasst=$pesopasst+$pesopass;
		  ?>
		  </div></td>
          <td><div align="center">
		  <? echo $pesoeq=$filasp['pesoeq_mpass'];
		  $pesoeqt=$pesoeqt+$pesoeq;
		  ?>
		  </div></td>
          <td><div align="center">
		  <? 
		  echo $pesosubt=$pesopass+$pesoeq;
		  $pesot=$pesot+$pesosubt;
		  ?>
		  </div></td>
        </tr>
		<? 
		}
		$objPer->Liberar($resultadop);  
		?>  
        <tr class="lblCampo">
          <td colspan="6"><div align="right"><span class="lblParrafo">2</span> Total Pax </div></td>
          <td><div align="center"><? echo $pesopasst;?></div></td>
          <td><div align="center"><? echo $pesoeqt;?></div></td>
          <td><div align="center"><? echo $pesot;?></div></td>
        </tr>
      </table>
    </div></td>
    <td></td>
  </tr>
  <tr class="lblCampo">
    <td></td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  <tr class="lblCampo">
    <td></td>
    <td><div align="center">MATERIALS</div></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td><div align="left">
      <table width="722" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
        <tr class="lblCampo">
          <td width="24" rowspan="2"><div align="center" >Item</div></td>
          <td colspan="2"><div align="center">Crew</div></td>
          <td width="92" rowspan="2"><div align="center">Company</div></td>
          <td width="83" rowspan="2"><div align="center">From</div></td>
          <td width="77" rowspan="2"><div align="center">Destination</div></td>
          <td colspan="3"><div align="center">Weight Kg </div></td>
        </tr>
        <tr class="lblCampo">
          <td width="202"><div align="center">Descripcion</div></td>
          <td width="81"><div align="center">N&ordm; Guia </div></td>
          <td width="42"><div align="center">Packs</div></td>
          <td width="46"><div align="center">Wg/Unit</div></td>
          <td width="55"><div align="center">Subtotal</div></td>
        </tr>
		<?
		  $resultadom=$objPer->getCargaDatos($cod_man,$via);	
          while($filasm=$objPer->NextRow($resultadom)){
		  $n2++;
		  ?>
        <tr class="lblCampo">
          <td><div align="center"><? echo $n2;?></div></td>
          <td><div align="left"><? echo $filasm['des_w'];?></div></td>
          <td><div align="left"><? echo $filasm['guia_w'];?></div></td>
          <td><div align="left"><? echo $filasm['compania'];?></div></td>
          <td><div align="left"><? echo $filasm['origen'];?></div></td>
          <td><div align="left"><? echo $filasm['destino'];?></div></td>
          <td><div align="center"><? echo $cantw=$filasm['cant_w'];
		  $cantwt=$cantwt+$cantw;
		  ?></div></td>
          <td><div align="center"><? echo $filasm['tipounidad'];?></div></td>
          <td><div align="center">
            <? echo $pesow=$filasm['peso_w'];
		  $pesowt=$pesowt+$pesow;
		  ?>
          </div></td>
        </tr>
		<? 
		}
		$objPer->Liberar($resultadom);  
		?> 
        <tr class="lblCampo">
          <td colspan="6"><div align="right"><span class="lblParrafo">3</span> Total Materials </div></td>
          <td><div align="center"><? echo $cantwt;?></div></td>
          <td><div align="center"></div></td>
          <td><div align="center"><? echo $pesowt;?></div></td>
        </tr>
        <tr class="lblCampo">
          <td colspan="6"><div align="right" class="lblParrafo">1+2+3 Total Payload </div></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><div align="center" class="lblParrafo"><? echo $pesott+$pesot+$pesowt;?></div></td>
        </tr>
      </table>
    </div></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td><table width="722" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
      <tr class="lblCampo">
        <td>COMMENTS : </td>
      </tr>
      <tr class="lblCampo">
	  <pre>
        <td><div align="left"><? echo $obser;?></div>
		</td>
		</pre>
      </tr>
    </table></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
</table>
<map name="MapMap">
  <area shape="rect" coords="3,4,23,21" href="fondo.php">
</map>
</body>
</html>

