<?
session_start();

if($v==1){
include("funcion/funciones.php");
$resultadoo=$objPer->getLugarDistancia1($origenes);								   
$filao=$objPer->NextRow($resultadoo);
$origenes=$filao['nom_lugar'];
}
?>
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="stilos/Estilos.css" rel="stylesheet" type="text/css">
<link href="Estilos.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="921" border="1" align="left" cellpadding="0" cellspacing="0">
  
  <tr bgcolor="#006600" class="rdoBanners">
    <td width="50"><div align="center">De</div></td>
    <td width="52"><div align="center">Para</div></td>
    <td width="25" bgcolor="#006600"><div align="center">HAR</div></td>
    <td width="25"><div align="center">HAI</div></td>
    <td width="24"><div align="center">HTI</div></td>
    <td width="26"><div align="center">HAP
        </div></td>
    <td width="38"><div align="center">TVC</div></td>
    <td width="95"><div align="center">Centro
         
    de Costo </div></td>
    <td width="24"><div align="center">PI</div></td>
    <td width="24"><div align="center">PS</div></td>
    <td width="24"><div align="center">PB</div></td>
    <td width="24"><div align="center">Kg</div></td>
    <td width="29"><div align="center">Carg</div></td>
    <td width="134"><div align="center">Tipo Carg. </div></td>
    <td width="64"><div align="center">WI</div></td>
    <td width="32"><div align="center">WS</div></td>
    <td width="45"><div align="center">WB</div></td>
    <td width="106">      
    <div align="center">Observacion<?=$origenes?></div></td>
    <td width="40"><div align="center">
      <input name="canasta1" type="hidden" size="5" id="canasta1" value="<?php echo $contarItem=count($control1); ?>">
    </div></td>
  </tr>
  <?php 
  $n=0;
  if (isset($control1)){
											$contarItem = count($control1);
										
										while(list($clave,$valor)=each($control1)){
											$harranq_dch=$valor[0];
											$haire_dch=$valor[1];
											$htierra_dch=$valor[2];											
											$hapaga_dch=$valor[3];
											$pi=$valor[4];
											$ps=$valor[5];
											$pb=$valor[6];											
											$kp=$valor[7];		
											$ttc=$valor[8];
											$tc=$valor[9];
											$kc=$valor[10];									
											$origen=$valor[11];
											$destino=$valor[12];
											$ccosto=$valor[13];
											$distancia=$valor[14];
											$obser=$valor[15];
											$ws=$valor[16];
											$wb=$valor[17];
											
 								 	?>
  <tr >
    <td><div align="center"><?php echo $origen ?></div></td>
    <td><div align="center"><?php echo $destino; ?>
	</div></td>
    <td><div align="center">
      <?=$harranq_dch;?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $haire_dch;	
	?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $htierra_dch;	
	?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $hapaga_dch;	
	?>
    </div></td>
    <td><div align="center">
      <?	
	  if($v==1){
	  //include("funcion/funciones.php"); 
		  if($matricula!='CFIGR'){
		  echo $thp=calcular_tiempo_trasnc($hapaga_dch,$harranq_dch);
		  }else{
		  $that=calcular_tiempo_trasnc($htierra_dch,$haire_dch);
		  echo calcular_horas_formato_inversa($that);
		  
		  }	   
	  }
	  $th=$th+$thp;
	  $thatt=$thatt+$that;
	  ?>
    </div></td>
    <td><div align="center">
      <?=$ccosto?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $pi;	
	?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $ps;	
	?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $pb;	
	?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $kp;	
	?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $ttc;	
	?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $tc;	
	?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $kc;	
	?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $ws;	
	?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $wb;	
	?>
    </div></td>
    <td><div align="left">
      <?php 
	echo $obser	
	?></div></td>
    <td><div align="center"><a href="#" onClick="DatosDeleteItem('<?=$clave?>')"><img src="../imagenes/btn_eliminar.gif" width="20" height="20" border="0"></a></div></td>
  </tr>
  
  <?php }}?>
  <tr class="lblCampo">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><div align="center">
    </div></td>
    <td>&nbsp;</td>
    <td><div align="center">
    </div></td>
    <td>&nbsp;</td>
    <td><div align="center"></div>      <div align="center">
      <?
	  
	  if($matricula!='CFIGR'){
	  echo $th;
	  }else{
	  echo calcular_horas_formato_inversa($thatt);
	  }
	  
	  ?>
    </div>      <div align="center"></div>      <div align="center"></div>      <div align="center"></div>      <div align="center"></div>      <div align="center"></div>      <div align="center"></div>      <div align="center"></div>      <div align="center"></div>      <div align="center"></div>      <div align="center"></div>      <div align="center"></div>      <div align="center"></div></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><div align="center"></div></td>
    <td><div align="center"></div></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
