<?
session_start();
  include("../clases/BDConexion.php");
  include("../clases/clsPer.php");
  include("Funciones.php");
  include("stilos/config.inc.php");
  $objPer=new clsPer;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin t&iacute;tulo</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">
<script language="JavaScript"> 
<!--
//sURL,x,y
function Abrir_Ventanapopup1(sURL,x,y) { 
/*var especificaciones="top=0, left=0, toolbar=no,location=no, status=yes,menubar=no,scrollbars=no, resizable=no, width=1,height=1" 
var titulo="Titulo"
window.open(el_url,titulo,especificaciones);*/ 

if (!window.focus) return;
			var par;
			par = "width=" +x + ",height="+y+","
			par = par + "dependent=no,scrollbars=yes,resizable=no"
			par = par + "menubar=no,toolbar=no,status=yes"
			var ventana = window.open(sURL,"Ver",par)
			ventana.focus();
}
//--> 
</script>
</head>
<? if($foco==1){?>
<body bgcolor="<?=$c_fondo['fondo']?>" onload=document.form1.des.focus()>
<? }else{?>
<body bgcolor="<?=$c_fondo['fondo']?>">
<? }?>
<table width="766" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <!--  enviar.php-->
  <form name="form1" method="post" action="cvp_pass_ver001.php">
    <td><div align="left">
      
        <table width="655" border="1" cellspacing="0" cellpadding="0" bordercolor="<?=$bordetabla?>" bgcolor="<?=$c_fondo['fondo tabla']?>" style="<?=$stylo['tabla']?>">
          <tr class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
            <td colspan="5"><div align="left">Detalle de Pasajeros y Tripulantes Nave seleccionada :<? echo $mat_trans."-".$tipo_trans;?></div></td>
          </tr>
          <tr class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
            <td width="306"><div align="center">Apellidos del Personal </div></td>
            <td width="65"><div align="center">Peso del Pasajero </div></td>
            <td width="69"><div align="center">Peso del Equipaje </div></td>
            <td width="167"><div align="center">Tipo de Pasjero
                    <input name="num" type="hidden" id="num3" value="<? echo $num?>" size="3">
                    <? echo count($pasajes);?> </div></td>
            <td width="38">&nbsp;</td>
          </tr>
          <tr class="lblCampo">
            <td colspan="5">			<div align="left">
                <select name="opciones" id="opciones">
                  <option value="appat_per">Apellido</option>
                  <option value="dociden_per">DNI</option>
                </select>
                <input name="des" type="text" id="des" size="40" >
                <input name="Submit22" type="submit" style="<?=$stylo['st2']?>" class="botira" value="&gt;&gt;&gt;" >
				<a href="cvp_nuevo_pers01.php">
              Nuevo
			  </a>
				<input name="dociden_per" type="hidden" size="5" id="dociden_per">
</div>
              </td>
            </tr>
          <tr>
            <td colspan="5"><div align="center">
                <table width="653" border="0" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bgcolor="<?=$c_fondo['fondo tabla']?>" bordercolor="<?=$bordetabla?>">
                  <? 	
