= 2) { $ofinterest=0; for ($iuyt=0; $iuyt 180.0) { $under180[0]=false; $under90[0]=false; } if (abs(floatval(str_replace("'","",str_replace('"','',$twoormore[$iuyt])))) > 90.0) { $under90[0]=false; } $ofinterest=1; } else if (is_numeric(str_replace("'","",str_replace('"','',$twoormore[$iuyt]))) && $ofinterest == 1) { $numbersfound=true; if (abs(floatval(str_replace("'","",str_replace('"','',$twoormore[$iuyt])))) > 180.0) { $under180[1]=false; $under90[1]=false; } if (abs(floatval(str_replace("'","",str_replace('"','',$twoormore[$iuyt])))) > 90.0) { $under90[1]=false; } $ofinterest=2; } else if (!is_numeric(str_replace("'","",str_replace('"','',$twoormore[$iuyt]))) && !$numbersfound && !$foundwordlatitude && !$foundwordlongitude) { if (strpos(strtolower(str_replace("'","",str_replace('"','',$twoormore[$iuyt]))), "latitude") !== false) { $foundwordlatitude=true; } else if (strpos(strtolower(str_replace("'","",str_replace('"','',$twoormore[$iuyt]))), "longitude") !== false) { $foundwordlongitude=true; } else if (strpos("~" . strtolower(str_replace("'","",str_replace('"','',$twoormore[$iuyt]))), "~lat") !== false) { $foundwordlatitude=true; } else if (strpos("~" . strtolower(str_replace("'","",str_replace('"','',$twoormore[$iuyt]))), "~long") !== false) { $foundwordlongitude=true; } } } } } $out.=$csv[$i]; } } if ($indelimis == "") { //file_put_contents("xxx.xxx", "under90[0]=" . $under90[0] . " under90[1]=" . $under90[1] . " under180[0]=" . $under180[0] . " under180[1]=" . $under180[1] . "\n"); if (!$under180[0] || !$under180[1]) { $reverseorder=$reverseorder; } else if ($under90[0] && $under90[1]) { if (!$foundwordlongitude) { $reverseorder=true; //$reverseorder; $reversesuffix="
";
        } else {
        $reversesuffix="



"; } } else if ($under90[0] && $under180[1]) { //if (!$foundwordlongitude) { $reverseorder=true; //$reverseorder; $reversesuffix="
";
        //}
      } else if ($under180[0] && $under90[1]) {
        $reverseorder=false;   //$reverseorder;
        $reversesuffix="



"; } //file_put_contents("zerocsv.xxx", $csv); //file_put_contents("one_csv.xxx", $rep); //file_put_contents("onecsv.xxx", $out); $out=str_replace("'","",str_replace('"','',clean_csv_commas($out, "'"))); //file_put_contents("twocsv.xxx", $out); } return $out; } if (isset($_GET['csvfile'])) { $fname=str_replace("+"," ",urldecode($_GET['csvfile'])); $csvcont=''; if (strpos(strtolower($fname),"http") !== false) { $csvcont=file_get_contents($fname); } else if (file_exists($fname)) { $csvcont=file_get_contents($fname); } //file_put_contents("threecsv.xxx", '" . str_replace("\r","
",str_replace("\n","
",str_replace("\r\n","
",str_replace("'","",clean_csv_commas($csvcont,""))))) . "'" . ';">'); if ($reverseorder) { echo '" . str_replace("\r","
",str_replace("\n","
",str_replace("\r\n","
",str_replace("'","",clean_csv_commas($csvcont,""))))) . "" . $reversesuffix . "'" . ';">'; } else { echo '" . str_replace("\r","
",str_replace("\n","
",str_replace("\r\n","
",str_replace("'","",clean_csv_commas($csvcont,""))))) . "" . $reversesuffix . "'" . ';">'; } exit; } $prehtml = ""; $midhtml = ""; $posthtml = ""; function retval($inv) { if (strpos($inv, "E-") !== false) return "0"; return $inv; } ?> Survey Traverse Calculation - RJM Programming - Copyright © 2013 rjmprogramming.com.au all rights reserved.

' . "\n"; $htm .= ''; $posthtm .= '
' . "\n"; $posthtm .= ''; if (isset($_GET['coords'])) { echo '
' . "\n"; } else { echo ' ' . "\n"; echo ' ' . "\n"; } //} ?>