Assignment 9: CRUD DVD App

Submission

Create assignment09 directory on itpwebdev.com server within public_html. Upload all assignment files to that new directory, then link the assignment on your Student Page. Do not modify any assignment files after the deadline. The last modified timestamp serves as your submission time.

You can also optionally upload this on Blackboard as a backup if upload fails for partial credit.

*Important:* After the completed files are uploaded to the server and you test them, you might not notice some changes show up immediately. For example, add a new DVD and search for it. If the new DVD does not show up in the search_results.php, check the database first that the new DVD has been inserted in to the database. If the DVD still does not show up in search_results.php, it’s likely that the browser is showing a cached version of your search_results.php and it is not updating to show your new DVD. In this case, try to hard refresh the page by pressing shift in your keyboard and click the refresh icon in the browser. This will force the browser to show the latest version of search_results.php.

Overview

For this assignment, you will complete a CRUD application using your DVD database.

Sample

Note: samples below don’t always meet all the requirements. Make sure to follow the requirements rather than solely relying on the samples.

http://304.itpwebdev.com/~zune/assignment_07/index.php

Requirements

HTML/CSS
  1. You may use the given starter HTML files (styled with Bootstrap) or create your own HTML files for practice.
CRUD Workflow
  1. You can use any workflow, as long as you provide full CRUD functionality
Main Page (index.php)
  1. Page title
  2. Links to Search Form and Add Form
Search Form & Search Results
  1. Same requirements as in Assignment 8.
  2. You may re-use your Assignment 8 files.
  3. Each DVD title should be a link to Detail Page.
  4. Additionally, each DVD Title on Search Results page should have a delete button where users can click to delete the title.
Detail Page
  1. Check for any errors & missing data.
    1. Output appropriate error messages.
  2. Display all information corresponding to the DVD.
    1. Title,
    2. Release Date,
    3. Award,
    4. Label (name, not primary ey),
    5. Sound (name, not primary key),
    6. Genre (name, not primary key),
    7. Rating (name, not primary key),
    8. Format (name, not primary key).
  3. Link for users to go back to search results.
Add Form
  1. Check for any errors and missing data.
    1. Output appropriate error messages.
  2. DVD Title text field (indicate as required field).
  3. Following drop-downs dynamically populated with data from the database.
    1. Genre,
    2. Rating,
    3. Label,
    4. Format,
    5. Sound,
    6. Use primary keys for value attributes,
    7. Display the name (genre, rating, etc) as drop-down option,
    8. Include Select One (empty/no selection) as first option in each drop-down.
  4. Award Text Area.
  5. Release Date Date Input (<input type=’date’…>).
Add Confirmation
  1. All PHP & MySQL errors are handled and displayed.
    1. Including missing user input for required fields.
  2. Add DVD to the database using prepared statements.
    1. Only DVD Title is a required field.
    2. Other fields should have user-selected values or NULL.
  3. Display the following message if DVD is added successfully in green:
    1. [DVD Title] was successfully added.
  4. Note: When searching for newly added records, you might have to do hard-refresh (Control/Command + R) to see them.
Delete & Update Functionality
  1. Users need to be able to update and delete each DVD record.
    1. Show confirmation popup before actually deleting the record.
Delete Page
  1. Check for any errors & missing data.
    1. Output appropriate error messages.
  2. Delete DVD record from the database.
  3. Display the following message if DVD is deleted successfully:
    1. [DVD Title] was successfully deleted.
Edit Form
  1. Check for any errors & missing data.
    1. Output appropriate error messages.
  2. DVD Title text field (indicate as a required field).
  3. Following drop-downs dynamically populated with data from the database.
    1. Genre,
    2. Rating,
    3. Label,
    4. Format,
    5. Sound,
    6. User primary keys for value attributes
    7. Display the name (genre, rating, etc) as drop-down option,
    8. Include Select One as first option in each drop-down.
  4. Award Text Area.
  5. Release Date Date Input (<input type=”date”>…)
  6. DVD Title ID hidden field with value set to current DVD’s primary key.
  7. Only DVD Title is a required field for user input. All other fields are optional.
  8. All form fields need to be pre-populated or have current DVD’s data pre-selected.
    1. For example:
      1. Pre-populate DVD Title text-field with DVD’s current title.
      2. Pre-select drop-downs with DVD’s current drop-down value.
  9. Submit & Reset buttons.
Edit Confirmation Page
  1. Check for any errors & missing data.
    1. Output appropriate error messages.
  2. Update DVD record in the database.
  3. Display the following message if DVD is updated successfully:
    1. [DVD Title] was successfully updated.
  4. Provide a link to the details page for edited DVD record.