<?
session_start();
if($v==1){
include("stilos/config.inc.php");
}
?>

<table width="868" border="1" cellpadding="0" cellspacing="0" bordercolor="<?=$bordetabla?>" bgcolor="<?=$c_fondo['fondo tabla']?>" style="<?=$stylo['tabla']?>" >  
  <tr class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
    <td width="21"><div align="center" class="lblCampoBlanco">#</div></td>
    <td width="220"><div align="center" class="lblCampoBlanco">Personal</div></td>
    <td width="80" ><div align="center" class="lblCampoBlanco">DNI/DOC. IDEN. </div></td>
    <td width="90"><div align="center" class="lblCampoBlanco">EMPRESA</div></td>
    <td width="24"><div align="center" class="lblCampoBlanco">Kg</div></td>
    <td width="34"><div align="center" class="lblCampoBlanco">Eq</div></td>
    <td width="104"><div align="center" class="lblCampoBlanco">Tipo Pax </div></td>
    <td width="101"><div align="center" class="lblCampoBlanco">C.I.</div></td>
    <td width="75">      
      <div align="center">Origen</div></td>
    <td width="73"><div align="center">Destino</div></td>
    <td width="22">&nbsp;    </td>
  </tr>
<?php 
if($q==1){	   
$rsperd=$objPer->getPassDatosPT($cod_man,$via);	
while($rowperd=$objPer->NextRow($rsperd)){

$personal=$rowperd['nombres'];
$dociden_per=$rowperd['dociden_per'];
$razon_emp=$rowperd['razon_emp'];
$peso_per=$rowperd['peso_mpass'];
$peso_eq=$rowperd['pesoeq_mpass'];
$tipo_mpass=$rowperd['tipo_mpass'];
$ccosto=$rowperd['ccosto'];
$origen=$rowperd['origen'];
$destino=$rowperd['destino'];
$distancia=$rowperd['distancia'];
$id=$rowperd['id'];
$codigo_mpass=$rowperd['codigo_mpass'];
$numorigen=$rowperd['numorigen'];
$numdestino=$rowperd['numdestino'];
						
$pasajeros1[]=array("$personal","$dociden_per",$razon_emp,$peso_per,$peso_eq,$tipo_mpass,$ccosto,$origen,$destino,$distancia,$id,$codigo_mpass,$numorigen,$numdestino);
}$objPer->Liberar($rsperd);  
} 
$n=0;
count($pasajeros1);
if($v==1){
if(isset($pasajeros1)){
while(list($clave,$valor)=each($pasajeros1)){
$personal=$valor[0];
$dociden_per=$valor[1];
$razon_emp=$valor[2];											
$peso_per=$valor[3];																				
$peso_eq=$valor[4];
$tipo_mpass=$valor[5];											
$ccosto=$valor[6];
$origen=$valor[7];
$destino=$valor[8];
$distancia=$valor[9];
$id=$valor[10];
$codigo_mpass=$valor[11];
$numorigen=$valor[12];
$numdestino=$valor[13];

?>
  <tr >
    <td><div align="center"><?=++$n;?></div></td>
    <td><div align="left"><?=$personal;?>
	</div></td>
    <td><div align="center">
      <?=$dociden_per;?>
      <? //$cod_ruta?>
    </div></td>
    <td><div align="center">
      <?=$razon_emp;?>
    </div></td>
    <td><div align="center">
	<?
	if($cerrar=='0'){ 
	if($codigo_mpass!=''){
	?>
	<input class="inputoff" id="a<?=$codigo_mpass;?>" onFocus="Focus(this.id, this.value)" onBlur="Blur(this.id, this.value, 'peso_per', <?=$codigo_mpass;?>, '<?=$cod_ruta;?>', '1', '<?=$via;?>', '<?=$clave;?>')" value="<?=$peso_per;?>" size="4" maxlength="4">
    <? }else{ echo $peso_per;}}else{ echo $peso_per;}
	$pesoperdis=$distancia*$peso_per;	  
	$pesoper=$pesoper+$peso_per;
	$pesoperdist=$pesoperdist+$pesoperdis;
	?>
    </div></td>
    <td><div align="center">
	<? 
	if($cerrar=='0'){
	if($codigo_mpass!=''){?>
	<input class="inputoff" id="b<?=$codigo_mpass;?>" onFocus="Focus(this.id, this.value)" onBlur="Blur(this.id, this.value, 'peso_eq', <?=$codigo_mpass;?>, '<?=$cod_ruta;?>', '1', '<?=$via;?>', '<?=$clave;?>')" value="<?=$peso_eq;?>" size="4" maxlength="4">
    <? }else{ echo $peso_eq;}}else{echo $peso_eq;}
	  $pesoeq=$pesoeq+$peso_eq;
    ?>
    </div></td>
    <td><div align="center">
	<? 
	if($cerrar=='0'){
	if($codigo_mpass!=''){?>
	<select onFocus="Focus(this.id, this.options[this.options.selectedIndex].value)" onBlur="Blur(this.id, this.options[this.options.selectedIndex].value, 'tipo_mpass', <?=$codigo_mpass;?>, '<?=$cod_ruta;?>', '1', '<?=$via;?>', '<?=$clave;?>')" class="inputoff" id="c<?=$codigo_mpass;?>">
		<option value="PASAJERO" <? if($tipo_mpass=='PASAJERO'){?> selected <? }?>>PASAJERO</option>
		<option value="TRIPULANTE" <? if($tipo_mpass=='TRIPULANTE'){?> selected <? }?>>TRIPULANTE</option>
	</select>
	<? }else{ echo $tipo_mpass;}}else{echo $tipo_mpass;}?>
    </div></td>
    <td><div align="center">
      <? 
	  if($cerrar=='0'){
	  if($codigo_mpass!=''){?>
      <select onFocus="Focus(this.id, this.options[this.options.selectedIndex].value)" onBlur="Blur(this.id, this.options[this.options.selectedIndex].value, 'ccosto', <?=$codigo_mpass;?>, '<?=$cod_ruta;?>', '1', '<?=$via;?>', '<?=$clave;?>')" class="inputoff" id="d<?=$codigo_mpass;?>">
        <option value="0" <? if($ccosto=="0"){?> selected <? }?>>Centro Costo</option>
        <?=$objPer->getCboCCostoT($ccosto);?>
      </select>
	  <? }else{ echo $ccosto;}}else{echo $ccosto;}
	  
	  ?>
    </div></td>
    <td><div align="center">
      <? 
	  if($cerrar=='0'){
	  if($codigo_mpass!=''){?>
      <select onFocus="Focus(this.id, this.options[this.options.selectedIndex].value)" onBlur="Blur(this.id, this.options[this.options.selectedIndex].value, 'origen', <?=$codigo_mpass;?>, '<?=$cod_ruta;?>', '1', '<?=$via;?>', '<?=$clave;?>')" class="inputoff" id="e<?=$codigo_mpass;?>">
        <option value="0" <? if($origen=="0"){?> selected <? }?>>Origen</option>
        <?=$objPer->getCboOrigenMan1($numorigen,$cod_ruta);?>
      </select>
	  <? }else{ echo $origen;}}else{echo $origen;}
	  
	  ?>
</div></td>
    <td><div align="center">
      <? 
	  if($cerrar=='0'){
	  if($codigo_mpass!=''){?>
      <select onFocus="Focus(this.id, this.options[this.options.selectedIndex].value)" onBlur="Blur(this.id, this.options[this.options.selectedIndex].value, 'destino', <?=$codigo_mpass;?>, '<?=$cod_ruta;?>', '1', '<?=$via;?>', '<?=$clave;?>')" class="inputoff" id="f<?=$codigo_mpass;?>">
        <option value="0" <? if($destino=="0"){?> selected <? }?>>Destino</option>
        <?=$objPer->getCboDestinoMan1($numdestino,$cod_ruta);?>
      </select>
	  <? }else{ echo $destino;}}else{echo $destino;}
	 
	  ?>
    </div></td>
    <td><div align="center">
	<? 
	if($cerrar=='0'){
	if($id!=''){
			if($codigo_mpass!=''){
	?>	
	<input name="boton_delper" type="button" id="boton_delper" value="x" onClick="DatosDeleteItemPerEdit('<?=$clave?>',<?=$id?>,<?=$codigo_mpass?>,'<?=$cod_man?>','<?=$via?>','<?=$cod_ruta?>')">
	<!-- <a href="#" ><img src="../imagenes/btn_eliminar.gif" width="15" height="15" border="0"></a> -->
	<?
			}else{
	?>
	<input name="boton_delper1" type="button" id="boton_delper1" value="x" onClick="DatosDeleteItemPerEdit1('<?=$clave?>',<?=$id?>,'<?=$cod_man?>','<?=$via?>','<?=$cod_ruta?>')">
	<!-- <a href="#" ><img src="../imagenes/btn_eliminar.gif" width="15" height="15" border="0"></a> -->
	<? }}else{
			if($codigo_mpass!=''){
	?>
	<input name="boton_delper2" type="button" id="boton_delper2" value="x" onClick="DatosDeleteItemPerEdit2('<?=$clave?>',<?=$codigo_mpass?>,'<?=$cod_man?>','<?=$via?>','<?=$cod_ruta?>')">
	<!-- <a href="#" ><img src="../imagenes/btn_eliminar.gif" width="15" height="15" border="0"></a> -->
	<?
			}else{
	?>
	<input name="boton_delper3" type="button" id="boton_delper3" value="x" onClick="DatosDeleteItemPerEdit3('<?=$clave?>','<?=$cod_man?>','<?=$via?>','<?=$cod_ruta?>')">
	<!-- <a href="#" ><img src="../imagenes/btn_eliminar.gif" width="15" height="15" border="0"></a> -->
	<? }}}?>
	</div></td>
  </tr> 
  
 
  <? }}}?>
  <tr class="lblCampo">
    <td colspan="4"><div align="center">
    </div></td>
    <td><div align="center">
      <?	  
	/* echo $pesoper."<br>";
	echo $pesoperdist; */
	$_SESSION['pesototalper']=$pesoper;	
	$_SESSION['pesototalperdis']=$pesoperdist; 
	?>
    </div></td>
    <td><div align="center">
      <? //$pesoeq?>
    </div></td>
    <td colspan="5">        
	<input name="numeroingre" type="hidden" size="5" id="canasta1" value="<?=$_SESSION['canasta_viaje']=count($pasajeros); ?>"> </td>
  </tr>
  <tr class="lblCampo">
    <td colspan="11"><div align="left"><?=$cerrar?>
     
    </div></td>
  </tr>
</table>

