Assignment 9: CRUD DVD App

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

Caching

Browsers like to cache previous versions of your web files. After you upload the completed files to the server and test them, you might notice that your changes are not showing. For example, add a new DVD and search for it. If the new DVD does not show up in the search_results.php, your browser may be caching a previous version of this file.

If this happens, open MySQL Workbench and double-check that your database is accurate. Then, try to hard refresh the page by pressing Shift on your keyboard while clicking the refresh icon in the browser. This will force the browser to show the late version of the file.

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 (completed in Lab 10).
  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. Same requirements as in Lab 10.
  2. You may re-use your Lab 10 files.
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 a drop-down option,
    8. Include Select One (empty/no selection) as the 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 the DVD record in the database using prepared statements.
  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.
Submission/Upload to the server

Please follow the submission requirements below carefully. You will be deducted points for not following submission requirements to the teeth.

  1. Open a browser and go to https://303.itpwebdev.com/cpanel (it will redirect you to https://54-148-150-30.cprapid.com:2083/).
  2. Login with your username and password (this password does not sync with your USC NETID password. You set this password in Lab 1. If you don’t remember your password, post on EdStem and a course staff member will reset it for you).
  3. Scroll down to Files section and click on File Manager. You will see a list of folders and files like below.
  4. Double click to navigate inside the public_html folder.
  5. Create a new folder inside the public_html folder by clicking on the +Folder button on the top left.
  6. Name the folder assignment09. Double click it to navigate inside this folder.
  7. Click on “Upload” to upload all assignment files to this folder.
  8. Drag and drop all assignment files to upload into this folder.
  9. In your browser, go to http://303.itpwebdev.com/~yourusername/assignment09/index.php to check that the assignment file has been uploaded correctly.
  10. One last thing. In your computer, open up student_page.html that you created in Lab 2. Add a link to this assignment to student_page.html under the heading “Assignments” so that the graders can easily access your completed assignment.
  11. Re-upload the updated student_page.html to the itpwebdev server via cPanel -> Files -> File Manager. If it asks you want to overwrite the previous file, click Yes.
  12. If all the above is completed, go to your student page at http://303.itpwebdev.com/~yourusername/student_page.html and check that the link to this assignment is there. The TAs/graders use this link to access your assignment so make sure this is working! Below is a screenshot sample of what it should look like.
  13. (Optional) If you are having trouble uploading to the server and cannot upload on time, add all files for this assignment in a folder, compress it as a .zip file and upload it to Blackboard. On Blackboard, go to Assignments -> Assignment 9: CRUD DVD App. You will get some points deducted for not uploading correctly but at least you will not get a zero.