Suggestion on the way to do a 'Contact Your Senator' Page?

terp

Beta Tester Extraordinaire
I'm going to mirror what the main Senate page is doing, more or less.

http://www.senate.gov/general/contact_information/senators_cfm.cfm

They have the "Choose a State" and the "Choose a Senator" filters working independantly, so to mirror what they have done, I could simply setup a table with all the contact info in the db, then have the two filters on the frontend search.

As for the display of the data in the table, I think Rob did a site and I think I remember a wine site in the site showcase forum that lists the records vertically rather than the traditional table w/ columns running horizontally, so I think I can pull that off.

Originally, I thought of using a regular table with the following fields:

Member Name | Party | State | Phone | Email | Website | Send Letter!

In short, what I am going to do is have a standard form letter (not a Fabrik form, but a pre-written rant people can send to their Senator). I though of using an image for the Send Letter! field and having it email the pre-written letter to the email address for that record (the senator they choose).

However, given the spam filters and the like, I am not sure it's a good idea to flood Congress with emails from my SMTP. :) So perhaps I'll use a simply 'mail to' with the message already written and populated in their email when they click on it....?

Hmmm, I know there's a question here somewhere....

Are there any ways to pull data from their cold fusion setup to make populating my db easier? I see they have an xml file, so perhaps I can read up on going from xml to sql? I normally would feel bad 'ganking' their data, but what the hell, I helped pay for it and it's part of the public domain. ;)

If I wanted to get fancy, would I just attempt to use some conditioning to have the senator drop-down populated based on their selection of their Senator? I guess I don't need to get fancy, but my beta testing has been limited to the very basics over and over and over and over...probably time I took off the training wheels. :)

So my goal is to write a rant and enable people to click a button and send that rant to their Senator. I may expand it to the House, too, but unless I figure out a way to pull the data for all 435 of those clowns, I am sure that'll be onthe infamous 'to-do list' for awhile.

And proximity searches still make my head hurt understanding how that works (i.e., enter your zip and find something, say, 50 miles away)...is that done is lat and long? Just given the number of area codes/zip codes/etc, I just don't understand how the calculations are made otherwise....sure I need to find/buy a database with all the relations in there, then figure out the syntax of the querry and link that querry to a field in one of my Fabrik forms?

...just making this up as I go along, so if none of this makes sense, just close it. :)
 
for the coldfusion stuff the xml file might be one way to go - or if you can find an ODBC adaptor for it you could get it into Access and then with a mySQL odbc driver get that into the site's database.

Google maps has a geo location service - Ive not looked in a while but you can send it an address and it will send you back coordinates.

For the query it goes something like this:

If you have a point ($lat, $lon) and you want to get the distances of the table's record locations from that point do:

SELECT (SQRT(POW(lat - " . $lat . ", 2) + POW(lon - " . $lon . ", 2)) / 6) AS distance FROM table.

Rob
 
SELECT (SQRT(POW(lat - " . $lat . ", 2) + POW(lon - " . $lon . ", 2)) / 6) AS distance FROM table.

Rob

Thanks, boss...when I find the time, I'll have to get serious and play with this...great functionaly I see a lot of sites used, but never understood how it's done.

In fact, it makes my head hurt when I think about it...like 3D math to an old dummy like me. ;)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top