$home = $_POST['home'];
    $work = $_POST['work'];
    $mobile = $_POST['mobile'];
    $email = $_POST['email'];
    $service = new CustomerService();
    $sqln = "select * from customer where customer_name='{$userName}'";
    $num = $service->GetCount($sqln);
    if ($num > 0) {
        echo 'aa';
        $flag = false;
        $msg = "This user name has been exsited.";
    } else {
        $sql = " insert into customer ";
        $dataArray = array("customer_name" => "'" . $userName . "'", "customer_password" => "'" . $password . "'", "customer_home_phone" => "'" . $home . "'", "customer_work_phone" => "'" . $work . "'", "customer_mobile_phone" => "'" . $mobile . "'", "customer_email" => "'" . $email . "'", "customer_status" => "'available'");
        $sql .= $service->GetInsertSQL($dataArray);
        $id = $service->saveCustomer($sql, $email, $userName, $password);
        if ($id != 0) {
            //ok
            Redirect("Login.php?register=ok");
        } else {
        }
    }
}
?>
<div id="body_wrapper">
  <div id="wrapper">
<?php 
include_once 'Header.php';
?>
	<div id="main">
<?php 
예제 #2
0
 /**
  * Save Customer
  * @param sfWebRequest $request
  * @return unknown_type
  */
 public function executeUpdateCustomer(sfWebRequest $request)
 {
     $customerService = new CustomerService();
     $customer = $customerService->readCustomer($request->getParameter('id'));
     $this->customer = $customer;
     if ($request->isMethod('post')) {
         $customer->setName($request->getParameter('txtName'));
         $customer->setDescription($request->getParameter('txtDescription'));
         $customerService->saveCustomer($customer);
         $this->setMessage('SUCCESS', array(TopLevelMessages::UPDATE_SUCCESS));
         $this->redirect('admin/listCustomer');
     }
 }
예제 #3
0
$customerVO->setCusLastName($lName);
$customerVO->setCusGender($gender);
$customerVO->setCusContactAddr($address);
$customerVO->setPhoneNumber($phone);
$customerVO->setCusFacebookAddr($facebookAdr);
$customerVO->setForceChange("false");
if ($customerService->duplicationUsername($username) && $customerService->duplicationEmail($email)) {
    echo "Your username and email have been used";
} else {
    if ($customerService->duplicationUsername($username)) {
        echo "This username have been used";
    } else {
        if ($customerService->duplicationEmail($email)) {
            echo "This email have been used";
        } else {
            $saveResult = $customerService->saveCustomer($customerVO);
            if ($saveResult == 200) {
                if ($iniConfiguration['email.sending.to.customer'] == true) {
                    $emailContent = new EmailContent();
                    $emailBody = $emailContent->getCusRegisterNormalContent($iniConfiguration['web.application.prefix']);
                    $sendingEmail = new SendingEmail($iniConfiguration['email.host'], $iniConfiguration['email.username'], $iniConfiguration['email.password'], $email, $iniConfiguration['email.subject.customer.register.prefix'], $emailBody, $iniConfiguration['email.username'], $iniConfiguration['email.name']);
                    echo $sendingEmail->sendingEmail();
                } else {
                    echo $saveResult;
                }
            } else {
                echo $saveResult;
            }
        }
    }
}