<?
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="1246" border="1" align="left" cellpadding="0" cellspacing="0">
  
  <tr bgcolor="#006600" class="rdoBanners">
    <td width="70"><div align="center">De</div></td>
    <td width="70"><div align="center">Para</div></td>
    <td width="30" bgcolor="#006600"><div align="center">HAR</div></td>
    <td width="30"><div align="center">HAP</div></td>
    <td width="40"><div align="center">HV</div></td>
    <td width="256"><div align="center">CC<input name="canasta1" type="hidden" size="5" id="canasta1" value="<?php echo $contarItem=count($control1); ?>"><?=$origenes?></div></td>
    <td width="25"><div align="center">PI</div></td>
    <td width="26"><div align="center">PS</div></td>
    <td width="25"><div align="center">PB</div></td>
    <td width="40"><div align="center">VIV.</div></td>
    <td width="41"><div align="center">EQ.</div></td>
    <td width="40"><div align="center">P&amp;E</div></td>
    <td width="40"><div align="center">MAT.</div></td>
    <td width="40"><div align="center">COM.</div></td>
    <td width="40"><div align="center">VIV.</div></td>
    <td width="40"><div align="center">EQ.</div></td>
    <td width="41"><div align="center">P&amp;E</div></td>
    <td width="40"><div align="center">MAT.</div></td>
    <td width="40"><div align="center">COM.</div></td>
    <td width="40"><div align="center">VIV.</div></td>
    <td width="40"><div align="center">EQ.</div></td>
    <td width="40"><div align="center">P&amp;E</div></td>
    <td width="40"><div align="center">MAT.</div></td>
    <td width="40"><div align="center">
      
COM.      </div></td>
    <td width="20"><div align="center"></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];
											$cit_viv=$valor[7];
											$cit_eq=$valor[8];
											$cit_pe=$valor[9];
											$cit_mat=$valor[10];
											$cit_com=$valor[11];
											$ct_viv=$valor[12];
											$ct_eq=$valor[13];
											$ct_pe=$valor[14];
											$ct_mat=$valor[15];
											$ct_com=$valor[16];
											$dt_viv=$valor[17];
											$dt_eq=$valor[18];
											$dt_pe=$valor[19];
											$dt_mat=$valor[20];
											$dt_com=$valor[21];											
											$origen=$valor[22];
											$destino=$valor[23];
											$ccosto=$valor[24];
											$distancia=$valor[25];
											$obser=$valor[26];
											
 								 	?>
  <tr >
    <td><div align="center"><?php echo $origen ?></div></td>
    <td><div align="center"><?php echo $destino."/".$distancia; ?>
	</div></td>
    <td><div align="center">
      <?=$harranq_dch;?>
    </div></td>
    <td><div align="center">
      <?php 
	echo $hapaga_dch;	
	?>
    </div></td>
    <td><div align="center">
      <?	
	  if($v==1){
	  //include("funcion/funciones.php");  
	  $thp=calcular_tiempo_trasnc($hapaga_dch,$harranq_dch);
	  $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">
      <?=$pi;?>
    </div></td>
    <td><div align="center">
      <?=$ps;?>
    </div></td>
    <td><div align="center">
      <?=$pb;?>
    </div></td>
    <td><div align="center"><?php echo $cit_viv ?></div></td>
    <td><div align="center"><?php echo $cit_eq ?></div></td>
    <td><div align="center"><?php echo $cit_pe ?></div></td>
    <td><div align="center"><?php echo $cit_mat ?></div></td>
    <td><div align="center"><?php echo $cit_com ?></div></td>
    <td><div align="center"><?php echo $ct_viv ?></div></td>
    <td><div align="center"><?php echo $ct_eq ?></div></td>
    <td><div align="center"><?php echo $ct_pe ?></div></td>
    <td><div align="center"><?php echo $ct_mat ?></div></td>
    <td><div align="center"><?php echo $ct_com ?></div></td>
    <td><div align="center"><?php echo $dt_viv ?></div></td>
    <td><div align="center"><?php echo $dt_eq ?></div></td>
    <td><div align="center"><?php echo $dt_pe ?></div></td>
    <td><div align="center"><?php echo $dt_mat ?></div></td>
    <td><div align="center"><?php echo $dt_com ?></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">
      <?
	  //echo calcular_horas_formato_inversa($thatt);
	  echo $thatt;
	  ?>
    </div></td>
    <td>&nbsp;</td>
    <td>&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><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><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>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
