Exemplo n.º 1
0
 }
 if (ACCOUNT_SUBURB == 'true') {
     $sql_data_array['affiliate_suburb'] = $a_suburb;
 }
 if (ACCOUNT_STATE == 'true') {
     // +Country-State Selector
     if ($a_zone_id == 0) {
         // -Country-State Selector
         if (strlen($a_state) < ENTRY_STATE_MIN_LENGTH) {
             $error = true;
             $messageStack->add('affiliate_signup', ENTRY_STATE_ERROR);
         }
     }
 }
 $sql_data_array['affiliate_date_account_created'] = 'now()';
 $affiliate_id = affiliate_insert($sql_data_array, $HTTP_SESSION_VARS['affiliate_ref']);
 // build the message content
 $name = $a_firstname . ' ' . $a_lastname;
 $email_text = sprintf(MAIL_GREET_NONE, $a_firstname);
 $email_text .= sprintf(MAIL_AFFILIATE_HEADER, STORE_NAME);
 $email_text .= sprintf(MAIL_AFFILIATE_ID, $affiliate_id);
 $email_text .= sprintf(MAIL_AFFILIATE_USERNAME, $a_email_address);
 $email_text .= sprintf(MAIL_AFFILIATE_PASSWORD, $a_password);
 $email_text .= sprintf(MAIL_AFFILIATE_LINK, HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE) . "\n\n";
 $email_text .= sprintf(MAIL_AFFILIATE_FOOTER, STORE_NAME, AFFILIATE_EMAIL_ADDRESS);
 tep_mail($name, $a_email_address, sprintf(MAIL_AFFILIATE_SUBJECT, STORE_NAME), $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
 tep_session_register('affiliate_id');
 $affiliate_email = $a_email_address;
 $affiliate_name = $a_firstname . ' ' . $a_lastname;
 tep_session_register('affiliate_email');
 tep_session_register('affiliate_name');
            $sql_data_array['affiliate_company_taxid'] = $a_company_taxid;
        }
        if (ACCOUNT_SUBURB == TRUE_STRING_S) {
            $sql_data_array['affiliate_suburb'] = $a_suburb;
        }
        if (ACCOUNT_STATE == TRUE_STRING_S) {
            if ($a_zone_id > 0) {
                $sql_data_array['affiliate_zone_id'] = $a_zone_id;
                $sql_data_array['affiliate_state'] = '';
            } else {
                $sql_data_array['affiliate_zone_id'] = '0';
                $sql_data_array['affiliate_state'] = $a_state;
            }
        }
        $sql_data_array['affiliate_date_account_created'] = 'now()';
        $_SESSION['affiliate_id'] = affiliate_insert($sql_data_array, $_SESSION['affiliate_ref']);
        $aemailbody = MAIL_AFFILIATE_HEADER . NEW_LINE . MAIL_AFFILIATE_ID . $_SESSION['affiliate_id'] . NEW_LINE . MAIL_AFFILIATE_USERNAME . $a_email_address . NEW_LINE . MAIL_AFFILIATE_PASSWORD . $a_password . "\n\n" . MAIL_AFFILIATE_LINK . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE . "\n\n" . MAIL_AFFILIATE_FOOTER;
        olc_php_mail(AFFILIATE_EMAIL_ADDRESS, STORE_OWNER, $a_email_address, $a_firstname . BLANK . $a_lastname, '', AFFILIATE_EMAIL_ADDRESS, STORE_OWNER, '', '', MAIL_AFFILIATE_SUBJECT, nl2br($aemailbody), nl2br($aemailbody));
        if (!isset($mail_error)) {
            olc_redirect(olc_href_link(FILENAME_AFFILIATE, 'info_message=' . urlencode(TEXT_PASSWORD_SENT), SSL, true, false));
        } else {
            echo $mail_error;
        }
        $_SESSION['affiliate_email'] = $a_email_address;
        $_SESSION['affiliate_name'] = $a_firstname . BLANK . $a_lastname;
        olc_redirect(olc_href_link(FILENAME_AFFILIATE_SIGNUP_OK, '', SSL));
    }
}
$breadcrumb->add(NAVBAR_TITLE, olc_href_link(FILENAME_AFFILIATE, '', SSL));
$breadcrumb->add(NAVBAR_TITLE_SIGNUP, olc_href_link(FILENAME_AFFILIATE_SIGNUP, '', SSL));
require DIR_WS_INCLUDES . 'header.php';