<?
session_start();
include("../../clases/BDConexion.php");
include("../../clases/clsPer.php");
include("../funcion/funciones.php");

$objPer=new clsPer;
$row = 1;
//echo $file;

$fp = fopen ($file,"r");

while ($data = fgetcsv ($fp, 1000, ","))
{
$num = count ($data);
$row++;
$rs=$objPer->getLugarDistanciaParam($data[0],$data[1]);
$row=$objPer->NextRow($rs);
$distancia=$row['distancia'];
//$insertar="INSERT INTO temp_ruta (centrocosto,nombre) VALUES ('$data[0]','$data[1]')";
//mysql_query($insertar);
if($data[8]=='0.00' || $data[8]=='0' || $data[8]==''){
$facturable='NO';
$combustible=0;
}
	  
$thpv=calcular_tiempo_trasnc($data[4],$data[3]);
$thpt=calcular_tiempo_trasnc($data[5],$data[2]);
$tvhm=calcular_horas_formato_inversa1($thpv);
$tvthm=calcular_horas_formato_inversa1($thpt);

$control_v[]=array($data[2],$data[3],$data[4],$data[5],$data[0],$data[1],$distancia,$data[10],$cod_rutadet,$data[6],$data[7],$thpv,$thpt,$tvhm,$tvthm,$data[11],$data[9],$data[8]);
                   //"$har",   $hs,    $hl,      $hap,     $de,     $para, $distancia,$obser,   $cod_rutadet,$com     ,$fac   ,$thpv,$thpt,$tvhm,$tvthm,$programado,$fechasalida,$fechallegada

}
fclose ($fp);

$origenes=$origen;

$rsth=$objPer->getTransTH($matricula);
$rowth=$objPer->NextRow($rsth);
$v=1;
//$fun=1;
$matricula=$matricula;
$vias=$vias;
$via=$vias;
$tipohora=$rowth['tipohora'];
include("../p_rutas_detalle_edit.php");
?>