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

<body bgcolor="<?=$c_fondo['fondo']?>">
<table width="816" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <form name="form1" method="post" action="enviar_mov.php">
    <td><div align="left">
      
        <table width="815" 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="7"><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">Descripcion o Nombre del Ocupante </div></td>
            <td><div align="center">Peso del Pasajero </div></td>
            <td width="47"><div align="center">Peso del Equipaje </div></td>
            <td width="106"><div align="center">Tipo de Pasjero
                    <input name="num" type="hidden" id="num3" value="<? echo $num?>" size="3">
                    <? echo count($pasajes);?> </div></td>
            <td><div align="center">Origen</div></td>
            <td><div align="center">Destino</div></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><div align="left">
                <input name="nombres" type="text" id="nombres" size="35" readonly>
                <input name="btn_ver1" type="button" class="botira" id="btn_ver1" style="<?=$stylo['st2']?>" value="Buscar" onClick="javascript:Abrir_Ventanapopup1('cvp_pass_ver.php',465,300)" >
              </div>
                <div align="left"> </div></td>
            <td width="48">
              <div align="center">
                <input name="peso_mpass" type="text" id="peso_mpass" value="0" size="3">
            </div></td>
            <td><div align="center">
                <input name="pesoeq_mpass" type="text" id="pesoeq_mpass" value="0" size="4">
            </div></td>
            <td><div align="center">
                <select name="tipo_mpass" id="tipo_mpass">
                  <option value="PASAJERO">PASAJERO</option>
                  <option value="TRIPULANTE">TRIPULANTE</option>
				  
                </select>
            </div></td>
            <td width="127">
              <div align="center"><span class="lblForm">
                <select name="orig_ruta" id="orig_ruta">
                  <option value="0" <? if($orig_ruta=="0"){?> selected <? }?>>Seleccionar Origen</option>
                  <? 
						    echo $objPer->getCboLugarN();
						    ?>
                </select>
              </span></div></td>
            <td width="131"><div align="center"><span class="lblForm">
              <select name="dest_ruta" id="dest_ruta">
                <option value="0" <? if($dest_ruta=="0"){?> selected <? }?>>Seleccionar Destino</option>
                <? 
						    echo $objPer->getCboLugarN();
						?>
              </select>
            </span></div></td>
            <td width="37"><input name="Submit22" type="submit" style="<?=$stylo['st2']?>" class="botira" value="&gt;&gt;&gt;" >
              <input name="dociden_per" type="hidden" size="5" id="dociden_per2"></td>
          </tr>
          <tr>
            <td colspan="7"><div align="center">
                <table width="814" 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];
$orig_ruta=$valor[4];
$dest_ruta=$valor[5];
$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="218" >
                      <div align="center"> </div>
                      <div align="left"> <? echo $filas['nom_per'];?> <? echo $filas['appat_per'];?> <? echo $filas['apmat_per'];?></div></td>
                    <td width="81"><div align="center">
                        <? 
			  echo $peso_mpass;
			  $peso_total=$peso_total+$peso_mpass;
			  ?>
                    </div></td>
                    <td width="67">
                      <div align="center">
                        <? 
				echo $pesoeq_mpass;
				$pesoeq_total=$pesoeq_total+$pesoeq_mpass;
				?>
                    </div></td>
                    <td width="137"><div align="center"><? echo $tipo_mpass?> </div></td>
                    <td width="140"><div align="center"><? echo $orig_ruta?></div></td>
                    <td width="128"><div align="center"><? echo $dest_ruta?></div></td>
                    <td width="43"><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>
                    <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>
                    <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>
                    <td>&nbsp;</td>
                  </tr>
                  <tr class="lblForm" >
                    <td>&nbsp;</td>
                    <td colspan="2"><div align="center">----------------</div></td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&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><div align="center"> </div></td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</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="815" 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="7"><div align="left">Detalle del Embarque </div></td>
          </tr>
          <tr class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>" valign="top">
            <td width="187"><div align="center">Descripcion del Embarque</div></td>
            <td width="120"><div align="center">Compania</div></td>
            <td><div align="center">Guia Remision</div></td>
            <td width="50"><div align="center">Cantidad</div></td>
            <td width="88"><div align="center">Peso del Equipaje                    
			<? echo count($cargac);?> </div></td>
            <td width="88"><div align="center">SubTotal Peso</div></td>
            <td>&nbsp;</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="20">
              </div></td>
            <td width="81">
              <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="tipounidad" id="tipounidad">
                <option value="UND">UND</option>
                <option value="KG">KG</option>
                <option value="BULTOS">BULTOS</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="37"><div align="left">
                <input name="Submit222" type="submit" style="<?=$stylo['st2']?>" class="botira" value="&gt;&gt;&gt;" >
            </div></td>
          </tr>
          <tr>
            <td colspan="7"><div align="center">
                <table width="653" 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];

		  /*$resultado=$objPer->devolverPer($dociden_per);
		  $filas=$objPer->NextRow($resultado);*/		  
?>
                  <?
//if ($linea){$color = "#ECE9D8";$linea=0;}else{$color = "#D4D0C8";$linea++;}
?>
                  <tr class="lblForm" >
                    <td width="185" >
                      <div align="center"> </div>
                      <div align="left">
                        <? 
			  echo $des_w;
			  
			  ?>
                      </div></td>
                    <td width="105" ><div align="center">
                      <? 
			  echo $compania;
			  
			  ?>
                    </div></td>
                    <td width="46"><div align="center">
                        <? 
			  echo $guia_w;
			  
			  ?>
                    </div></td>
                    <td width="115">
                      <div align="center">
                        <? 
				echo $cant_w;
				$cant_total=$cant_total+$cant_w;
				?>
                    </div></td>
                    <td width="51"><div align="center"><? echo $tipounidad;?>
					 </div></td>
                    <td width="119"><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="32"><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>&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"><? 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>&nbsp;</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>&nbsp;</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>&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>
