public function testNormalizeValid() { $this->assertEquals(15, Exporter::normalize($this->db, self::UID, array("t" => "15"))); $this->assertEquals(15, Exporter::normalize($this->db, self::UID, array("tn" => self::TRIPNAME))); $this->assertTrue(Exporter::normalize($this->db, self::UID, array("t" => "a"))); $this->assertTrue(Exporter::normalize($this->db, self::UID, array("tn" => ""))); $this->assertNull(Exporter::normalize($this->db, self::UID, array("t" => "n"))); $this->assertNull(Exporter::normalize($this->db, self::UID, array("tn" => "<None>"))); }
echo "<Result>4</Result>"; die; } $showbearings = 0; if (!isset($_SESSION["ID"])) { echo "<Result>Not Logged in or this is not a private system</Result>"; die; } $action = $_GET["a"]; // $username = urldecode($_GET["u"]); // $password = urldecode($_GET["p"]); $datefrom = urldecode($_GET["df"]); $dateto = urldecode($_GET["dt"]); $showbearings = urldecode($_GET["sb"]); $userid = $_SESSION["ID"]; $tripid = Exporter::normalize($db, $userid, $_GET); if ($action == "kml") { require_once "exporter/kml.php"; $exporter = new KMLExporter($db, $userid, $tripid, $datefrom, $dateto); } else { if ($action = "gpx") { require_once "exporter/gpx.php"; $exporter = new GPXExporter($db, $userid, $tripid, $datefrom, $dateto); } else { echo "<Result>Invalid action selected</Result>"; die; } } $output = $exporter->export($showbearings); // Create file $FileName = str_replace(" ", "_", $exporter->username . "_" . $exporter->tripname . "_" . $datefrom . "_" . $dateto . ".{$action}");