High level requirement description:
I want to have a set of scripts which do the following:
1- put user entries in my site's database. The data entered are an entry name, description, address fields, a URL, a flag (false/true), a category, and a picture. The addresses should be converted by the script into coordinates
2- allow users to search geographically the entries (i.e. around a location +/- x kilometers)
3- display the entries on a map. Markers should display entry name, description and picture, URL. The entries with flag = true should be displayed by default on top zoom level, the other entries should be displayed 2 levels below.
Technologies to be used:
The code must be compatible with PHP4 and MySQL4.
Do not use PHP header functions, do not store pictures in the database.
I will have to maintain this code, so write a lot of comments and keep it as simple as possible, avoid using complex nested functions, limit the number of includes to one level.
Detailed requirements / how I imagine the thing could work:
1a- entry form, where the user enters the data
entry name - text 50
description - text 300
address fields [Address line 1(50), Address line 2 (50), City (30), ZIP (6), Province/State (3), Country (3)] => provinces and countries contain a code only, and should have 2 DB tables linked to them.
a URL (60)
a flag (true/false)
a category (1 to 10 if you want)
a picture (upload function to a directory) - max. 100kb in size - a thumbnail of max dimension 100px should be made on the fly - filename should be stored in DB
1b- the script converts the address into coordinates and displays the location on a map for the user, as well as the info prevously entered.
the user is asked if the location is correct.
No => go back to entry form and correct address
Yes => proceed - the script saves coordinates into DB - thank you
2- User search
Users can search either:
- without a radius, classical search: inside an area: country, province, city, address, entry name, by category, etc.
- from a location + radius: city, address, by category, etc.
3- Display of results
Results are displayed in a google map, the initial zoom level being set automatically to show all the markers where the flag is = true.
The other markers are displayed when the user zooms in by 2 levels.
All standard controls are present on the map.
The markers should have different colors according to category.
When the mouse goes over a marker, it expands and displays entry name, description and picture, URL (if the mouse over is not feasible, then on click).