..
$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"}