Exercise #9
Note: You will need the database from Exercise #8 setup, you should use the given solution if you have not set it up yourself.
Create three PHP pages:
store.php: a storefront that should:
-
Display a sorted list of components on the left, clicking on one should take you to the component.php page for that particular component id.
-
A daily deals listing on the right which is composed of 10 random items that have 1000 or more items in stock. Clicking on an item should take you to that items item page.
component.php: A component listing page that should:
-
Clicking on the store heading should take you back to the store.php page.
-
Switch to a vendors list (up to 10 items per page) for that component type on the left side. Clicking on a vendor should show only those items from that vendor.
-
Show a list of items of that component type in the item list on the right. This should be paginated (not shown in the reference images.)
component.phpshould take up to three GET variables:cid=?The component ID number vid=?The vendor ID number page=?The page number currently being displayed.
item.php: The item display
-
should take one get variable, iid=? The item inventory ID for the item to display. If there is no item by that id, it should redirect back to the store front.
-
The store name is a link back to store.php
-
There should be a "path" displayed under the store name:
Home >component-name> Item #iid
The "Home" portion should link back tostore.phpThe component-name portion should link back to the component.php page for that component type. -
The item display should indicate if the item is in stock or not.
Additional notes:
-
You should use the object oriented PHP mysqli interface and use prepared statements where applicable.
-
A style.css CSS file is provided that might be of some help, you may optionally style your store as you see fit. To use an external stylesheet, in your head section use the element:
<link rel='stylesheet' type='text/css' href='style.css'> -
Stock images (images.tar.gz) have been provided which you may consider using where the picture should go (the boxes with a single letter/number in them.) Images should be all jpg files that are named the same as the component name to which they belong.