I've held off posting this as long as possible but I'm in need of some
help!

http://apricot13.org/tcp/maps/v2/

I have a database - locations with the following fields:
id, name, lat, long, desc, date, time

I would like to filter what appears on the map using a dropdown or
checkboxes or even using a slider. So form element for date and
another for time.

My read.php file looks like so:

<?php
$host = 'localhost';
$user = 'xxx';
$pass = 'xxxt';
$dbname = 'xxx';

if (!$db = mysql_connect($host, $user, $pass)) {
        echo 'Could not connect to mysql';
        exit;
}
if (!mysql_select_db($dbname, $db)) {
        echo 'Could not select database';
        exit;
}
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
//XML Header
header("content-type:text/xml");


$query = "SELECT location_id, name, lat, lng, description, date, time
FROM locations WHERE date<=curdate()";
$query = mysql_query($query);
echo "<events>";
while ($row=mysql_fetch_assoc($query)){
        echo '<event id="'.$row['location_id'].'" name="'.$row['name'].'"
lat="'.$row['lat'].'" lng="'.$row['lng'].'" description="'.$row
['description'].'" date="'.$row['date'].'" time="'.$row['time'].'" /
>';
}
echo "</events>";



?>


At the moment it gets all events from today and before and shows them
on the map.

My first thought was to have functions enclosing different instances
of:

$query = "SELECT location_id, name, lat, lng, description, date, time
FROM locations WHERE date<=curdate()";
$query = mysql_query($query);
echo "<events>";
while ($row=mysql_fetch_assoc($query)){
        echo '<event id="'.$row['location_id'].'" name="'.$row['name'].'"
lat="'.$row['lat'].'" lng="'.$row['lng'].'" description="'.$row
['description'].'" date="'.$row['date'].'" time="'.$row['time'].'" /
>';
}
echo "</events>";

one for date and one for time? I'm unsure how to call a php function
from javascript though!

I've spent a week googling but I'm stuck!

If anyone can give me a hand i'd be really grateful :)

Thank you!



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to