I require a PHP5 class that produces a collapsable list of fixed data with various options.? ? The list needs to be persistable via the mysql database.?
Code has to be clean, compact, properly indented, commented.? It should avoid deprecated functions, should produce no errors even at highest reporting level.? Also it should not rely on libraries such as jquery etc if possible.?
## Deliverables
I require a PHP5? class that outputs a collapsable list with various options.?
This is part of a much larger project, and if the succesful bidder does a good job and the client is happy, then we will probably be able to offer you regular projects.?
Here are the requirements:
The class should accept a database results set,? "reference"? and? "always_show_selected" flag.?
The database results set will contain the following fields:
is_recommended: 0 or 1
is_recommended_text: varchar
product_cat: varchar
product_desc: varchar
product_id: integer
price: decimal
selected: 0 = no, 1 = us, 2 = third party
The data will be sorted by is_recommended (desc), product_cat, product_desc
The data should be displayed as a collapsable list.? product_cat will be listed as the headers, and when expanded it will show a list of product_desc and price for that product_cat.?
There will be radio buttons for "selected"? (0, 1 or 2).? The price should be greyed out unless 1 (us) is selected.?
If the "always_show_selected" flag passed to the class = 1 then when a category is collapsed it should show a list of items where "selected" = 1 or 2.? If it is set to 0 then it shouldn't show anything other than the header.?
A table should be created that persists the selected values, kept unique using the "reference" value passed to the class.? When returning to the page it should automatically display it's last state.?
When a category contains one or more selected item (i.e. "selected" is not equal to 0) it should show in a darker colour than when nothing in that category is selected.? Colours should be set in CSS stylesheet.?
For items where is_recommended = 1, these should also be shown in a box at the top of the page (one box per item), along with is_recommended_text and a button that when clicked will tick "us" for the "selected" item on that row.?
A running total should be displayed of the value of all the "selected" = "us" values.