<?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->getCodPer();
  $filas=$objPer->NextRow($resultado);
  $cod_per=$filas['valor_e'].getNumCeros($filas['valor']);*/
?>

<!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 width="4"></td>
    <td width="829"  valign="bottom">&nbsp;</td>
    <td width="24"></td>
  </tr>
  <tr>
    <td></td>
    <td  valign="bottom"><div align="left">
      <table width="793" border="0" cellpadding="0" cellspacing="0">
        <tr class="lblCampo" valign="top">
          <td width="251" valign="top"><table width="226" border="0" cellspacing="0" cellpadding="0">
            <tr class="lblCampo">
              <td width="42"><img src="../imagenes/Brp%20logon.JPG" width="35" height="35" border="0"></td>
              <td width="184">BARRETT RESOURCES (PERU) LLC<br>
                SUCURSAL DEL PERU </td>
            </tr>
          </table></td>
          <td width="503" valign="bottom"><div align="left" class="lblParrafo">Recorrido del Transporte <? echo $model_trans." ".$mat_trans;?></div></td>
          <td width="39"><div align="left"></div></td>
        </tr>
      </table>
    </div></td>
    <td></td>
  </tr>
  <tr class="lblCampo">
    <td></td>
    <td height="20"  valign="bottom"><div align="left"></div></td>
    <td></td>
  </tr> 
  
  <tr class="lblCampo">
    <td></td>
    <td><div align="center">Reporte del <? echo $fecha1?> al <? echo $fecha2?></div></td>
    <td></td>
  </tr>
  <tr class="lblCampo">
    <td></td>
    <td height="25">&nbsp;</td>
    <td></td>
  </tr>
  <tr class="lblCampo">
    <td></td>
    <td><div align="center">TRIPULACION</div></td>
    <td></td>
  </tr>
  <tr class="lblCampo">
    <td></td>
    <td><div align="left">
      <table width="798" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
        <tr class="lblCampo" >
          <td width="26" rowspan="2"><div align="center" >Pax</div></td>
          <td colspan="2"><div align="center">Crew</div></td>
          <td width="158" rowspan="2"><div align="center">Company</div></td>
          <td width="95" rowspan="2"><div align="center">From</div></td>
          <td width="83" rowspan="2"><div align="center">Destination</div></td>
          <td colspan="3"><div align="center">Weight Kg </div></td>
        </tr>
        <tr class="lblCampo">
          <td width="182"><div align="center">Name/Descripcion</div></td>
          <td width="85"><div align="center">DNI/DOC</div></td>
          <td width="46"><div align="center">Peso Crew </div></td>
          <td width="49"><div align="center">Peso Eq. </div></td>
          <td width="54"><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['cargo_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"> 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></td>
  </tr>
  <tr class="lblCampo">
    <td></td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  <tr class="lblCampo">
    <td></td>
    <td><div align="center">DETALLE DE LA CARGA </div></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td><div align="left">
      <table width="798" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
        <tr class="lblCampo">
          <td width="26" rowspan="2"><div align="center" >Item</div></td>
          <td colspan="2"><div align="center"></div></td>
          <td width="158" rowspan="2"><div align="center">Compania</div></td>
          <td width="95" rowspan="2"><div align="center">Origen</div></td>
          <td width="83" rowspan="2"><div align="center">Destino</div></td>
          <td colspan="3"><div align="center">Weight Kg </div></td>
        </tr>
        <tr class="lblCampo">
          <td width="182"><div align="center">Descripcion</div></td>
          <td width="85"><div align="center">N&ordm; Guia </div></td>
          <td width="46"><div align="center">Packs</div></td>
          <td width="49"><div align="center">Wg/Unit</div></td>
          <td width="54"><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"> 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>
        
      </table>
    </div></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td>&nbsp;</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>

