-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetLocations.php
More file actions
39 lines (25 loc) · 859 Bytes
/
getLocations.php
File metadata and controls
39 lines (25 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
$Org=$_GET['org'];
include("../php/db_login.php");
$con=mysql_connect($db_host,$db_username,$db_password);
$db=mysql_select_db($db_database,$con);
$query="SELECT name, bg_lat as latitude, bg_long as longitude,address,city,zip FROM fp_locations WHERE BankID='".$Org."'";
$json='{
"marker":[';
$result=mysql_query($query);
while($row=mysql_fetch_assoc($result)){
$json .= $joiner.'{"location":"'.$row["name"].'"';
$json .= ',"address":"'.$row["address"].'"';
$json .= ',"city":"'.$row["city"].'"';
$json .= ',"zip":"'.$row["zip"].'"';
$json .= ',"latitude":"'.$row["latitude"].'"';
$json .= ',"longitude":"'.$row["longitude"].'"}';
$joiner=",";
}
$json .= ']}';
echo $json;
//print_r($row);
//echo "var markers= ",json_encode($markers),"\n";
//$hello=array_map(utf8_encode, $row);
//echo "marker:".json_encode($hello)."\n";
?>