Grocery Store Outline csc 242 web programming Professor
Grocery Store Outline csc 242 – web programming Professor John Carelli Kutztown University Computer Science Department
Landing Page • Uniform layout among pages • Contains primary links • Suggestion: use table or DIV based header/footer • store. php Professor John Carelli Kutztown University Computer Science Department
Create Account • Create an account in the grocerystore DB • This is a “fake” account for the Grocery Store! • Not the same as your DB login account! • Collect and verify user information • Use SQL command to create (insert) the account in the DB • This should include a password for the user to login with! • The account information is stored in the Customers table in the DB • create. php Professor John Carelli Kutztown University Computer Science Department
Login • User must login to their grocery store account to make a purchase • Use SQL to query the Customers table in DB for a matching email and password • If a match is found • Create a new session – store the customer name and ID in the session • This is how you will tell if they are logged in! • Display a post-login page or message to indicate a successful login • If no match • output a message directing them to create an account • And close any existing session! • login. Page. php / login. php Professor John Carelli Kutztown University Computer Science Department
Logout • Delete the session • logout. php Professor John Carelli Kutztown University Computer Science Department
Browse Products • Enable browsing by product category or by pattern search • You are free to implement this as you wish • Just be sure to have both capabilities available • Use SQL commands to access product information from the Products and Categories tables • Display results together with a capability to add items to a shopping cart • browse. php Professor John Carelli Kutztown University Computer Science Department
Adding Products • Browser result will be: • list of products • A capability to add products to the shopping cart • Shopping cart stored in a session • User can enter quantities for purchase • Only if logged in! • If not, issue a message directing them to the login page • After entering products, send them to the shopping cart Professor John Carelli Kutztown University Computer Science Department
Shopping Cart • View the shopping cart prior to a purchase • Items can be added (from browser) • Include S&H • Ability to clear the Shopping Cart • Shopping Cart must be maintained in session variables! • Not in the database! Professor John Carelli Kutztown University Computer Science Department
Checkout • On Checkout • Use the customer ID to create/access an order • Confirm the order (a popup will suffice) • Create the order in the Orders table • Enter all info, including date, S/H costs, etc. • Add the products in the session cart to the Order. Details table • Use the Order. ID just created to link those products to this order Professor John Carelli Kutztown University Computer Science Department
Order history • View Customer order history • List all orders for the user’s Customer. ID in Orders • Note: must be logged into view orders! • Otherwise display a message • Capability to select and view a past order (click on an order number) • Display an order by Order. ID in Orders • List all products matching that Order. ID in Order. Details Professor John Carelli Kutztown University Computer Science Department
Review Past Orders • Click on an order number in the Orders History • Access the DB to retrieve the order info • Display it Professor John Carelli Kutztown University Computer Science Department
Dropdown Example Professor John Carelli Kutztown University Computer Science Department
- Slides: 12