Location: PHPKode > scripts > Php AddressBook 2 > php-addressbook-2/googlemaps.php
<?
$sql  = " SELECT * FROM addressbook WHERE id = $id ";
		
        # execute SQL statement
        $result = mysql_query($sql,$cid);

        # retrieve values
        $row = mysql_fetch_array($result);
		include("rows.php"); 			
?>

<div id="map" style="width: 640px; height: 480px"></div>
<script type="text/javascript">
    //<![CDATA[

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(<? echo"$lat"; ?>, <? echo"$lng"; ?>), 13);

        // Our info window content
        var infoTabs = [
          new GInfoWindowTab("Address", "<? echo"$firstname $lastname"; ?><br><? if (!$address == '') echo "$address";?><br><? if (!$suite == '') echo "Suite: $suite<br>";?><? if (!$city == '') echo "$city  $province $postalcode<br/>$country" ?>") 
        ];

        // Place a marker in the center of the map and open the info window
        // automatically
        var marker = new GMarker(map.getCenter());
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowTabsHtml(infoTabs);
        });
        map.addOverlay(marker);
        marker.openInfoWindowTabsHtml(infoTabs);
      }
    }

    //]]>
</script>
Return current item: Php AddressBook 2