Start by copying the SmartPhoneProducts5 into a new JAVASCRIPT project. Check that the table displays properly.
Make this a one-file, self-processing page by eliminating process_order.php. You will need to add logic to switch between selecting product quantities and displaying the order.
Create a function with interface void display_products(array $products_to_display [, bool $has_posted_quantities]). This function will take the multi-dimensional array of products $products_to_display and print the HTML table with quantity selection textboxes by default. If an optional $has_posted_quantities is TRUE, just the quantities in the post from the textboxes will be shown in place of the selection textboxes.
Use display_products() to display the selection table and order tables.
Don’t forget to not print the submit button if the selections are being displayed i.e. $has_posted_quantities is TRUE.
You can view the screencast solution here
Rx: <18 min Av: 18-28 min Sd: 28-38 min DNF: 38+ min