Exemple #1
0
         $setperson = $worketc->SetPerson(array('person' => array('Title' => $title, 'FirstName' => $firstname, 'MiddleName' => '', 'Surname' => $lastname, 'Gender' => $newgender, 'EntityID' => 0, 'LastActivity' => date('c'), 'DateLastModified' => date('c'), 'CreationDate' => date('c'), 'Email' => $email_address, 'CustomerCredentials' => 'SupportPersonal', 'Delete' => false, 'RemoveParentLinks' => false, 'OwnerID' => $OwnerID, 'SupplierRate' => 3.1, 'SupplierUnit' => 'None', 'Website' => $website, 'Addresses' => array('Address' => array('AddressID' => $addid, 'AddressType' => 'Home', 'Street' => $street_address, 'Suburb' => $city, 'StateOrProv' => $state, 'PostalCode' => $postcode, 'Country' => tep_get_country_name($country), 'Phone' => $telephone, 'PhoneExt' => $customers_telephone_ext, 'Fax' => $fax, 'Delete' => false, 'RemoveParentLinks' => false, 'DateLastModified' => date('c'))), 'RelatedBranches' => array('BranchResult' => array('BranchName' => $company, 'BranchLabel' => $company, 'CompanyName' => $company, 'EntityID' => 0, 'IsPrimary' => true, 'BranchID' => 0, 'Delete' => false)))));
         $entityid = $setperson->EntityID;
     } else {
         $findcompany = $worketc->FindCompanies(array('keywords' => $company));
         $company_id = $findcompany->Company->Branches->Branch->BranchID;
         $setperson = $worketc->SetPerson(array('person' => array('Title' => $title, 'FirstName' => $firstname, 'MiddleName' => '', 'Surname' => $lastname, 'Gender' => $newgender, 'EntityID' => $entity, 'LastActivity' => date('c'), 'DateLastModified' => date('c'), 'CreationDate' => date('c'), 'Email' => $email_address, 'CustomerCredentials' => 'SupportPersonal', 'Delete' => false, 'RemoveParentLinks' => false, 'OwnerID' => $OwnerID, 'SupplierRate' => 3.1, 'SupplierUnit' => 'None', 'Website' => $website, 'Addresses' => array('Address' => array('AddressID' => $addid, 'AddressType' => 'Home', 'Street' => $street_address, 'Suburb' => $city, 'StateOrProv' => $state, 'PostalCode' => $postcode, 'Country' => tep_get_country_name($country), 'Phone' => $telephone, 'PhoneExt' => $customers_telephone_ext, 'Fax' => $fax, 'Delete' => false, 'RemoveParentLinks' => false, 'DateLastModified' => date('c'))), 'RelatedBranches' => array('BranchResult' => array('BranchName' => $company, 'BranchLabel' => $company, 'CompanyName' => $company, 'EntityID' => $entity, 'IsPrimary' => true, 'BranchID' => 0, 'Delete' => false)))));
         $entityid = $entity;
     }
     $worketc->EntityAddTag(array('EntityID' => $entityid, 'Tag' => "Registered Online"));
 }
 //end etc
 if ($error == false) {
     $sql_data_array = array('customers_firstname' => $firstname, 'referral' => $referral, 'referral_other' => $referral_other, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'customers_telephone_ext' => $customers_telephone_ext, 'customers_fax' => $fax, 'customers_newsletter' => $newsletter, 'customers_group' => $group, 'website' => $website, 'title' => $title, 'st' => $st, 'ip' => $_SERVER['REMOTE_ADDR'], 'customers_password' => tep_encrypt_password($password));
     tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
     $customer_id = tep_db_insert_id();
     if (WORKETC_ENABLE == 'True' && tep_connect_worketc() != 0) {
         $sql_data_array2 = array('customer_id' => $customer_id, 'tag_id' => 1);
         tep_db_perform('customers_to_tag', $sql_data_array2);
     }
     $sql_data_array = array('customers_id' => $customer_id, 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, 'entry_postcode' => $postcode, 'entry_city' => $city, 'entry_country_id' => $country);
     $sql_data_array['entry_company'] = $company;
     $sql_data_array['entry_zone_id'] = '0';
     $sql_data_array['entry_state'] = $state;
     tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
     $address_id = tep_db_insert_id();
     tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int) $address_id . "' where customers_id = '" . (int) $customer_id . "'");
     tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int) $customer_id . "', '0', now())");
     if (SESSION_RECREATE == 'True') {
         tep_session_recreate();
     }
     $customer_first_name = $firstname;
Exemple #2
0
function get_current_login_etc()
{
    $worketc = tep_connect_worketc();
    $userID = $worketc->session("UserID");
    return $userID;
}