-
Notifications
You must be signed in to change notification settings - Fork 0
/
all_details.php
50 lines (48 loc) · 1.46 KB
/
all_details.php
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
39
40
41
42
43
44
45
46
47
48
49
50
<?php
include "distinct_area_name.php";
/********************************
*
* Coordinates of Area and Restaurants
*/
$all_lat = array();
$all_lng = array();
$all_rest_lat = array();
$all_rest_lng = array();
$all_rest_name = array();
/**********************
*
* Coordinates of the Area;
*/
for($i = 0;$i<count($distinct_area_name);$i++){
$temp1_array = array();
$temp2_array = array();
$query = "select * from coordinates where name='".$distinct_area_name[$i]."' order by id";
$result = mysql_query($query);
while($row=@mysql_fetch_assoc($result)){
array_push($temp1_array, $row['lat']);
array_push($temp2_array, $row['lng']);
}
array_push($all_lat,$temp1_array);
array_push($all_lng, $temp2_array);
}
/*************************
*
* Coordinates of Restaurants;
*/
for($i=0;$i< count($distinct_area_name);$i++){
$temp1_array = array();
$temp2_array = array();
$temp3_array = array();
$query = "Select * from restaurant where name = '".$distinct_area_name[$i]."'";
$result = mysql_query($query);
while($row=@mysql_fetch_assoc($result)){
array_push($temp1_array, $row['lat']);
array_push($temp2_array, $row['lng']);
array_push($temp3_array,$row['rest_name']);
}
//echo count($temp1_array)."<br>".count($temp2_array)."<br>";
array_push($all_rest_lat,$temp1_array);
array_push($all_rest_lng,$temp2_array);
array_push($all_rest_name,$temp3_array);
}
?>