Chris Pollett> Old Classses >
CS174

( Print View )

Student Corner:
[Submit Sec2]
[Grades Sec2]

[Lecture Notes]
[Discussion Board]

Course Info:
[Texts & Links]
[Description]
[Course Outcomes]
[Outcomes Matrix]
[Course Schedule]
[Grading]
[Requirements/HW/Quizzes]
[Class Protocols]
[Exam Info]
[Regrades]
[University Policies]
[Announcements]

HW Assignments:
[Hw1] [Hw2] [Hw3]
[Hw4] [Hw5] [Quizzes]

Practice Exams:
[Midterm] [Final]

HW#2 --- last modified October 05 2022 19:10:11.

Solution set.

Due date: Oct 7

Files to be submitted:
  Hw2.zip

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:

Original Pizza Place

Menu

PizzaPricePopularityActions
Saucy Pie$12💗💗💗
Fromage Delight$13💗💗
Peppy Pizzazz$15💗💗💗💗
Landing Page

Original Pizza Place

Pie Editor

Toppings:
Create/Edit Page

Original Pizza Place

Saucy Pie

Price: $12
  • Red Sauce
Detail Page

Original Pizza Place

Are you sure you want to delete the bookmark: Saucy Pie ?

Confirm Delete Bookmark
Here are requirements for your project:
  1. Your Hw2.zip folder should have a readme.txt file with all the names and ids for your group.
  2. All pages produced by your app should be valid XHTML 5.
  3. 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.
  4. 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.
  5. 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.
  6. The h1 tag with Original Pizza Place in it on all pages should link back to the landing page.
  7. On the landing page, the pizza name links go to the detail page for the given pizza.
  8. 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.
  9. 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).
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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).
  15. 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.
  16. 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 6pts
Total 10pts