About DevBooks
Overview
- Site created by Tyler Schroeder 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).
Thanks to Amazon.com (the world's greatest on-line bookstore) for the use of its book images and book descriptions.
Database
mySQL Database used to store all customer and product information.
- Is normailzed 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.
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 to 50 words.
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.
Final Checkout 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
- Custom Graphics
- CSS Based Layout
- Descriptions Truncated at 50 words
- Sends HTML-based confirmation Email
- Dynamically generated titles
- Right sidebar with page-specific functions:
- Index Page: Lists 5 most recent purchases
- Product Page: Lists books in same category
- Checkout/Order History: provides order summary and account information
- Search Browse:
- Browse: Most commonly purchased books in category
- Search: Last 10 searches sitewide
- Order History Page groups all books by order
- Lightbox used for all large images on ProductPage.

