CSC 436 - Assignment #3
Web Database Project
Due Dec. 7


Overview:  This assignment involves using PostgreSQL and PHP Scripts to do develop a simple web-based database.

Problem Statement:
The Humungo Studios Video database has been created and populated (in your last assignment). Now, you are asked to make an interface that customers can use to access the database from the web to do the following:

  1. Search the database by Title or Name.
  2. Register as a customer.
  3. Add items into a shopping cart for later purchase.

Main Page:
The opening page of this web site should provide the following functionality:

  1. Link to register as a new shopper.
  2. Text box to enter existing customer number.
  3. Text box to search the Humungo Video Stores database.
The following screen shot shows the MINIMAL functionality required. It is not pretty, but it does what is required.



Customer Registration Page:
When the customer clicks on the link to register, the Customer Registration Page should ask for First Name, Last Name, Address and Credit Card to be submitted. The following screen shot shows the minimal required information for this page:


Submitting this information should enter the data into the database, adding an entry into the Shopper table in the database. Upon submitting the data, a new page should appear with the newly entered customer information displayed.

These pages should each have a link back to the main page.

Existing Customer Page:
When the customer enters an existing Customer Number on the main page and submits, a new page should open that displays the shopping cart for this customer. (See screen shot below)



In case the customer number that was entered does not exist, the new page should display a message indicating that no such number exists.

These pages should each have a link back to the main page.

Search Results Page:
When the customer enters a name or title in the search box on the main page and submits the query, a new page should be displayed with the results of the search. (See screen shot below)



For each matching Actor, Film, Director, or Studio, the page should provide a link to display more. For example, the screen shot above shows the results of searching for the string "HE". Clicking on the actor CHARLIE SHEEN should produce a page (Actor Information Page) listing all of the films that Charlie Sheen has appeared in. (See screen shot below)

Similarly, clicking on the link for the film THE PRINCESS BRIDE should produce a page (Film Information Page) that lists information about the film.

Each of the pages above should have a link to return to the main page.

Actor Infomormation Page:
Any time a link to an actor's name is chosen, the Actor Information Page should appear. This page should list the "Filmography" for the chosen actor, listing the titles of all of the films that the actor has appeared in. Each of the films should provide a link to the Film Information Page for that film.



Film Information Page:
When a customer clicks on the title of a film, the Film Information Page associated with that film should appear. This page should include the following information:

  1. The title of the film.
  2. An option to add the associated video or DVD to the customer's shopping cart (Video or DVD Purchase Page).
  3. The cast of the film - actor's names (with links to their associated Actor Information pages).
  4. The director of the film (no links required here).
  5. The studio responsible for producing the film (no links required).




Video or DVD Purchase Page:
When a customer clicks on a link to purchase a video or a DVD from a Film Information Page, a new page should appear. This page should request the Customer number (it is not required that your application remember if a customer number was previously entered). The page should also display the title and price of the film that is being added. Once the customer number is submitted, a new page with the new shopping cart should be displayed.

Extra Credit:
For extra credit, create a page that allows a user to enter the names of two actors, and write php code to access the database to determine the "degree of separation" between the two actors. The degree of separation between a pair of actors is the number of links from actor to film to actor that you have to traverse to get from the first actor to the second. For instance, Demi Moore was in A Few Good Men with Kevin Bacon, so the degree of separation between Demi Moore and Kevin Bacon is 1. However, the degree of separation between Robin Wright and Demi Moore is 3 because Robin Wright was in Forrest Gump with Tom Hanks, who was in Apollo 13 with Kevin Bacon, who was in A Few Good Men with Demo Moore.

The page should have two text boxes and a submit button that calculates the degree of separation.

You are to turn in a report that includes the following:

  1. A cover page that has your name, and the URL for the main page of your web site.
  2. Well-commented code for each php file that you have created. Be sure that your name appears at the beginning of every file.
  3. Any other comments you would like to make regarding the project, including discussion of parts that you were not able to complete, and why, as well as additional functionality that you provided.
Please submit this report to the course web site by Dec. 7. It is highly preferred that you submit this as one printable PDF file. However, you may also submit a single .zip file.

Instructions for Setting up the your Web Site:

We have assembled a set of insructions for setting up the your web site on the department web server. Find these instructions here. You are not required to use the department web server. As long as your web server is enable to handle php scripts, you may store it on any machine that you have available.
 

PostgreSQL/PHP On-Line Documentation

HTML Tutorial