Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1. Tsarbucks
  2. Summary
  3.  
  4. Using PHP, HTML, and a connection to a MySQL database, create an e-commerce system for a fictional coffee company. This involves a shopping cart for a customer, a menu of items that can be added to the cart, and a separate screen for a barista to mark ordered items as complete.
  5.  
  6. Make sure you have an understanding of form submissions, mysqli or PDO, sessions, strings, and arrays.
  7.  
  8. Check out the screenshots (comp484-project-3-screenshots.zipView in a new window) for an idea of how the system works.
  9.  
  10. You may also create your own database schema or use the same one I made for my implementation (tsarbucks.sqlPreview the documentView in a new window).
  11.  
  12. If you create your own database schema, please also submit it as a .sql file (SQL dump) along with all data in your database in the same ZIP file as your assignment submission. You can do this in one fell swoop in both phpMyAdmin (Export tab) and Sequel Pro (File > Export).
  13.  
  14. Finally, you MUST do the server-side components in vanilla PHP; you may not use a framework on this project. This is an exercise in development using vanilla PHP.
  15. Specification
  16.  
  17. The Tsarbucks e-commerce system provides a way for a customer to log-in, see their order history, select drinks from a menu, add the desired drinks to their shopping cart, and submit the order to be prepared. It also provides a way for a barista to log-in and mark the items in an order as completed (i.e. when they have finished making a drink for a customer).
  18. User Interface
  19.  
  20. The user interface should contain the following:
  21.  
  22. General
  23.  
  24. Login screen that takes a username and password
  25. Logout functionality (link, screen, etc) that logs-out the current user
  26. Navigation bar that has all available options for the logged-in user
  27.  
  28. Customer Component
  29.  
  30. Home screen that displays information (this can be the same as the My Orders screen)
  31. My Orders screen that displays the details of past and current orders
  32. If an item in an order has been completed, it should show that it has been completed. Otherwise it should show as pending.
  33. Menu screen that gives the customer a set of items to add to the cart
  34. My Cart screen that displays everything currently in the customer's cart
  35. Each item on the screen should have the option to remove it
  36. There should also be a button that allows the customer to submit their order
  37.  
  38. Barista Component
  39.  
  40. Home screen that displays information (this can be the same as the Pending Orders screen)
  41. Pending Orders screen that displays all orders that are currently pending
  42. All non-completed (pending) items in all orders should be shown
  43. Each item should have the option for the barista to mark it as completed
  44.  
  45. I'm not looking for anything stellar for the UI but just make sure all of the components are there.
  46. Functionality
  47.  
  48. Redirecting with PHP
  49.  
  50. // redirect to the home page and then exit the script
  51. header("Location: index.php");
  52. exit();
  53.  
  54. General
  55.  
  56. The Login functionality needs to take a username and password, check it against the database, and then log the user in. The username and user ID should be saved to the session and then the user should be redirected to the home page.
  57. The Logout functionality needs to destroy the entire session upon logout and then redirect the user back to the home page.
  58. The navigation bar needs to link to all the relevant pages based on the logged-in user
  59.  
  60. Customer Component
  61.  
  62. The My Orders screen needs to show the details of each order both past and current from the database. The details are the following:
  63. Cost of the entire order
  64. The name of each item in the order
  65. Whether each item in the order has been completed or is still pending
  66. The Menu screen needs to do the following:
  67. Display all items available for purchase
  68. Each item available needs to show its price
  69. Each item needs to have a way for the user to add it to his cart
  70. The My Cart screen needs to do the following:
  71. Display all items currently in the user's cart
  72. Each item in the cart needs to show its price
  73. Each item in the cart needs to have a way for the user to remove it from his cart
  74. Provide a way for the user to submit the order in his cart
  75. This should save the data of the order to the database
  76.  
  77. Barista Component
  78.  
  79. The Pending Orders screen needs to do the following:
  80. Show only items that are pending in the orders (i.e. not completed) from the database
  81. Each pending item needs to show its price
  82. Each pending item needs to have a way for the barista to mark it as completed
  83. Marking an item as completed should update the order item in the database
  84.  
  85. Grading
  86.  
  87. This project is worth 20 points, weighted at 20% of the grade. Implementing all of the functionality is considerably more important than how the UI looks.
  88.  
  89. I'm going to be using Chrome to run everything since Firefox can be funky sometimes.
  90. Extra Credit
  91.  
  92. The extra credit for this project involves integrating AJAX and Socket.io with the customer's My Orders screen and the barista's Pending Orders screen.
  93.  
  94. Upon the barista marking an item as complete (you'll probably want to do that with an AJAX call now) a socket message should fire to the Socket.io server (after the database update is successful) and then a message should be sent to the customer from the server in response.
  95.  
  96. When the customer receives the message (only while on the My Orders screen), the relevant order item that was just completed should change visually somehow. My implementation involves changing the background color of the table row containing the item in the order.
  97.  
  98. The extra credit is worth 2 points.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement