Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

ONLINE CD STORE

Deliverables: You need to submit the following files:


All HTML and PHP files which you have produced. The MySQL database which you have produced. (Attach all your SQL scripts in a txt file) Make sure to test your program on the Mercury server before submission. Supply your MySQL username and password for database connectivity on the Swinburne network. (Keep them in your PHP files when you submit) Do not make any changes in your database tables until the assessment is completed.

Music Store:
You will produce a simplified business-to-customer (B2C) e-commerce application for an Online Music Store selling CD music. It will provide the following facilities: Administration of the store (back-end): facilities for: Inserting new CD stock items Searching for an album in the stock of CD music Editing a stock item Deleting a stock item Public access to the online store (front end): facilities for: Browsing through the shop Selecting an album to add to a shopping cart Changing quantities or removing an album from the shopping cart. Emptying the shopping cart. Assignment background description: For this assignment, you need to produce and enable appropriate HTML / PHP pages and MySQL tables. The music store database: Should contain two tables: CDs and cart. The design is kept simple and is not optimal based on relational database design principles. This may be improved based on your knowledge in database design.

For the CDs table, you should create following fields: o cd_id the unique identifier number for each CD item, e.g., 1,2,3. Set this fields properties as integer, primary key, unsigned, not null and auto_increment. o cd_type the type of the CD item, e.g. jazz, classical, rap, 'rock'. Set this fields properties as varchar, size=40, and null. o cd_artist the band, musician or composer which produced the item, e.g. 'Pink Floyd', 'Abba', 'Beethoven'. Set this fields properties as varchar, size=50, and null. o cd_name the album name, e.g. 'Abbey Road', 'Gold: Greatest Hits'. Set this fields properties as varchar, size=64, and null. o date_arrived the date on which the album is entered into the database, e.g., 504-2009 (DD-MM-YYYY). Set this fields properties as date, and null. o cd_price the unit price of the album in $, e.g. '12.95'. Set this fields properties as double, unsigned and null. for the cart table, you should create following fields: o cd_id the unique identifier number for each item in the cart, e.g. 1, 2, 3. Set this fields properties as integer, primary key, unsigned and not null. o cd_artist the band, musician or composer which produced the item, e.g. 'Pink Floyd', 'Abba', 'Beethoven'. Set this fields properties as varchar, size=50, and null. o cd_name the album name, e.g. Abbey Road'. Set this fields properties as varchar, size=64, and null. o item_qty the quantity of the album selected for purchasing, e.g. 2. Set this fields properties as integer, and null. o total_price the unit price of the album times the quantity, e.g. 12.95*2=25.90. Set this fields properties as double, unsigned and null.

Back-end (administration) of the Online Music Store

Task 1 Administration Page admin.html This task allows administrator of the B2C application to insert, update, and delete records from the CDs table. Requirements: This page should contain three buttons, Insert CD Items, Browse CD Items and Search CD Items. (Edit: Error here. Only 2 buttons are needed. No Browse button). Insert functionality should allow adding new album entries into the database. Search functionality should allow searching for a particular CD item based on the search condition, i.e., administrator should be able to search for a CD item by its type, name, artist, date entered, etc (search.php, Task 3).

Task 2 Insert records into the CDs table - insert.php Requirements: Allow administrator to add records into the CDs table. This page should contain an html form with 5 text fields for CD type, CD artist, CD or Album name, date arrived and item price, and 3 buttons, namely Insert (to insert an album into the CDs table), Reset(to reset form entries) and Admin Home (to go back to administrator control page, admin.html). Display confirmation message for successful entry into the table with a link to go back to the admin.html page, or display an error message for entry failure with a link to go back to insert.php page.

Task 3 Search records within the CDs table - search.php: Requirements: This task follows-up from Task 1, when the Search CD Items button is clicked. The search functionality should provide multiple search options, i.e., search by CD type, CD/Album name, CD artist, CD price, etc. The Search CD Items button should invoke search.php page, which contains an html form with a drop-down menu item, a text input element, and a Search button. The dropdown menu item contains the list of search conditions e.g., CD type, CD artist, Album name, CD price, etc. and the text input element is used to enter details of the search condition. For example, if the artist is selected from the drop-down list then type in the artists name in the text input element e.g., Beatles. Click on the Search button to start the search. Retrieve and display the CD item(s) from the CDs table depending on the search criteria. Each displayed album should also accompany three buttons, namely Update, Delete and Admin Home. The Update button should invoke update.php (Task 4), the Delete button should invoke delete.php (Task 5) and Admin Home should provide a link back to the admin.html page. Display proper error message if no records match the search criteria, along with a link to go back to the search.php page.

