Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
MAP
- Loading branch information
Arif Prabawa
authored and
Arif Prabawa
committed
Apr 22, 2017
1 parent
6c874ea
commit 881258b
Showing
3 changed files
with
107 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
require("cred.php"); | ||
|
||
// Start XML file, create parent node | ||
|
||
$dom = new DOMDocument("1.0"); | ||
$node = $dom->createElement("markers"); | ||
$parnode = $dom->appendChild($node); | ||
|
||
// Opens a connection to a MySQL server | ||
|
||
$connection=mysql_connect ('localhost', $username, $password); | ||
if (!$connection) { die('Not connected : ' . mysql_error());} | ||
|
||
// Set the active MySQL database | ||
|
||
$db_selected = mysql_select_db($database, $connection); | ||
if (!$db_selected) { | ||
die ('Can\'t use db : ' . mysql_error()); | ||
} | ||
|
||
// Select all the rows in the markers table | ||
|
||
$query = "SELECT * FROM well_completion_report WHERE 1 LIMIT 10"; | ||
$result = mysql_query($query); | ||
if (!$result) { | ||
die('Invalid query: ' . mysql_error()); | ||
} | ||
|
||
header("Content-type: text/xml"); | ||
|
||
// Iterate through the rows, adding XML nodes for each | ||
|
||
while ($row = @mysql_fetch_assoc($result)){ | ||
// Add to XML document node | ||
$node = $dom->createElement("marker"); | ||
$newnode = $parnode->appendChild($node); | ||
$newnode->setAttribute("id",$row['Permit_Number']); | ||
$newnode->setAttribute("streetNumber", $row['Well_Street_Number']); | ||
$newnode->setAttribute("streetName", $row['Well_Street_Name']); | ||
$newnode->setAttribute("Town", $row['Well_Town']); | ||
$newnode->setAttribute("lat", $row['Well_Latitude']); | ||
$newnode->setAttribute("lng", $row['Well_Longitude']); | ||
} | ||
|
||
echo $dom->saveXML(); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters