Purpose: To write a server-side application using PHP.
Related Course Outcomes:
CLO1 -- Write HTML documents containing standard HTML elements including forms, tables, client-side scripts, and server-side scripts.
CLO3 -- Write server-side scripts that process HTML forms.
Specification:
For this homework I want you to design a website that can manage menu items for the Original Pizza Place company. Your website will
have three main pages illustrated below:
Are you sure you want to delete the bookmark: Saucy Pie ?
Confirm Delete Bookmark
Here are requirements for your project:
Your Hw2.zip folder should have a readme.txt file with all the names and ids for your group.
All pages produced by your app should be valid XHTML 5.
Your app should work regardless of what folder under DOCUMENT_ROOT the
grader chooses to grade it. If you have variables/constants
that need to be set to ensure this, they should be in a file config.php
which is require_once'd by your index.php file.
All urls used by your app (for links, form data, etc) should be of one of the following forms:
(1) index.php
(2) index.php?a=some_activity&arg1=some_argument1
(3) index.php?a=some_activity&arg1=some_argument1&arg2=some_argument2
Here allowed activities are: landing, edit, detail, confirm. An example possible
use of the arg1 variable might be to hold a pizza name.
Your index.php should have four functions:
menuView, editPizzaView, detailView, confirmView.
These are supposed to draw the Pizza Menu on the Landing Page,
the CreateEdit Pizza Page, the Pizza Detail/Update popularity page,
and the Confirm Page respectively, according to the mock-ups shown above.
The only HTML that is output by your code, must be output in one of these
four methods.
The h1 tag with Original Pizza Place in it on all pages should link
back to the landing page.
On the landing page, the pizza name links go to the detail page for the given pizza.
On the landing page, the pencil icon in a given pizza row takes on to the edit page for that pizza,
the Add Pie button takes one to the Create Pizza page.
On the landing page, the number of hearts next to a pizza should be log5 round down the number of times
the details page for that pizza has been viewed, up to a maximum of 5 hearts (after which no further hearts can be acquired).
On the landing page, if the user clicks the waste bin in a pizza row, it takes the user to the confirm delete page for that pizza.
The difference between the Create/Edit Pizza pages is that in the latter the page is initially populated with the existing pages current settings;
whereas, all the values are initially empty on the create pizza page.
It should not be possible to create a pizza without a name or price. Information about a pizza should be stored in a file
"Pizza".md5($pizza_name).".txt" as a serialized array.
Editing a pizza should update this file, creating a pizza should create it. The Create/Edit pizza page should like the
above, and the checkbox info should be correctly recorded in the pizza text file.
The detail page should look like the above (say the price of the particular pizza, list what toppings it has, attempt
to draw what the pizza looks like given the toppings using pure CSS).
Viewing a detail page should add one to the
count of the number of times the page has been viewed in the pizza text file. This count on the landing page should be used to
draw heatrs.
Clicking Confirm on a Delete Page should delete the corresponding pizza and return the user to the Landing Page.
Clicking Cancel on a Delete Page should return the user to the Landing Page without deleting the file.
Point Breakdown
Items (c)-(e), and (m) are each worth up 1pt
4pts
Items (a), (b), (f)-(p) (excluding (m)) are each worth a 1/2pt