<?php include 'dbconnect.php'; generateMarkers(); function generateMarkers() { $dbc = connectToDB(); $query = "SELECT * FROM location"; $result = performQuery($dbc, $query); $results = array(); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $results[] = $row; } header('Content-type: application/json'); echo json_encode(array('results' => $results)); }
echo 'color="' . $path['gps_path_color'] . '" '; echo '>'; // Iterate through the rows, printing XML nodes for each while ($row = @mysqli_fetch_assoc($result)) { echo '<coord '; echo 'lat="' . $row['gps_latitude'] . '" '; echo 'lng="' . $row['gps_longitude'] . '" '; echo '/>'; } echo "</path>"; } // End XML file echo '</paths>'; } $showPathMarkers = false; if (isset($_GET['showPathMarkers']) && $_GET['showPathMarkers'] == "true") { $showPathMarkers = true; } $markerDelay = 0; if ($loginT == null || $loginT->getStatus() == false) { $markerDelay = phpGPS_Settings::$_markerDelay; } header("Content-type: text/xml"); echo "<mapInfo>\n"; if (isset($_GET['marker_id']) && $_GET['marker_id'] != "") { generateMarkers($con, $_GET['marker_id'], $markerDelay); } else { generateMarkers($con, '', $showPathMarkers, $markerDelay); generatePaths($con, $markerDelay); } echo "</mapInfo>\n";