$n=0;
if (isset($pasajes)){
while(list($clave,$valor)=each($pasajes)){
$dociden_per=$valor[0];
$peso_mpass=$valor[1];
$pesoeq_mpass=$valor[2];
$tipo_mpass=$valor[3];
$ccosto=$valor[4];
$n++; 
		  $resultado=$objPer->devolverPer($dociden_per);
		  $filas=$objPer->NextRow($resultado);		  
?>
                  <?
//if ($linea){$color = "#ECE9D8";$linea=0;}else{$color = "#D4D0C8";$linea++;}
?>
                  <tr class="lblForm" >
                    <td width="282" >
                      <div align="center"> </div>
                      <div align="left"> <? echo $filas['nom_per'];?> <? echo $filas['appat_per'];?> <? echo $filas['apmat_per'];?></div></td>
                    <td width="69"><div align="center">
                        <? 
			  echo $peso_mpass;
			  $peso_total=$peso_total+$peso_mpass;
			  ?>
                    </div></td>
                    <td width="72">
                      <div align="center">
                        <? 
				echo $pesoeq_mpass;
				$pesoeq_total=$pesoeq_total+$pesoeq_mpass;
				?>
                    </div></td>
                    <td width="127"><div align="center"><? echo $tipo_mpass?> </div></td>
                    <td width="63"><div align="center"><?=$ccosto?></div></td>
                    <td width="40"><div align="center"> <a href="procesos/cvp_det_manifiesto_sel_borrar.php?item=<? echo $clave?>"><img src="../imagenes/btn_eliminar.gif" width="15" height="15" border="0"></a> </div></td>
                  </tr>
                  <?  
	} ?>
                  <? } ?>
                  <tr class="lblForm" >
                    <td>&nbsp;</td>
                    <td><div align="center">-----------</div></td>
                    <td><div align="center">--------------</div></td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr class="lblForm" >
                    <td>&nbsp;</td>
                    <td><div align="center"><? echo $peso_total;?></div></td>
                    <td><div align="center"><? echo $pesoeq_total;?></div></td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr class="lblForm" >
                    <td><div align="right">Total peso pasajero + peso equipaje </div></td>
                    <td colspan="2"><div align="center">
                        <? 
			  echo $_SESSION['pesototal2']=$peso_total+$pesoeq_total;
			  ?>
                    </div></td>
                    <td><div align="center">
                        <? //echo $n;?>
                    </div></td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr class="lblForm" >
                    <td>&nbsp;</td>
                    <td colspan="2"><div align="center">----------------</div></td>
                    <td colspan="2">&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr class="lblForm" >
                    <td><div align="right">Total de capacidad de carga de la nave</div></td>
                    <td colspan="2"><div align="center"><? echo $_SESSION['carga'];?></div></td>
                    <td colspan="2"><div align="center"> </div></td>
                    <td>&nbsp;</td>
                  </tr>
                </table>
            </div></td>
          </tr>
        </table>
     
        </div></td>
    </form>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><div align="left">
      <form name="form2" method="post" action="enviar_carga.php">
        <table width="764" border="1" cellspacing="0" cellpadding="0" bordercolor="<?=$bordetabla?>" bgcolor="<?=$c_fondo['fondo tabla']?>" style="<?=$stylo['tabla']?>">
          <tr class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
            <td colspan="9"><div align="left">Detalle del Embarque </div></td>
          </tr>
          <tr class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>" valign="top">
            <td width="175"><div align="center">Descripcion del Embarque</div></td>
            <td width="75"><div align="center">Compania</div></td>
            <td><div align="center">Guia Remision</div></td>
            <td width="44"><div align="center">Cantidad</div></td>
            <td width="100"><div align="center">Centro Costo </div></td>
            <td width="121"><div align="center">Peso del Equipaje  </div></td>
            <td width="68"><div align="center">Tipo Carga </div></td>
            <td width="47"><div align="center">SubTotal Peso</div></td>
            <td><? echo count($cargac);?></td>
          </tr>
          <tr>
            <td><div align="left">
                <input name="des_w" type="text" id="nombres3" size="35">
              </div>
                <div align="left"> </div></td>
            <td>
              <div align="center">
                <input name="compania" type="text" id="compania" size="15">
              </div></td>
            <td width="67">
              <div align="center">
                <input name="guia_w" type="text" id="peso_mpass23" size="12">
</div></td>
            <td><div align="center">
              <input name="cant_w" type="text" id="peso_mpass22" value="0" size="5" maxlength="5">
</div></td>
            <td><div align="center">
              <select name="ccosto_w" id="select">
                <option value="0" <? if($ccosto=="0"){?> selected <? }?>>Centro Costo</option>
                <? 
						    echo $objPer->getCboCCostoT($filas['centrocosto']);
						?>
              </select>
</div></td>
            <td><div align="center">
              <select name="tipounidad" id="tipounidad">
                <option value="UND">UND</option>
                <option value="KG">KG</option>
                <option value="BULTOS">BULTOS</option>
                <option value="GAL">GALONES</option>
              </select>
            </div></td>
            <td><div align="center">
              <select name="ttc" id="ttc">
                <option value="Ext">Ext</option>
                <option value="Int">Int</option>
              </select>
            </div></td>
            <td><div align="center">
              <input name="peso_w" type="text" id="pesoeq_mpass22" value="0" size="8" maxlength="7">
            </div></td>
            <td width="47"><div align="left">
                <input name="Submit222" type="submit" style="<?=$stylo['st2']?>" class="botira" value="&gt;&gt;&gt;" >
            </div></td>
          </tr>
          <tr>
            <td colspan="9"><div align="center">
                <table width="759" border="0" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bgcolor="<?=$c_fondo['fondo tabla']?>" bordercolor="<?=$bordetabla?>">
                  <? 
