Site Features
- Site created by Taylor Willis as a class project for MIS 314 at Western Washington University.
- All product information is dynamically generated using PHP and mySQL.
- Product, customer and order information is stored in a mySQL database.
- Include files are used for all code that is used more than once (i.e. search/browse menu, ListAuthor function, header and footer).
- mySQL Database
- Normalized to 3rd normal form (or greater). Tables include:
- book details
- book categories
- relationship details-books (many-to-many)
- authors
- relationship authors-books (many-to-many)
- customers
- orders
- order items (one-to-many)
- Database is located on a separate database server for greater security and speed.
- Normalized to 3rd normal form (or greater). Tables include:
- Home page
- Selects three random items from from the database using a SQL statement.
- Generates the browse menu dynamically from the database using a SQL query that shows only the book categories that currently contain books.
- Truncates book descriptions at 250 characters.
- Search page
- Cleans user entered data to protect against SQL Injection attacks and cross-site scripting.
- Searches book title, description, author and category fields in the database.
- The mysql_num_rows() function is used to count the number of books found by the search.
- Responds gracefully to searches that return no matches.
- Shopping cart page
- Uses a cookie to store the ISBNs of items in the cart.
- Checkout pages
- Searches the database for email addresses of existing customer accounts and writes their shipping information in the form on the order confirmation page.
- Customer ID is encrypted using Rijndael encryption algorithm
- Order Confirmation Page
- Checks for shopping cart and prompts user if cart is empty.
- All fields are checked to make sure that they contain information.
- Checks email address in database and prompts user to try again user if address not found.
- Modifications made to customer information are updated in the database.
- Order information are written to the database.
- An email is sent to the customer with the order information.
- The shopping cart is emptied by setting ItemCount to zero in the ShoppingCart cookie.
- Order History Page
- Searches the database for all orders associated with e-mail address
- If no matching email address is found user is prompted to try again.
- Enhancements
- This site uses a simple template by the use of PHP "include" statements.
- Made a custom logo for the bookstore as well as edited other various graphics, such as the search and browse headers in the menu and the continue button.
- Used HTML to format the order confirmation email.
- Incorporates the bookstore logo in the email.
- Uses internal CSS to include color elements (may not display color properly on every email client).
- Sends a carbon copy to my own email when the email is sent to the customer.
- Used a separate SQL function to total up all the books in the Order History page.
- Used a separate SQL function to populate the name of the customer in the Order History page.
- Used the COUNT DISTINCT SQL function to count the number of books in each individual categories in the Browse Categories section in the menu.
- Truncated the product descriptions on whole words rather than on a fixed number of characters.
- I have upgraded the graphical appearance of the bookstore.
- Using two separate buttons on Checkout02, an explode array, and many IF statements, I was able to create the following 8 outcomes:
New Customer Returning Customer Empty Cart Update Adds new customer to database, green text message Applies any changes made, green text message Empty Cart Checkout Adds new customer to database, green text message Applies any changes made, green text message, denies checkout process Full Cart Update Adds new customer to database, green text message, cart stays full Applies any changes made, green text message, cart stays full Full Cart Checkout Adds new customer to database, checks customer out, cart empties Applies any changes made, customer checks out, cart empties
- Included a counter in the header telling the user how many items are in their cart no matter what page they are on.
- When something is searched that returns only one result, the user is redirected to the product page for that result.
- When someone makes a blank search, a message reads that 0 results for an empty search instead of an error.
- When the user hovers over a div on either the SearchBrowse page or the ProductPage page, the background changes and a small drop shadow is displayed.
*Thanks to Amazon.com for the use of its icons, book images and book descriptions.