Beispiel #1
0
    if (errorFlag == true) {
      alert("Geolocation service failed. Go to Newyork since It's google problem so have fun there.");
      initialLocation = newyork;
    } else {
      alert("Your browser doesn't support geolocation. I've placed you in Siberia. hahahahah");
      initialLocation = siberia;
    }
    map.setCenter(initialLocation);
  }
var marker1 = new google.maps.Marker({
 position: initialLocation,
 animation: google.maps.Animation.DROP
 });
 <?php 
if ($userPermission == "power" || $userPermission == "user") {
    $query = $db->selectFrom("*", "pmarkers");
    while ($row = mysql_fetch_array($query)) {
        $id = $row['id'];
        $na = $row['name'];
        $lat = $row['lat'];
        $lon = $row['lng'];
        $desc = $row['disease'];
        echo "addMarker({$lat}, {$lon},'{$na}', '{$desc}',{$id}, 'p');\n";
    }
    $query = $db->selectFrom("*", "dmarkers");
    while ($row = mysql_fetch_array($query)) {
        $id = $row['id'];
        $na = $row['name'];
        $lat = $row['lat'];
        $lon = $row['lng'];
        $desc = $row['specialization'];
$cnic = $_GET['cnic'];
$location = $_GET['location'];
$disease = $_GET['disease'];
$contact = $_GET['contact'];
$dbname = 'mapdatabase';
//Name of the database
$dbuser = '******';
//Username for the db
$dbpass = '';
//Password for the db
$dbserver = 'localhost';
//Name of the mysql server
$db = new dataBase("{$dbuser}", "{$dbpass}", "{$dbserver}");
$dbcnx = $db->connectDb();
$db->selectDb($dbname);
$query = $db->selectFrom("*", "login", "key = " . $key);
if ($query > 0) {
    $google_maps_key = 'ABQIAAAAe8rhZlbrTrtYn3S4B8DbrBSiiq6SSn-FolLKfZOodfiXZD81ZRTNuab0TvJ-86gOsCgtlSG1BHnwtQ';
    $adr = urlencode($location);
    $url = "http://maps.google.com/maps/geo?q=" . $adr . "&output=xml&key={$google_maps_key}";
    $xml = simplexml_load_file($url);
    $status = $xml->Response->Status->code;
    if ($status = '200') {
        //address geocoded correct, show results
        //echo ("The address can be geocoded, we found the following results:<br/>");
        foreach ($xml->Response->Placemark as $node) {
            // loop through the responses
            $address = $node->address;
            $quality = $node->AddressDetails['Accuracy'];
            $coordinates = $node->Point->coordinates;
            $latlng = explode(",", $coordinates);
Beispiel #3
0
<head>
<?php 
$userName = $_POST['userName'];
$password = $_POST['userPassword'];
$dbname = 'mapdatabase';
//Name of the database
$dbuser = '******';
//Username for the db
$dbpass = '';
//Password for the db
$dbserver = 'localhost';
//Name of the mysql server
$db = new dataBase("{$dbuser}", "{$dbpass}", "{$dbserver}");
$dbcnx = $db->connectDb();
$db->selectDb($dbname);
$query = $db->selectFrom("*", "login", "userName = "******" AND userPassword = "******"SELECT * FROM markers");
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome</title>
</head>
<body>
<?php 
if ($userName != "guest") {
    if ($query > 0) {
        $data = mysql_fetch_array($query);
        //echo $data['userId'];
        //$userid = $query['userId'];
        $_SESSION['userId'] = $data['userId'];
        $_SESSION['userPermissions'] = $data['permissions'];
        $_SESSION['user'] = $userName;