Task 4 Update records in CDs table - update.php and final-update.php Requirements: This task follow up from Task 3 and allows administrator to update records in the CDs table. Once clicked, the Update button should invoke the update.php page, which retrieves and displays the selected record with all fields editable, along with 3 buttons namely Confirm Update, Reset (to reset all entries) and Admin Home (to go back to the admin.html). Make any modifications in the displayed record and click the Final Update button. Once clicked, the Final Update button should invoke final_update.php and the changes should be recorded in the CDs table. Display confirmation message for successful update with a link to go back to the admin.html page, or an error message for update failure with a link to go back to the admin.html page.

Task 5 Delete records from the CDs table - delete.php and final_delete.php Requirements: This task is a follow up of Task 3 and allows administrator to delete records from the CDs table. Once clicked, the Delete button should invoke the delete.php page, which should retrieve and display the selected record, along with 2 buttons namely Confirm Delete and Admin Home (to go back to the admin.html page). Once clicked, the Confirm Delete button should invoke confirm_delete.php and the record should be deleted permanently from the CDs table. Display confirmation message for successful deletion with a link to go back to the admin.html page, or an error message for deletion failure with a link to go back to the

admin.html page.

Front-end (public access) of the Online Music Store


Task 6 Home page index.html The assignment2 directory/folder should contain an HTML file called index.html. This should be a very simple Web page containing: Your name Your student ID number Your email address A statement: I declare that this assignment is my individual work. I have not worked collaboratively nor have I copied from any other students work or from any other source. Two buttons: The Customer button provides a link to the front-end of the music store (Task 7) and the Administrator button provides a link to the back-end of the music store site (Task 1).

Task 7 List the music CDs in the online music store - main.php Requirements: Check the CDs table to retrieve albums available in the table and display the retrieved CD items with the following fields: cd_type, cd_name, and cd_price. There should be a link Add to Cart besides every CD album in the list, for adding that album into the cart. Once clicked, the cd_id, cd_name, item_qty and total_price (i.e., cd_price * item_qty) should be inserted into the cart table by invoking add_to_cart.php (Task 9). Use the cart table to display the number of selected CD items in the cart along with the total price of the cart. This page should contain two more buttons: View Cart and Empty Cart with links to view_cart.php (Task 10) and empty_cart.php (Task 12) respectively.

Task 8 Add selected CD into shopping cart- add_to_cart.php Requirements: Retrieve the selected record (in Task 7) from CDs table and insert it into the cart table. The default quantity when a music CD is added is 1. Do not insert the record into the cart table if it already exists however increase the quantity by 1 and update the total price of that CD item in the cart. Redirect the customer back to main.php page automatically for adding more CD item(s) into the shopping cart.

Task 9 View the albums currently in the shopping cart - view_cart.php Requirements: This task is a follow up of Task 7 when the View Cart button is clicked on the main.php page. This allows customer to view the albums already in the cart. Retrieve the album names, quantity, unit price and total price information from the cart and the CDs tables. Display the above information for each of the selected CDs along with the total price of each CD item (unit price * quantity). Display the total number of music CDs in the cart and the total price of the cart. The quantity field should be editable to allow customer to change the quantity of any selected album and then click the Update Cart button to update (Task 10). The total price for the selected CD and the total price of the cart should be updated accordingly. (Quantity may be 0 or more units).

Allow customer to remove all items from the cart by clicking on the Empty Cart button (Task 11). Allow customer to go back to the main.php page to add more albums into the cart by clicking the Home button.

Task 10 Update the cart - update_cart.php: Requirements: This task is a follow up of Task 9 when the Update Cart button is clicked, music CD items total price and total cart price should be updated (depending on the quantity). If the quantity changes to 0, the album is removed from the cart. Redirect the customer back to the view_cart.php page automatically after updating the cart. Task 11 Empty the cart - empty_cart.php Requirements: This task is a follow up of Task 7 & 9 when the Empty Cart button is clicked. All the records from the cart table should be deleted. Once the cart is empty, display a message There are no CDs in your cart

Redirect the customer back to the main.php page automatically with no album in the shopping cart.

Appendix: Marking Scheme Task Mark 1. Task 1: Administration Page 5 2. Task 2: Insert new albums 10 3. Task 3: Search for CDs in stock 15 4. Task 4: Update albums currently in stock 10 5. Task 5: Delete albums from stock 10 6. Task 6: Home page 2 7. Task 7: List the music CDs in stock 10 8. Task 8: Add selected CD into shopping cart 10 9. Task 9: View the albums currently in the shopping cart 10 10. Task 10: Update the shopping cart 10 11. Task 11: Empty the cart 8 Total 100/100

You might also like