Assignment #6
Due Thursday, May 8
100 points
In this assignment you will have a chance to put everything together and
create some actual three-tier Web applications.
This assignment will require you to manage all three tiers — client,
middle and data — using PHP and MySQL. You will be expected to put
into practice the PHP we covered earlier in the semester and write
well-structured Web applications. You will also be expected
to utilize the data tiers you developed using MySQL in the previous
assignment.
- (50 points) Enhance your single-file Web application
from part 1 of Assignment #4 so that it
continues to fulfill the requirements stated in that assignment,
with the following additions:
- Fix any errors noted in your grading report
for Assignment #4.
- Use your database from part 1 of Assignment
#5 (instead of the guestbook.txt file) as your data tier.
- Use a cookie to track the number of
times a browser has accessed the PHP file containing your application
and display the number of hits, along with an appropriate label,
somewhere near the bottom of each page. Only track
hits since the browser was launched. If the browser is closed
and relaunched, the hit count should start over.
The points assigned to this part are meant to reflect the fact that
I want you to invest significant time and energy in both satisfying
the requirements and polishing up the results of your efforts. I
will be looking for this part to be complete and professional, befitting
the culmination of a semester's work and study. This part is
simpler than the next part, so you should make sure you have this
one perfected before moving on to the next.
-
(50 points) Design and implement a Web application
(single-file or multi-file) that will act as a user interface for
your database from part 2 of Assignment #5 that satisfies
the following requirements.
- Accept the entry of a new CD and store it in your
data tier. Give the user a form with appropriate controls to
enter all the data items needed to represent a CD in your data
tier. Perform appropriate validation. Display as many error messages
as you can detect at once along with the form containing the
user’s
previous entries. You may assume that a CD will have no more
than 20 tracks if it simplifies your form implementation. Plan
your approach carefully so that your code performs the insertions
in the proper order to maintain the proper relationships between
primary and foreign keys.
- Display lists of all CDs, artists and tracks stored
in your data tier. The user should be able to display each list
individually upon request. The CD list should show all stored
data that pertains to each CD, including artists and tracks.
The artist list should show all stored data that pertains to
each artist, including CDs and tracks. The track list should
show all stored data that pertains to each track, including artist
and CD. You may arrange the output in whatever way you feel makes
the most sense.
- Allow the creation of a playlist using sessions.
In the lists described above, each place a track is listed it
should be accompanied by a link that allows the user to add that
track to the current playlist. The user should be given means of viewing
and clearing the current playlist. When viewing the playlist,
the title, artist, CD and play time for each track should be
shown as well as the total play time of all tracks currently in the
playlist.