We also want to let users register on
the site and edit their profiles. You??™ll create a componentized template for the login form and
place it just on top of the search box, as shown in Figure 16-4.
Figure 16-4. TShirtShop with a login box
CHAPTER 16 ?– MANAGING CUSTOMER DETAILS 500
The new user registration page looks like Figure 16-5.
Figure 16-5. The new user registration page in TShirtShop
After the user logs in to the site, a new componentized template displays the logged-in
user??™s name and a number of links for manipulating the user??™s account (see Figure 16-6).
Figure 16-6. Sample TShirtShop page for a logged-in user
CHAPTER 16 ?– MANAGING CUSTOMER DETAILS 501
Clicking the Add CC Details link leads the user to the page shown in Figure 16-7.
Figure 16-7. Adding credit card information
A similar form will be shown to the user when clicking the Add Address link. When the user
already has a credit card and an address listed, the Add... links in the Welcome box change into
Change... links.
You??™ll start implementing the new functionality by writing the data tier code that will support
the UI.
Implementing the Data Tier
You??™ll create the usual data tier stored procedures supporting customer accounts functionality
in the following exercise, and we??™ll comment on each one.
Exercise: Creating the Database Functions
1. Use phpMyAdmin to create the stored procedures described in the following steps.
Pages:
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623