All in one

So I got a bit of free time today and had a shot of creating a page where you can search all the films based on their rating i.e. grouping all 1 star films together all 3 and a half star films together etc etc

The first thing that I realised quickly was that whilst this is easy enough done on the surface but to build this page to deal with many many many films that will get added to the DB I would need to also implement a way of dividing them up when they are split up into their ratings. So I fell back again on the splitting films up by a-z as I have been doing. Easy enough I hear you say seeing as I have already pushed that functionality out to a fair few pages. Well actually yes, but no seeing as the user needs to be able to change the rating level they are looking at as well. So for example on the page you will have the options to change what rating your looking at as well as what letter your drilled down to. All not terribly complicated just fiddly to get working and running smoothly via urls.

I go the urls working first and then used that to pull the variables in and set them for the stored procedures. that way I knew the back bone of what i was building was working. At this point in time there was no page option to select letters or ratings. I then implemented the letter choices and the break down of results in the table. Once this was working properly passing the users choices into the stored procedure and into the urls so it all could be tracked I then moved onto creating a function that would create the options of selecting what rating you wanted to see.

This was fiddly as it wasn't for working properly and took a little bit of tweaking to get it just right the way it needed to be. Once I did this i implemented a bit of code so it could highlight which option was selected. This is when things turned a little difficult as now both the star select and letter select had to know what was selected on the other so they could build up the link and maintain correct selections without resetting. i.e. if you were on 4 star reviews starting with A and you then select D it needs to know to stay on 4 star reviews or your on 2 star reviews showing results starting with F then select 3 star reviews it needs to stay on F as well. That way it retains its previous status and just updates the one of the two options the user has amended.

I worked out a simple way (probably not the best way) to get this to work and after the first implementation of it it worked thankfully. So now I have a multidimensional dynamic choice going on on one page that returns the results to the user to make it all easier to search the films.

Currently this shows all films, although I am thinking of breaking it down into B-Movies and non B-Movies as well to give further options for searching.

>>back<<