In this assignment, you are required to develop part of a B2C (business-to-customer) e-commerce site, which is an online bookstore. Through the developed site, the user should be able to login, search for books, view book details and add books to a shopping cart. The structure of the tables in the database is presented in Appendix A.
In this coursework you are required to develop PHP scripts and HTML documents to implement the application server of the web store. The web store must provide the following functionality:
• PHP: The core logic of the web store should be implemented in PHP.
• Home: This is the front page of the site. For this page, the user should specify whether he/she is a customer or not. If a customer, a customer id and password are required to be passed for this page. The returned HTML document should contain customer details and a link to the Search Request page.
• Search Request: This page should allow the user to enter a search criterion (search by name, by author, by topic) and a value in a form.
• Search Result: The reply of the search request should be provided by a search result page, which requires a search criterion and a value. The HTML document returned should contain links to Search Request and Product Detail.
• Product Detail: This web page returns the details of a particular book. An item id parameter is required for this interaction. The HTML document returned should contain links to Search Request and Shopping Cart.
• Shopping Cart: A cart should be associated with each user session. In this web page, such a cart is updated. If no cart is associated with user session, one should be created in this interaction. New items can be added to the cart or existing items updated. The function interface to the cart should be designed in such a way that a list of (i id, i qty) pairs is passed to the main function updating the contents of the cart, where the first component of the pair is the identity of the item to add/update and the second component is the the quantity to add/update. Additionally, the function interface should provide a parameter add flag, specifying whether the quantity should be added or updated in the shopping cart. The HTML document returned contains the updated cart and includes links to Shopping Cart and Search Request.
• DB interface: The application should provide an interface to change the settings for the database connection (server, user-name, db-name, table-names).
• GUI: The above functionality should be presented in a simple, intuitive, easy-to-use GUI.