if (isset($cargac)){
while(list($clave1,$valor1)=each($cargac)){

$des_w=$valor1[0];
$guia_w=$valor1[1];
$cant_w=$valor1[2];
$peso_w=$valor1[3];
$compania=$valor1[4];
$tipounidad=$valor1[5];
$ttc=$valor1[6];
$ccosto_w=$valor1[7];

		  /*$resultado=$objPer->devolverPer($dociden_per);
		  $filas=$objPer->NextRow($resultado);*/		  
?>
                  <?
//if ($linea){$color = "#ECE9D8";$linea=0;}else{$color = "#D4D0C8";$linea++;}
?>
                  <tr class="lblForm" >
                    <td width="193" >
                      <div align="center"> </div>
                      <div align="left">
                        <? 
			  echo $des_w;
			  
			  ?>
                      </div></td>
                    <td width="123" ><div align="center">
                      <? 
			  echo $compania;
			  
			  ?>

<? 
			  //echo $ccosto_w;
			  
			  ?>
</div></td>
                    <td width="74"><div align="center">
                        <? 
			  echo $guia_w;
			  
			  ?>
                    </div></td>
                    <td width="76">
                      <div align="center">
                        <? 
				echo $cant_w;
				$cant_total=$cant_total+$cant_w;
				?>
                    </div></td>
                    <td width="58"><div align="center"><? echo $ttc;?>
					 </div></td>
                    <td width="58"><div align="center"><? echo $tipounidad;?></div></td>
                    <td width="138"><div align="center">
					<? /*echo $peso_w;
					$pesoc_total=$pesoc_total+$peso_w;*/
					?>
					<? 
					echo $peso_w;
					
					$ptotal_w=$ptotal_w+($peso_w);
					?></div></td>
                    <td width="39"><div align="center"> <a href="procesos/cvp_det_manifiesto_sel_borrar2.php?item1=<? echo $clave1?>"><img src="../imagenes/btn_eliminar.gif" width="15" height="15" border="0"></a> </div></td>
                  </tr>
                  <?  
	} ?>
                  <? } ?>
                  <tr class="lblForm" >
                    <td colspan="2">&nbsp;</td>
                    <td><div align="center"></div></td>
                    <td><div align="center">---------</div></td>
                    <td><div align="center"></div></td>
                    <td><div align="center"></div></td>
                    <td><div align="center">-----------</div></td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr class="lblForm" >
                    <td colspan="2">&nbsp;</td>
                    <td><div align="center"></div></td>
                    <td><div align="center">
                      <? echo $cant_total;?>
                    </div></td>
                    <td>
                      <div align="center"></div></td>
                    <td><div align="center"></div></td>
                    <td><div align="center"><? echo $ptotal_w;?></div></td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr class="lblForm" >
                    <td colspan="4"><div align="right">Total Emabrque Seleccionado </div>                      <div align="center">                    </div>                      <div align="center">
                      </div></td>
                    <td><div align="center"></div></td>
                    <td><div align="center"></div></td>
                    <td>
					  <div align="center">
					    <? 
			  //$_SESSION['pesototal22']=$cant_total*$pesoc_total;
			  $_SESSION['pesototal22']=$ptotal_w;
			  echo $_SESSION['pesototal22']."/";
			  echo $_SESSION['pesototal2']=$_SESSION['pesototal2']+$_SESSION['pesototal22'];
			  ?>
				      </div></td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr class="lblForm" >
                    <td colspan="2">&nbsp;</td>
                    <td><div align="center"></div></td>
                    <td><div align="center"></div></td>
                    <td><div align="center"></div></td>
                    <td><div align="center"></div></td>
                    <td><div align="center">----------</div></td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr class="lblForm" >
                    <td colspan="4"><div align="right">Total de capacidad de carga de la nave</div>                      
                      <div align="center"></div>                      <div align="center">
                      </div></td>
                    <td><div align="center"></div></td>
                    <td>&nbsp;</td>
                    <td><div align="center"><? echo $_SESSION['carga']-$_SESSION['pesototal2'];?></div></td>
                    <td>&nbsp;</td>
                  </tr>
                </table>
            </div></td>
          </tr>
        </table>
      </form>
    </div></td>
  </tr>
</table>
</body>
</html>
