$is_add = false; for ($i = 1; $i <= $_POST['fields_' . $extra_fields['fields_id'] . '_total']; $i++) { if (isset($_POST['fields_' . $extra_fields['fields_id'] . '_' . $i])) { if ($is_add) { $sql_data_array['value'] .= "\n"; } else { $is_add = true; } $sql_data_array['value'] .= $_POST['fields_' . $extra_fields['fields_id'] . '_' . $i]; } } } vam_db_perform(TABLE_CUSTOMERS_TO_EXTRA_FIELDS, $sql_data_array); } $user_id = vam_db_insert_id(); vam_write_user_info($user_id); $sql_data_array = array('customers_id' => $_SESSION['customer_id'], 'entry_firstname' => $firstname, 'entry_secondname' => $secondname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, 'entry_postcode' => $postcode, 'entry_city' => $city, 'entry_country_id' => $country, 'address_date_added' => 'now()', 'address_last_modified' => 'now()'); if (ACCOUNT_GENDER == 'true') { $sql_data_array['entry_gender'] = $gender; } if (ACCOUNT_COMPANY == 'true') { $sql_data_array['entry_company'] = $company; } if (ACCOUNT_SUBURB == 'true') { $sql_data_array['entry_suburb'] = $suburb; } if (ACCOUNT_STATE == 'true') { if ($zone_id > 0) { $sql_data_array['entry_zone_id'] = $zone_id; $sql_data_array['entry_state'] = ''; } else {
} // Login tries = 0 $date_now = date('Ymd'); vam_db_query("update " . TABLE_CUSTOMERS . " SET login_tries = 0, login_time = now() WHERE customers_email_address = '" . vam_db_input($email_address) . "'"); $check_country_query = vam_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $check_customer['customers_id'] . "' and address_book_id = '" . $check_customer['customers_default_address_id'] . "'"); $check_country = vam_db_fetch_array($check_country_query); $_SESSION['customer_gender'] = $check_customer['customers_gender']; $_SESSION['customer_first_name'] = $check_customer['customers_firstname']; $_SESSION['customer_last_name'] = $check_customer['customers_lastname']; $_SESSION['customer_email_address'] = $check_customer['customers_email_address']; $_SESSION['customer_id'] = $check_customer['customers_id']; $_SESSION['customer_vat_id'] = $check_customer['customers_vat_id']; $_SESSION['customer_default_address_id'] = $check_customer['customers_default_address_id']; $_SESSION['customer_country_id'] = $check_country['entry_country_id']; $_SESSION['customer_zone_id'] = $check_country['entry_zone_id']; vam_db_query("update " . TABLE_CUSTOMERS_INFO . " SET customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 WHERE customers_info_id = '" . (int) $_SESSION['customer_id'] . "'"); vam_write_user_info((int) $_SESSION['customer_id']); // restore cart contents $_SESSION['cart']->restore_contents(); if ($_SESSION['cart']->count_contents() > 0) { if ($_SESSION['nologin']) { vam_redirect(vam_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } else { vam_redirect(vam_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); } } else { vam_redirect(vam_href_link(FILENAME_DEFAULT)); } } } } }