Prev | Current Page 621 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

..
$customer_read = Customer::GetLoginInfo($this->mEmail);
/* ...if we have one and we are in 'new user' mode then
email already taken error */
if ((!(empty ($customer_read['customer_id']))) &&
($this->mEditMode == 0))
{
$this->mEmailAlreadyTaken = 1;
CHAPTER 16 ?–  MANAGING CUSTOMER DETAILS 517
return;
}
// We have a new user or we are updating an existing user's details
if ($this->mEditMode == 0)
Customer::Add($this->mName, $this->mEmail, $this->mPassword);
else
Customer::UpdateAccountDetails($this->mName, $this->mEmail,
$this->mPassword, $this->mDayPhone, $this->mEvePhone,
$this->mMobPhone);
header('Location:' . $this->mLinkToCancelPage);
exit();
}
if ($this->mEditMode == 1 && !isset ($_POST['sended']))
{
// We are editing an existing customer's details
$customer_data = Customer::Get();
$this->mName = $customer_data['name'];
$this->mEmail = $customer_data['email'];
$this->mDayPhone = $customer_data['day_phone'];
$this->mEvePhone = $customer_data['eve_phone'];
$this->mMobPhone = $customer_data['mob_phone'];
}
}
}
?>
7. Create a new template file named customer_address.tpl in the presentation/templates folder,
and add the following code to it:
{* customer_address.tpl *}
{load_presentation_object filename="customer_address" assign="obj"}

Please enter your address details:





Address 1:
size="32" />
{if $obj->mAddress1Error}

You must enter an address.


Pages:
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633