My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 102 attachment: Map.php (2.0 KB)

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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?
include("dbfns.php");
include("include/session.php");
require('GoogleMaps/GoogleMapAPI.class.php');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<link href="CSS/style.css" rel="stylesheet" type="text/css" />
<style>
body{
background:none;
}
</style>
<?php
$map = new GoogleMapAPI('map');
// setup database for geocode caching
//$map->setDSN('mysql://USER:PASS@localhost/GEOCODES');
// enter YOUR Google Map Key
//$map->setAPIKey('ABQIAAAAx_xt4pj_36dzfNUAEsuWPhSzQnSKLvEUG8XNJUhBMFAhC2McvRTlPoD-DyObAq8hZHtYvZpX2GyyLA');

// create some map markers
if(isset($_GET['client_id'])){
$result=$myfunctions->GetClientAddress($_GET['client_id']);
while ($row=mysql_fetch_array($result)){
$address="$row[address] $row[city], $row[state] $row[zip_code]";
$client_name=$row['client_name'];
$details=$client_name."<br>".$address;
$map->addMarkerByAddress($address,$client_name,$details);
}
}

if(isset($_GET['food_cat_id'])){
$array=$myfunctions->GetFoodCatAddresses($_GET['food_cat_id']);
$food_cat_name=$myfunctions->GetFoodCatName($_GET['food_cat_id']);
echo "<div class=\"MapTitle\">$food_cat_name</div>";
while ($row=mysql_fetch_array($array)){
$address="$row[address] $row[city], $row[state] $row[zip_code]";
$client_name=$row['client_name'];
$details=$client_name."<br>".$address;
$map->addMarkerByAddress($address,$client_name,$details);
}
}


$map->printHeaderJS();
$map->printMapJS();
?>
<!-- necessary for google maps polyline drawing in IE -->
<style type="text/css">
v\:* {
behavior:url(#default#VML);
}
</style>
</head>
<body onload="onLoad()">


<table border=0 width="700" height="580">
<tr><td>
<?php $map->printMap(); ?>
</td><td>
<?php $map->printSidebar(); ?>
</td></tr>
</table>
</body>
</html>
Powered by Google Project Hosting