Specifications
FIGURE 25.2
The administrator view of the Book-O-Rama system allows insertion, editing, and deletion of books and categories.
In Figure 25.1, we show the main links between scripts in the user part of the site. A customer
will come first to the main page, which lists all the categories of books in the site. From there,
she can go to a particular category of books, and from there to an individual book’s details.
We will give the user a link to add a particular book to her cart. From the cart, she will be able
to check out of the online store.
Figure 25.2 shows the administrator interface—this has more scripts, but not much new code is
here. These scripts let an administrator log in and insert books and categories.
The easiest way to implement editing and deletion of books and categories is to show the
administrator a slightly different version of the user interface to the site. The administrator will
still be able to browse categories and books, but instead of having access to the shopping cart,
the administrator will be able to go to a particular book or category and edit or delete that book
or category. By making the same scripts suit both normal and administrator users, we can save
ourselves time and effort.
The three main code modules for this application are as follows:
• Catalog.
• Shopping cart and order processing (We’ve bundled these together because they are
strongly related.)
• Administration.
Building a Shopping Cart
C
HAPTER 25
25
B
UILDING A
SHOPPING CART
543
Book
Details
Insert
Book
Insert
Category
Change
Password
Logout
Category
Book
List
Category
List
Admin
Menu
Edit
Category
Delete
Category
Edit
Book
Delete
Book
31 7842 CH25 3/6/01 3:38 PM Page 543










