<?php
  include("stilos/config.inc.php");
  include("../clases/BDConexion.php");
  include("../clases/clsPer.php");
  include("funcion/funciones.php");
  include("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><MMString:LoadString id="insertbar/formsHidden" /></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">

<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
<? $url="cvp_recorrido_trans.php?mat_trans=$mat_trans&fecha1=$fecha1&fecha2=$fecha2"?>
<script>
function volver(form)
{
location.reload('<? echo $url ?>');
}
</script>
<script language="JavaScript"> 
<!--
function print_1(sURL,x,y) {
if (!window.focus) return;
			var par;
			par = "width=" +x + ",height="+y+","
			par = par + "dependent=no,scrollbars=yes,resizable=yes,"
			par = par + "menubar=no,toolbar=no,status=no"
			var ventana = window.open(sURL,"Ver",par)
			ventana.focus();
}
//--> 
</script>

</head>

<body background="../imagenes/fondo.jpg">
<table width="860" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="25"><img src="../estilo_tabla/parte_sup_izq.gif" width="25" height="25"></td>
    <td width="810" background="../estilo_tabla/parte_sup_cen.gif" valign="bottom">
      <div align="left" class="lblTitulo" >Detalle de la Carga del Transporte <? echo $mat_trans." ".$model_trans;?></div></td>
    <td width="25"><img src="../estilo_tabla/parte_sup_der.gif" width="25" height="25" border="0" usemap="#MapMap"></td>
  </tr>
  <tr>
    <td width="25" background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
    <td width="810" height="86" background="../estilo_tabla/parte_med_cen.gif"><div align="center">
        <table width="799" border="0" cellspacing="0" cellpadding="0">
          <tr class="lblCampoBlanco">
            <td height="15"><div align="left"></div></td>
          </tr>
          <tr> </tr>
          <tr class="lblCampo">
            <td><div align="center">TRIPULACION</div></td>
          </tr>
          <tr>
            <td><div align="center">
              <table width="798" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bgcolor="<?=$c_fondo['fondo tabla']?>" bordercolor="<?=$bordetabla?>">
                <tr class="lblCampo" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
                  <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>
          </tr>
          <tr>
            <td height="25">&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><div align="center"></div></td>
          </tr>
          <tr>
            <td height="25">&nbsp;</td>
          </tr>
          <tr class="lblCampo">
            <td><div align="center">DETALLE DE LA CARGA </div></td>
          </tr>
          <tr>
            <td><div align="center">
              <table width="798" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bgcolor="<?=$c_fondo['fondo tabla']?>" bordercolor="<?=$bordetabla?>">
                <tr class="lblCampo" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
                  <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>
          </tr>
          
          <tr>
            <td><div align="center"> </div></td>
          </tr>
          <tr>
            <form name="form1" method="post" action="cvp_recorrido_trans_print.php">
              <td><div align="center">
                  <table width="450" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="104"><div align="right">
                          <input type="button" name="Submit" value=".:Imprimir:." style="<?=$stylo['st2']?>" class="botira" onClick="javascript:print_1('cvp_recorrido_trans_print.php?cod_man=<? echo $cod_man?>&via=<? echo $via?>&mat_trans=<? echo $mat_trans?>&model_trans=<? echo $model_trans?>&fecha1=<? echo $fecha1?>&fecha2=<? echo $fecha2?>',800,600)">
                      </div></td>
                      <td width="93"><input name="dociden_per" type="hidden" id="dociden_per" value="<? echo $dociden_per?>">
                          <input name="fecha1" type="hidden" size="3" id="fecha1" value="<? echo $fecha1?>">
                          <input name="fecha2" type="hidden" id="fecha2" value="<? echo $fecha2?>">
                                                </td>
                      <td width="104"><div align="left">
                          <input type="button" name="Submit2" value=".:Regresar:." style="<?=$stylo['st2']?>" class="botira" onClick="volver(this.form);">
                      </div></td>
                    </tr>
                  </table>
              </div></td>
            </form>
          </tr>
        </table>
    </div></td>
    <td background="../estilo_tabla/parte_med_der.gif">&nbsp;</td>
  </tr>
  <tr>
    <td><img src="../estilo_tabla/parte_inf_izq.gif" width="25" height="20"></td>
    <td background="../estilo_tabla/parte_inf_cen.gif">&nbsp;</td>
    <td><img src="../estilo_tabla/parte_inf_der.gif" width="25" height="20"></td>
  </tr>
</table>
<map name="MapMap">
  <area shape="rect" coords="2,5,22,21" href="fondo.php">
</map>
<map name="Map">
  <area shape="rect" coords="2,5,22,21" href="fondo.php">
</map>
</body>

</html>

