diff --git a/GEAENDERTE DATEIEN/DEINADMIN/customers.php b/GEAENDERTE DATEIEN/DEINADMIN/customers.php index 2fdfcbb..87c96f2 100644 --- a/GEAENDERTE DATEIEN/DEINADMIN/customers.php +++ b/GEAENDERTE DATEIEN/DEINADMIN/customers.php @@ -1,92 +1,89 @@ bindVars($addresses_query, ':customersID', $_GET['cID'], 'integer'); - - $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_LIST_ADDRESSES', $addresses_query); - - $addresses = $db->Execute($addresses_query); - $addressArray = array(); - foreach ($addresses as $address) { - $format_id = zen_get_address_format_id($address['country_id']); +if (!empty($action)) { + switch ($action) { + case 'list_addresses': + $customer = new Customer($_GET['cID']); + $addressArray = $customer->getData('addresses'); + break; + case 'status': + if (isset($_POST['current_status']) && ctype_digit($_POST['current_status'])) { + if ($_POST['current_status'] === CUSTOMERS_APPROVAL_AUTHORIZATION) { + if (CUSTOMERS_APPROVAL_AUTHORIZATION === '1' || CUSTOMERS_APPROVAL_AUTHORIZATION === '2') { + $customers_authorization = 0; + } else { + $customers_authorization = 4; + } - $addressArray[] = array( - 'firstname' => $address['firstname'], - 'lastname' => $address['lastname'], - 'address_book_id' => $address['address_book_id'], - 'format_id' => $format_id, - 'address' => $address); - } - break; - case 'list_addresses_done': - $action = ''; - zen_redirect(zen_href_link(FILENAME_CUSTOMERS, 'cID=' . (int)$_GET['cID'] . '&page=' . $_GET['page'], 'NONSSL')); - break; - case 'status': - if (isset($_POST['current']) && is_numeric($_POST['current'])) { - if ($_POST['current'] == CUSTOMERS_APPROVAL_AUTHORIZATION) { - if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 || CUSTOMERS_APPROVAL_AUTHORIZATION == 2) { - $customers_authorization = 0; - } else { - $customers_authorization = 4; - } - $sql = "UPDATE " . TABLE_CUSTOMERS . " - SET customers_authorization = " . $customers_authorization . " - WHERE customers_id = " . (int)$customers_id; - $custinfo = $db->Execute("SELECT customers_email_address, customers_firstname, customers_lastname - FROM " . TABLE_CUSTOMERS . " - WHERE customers_id = " . (int)$customers_id); - if ((int)CUSTOMERS_APPROVAL_AUTHORIZATION > 0 && (int)$_POST['current'] > 0 && $custinfo->RecordCount() > 0) { - $message = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE; - $html_msg['EMAIL_MESSAGE_HTML'] = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE; - zen_mail($custinfo->fields['customers_firstname'] . ' ' . $custinfo->fields['customers_lastname'], $custinfo->fields['customers_email_address'], EMAIL_CUSTOMER_STATUS_CHANGE_SUBJECT, $message, STORE_NAME, EMAIL_FROM, $html_msg, 'default'); - } - zen_record_admin_activity('Customer-approval-authorization set customer auth status to 0 for customer ID ' . (int)$customers_id, 'info'); - } else { - $sql = "UPDATE " . TABLE_CUSTOMERS . " - SET customers_authorization = '" . CUSTOMERS_APPROVAL_AUTHORIZATION . "' - WHERE customers_id = " . (int)$customers_id; - zen_record_admin_activity('Customer-approval-authorization set customer auth status to ' . CUSTOMERS_APPROVAL_AUTHORIZATION . ' for customer ID ' . (int)$customers_id, 'info'); - } - $db->Execute($sql); - $action = ''; - zen_redirect(zen_href_link(FILENAME_CUSTOMERS, 'cID=' . (int)$customers_id . '&page=' . $_GET['page'], 'NONSSL')); - } - $action = ''; - break; - case 'update': + $customer = new Customer($customers_id); + $old = $customer->getData('customers_authorization'); + $custinfo = $customer->setCustomerAuthorizationStatus($customers_authorization); + if ((int)CUSTOMERS_APPROVAL_AUTHORIZATION > 0 && (int)$_POST['current_status'] > 0 && $old != $customers_authorization) { + $message = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE; + $html_msg['EMAIL_MESSAGE_HTML'] = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE; + zen_mail( + $custinfo['customers_firstname'] . ' ' . $custinfo['customers_lastname'], + $custinfo['customers_email_address'], + EMAIL_CUSTOMER_STATUS_CHANGE_SUBJECT, + $message, + STORE_NAME, + EMAIL_FROM, + $html_msg, + 'default' + ); + } + zen_record_admin_activity( + 'Customer-approval-authorization set customer auth status to 0 for customer ID ' . $customers_id, + 'info' + ); + } else { + $customer = new Customer($customers_id); + $customer->setCustomerAuthorizationStatus(CUSTOMERS_APPROVAL_AUTHORIZATION); + zen_record_admin_activity( + 'Customer-approval-authorization set customer auth status to ' . CUSTOMERS_APPROVAL_AUTHORIZATION . ' for customer ID ' . (int)$customers_id, + 'info' + ); + } + zen_redirect( + zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(['action']), 'NONSSL') + ); + } + $action = ''; + break; + case 'update': // bof Zahlungsart nur fuer bestimmte Kunden anbieten if (isset($_POST['optional_payment_1']) && zen_not_null($_POST['optional_payment_1'])) { @@ -99,596 +96,593 @@ $customers_lastname = zen_db_prepare_input(zen_sanitize_string($_POST['customers_lastname'])); $customers_email_address = zen_db_prepare_input($_POST['customers_email_address']); $customers_telephone = zen_db_prepare_input($_POST['customers_telephone']); - if (ACCOUNT_FAX_NUMBER == 'true'){ - $customers_fax = zen_db_prepare_input($_POST['customers_fax']); - } - $customers_newsletter = zen_db_prepare_input($_POST['customers_newsletter']); - $customers_group_pricing = (int)zen_db_prepare_input($_POST['customers_group_pricing']); - $customers_email_format = zen_db_prepare_input($_POST['customers_email_format']); - $customers_gender = !empty($_POST['customers_gender']) ? zen_db_prepare_input($_POST['customers_gender']) : ''; - $customers_dob = (empty($_POST['customers_dob']) ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_db_prepare_input($_POST['customers_dob'])); - - $customers_authorization = zen_db_prepare_input($_POST['customers_authorization']); - $customers_referral = zen_db_prepare_input($_POST['customers_referral']); - - if (CUSTOMERS_APPROVAL_AUTHORIZATION == 2 && $customers_authorization == 1) { - $customers_authorization = 2; - $messageStack->add_session(ERROR_CUSTOMER_APPROVAL_CORRECTION2, 'caution'); - } + $customers_fax = ''; + if (ACCOUNT_FAX_NUMBER === 'true') { + $customers_fax = zen_db_prepare_input($_POST['customers_fax']); + } + $customers_newsletter = zen_db_prepare_input($_POST['customers_newsletter']); + $customers_group_pricing = (int)$_POST['customers_group_pricing']; + $customers_email_format = zen_db_prepare_input($_POST['customers_email_format']); + $customers_gender = !empty($_POST['customers_gender']) ? + zen_db_prepare_input($_POST['customers_gender']) : ''; + $customers_dob = (empty($_POST['customers_dob'])) ? + zen_db_prepare_input('0001-01-01 00:00:00') : zen_db_prepare_input($_POST['customers_dob']); + + $customers_authorization = (int)$_POST['customers_authorization']; + $customers_referral = zen_db_prepare_input($_POST['customers_referral']); + + if (CUSTOMERS_APPROVAL_AUTHORIZATION === '2' && $customers_authorization === 1) { + $customers_authorization = 2; + $messageStack->add_session(ERROR_CUSTOMER_APPROVAL_CORRECTION2, 'caution'); + } - if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && $customers_authorization == 2) { - $customers_authorization = 1; - $messageStack->add_session(ERROR_CUSTOMER_APPROVAL_CORRECTION1, 'caution'); - } + if (CUSTOMERS_APPROVAL_AUTHORIZATION === '1' && $customers_authorization === 2) { + $customers_authorization = 1; + $messageStack->add_session(ERROR_CUSTOMER_APPROVAL_CORRECTION1, 'caution'); + } - $default_address_id = zen_db_prepare_input($_POST['default_address_id']); - $entry_street_address = zen_db_prepare_input($_POST['entry_street_address']); - $entry_suburb = zen_db_prepare_input($_POST['entry_suburb']); - $entry_suburb_error = false; - $entry_postcode = zen_db_prepare_input($_POST['entry_postcode']); + $default_address_id = (int)$_POST['default_address_id']; + $entry_street_address = zen_db_prepare_input($_POST['entry_street_address']); + $entry_suburb = !empty($_POST['entry_suburb']) ? zen_db_prepare_input($_POST['entry_suburb']) : ''; + $entry_postcode = zen_db_prepare_input($_POST['entry_postcode']); $entry_city = zen_db_prepare_input($_POST['entry_city']); - $entry_country_id = zen_db_prepare_input($_POST['entry_country_id']); - - $entry_company = zen_db_prepare_input($_POST['entry_company']); - $entry_company_error = false; - if (ACCOUNT_STATE == 'true'){ - $entry_state = zen_db_prepare_input($_POST['entry_state']); - } - if (isset($_POST['entry_zone_id'])) $entry_zone_id = zen_db_prepare_input($_POST['entry_zone_id']); - - if (strlen($customers_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) { - $error = true; - $entry_firstname_error = true; - } else { - $entry_firstname_error = false; - } - - if (strlen($customers_lastname) < ENTRY_LAST_NAME_MIN_LENGTH) { - $error = true; - $entry_lastname_error = true; - } else { - $entry_lastname_error = false; - } - - if (ACCOUNT_DOB == 'true') { - if (ENTRY_DOB_MIN_LENGTH > 0) { - if (checkdate(substr(zen_date_raw($customers_dob), 4, 2), substr(zen_date_raw($customers_dob), 6, 2), substr(zen_date_raw($customers_dob), 0, 4))) { - $entry_date_of_birth_error = false; - } else { - $error = true; - $entry_date_of_birth_error = true; - } - } - } else { - $customers_dob = '0001-01-01 00:00:00'; - } - - if (strlen($customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) { - $error = true; - $entry_email_address_error = true; - } else { - $entry_email_address_error = false; - } - - if (!zen_validate_email($customers_email_address)) { - $error = true; - $entry_email_address_check_error = true; - } else { - $entry_email_address_check_error = false; - } - - if (strlen($entry_street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) { - $error = true; - $entry_street_address_error = true; - } else { - $entry_street_address_error = false; - } - - if (strlen($entry_postcode) < ENTRY_POSTCODE_MIN_LENGTH) { - $error = true; - $entry_post_code_error = true; - } else { - $entry_post_code_error = false; - } - - if (strlen($entry_city) < ENTRY_CITY_MIN_LENGTH) { - $error = true; - $entry_city_error = true; - } else { - $entry_city_error = false; - } - - if ($entry_country_id == false) { - $error = true; - $entry_country_error = true; - } else { - $entry_country_error = false; - } - - if (ACCOUNT_STATE == 'true') { - if ($entry_country_error == true) { - $entry_state_error = true; - } else { - $zone_id = 0; - $entry_state_error = false; - $check_value = $db->Execute("SELECT COUNT(*) AS total - FROM " . TABLE_ZONES . " - WHERE zone_country_id = " . (int)$entry_country_id); - - $entry_state_has_zones = ($check_value->fields['total'] > 0); - if ($entry_state_has_zones == true) { - $zone_query = $db->Execute("SELECT zone_id - FROM " . TABLE_ZONES . " - WHERE zone_country_id = " . (int)$entry_country_id . " - AND zone_name = '" . zen_db_input($entry_state) . "'"); - - if ($zone_query->RecordCount() > 0) { - $entry_zone_id = $zone_query->fields['zone_id']; + $entry_country_id = (int)$_POST['entry_country_id']; + $entry_company = !empty($_POST['entry_company']) ? zen_db_prepare_input($_POST['entry_company']) : ''; + $entry_state = !empty($_POST['entry_state']) ? zen_db_prepare_input($_POST['entry_state']) : ''; + $entry_zone_id = (int)($_POST['entry_zone_id'] ?? 0); + + if (ACCOUNT_GENDER === 'true' && empty($customers_gender)) { + $error = true; + $entry_gender_error = true; } else { - $error = true; - $entry_state_error = true; - } - } else { - if (strlen($entry_state) < (int)ENTRY_STATE_MIN_LENGTH) { - $error = true; - $entry_state_error = true; + $entry_gender_error = false; } - } - } - } - if (strlen($customers_telephone) < ENTRY_TELEPHONE_MIN_LENGTH) { - $error = true; - $entry_telephone_error = true; - } else { - $entry_telephone_error = false; - } - - $check_email = $db->Execute("SELECT customers_email_address - FROM " . TABLE_CUSTOMERS . " - WHERE customers_email_address = '" . zen_db_input($customers_email_address) . "' - AND customers_id != " . (int)$customers_id); - - if ($check_email->RecordCount() > 0) { - $error = true; - $entry_email_address_exists = true; - } else { - $entry_email_address_exists = false; - } + if (ACCOUNT_DOB === 'true') { + if (checkdate( + (int)substr(zen_date_raw($customers_dob), 4, 2), + (int)substr(zen_date_raw($customers_dob), 6, 2), + (int)substr(zen_date_raw($customers_dob), 0, 4) + )) { + $entry_date_of_birth_error = false; + } else { + $error = true; + $entry_date_of_birth_error = true; + } + } else { + $customers_dob = '0001-01-01 00:00:00'; + } - $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_UPDATE_VALIDATE', array(), $error); + $entry_email_address_check_error = false; + if (!zen_validate_email($customers_email_address)) { + $error = true; + $entry_email_address_check_error = true; + } - if ($error == false) { + $entry_email_address_exists = !zen_check_email_address_not_already_used( + $customers_email_address, + $customers_id + ); + if ($entry_email_address_exists) { + $error = true; + } - $sql_data_array = array(array('fieldName' => 'customers_firstname', 'value' => $customers_firstname, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'customers_lastname', 'value' => $customers_lastname, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'optional_payment_1', 'value'=>$optional_payment_1, 'type'=>'stringIgnoreNull'), - array('fieldName' => 'customers_email_address', 'value' => $customers_email_address, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'customers_telephone', 'value' => $customers_telephone, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'customers_group_pricing', 'value' => $customers_group_pricing, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'customers_newsletter', 'value' => $customers_newsletter, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'customers_email_format', 'value' => $customers_email_format, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'customers_authorization', 'value' => $customers_authorization, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'customers_referral', 'value' => $customers_referral, 'type' => 'stringIgnoreNull'), - ); + $zone_id = 0; + $entry_state_error = false; + if (ACCOUNT_STATE === 'true') { + $entry_state_has_zones = count(zen_get_country_zones($entry_country_id)) > 0; + if ($entry_state_has_zones) { + $zone_query = $db->Execute( + "SELECT zone_id + FROM " . TABLE_ZONES . " + WHERE zone_country_id = " . (int)$entry_country_id . " + AND zone_name = '" . zen_db_input($entry_state) . "'" + ); + + if (!$zone_query->EOF) { + $entry_zone_id = $zone_query->fields['zone_id']; + } else { + $error = true; + $entry_state_error = true; + } + } + } - if (ACCOUNT_GENDER == 'true') { - $sql_data_array[] = array('fieldName' => 'customers_gender', 'value' => $customers_gender, 'type' => 'stringIgnoreNull'); - } - if (ACCOUNT_DOB == 'true') { - $sql_data_array[] = array('fieldName' => 'customers_dob', 'value' => ($customers_dob == '0001-01-01 00:00:00' ? '0001-01-01 00:00:00' : zen_date_raw($customers_dob)), 'type' => 'date'); - } - if (ACCOUNT_FAX_NUMBER == 'true'){ - $sql_data_array[] = array('fieldName' => 'customers_fax', 'value' => $customers_fax, 'type' => 'stringIgnoreNull'); - } + $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_UPDATE_VALIDATE', [], $error); + + if ($error === false) { + $sql_data_array = [ + [ + 'fieldName' => 'customers_firstname', + 'value' => $customers_firstname, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'customers_lastname', + 'value' => $customers_lastname, + 'type' => 'stringIgnoreNull' + ], + + + [ + 'fieldName' => 'optional_payment_1', + 'value' => $optional_payment_1, + 'type' => 'stringIgnoreNull' + ], + + [ + 'fieldName' => 'customers_email_address', + 'value' => $customers_email_address, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'customers_telephone', + 'value' => $customers_telephone, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'customers_fax', + 'value' => $customers_fax, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'customers_group_pricing', + 'value' => $customers_group_pricing, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'customers_newsletter', + 'value' => $customers_newsletter, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'customers_email_format', + 'value' => $customers_email_format, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'customers_authorization', + 'value' => $customers_authorization, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'customers_referral', + 'value' => $customers_referral, + 'type' => 'stringIgnoreNull' + ], + ]; + + if (ACCOUNT_GENDER === 'true') { + $sql_data_array[] = [ + 'fieldName' => 'customers_gender', + 'value' => $customers_gender, + 'type' => 'stringIgnoreNull' + ]; + } + if (ACCOUNT_DOB === 'true') { + $sql_data_array[] = [ + 'fieldName' => 'customers_dob', + 'value' => ($customers_dob === '0001-01-01 00:00:00') ? + '0001-01-01 00:00:00' : zen_date_raw($customers_dob), + 'type' => 'date' + ]; + } - $db->perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "'"); + $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_CUSTOMER_UPDATE', $customers_id, $sql_data_array); + $db->perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = " . (int)$customers_id . " LIMIT 1"); - $db->Execute("UPDATE " . TABLE_CUSTOMERS_INFO . " + $db->Execute( + "UPDATE " . TABLE_CUSTOMERS_INFO . " SET customers_info_date_account_last_modified = now() - WHERE customers_info_id = " . (int)$customers_id); - if (ACCOUNT_STATE == 'true') { + WHERE customers_info_id = " . (int)$customers_id . " + LIMIT 1" + ); if ($entry_zone_id > 0) { $entry_state = ''; } - } - - $sql_data_array = array(array('fieldName' => 'entry_firstname', 'value' => $customers_firstname, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'entry_lastname', 'value' => $customers_lastname, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'entry_street_address', 'value' => $entry_street_address, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'entry_postcode', 'value' => $entry_postcode, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'entry_city', 'value' => $entry_city, 'type' => 'stringIgnoreNull'), - array('fieldName' => 'entry_country_id', 'value' => $entry_country_id, 'type' => 'integer'), - ); - - if (ACCOUNT_COMPANY == 'true') { - $sql_data_array[] = array('fieldName' => 'entry_company', 'value' => $entry_company, 'type' => 'stringIgnoreNull'); - } - if (ACCOUNT_SUBURB == 'true') { - $sql_data_array[] = array('fieldName' => 'entry_suburb', 'value' => $entry_suburb, 'type' => 'stringIgnoreNull'); - } + $sql_data_array = [ + [ + 'fieldName' => 'entry_firstname', + 'value' => $customers_firstname, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'entry_lastname', + 'value' => $customers_lastname, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'entry_street_address', + 'value' => $entry_street_address, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'entry_postcode', + 'value' => $entry_postcode, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'entry_city', + 'value' => $entry_city, + 'type' => 'stringIgnoreNull' + ], + [ + 'fieldName' => 'entry_country_id', + 'value' => $entry_country_id, + 'type' => 'integer' + ], + ]; + + if (ACCOUNT_COMPANY === 'true') { + $sql_data_array[] = [ + 'fieldName' => 'entry_company', + 'value' => $entry_company, + 'type' => 'stringIgnoreNull' + ]; + } + if (ACCOUNT_SUBURB === 'true') { + $sql_data_array[] = [ + 'fieldName' => 'entry_suburb', + 'value' => $entry_suburb, + 'type' => 'stringIgnoreNull' + ]; + } - if (ACCOUNT_STATE == 'true') { - if ($entry_zone_id > 0) { - $sql_data_array[] = array('fieldName' => 'entry_zone_id', 'value' => $entry_zone_id, 'type' => 'integer'); - $sql_data_array[] = array('fieldName' => 'entry_state', 'value' => '', 'type' => 'stringIgnoreNull'); - } else { - $sql_data_array[] = array('fieldName' => 'entry_zone_id', 'value' => 0, 'type' => 'integer'); - $sql_data_array[] = array('fieldName' => 'entry_state', 'value' => $entry_state, 'type' => 'stringIgnoreNull'); - } - } + if (ACCOUNT_STATE === 'true') { + if ($entry_zone_id > 0) { + $sql_data_array[] = [ + 'fieldName' => 'entry_zone_id', + 'value' => $entry_zone_id, + 'type' => 'integer' + ]; + $sql_data_array[] = [ + 'fieldName' => 'entry_state', + 'value' => '', + 'type' => 'string' + ]; + } else { + $sql_data_array[] = [ + 'fieldName' => 'entry_zone_id', + 'value' => 0, + 'type' => 'integer' + ]; + $sql_data_array[] = [ + 'fieldName' => 'entry_state', + 'value' => $entry_state, + 'type' => 'string' + ]; + } + } - $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_B4_ADDRESS_UPDATE', array('customers_id' => $customers_id, 'address_book_id' => $default_address_id), $sql_data_array); + $zco_notifier->notify( + 'NOTIFY_ADMIN_CUSTOMERS_B4_ADDRESS_UPDATE', + ['customers_id' => $customers_id, 'address_book_id' => $default_address_id], + $sql_data_array + ); + + $db->perform( + TABLE_ADDRESS_BOOK, + $sql_data_array, + 'update', + "customers_id = " . (int)$customers_id . " AND address_book_id = " . (int)$default_address_id . " LIMIT 1" + ); + + if (isset($_POST['customer_groups']) && is_array($_POST['customer_groups'])) { + zen_sync_customer_group_assignments($customers_id, $_POST['customer_groups']); + } - $db->perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$default_address_id . "'"); - zen_record_admin_activity('Customer record updated for customer ID ' . (int)$customers_id, 'notice'); - $zco_notifier->notify('ADMIN_CUSTOMER_UPDATE', (int)$customers_id, $default_address_id, $sql_data_array); - zen_redirect(zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')) . 'cID=' . $customers_id, 'NONSSL')); - } else if ($error == true) { - $cInfo = new objectInfo($_POST); - $processed = true; - } + zen_record_admin_activity('Customer record updated for customer ID ' . (int)$customers_id, 'notice'); - break; - case 'pwdresetconfirm': - if ((int)$customers_id > 0 && isset($_POST['newpassword']) && $_POST['newpassword'] != '' && isset($_POST['newpasswordConfirm']) && $_POST['newpasswordConfirm'] != '') { + // ----- + // The following, seemingly duplicate, notifications enable an auto-loaded admin observer to successfully + // bind to the notification using the 'NOTIFY_ADMIN_CUSTOMER_UPDATE' version. The other notification is kept + // for downward compatibility with existing plugins' observers. + // + $zco_notifier->notify( + 'NOTIFY_ADMIN_CUSTOMER_UPDATE', + $customers_id, + $default_address_id, + $sql_data_array + ); + $zco_notifier->notify( + 'ADMIN_CUSTOMER_UPDATE', + $customers_id, + $default_address_id, + $sql_data_array + ); + + zen_redirect( + zen_href_link( + FILENAME_CUSTOMERS, + zen_get_all_get_params(['cID', 'action']) . 'cID=' . $customers_id, + 'NONSSL' + ) + ); + } elseif ($error === true) { + $cInfo = new objectInfo($_POST); + $cInfo->company = $cInfo->entry_company; + $cInfo->street_address = $cInfo->entry_street_address; + $cInfo->suburb = $cInfo->entry_suburb; + $cInfo->postcode = $cInfo->entry_postcode; + $cInfo->city = $cInfo->entry_city; + $cInfo->state = $cInfo->entry_state; + $processed = true; + } + break; + case 'pwdresetconfirm': + if ($customers_id > 0 && isset($_POST['newpassword']) && $_POST['newpassword'] !== '' && isset($_POST['newpasswordConfirm']) && $_POST['newpasswordConfirm'] !== '') { $password_new = zen_db_prepare_input($_POST['newpassword']); $password_confirmation = zen_db_prepare_input($_POST['newpasswordConfirm']); $error = FALSE; if (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) { $error = true; $messageStack->add_session(ERROR_PWD_TOO_SHORT . '(' . ENTRY_PASSWORD_MIN_LENGTH . ')', 'error'); - } elseif ($password_new != $password_confirmation) { - $error = true; - $messageStack->add_session(ERROR_PASSWORDS_NOT_MATCHING, 'error'); - } - if ($error == FALSE) { - $sql = "SELECT customers_email_address, customers_firstname, customers_lastname - FROM " . TABLE_CUSTOMERS . " - WHERE customers_id = :customersID"; - $sql = $db->bindVars($sql, ':customersID', $customers_id, 'integer'); - $custinfo = $db->Execute($sql); - if ($custinfo->RecordCount() == 0) { - die('ERROR: customer ID not specified. This error should never happen.'); - } - - $sql = "UPDATE " . TABLE_CUSTOMERS . " - SET customers_password = :password - WHERE customers_id = :customersID"; - $sql = $db->bindVars($sql, ':customersID', $customers_id, 'integer'); - $sql = $db->bindVars($sql, ':password', zen_encrypt_password($password_new), 'string'); - $db->Execute($sql); - $sql = "UPDATE " . TABLE_CUSTOMERS_INFO . " - SET customers_info_date_account_last_modified = now() - WHERE customers_info_id = :customersID"; - $sql = $db->bindVars($sql, ':customersID', $customers_id, 'integer'); - $db->Execute($sql); - - $message = EMAIL_CUSTOMER_PWD_CHANGE_MESSAGE . "\n\n" . $password_new . "\n\n\n"; - $html_msg['EMAIL_MESSAGE_HTML'] = nl2br($message); - zen_mail($custinfo->fields['customers_firstname'] . ' ' . $custinfo->fields['customers_lastname'], $custinfo->fields['customers_email_address'], EMAIL_CUSTOMER_PWD_CHANGE_SUBJECT, $message, STORE_NAME, EMAIL_FROM, $html_msg, 'default'); - $userList = zen_get_users($_SESSION['admin_id']); + } elseif ($password_new !== $password_confirmation) { + $error = true; + $messageStack->add_session(ERROR_PASSWORDS_NOT_MATCHING, 'error'); + } + if ($error === false) { + $customer = new Customer($customers_id); + $custinfo = $customer->getData(); + if (empty($custinfo)) { + die('ERROR: customer ID not specified. This error should never happen.'); + } + $customer->setPassword($password_new); + + $message = EMAIL_CUSTOMER_PWD_CHANGE_MESSAGE . "\n\n" . $password_new . "\n\n\n"; + $html_msg['EMAIL_MESSAGE_HTML'] = nl2br($message); + zen_mail( + $custinfo['customers_firstname'] . ' ' . $custinfo['customers_lastname'], + $custinfo['customers_email_address'], + EMAIL_CUSTOMER_PWD_CHANGE_SUBJECT, + $message, + STORE_NAME, + EMAIL_FROM, + $html_msg, + 'default' + ); + $userList = zen_get_users($_SESSION['admin_id']); $userDetails = $userList[0]; $adminUser = $userDetails['id'] . '-' . $userDetails['name'] . ' ' . zen_get_ip_address(); - $message = sprintf(EMAIL_CUSTOMER_PWD_CHANGE_MESSAGE_FOR_ADMIN, $custinfo->fields['customers_firstname'] . ' ' . $custinfo->fields['customers_lastname'] . ' ' . $custinfo->fields['customers_email_address'], $adminUser) . "\n"; - $html_msg['EMAIL_MESSAGE_HTML'] = nl2br($message); - zen_mail($userDetails['name'], $userDetails['email'], EMAIL_CUSTOMER_PWD_CHANGE_SUBJECT, $message, STORE_NAME, EMAIL_FROM, $html_msg, 'default'); + $message = sprintf( + EMAIL_CUSTOMER_PWD_CHANGE_MESSAGE_FOR_ADMIN, + $custinfo['customers_firstname'] . ' ' . $custinfo['customers_lastname'] . ' ' . $custinfo['customers_email_address'], + $adminUser + ) . "\n"; + $html_msg['EMAIL_MESSAGE_HTML'] = nl2br($message); + zen_mail( + $userDetails['name'], + $userDetails['email'], + EMAIL_CUSTOMER_PWD_CHANGE_SUBJECT, + $message, + STORE_NAME, + EMAIL_FROM, + $html_msg, + 'default' + ); $messageStack->add_session(SUCCESS_PASSWORD_UPDATED, 'success'); } - zen_redirect(zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')) . 'cID=' . $customers_id)); - } - break; - case 'deleteconfirm': - $customers_id = zen_db_prepare_input($_POST['cID']); - - $zco_notifier->notify('NOTIFIER_ADMIN_ZEN_CUSTOMERS_DELETE_CONFIRM', array('customers_id' => $customers_id)); - - if (isset($_POST['delete_reviews']) && ($_POST['delete_reviews'] == 'on')) { - $reviews = $db->Execute("SELECT reviews_id - FROM " . TABLE_REVIEWS . " - WHERE customers_id = " . (int)$customers_id); - while (!$reviews->EOF) { - $db->Execute("DELETE FROM " . TABLE_REVIEWS_DESCRIPTION . " - WHERE reviews_id = " . (int)$reviews->fields['reviews_id']); - $reviews->MoveNext(); - } - - $db->Execute("DELETE FROM " . TABLE_REVIEWS . " - WHERE customers_id = '" . (int)$customers_id . "'"); - } else { - $db->Execute("UPDATE " . TABLE_REVIEWS . " - SET customers_id = null - WHERE customers_id = " . (int)$customers_id); - } - - $db->Execute("DELETE FROM " . TABLE_ADDRESS_BOOK . " - WHERE customers_id = " . (int)$customers_id); - - $db->Execute("DELETE FROM " . TABLE_CUSTOMERS . " - WHERE customers_id = " . (int)$customers_id); - - $db->Execute("DELETE FROM " . TABLE_CUSTOMERS_INFO . " - WHERE customers_info_id = " . (int)$customers_id); - - $db->Execute("DELETE FROM " . TABLE_CUSTOMERS_BASKET . " - WHERE customers_id = " . (int)$customers_id); - - $db->Execute("DELETE FROM " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " - WHERE customers_id = " . (int)$customers_id); - - $db->Execute("DELETE FROM " . TABLE_WHOS_ONLINE . " - WHERE customer_id = " . (int)$customers_id); - - $db->Execute("DELETE FROM " . TABLE_PRODUCTS_NOTIFICATIONS . " - WHERE customers_id = " . (int)$customers_id); - - zen_record_admin_activity('Customer with customer ID ' . (int)$customers_id . ' deleted.', 'warning'); - zen_redirect(zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')), 'NONSSL')); - break; + zen_redirect( + zen_href_link( + FILENAME_CUSTOMERS, + zen_get_all_get_params(['cID', 'action']) . 'cID=' . $customers_id + ) + ); + } + break; + case 'deleteconfirm': + $zco_notifier->notify('NOTIFIER_ADMIN_ZEN_CUSTOMERS_DELETE_CONFIRM', ['customers_id' => $customers_id]); + $customer = new Customer($customers_id); + $delete_reviews = (isset($_POST['delete_reviews']) && $_POST['delete_reviews'] === 'on'); + $forget_only = (isset($_POST['delete_type_forget']) && $_POST['delete_type_forget'] === 'forget'); + $customer->delete($delete_reviews, $forget_only); + zen_redirect(zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(['cID', 'action']), 'NONSSL')); + break; default: - $customers = $db->Execute("SELECT c.customers_id, c.customers_gender, c.customers_firstname, c.optional_payment_1, - c.customers_lastname, c.customers_dob, c.customers_email_address, - a.entry_company, a.entry_street_address, a.entry_suburb, - a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, - a.entry_country_id, c.customers_telephone, c.customers_fax, - c.customers_newsletter, c.customers_default_address_id, - c.customers_email_format, c.customers_group_pricing, - c.customers_authorization, c.customers_referral, c.customers_secret - FROM " . TABLE_CUSTOMERS . " c - LEFT JOIN " . TABLE_ADDRESS_BOOK . " a ON c.customers_default_address_id = a.address_book_id - WHERE a.customers_id = c.customers_id - AND c.customers_id = " . (int)$customers_id); - - $reviews = $db->Execute("SELECT COUNT(*) AS number_of_reviews - FROM " . TABLE_REVIEWS . " - WHERE customers_id = " . (int)$customers_id); - - $cInfo_array = array_merge($customers->fields, $reviews->fields); - $cInfo = new objectInfo($cInfo_array); - } + $customer = new Customer($customers_id); + $cInfo = new objectInfo($customer->getData()); + break; + } } ?> -> - - - <?php echo TITLE; ?> - - - - - - - - - - + + + + - +
- -

- '1', 'text' => ENTRY_NEWSLETTER_YES), - array('id' => '0', 'text' => ENTRY_NEWSLETTER_NO)); - ?> - customers_default_address_id); - echo zen_hide_session_id(); - ?> + +

+ '1', 'text' => ENTRY_NEWSLETTER_YES], + ['id' => '0', 'text' => ENTRY_NEWSLETTER_NO] + ]; + + echo zen_draw_form( + 'customers', + FILENAME_CUSTOMERS, + zen_get_all_get_params(['action']) . 'action=update', + 'post', + 'onsubmit="return check_form(customers);" class="form-horizontal"', + true + ); + echo zen_draw_hidden_field('default_address_id', $cInfo->customers_default_address_id); + echo zen_hide_session_id(); +?>
- +
- -
- '; - echo zen_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . MALE; - echo ''; - echo ''; - echo ' ' . ENTRY_GENDER_ERROR; - } else { - echo ''; - echo ''; - echo ''; - } - ?> -
+
+

+
+
+ + + + +
- + '0', 'text' => CUSTOMERS_AUTHORIZATION_0), - array('id' => '1', 'text' => CUSTOMERS_AUTHORIZATION_1), - array('id' => '2', 'text' => CUSTOMERS_AUTHORIZATION_2), - array('id' => '3', 'text' => CUSTOMERS_AUTHORIZATION_3), - array('id' => '4', 'text' => CUSTOMERS_AUTHORIZATION_4), // banned - ); - ?> -
- -
- customers_authorization, 'class="form-control"'); ?> + $customers_authorization_array = [ + ['id' => '0', 'text' => CUSTOMERS_AUTHORIZATION_0], + ['id' => '1', 'text' => CUSTOMERS_AUTHORIZATION_1], + ['id' => '2', 'text' => CUSTOMERS_AUTHORIZATION_2], + ['id' => '3', 'text' => CUSTOMERS_AUTHORIZATION_3], + ['id' => '4', 'text' => CUSTOMERS_AUTHORIZATION_4], // banned + ]; +?> +
+ +
+ customers_authorization, + 'class="form-control" id="customers_authorization"' + ); ?> +
-
-
- -
+
customers_firstname, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', 50) . ' class="form-control"') . ' ' . ENTRY_FIRST_NAME_ERROR; - } else { - echo $cInfo->customers_firstname . zen_draw_hidden_field('customers_firstname'); - } - } else { - echo zen_draw_input_field('customers_firstname', htmlspecialchars($cInfo->customers_firstname, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', 50) . ' class="form-control"', true); - } - ?> + echo zen_draw_label(ENTRY_FIRST_NAME, 'customers_firstname', 'class="col-sm-3 control-label"'); ?> +
+ customers_firstname, + ENT_COMPAT, + CHARSET, + true + ), + zen_set_field_length( + TABLE_CUSTOMERS, + 'customers_firstname', + 50 + ) . ' class="form-control" id="customers_firstname" minlength="' . ENTRY_FIRST_NAME_MIN_LENGTH . '"', + true + ); ?> +
-
-
- -
+
customers_lastname, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', 50) . ' class="form-control"') . ' ' . ENTRY_LAST_NAME_ERROR; - } else { - echo $cInfo->customers_lastname . zen_draw_hidden_field('customers_lastname'); - } - } else { - echo zen_draw_input_field('customers_lastname', htmlspecialchars($cInfo->customers_lastname, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', 50) . ' class="form-control"', true); - } - ?> + echo zen_draw_label(ENTRY_LAST_NAME, 'customers_lastname', 'class="col-sm-3 control-label"'); ?> +
+ customers_lastname, + ENT_COMPAT, + CHARSET, + true + ), + zen_set_field_length( + TABLE_CUSTOMERS, + 'customers_lastname', + 50 + ) . ' class="form-control" id="customers_lastname" minlength="' . ENTRY_LAST_NAME_MIN_LENGTH . '"', + true + ); ?> +
-
- -
- customers_dob == '0001-01-01 00:00:00' ? '' : zen_date_short($cInfo->customers_dob)), 'maxlength="10" class="form-control"') . ' ' . ENTRY_DATE_OF_BIRTH_ERROR; - } else { - echo $cInfo->customers_dob . ((empty($customers_dob) || $customers_dob <= '0001-01-01' || $customers_dob == '0001-01-01 00:00:00') ? 'N/A' : zen_draw_hidden_field('customers_dob')); - } - } else { - echo zen_draw_input_field('customers_dob', ((empty($cInfo->customers_dob) || $cInfo->customers_dob <= '0001-01-01' || $cInfo->customers_dob == '0001-01-01 00:00:00') ? '' : zen_date_short($cInfo->customers_dob)), 'maxlength="10" class="form-control"', true); - } - ?> -
+ +
+ customers_dob) || $cInfo->customers_dob <= '0001-01-01' || $cInfo->customers_dob === '0001-01-01 00:00:00') ? '' : + (($action === 'edit') ? zen_date_short($cInfo->customers_dob) : $cInfo->customers_dob) + ), + 'maxlength="10" class="form-control" id="customers_dob" minlength="' . ENTRY_DOB_MIN_LENGTH . '"', + (ACCOUNT_DOB === 'true' && (int)ENTRY_DOB_MIN_LENGTH !== 0) + ); + echo ($error === true && $entry_date_of_birth_error === true) ? ' ' . ENTRY_DATE_OF_BIRTH_ERROR : '';?> +
-
- -
- customers_email_address, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50) . ' class="form-control"') . ' ' . ENTRY_EMAIL_ADDRESS_ERROR; - } elseif ($entry_email_address_check_error == true) { - echo zen_draw_input_field('customers_email_address', htmlspecialchars($cInfo->customers_email_address, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50) . ' class="form-control"') . ' ' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR; - } elseif ($entry_email_address_exists == true) { - echo zen_draw_input_field('customers_email_address', htmlspecialchars($cInfo->customers_email_address, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50) . ' class="form-control"') . ' ' . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS; - } else { - echo $customers_email_address . zen_draw_hidden_field('customers_email_address'); - } - } else { - echo zen_draw_input_field('customers_email_address', htmlspecialchars($cInfo->customers_email_address, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50) . ' class="form-control"', true); - } - ?> +
+ +
+ customers_email_address, + ENT_COMPAT, + CHARSET, + true + ), + zen_set_field_length( + TABLE_CUSTOMERS, + 'customers_email_address', + 50 + ) . ' class="form-control" id="customers_email_address" minlength="' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . '"', + true + ); + echo ($error === true && $entry_email_address_check_error === true) ? ' ' . ENTRY_EMAIL_ADDRESS_ERROR : ''; ?> +
-
-
- -
- -
-
-
+ + 'The text to include for the field label', + // 'fieldname' => 'label "for" attribute, must match id of input field' + // 'input' => 'The form-related portion of the field', + // ], + // ... + // ]; + // + $additional_fields = []; + $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_CUSTOMER_EDIT', $cInfo, $additional_fields); + if (!empty($additional_fields)) { + foreach ($additional_fields as $current_field) { +?>
- -
- entry_company, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', 50) . ' class="form-control"') . ' ' . ENTRY_COMPANY_ERROR; - } else { - echo $cInfo->entry_company . zen_draw_hidden_field('entry_company'); - } - } else { - echo zen_draw_input_field('entry_company', htmlspecialchars($cInfo->entry_company, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', 50) . ' class="form-control"'); - } - ?> -
+ +
- 'The text to include for the field label', - // 'input' => 'The form-related portion of the field', - // ), - // ... - // ); - // - $additional_fields = array(); - $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_CUSTOMER_EDIT', $cInfo, $additional_fields); - if (is_array($additional_fields)) { - foreach ($additional_fields as $current_field) { - ?> -
- -
-
- -
- + } +?> +
+ +
+ +
+
+ +
+
+
+ +
+ company ?? ''), ENT_COMPAT, CHARSET, true), + zen_set_field_length( + TABLE_ADDRESS_BOOK, + 'entry_company', + 50 + ) . ' class="form-control" id="entry_company" minlength="' . ENTRY_COMPANY_MIN_LENGTH . '"' + ); ?> +
+
+
+
-
- -
+
entry_street_address, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', 50) . ' class="form-control"') . ' ' . ENTRY_STREET_ADDRESS_ERROR; - } else { - echo $cInfo->entry_street_address . zen_draw_hidden_field('entry_street_address'); - } - } else { - echo zen_draw_input_field('entry_street_address', htmlspecialchars($cInfo->entry_street_address, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', 50) . ' class="form-control"', true); - } - ?> + echo zen_draw_label(ENTRY_STREET_ADDRESS, 'entry_street_address', 'class="col-sm-3 control-label"'); ?> +
+ street_address, ENT_COMPAT, CHARSET, true), + zen_set_field_length( + TABLE_ADDRESS_BOOK, + 'entry_street_address', + 50 + ) . ' class="form-control" id="entry_street_address" minlength="' . ENTRY_STREET_ADDRESS_MIN_LENGTH . '"', + true + ); ?> +
-
- +
- -
- entry_suburb, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', 50) . ' class="form-control"') . ' ' . ENTRY_SUBURB_ERROR; - } else { - echo $cInfo->entry_suburb . zen_draw_hidden_field('entry_suburb'); - } - } else { - echo zen_draw_input_field('entry_suburb', htmlspecialchars($cInfo->entry_suburb, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', 50) . ' class="form-control"'); - } - ?> -
-
- -
- -
- entry_postcode, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', 10) . ' class="form-control"') . ' ' . ENTRY_POST_CODE_ERROR; - } else { - echo $cInfo->entry_postcode . zen_draw_hidden_field('entry_postcode'); - } - } else { - echo zen_draw_input_field('entry_postcode', htmlspecialchars($cInfo->entry_postcode, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', 10) . ' class="form-control"', true); - } - ?>
-
-
- -
entry_city, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', 50) . ' class="form-control"') . ' ' . ENTRY_CITY_ERROR; - } else { - echo $cInfo->entry_city . zen_draw_hidden_field('entry_city'); - } - } else { - echo zen_draw_input_field('entry_city', htmlspecialchars($cInfo->entry_city, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', 50) . ' class="form-control"', true); - } - ?>
-
- -
- -
- entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state); - if ($error == true) { - if ($entry_state_error == true) { - if ($entry_state_has_zones == true) { - $zones_array = array(); - $zones_values = $db->Execute("SELECT zone_name - FROM " . TABLE_ZONES . " - WHERE zone_country_id = " . (int)zen_db_input($cInfo->entry_country_id) . " - ORDER BY zone_name"); - - while (!$zones_values->EOF) { - $zones_array[] = array('id' => $zones_values->fields['zone_name'], 'text' => $zones_values->fields['zone_name']); - $zones_values->MoveNext(); - } - echo zen_draw_pull_down_menu('entry_state', $zones_array, '', 'class="form-control"') . ' ' . ENTRY_STATE_ERROR; - } else { - echo zen_draw_input_field('entry_state', htmlspecialchars(zen_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state), ENT_COMPAT, CHARSET, TRUE), 'class="form-control"') . ' ' . ENTRY_STATE_ERROR; - } - } else { - echo $entry_state . zen_draw_hidden_field('entry_zone_id') . zen_draw_hidden_field('entry_state'); - } - } else { - echo zen_draw_input_field('entry_state', htmlspecialchars(zen_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state), ENT_COMPAT, CHARSET, TRUE), 'class="form-control"'); - } - ?> -
+ echo zen_draw_label(ENTRY_SUBURB, 'entry_suburb', 'class="col-sm-3 control-label"'); ?> +
+ suburb, ENT_COMPAT, CHARSET, true), + zen_set_field_length( + TABLE_ADDRESS_BOOK, + 'entry_suburb', + 50 + ) . ' class="form-control" id="entry_suburb"' + ); ?> +
- -
- -
+ +
+ +
+ postcode, ENT_COMPAT, CHARSET, true), + zen_set_field_length( + TABLE_ADDRESS_BOOK, + 'entry_postcode', + 10 + ) . ' class="form-control" id="entry_postcode" minlength="' . ENTRY_POSTCODE_MIN_LENGTH . '"', + true + ); ?> +
+
+
entry_country_id, 'class="form-control"') . ' ' . ENTRY_COUNTRY_ERROR; - } else { - echo zen_get_country_name($cInfo->entry_country_id) . zen_draw_hidden_field('entry_country_id'); - } - } else { - echo zen_draw_pull_down_menu('entry_country_id', zen_get_countries(), $cInfo->entry_country_id, 'class="form-control"'); - } - ?> + echo zen_draw_label(ENTRY_CITY, 'entry_city', 'class="col-sm-3 control-label"'); ?> +
+ city, ENT_COMPAT, CHARSET, true), + zen_set_field_length( + TABLE_ADDRESS_BOOK, + 'entry_city', + 50 + ) . ' class="form-control" id="entry_city" minlength="' . ENTRY_CITY_MIN_LENGTH . '"', + true + ); ?> +
+
+ +
+ +
+country_id, (int)$cInfo->zone_id, $cInfo->state); + $zones_values = zen_get_country_zones((int)$cInfo->country_id); + if (count($zones_values) !== 0) { + $zones_array = []; + foreach ($zones_values as $zones_value) { + $zones_array[] = [ + 'id' => $zones_value['text'], + 'text' => $zones_value['text'] + ]; + } + echo zen_draw_pull_down_menu( + 'entry_state', + $zones_array, + $entry_state, + 'class="form-control" id="entry_state"' + ); + } else { + echo zen_draw_input_field( + 'entry_state', + htmlspecialchars( + zen_get_zone_name( + (int)$cInfo->country_id, + (int)$cInfo->zone_id, + $cInfo->state + ), + ENT_COMPAT, + CHARSET, + true + ), + 'class="form-control" id="entry_state" minlength="' . ENTRY_STATE_MIN_LENGTH . '"' + ); + } +?> +
+
+ +
+ +
+ country_id, + 'class="form-control" id="entry_country_id"' + ); ?> +
-
-
+
+ +
-
- -
- customers_telephone, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', 15) . ' class="form-control"') . ' ' . ENTRY_TELEPHONE_NUMBER_ERROR; - } else { - echo $cInfo->customers_telephone . zen_draw_hidden_field('customers_telephone'); - } - } else { - echo zen_draw_input_field('customers_telephone', htmlspecialchars($cInfo->customers_telephone, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', 15) . ' class="form-control"', true); - } - ?> +
+ +
+ customers_telephone, + ENT_COMPAT, + CHARSET, + true + ), + zen_set_field_length( + TABLE_CUSTOMERS, + 'customers_telephone', + 15 + ) . ' class="form-control" id="customers_telephone" minlength="' . ENTRY_TELEPHONE_MIN_LENGTH . '"', + true + ); ?> +
-
- +
-
- customers_fax . zen_draw_hidden_field('customers_fax'); - } else { - echo zen_draw_input_field('customers_fax', htmlspecialchars($cInfo->customers_fax, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_fax', 15) . ' class="form-control"'); - } - ?> -
+
+customers_fax . zen_draw_hidden_field('customers_fax'); + } else { + echo zen_draw_input_field( + 'customers_fax', + htmlspecialchars( + (string)$cInfo->customers_fax, + ENT_COMPAT, + CHARSET, + true + ), + zen_set_field_length( + TABLE_CUSTOMERS, + 'customers_fax', + 15 + ) . ' class="form-control" id="customers_fax"' + ); + } +?> +
- + +
+
+
-
-
- -
- customers_email_format) { - echo $customers_email_format . zen_draw_hidden_field('customers_email_format'); - } - } else { - $email_pref_text = ($cInfo->customers_email_format == 'TEXT') ? true : false; - $email_pref_html = !$email_pref_text; - echo ''; - echo ''; - } - ?> +
+
+

+
+
+customers_email_format) { + echo $customers_email_format . zen_draw_hidden_field('customers_email_format'); + } + } else { + $email_pref_text = ($cInfo->customers_email_format === 'TEXT'); + $email_pref_html = !$email_pref_text; +?> + + + +
-
-
- -
- customers_newsletter == '1') { - echo ENTRY_NEWSLETTER_YES; - } else { - echo ENTRY_NEWSLETTER_NO; - } - echo zen_draw_hidden_field('customers_newsletter'); - } else { - echo zen_draw_pull_down_menu('customers_newsletter', $newsletter_array, (($cInfo->customers_newsletter == '1') ? '1' : '0'), 'class="form-control"'); - } - ?> +
+ +
+customers_newsletter === '1') { + echo ENTRY_NEWSLETTER_YES; + } else { + echo ENTRY_NEWSLETTER_NO; + } + echo zen_draw_hidden_field('customers_newsletter'); + } else { + echo zen_draw_pull_down_menu( + 'customers_newsletter', + $newsletter_array, + ($cInfo->customers_newsletter === '1') ? '1' : '0', + 'class="form-control" id="customers_newsletter"' + ); + } +?> +
-
-
- -
- customers_group_pricing) { - $group_query = $db->Execute("SELECT group_name, group_percentage - FROM " . TABLE_GROUP_PRICING . " - WHERE group_id = " . (int)$cInfo->customers_group_pricing); - echo $group_query->fields['group_name'] . ' ' . $group_query->fields['group_percentage'] . '%'; - } else { - echo ENTRY_NONE; - } - echo zen_draw_hidden_field('customers_group_pricing', $cInfo->customers_group_pricing); - } else { - $group_array_query = $db->execute("SELECT group_id, group_name, group_percentage - FROM " . TABLE_GROUP_PRICING); - $group_array[] = array('id' => 0, 'text' => TEXT_NONE); - foreach ($group_array_query as $item) { - $group_array[] = array( - 'id' => $item['group_id'], - 'text' => $item['group_name'] . ' ' . $item['group_percentage'] . '%'); - } - echo zen_draw_pull_down_menu('customers_group_pricing', $group_array, $cInfo->customers_group_pricing, 'class="form-control"'); - } - ?> +
+ +
+customers_group_pricing) { + $group_query = $db->Execute( + "SELECT group_name, group_percentage + FROM " . TABLE_GROUP_PRICING . " + WHERE group_id = " . (int)$cInfo->customers_group_pricing, + 1 + ); + echo $group_query->fields['group_name'] . ' ' . $group_query->fields['group_percentage'] . '%'; + } else { + echo ENTRY_NONE; + } + echo zen_draw_hidden_field('customers_group_pricing', $cInfo->customers_group_pricing); + } else { + $group_array_query = $db->Execute( + "SELECT group_id, group_name, group_percentage + FROM " . TABLE_GROUP_PRICING + ); + $group_array[] = [ + 'id' => 0, + 'text' => TEXT_NONE + ]; + foreach ($group_array_query as $item) { + $group_array[] = [ + 'id' => $item['group_id'], + 'text' => $item['group_name'] . ' ' . $item['group_percentage'] . '%' + ]; + } + echo zen_draw_pull_down_menu( + 'customers_group_pricing', + $group_array, + $cInfo->customers_group_pricing, + 'class="form-control" id="customers_group_pricing"' + ); + } +?> +
-
-
- -
- customers_referral, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', 15) . ' class="form-control"'); ?> +
+ +
+ customers_referral, + ENT_COMPAT, + CHARSET, + true + ), + zen_set_field_length( + TABLE_CUSTOMERS, + 'customers_referral', + 15 + ) . ' class="form-control" id="customers_referral"' + ); ?> +
+
+
+
+

+
+
+
+
+ +customers_id); + foreach (zen_get_all_customer_groups() as $group) { +?> +
+ +
+ +
+
+
-
-
-
-
-
- '; ?> -
-
- -
-
- -

-
'); ?>
- -
- -
-
+
-
- - ' . IMAGE_RESET . '  '; - } - echo HEADING_TITLE_SEARCH_DETAIL . ' ' . zen_draw_input_field('search') . zen_hide_session_id(); - if (isset($_GET['search']) && zen_not_null($_GET['search'])) { - $keywords = zen_db_prepare_input($_GET['search']); - echo '
' . TEXT_INFO_SEARCH_DETAIL_FILTER . zen_output_string_protected($keywords); - } - ?> - '; ?> + +
- '; ?> + +
+
+ +
+
+ +

+

+
' + ); ?> +
+ +
+ +
+ + + +
+
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + 'The content for the column', + // 'class' => 'Any additional class for the display', + // 'parms' => 'Any additional parameters for the display', + // ], + // ... + // ]; + // + // The 'content' element is required; the 'class' and 'parms' are optional. + // + $additional_headings = []; + $additional_heading_count = 0; + $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_LISTING_HEADER', [], $additional_headings); + if (is_array($additional_headings) && count($additional_headings) !== 0) { + $additional_heading_count = count($additional_headings); + foreach ($additional_headings as $heading_data) { + $additional_class = (isset($heading_data['class'])) ? (' ' . $heading_data['class']) : ''; + $additional_parms = (isset($heading_data['parms'])) ? (' ' . $heading_data['parms']) : ''; + $heading_content = $heading_data['content']; +?> + + -
-
-
+ + +   + + ' . TABLE_HEADING_LASTNAME . '' : + TABLE_HEADING_LASTNAME); ?> +
+ + ' . TEXT_ASC . '' : + '' . TEXT_ASC . ''; ?> +   + + ' . TEXT_DESC . '' : + '' . TEXT_DESC . ''; ?> + +
+ ' . TABLE_HEADING_FIRSTNAME . '' : + TABLE_HEADING_FIRSTNAME; ?> +
+ + ' . TEXT_ASC . '' : + '' . TEXT_ASC . ''; ?> +   + + ' . TEXT_DESC . '' : + '' . TEXT_DESC . ''; ?> + +
+ ' . TABLE_HEADING_COMPANY . '' : + TABLE_HEADING_COMPANY; ?> +
+ + ' . TEXT_ASC . '' : + '' . TEXT_ASC . ''; ?> +   + + ' . TEXT_DESC . '' : + '' . TEXT_DESC . ''; ?> + +
+ + > + +
- - - - - - - 'The content for the column', - // 'class' => 'Any additional class for the display', - // 'parms' => 'Any additional parameters for the display', - // ), - // ... - // ); - // - // The 'content' element is required; the 'class' and 'parms' are optional. - // - $additional_headings = array(); - $additional_heading_count = 0; - $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_LISTING_HEADER', array(), $additional_headings); - if (is_array($additional_headings) && count($additional_headings) != 0) { - $additional_heading_count = count($additional_headings); - foreach ($additional_headings as $heading_data) { - $additional_class = (isset($heading_data['class'])) ? (' ' . $heading_data['class']) : ''; - $additional_parms = (isset($heading_data['parms'])) ? (' ' . $heading_data['parms']) : ''; - $heading_content = $heading_data['content']; - ?> - - - - - - - - - - - - - - - - - - - $v) { - $sql_add = " (c.customers_lastname like '%:part%' - or c.customers_firstname like '%:part%' - or c.customers_email_address like '%:part%' - or c.customers_telephone rlike ':keywords:' - or a.entry_company rlike ':keywords:' - or a.entry_street_address rlike ':keywords:' - or a.entry_city rlike ':keywords:' - or a.entry_postcode rlike ':keywords:')"; - if ($k != 0) { - $sql_add = ' and ' . $sql_add; - } - $sql_add = $db->bindVars($sql_add, ':part', $v, 'noquotestring'); - $sql_add = $db->bindVars($sql_add, ':keywords:', $v, 'regexp'); - $search .= $sql_add; - } - } - $new_fields = ''; - - $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_LISTING_NEW_FIELDS', array(), $new_fields, $disp_order); - - $customers_query_raw = "SELECT c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_group_pricing, c.customers_telephone, c.customers_authorization, c.customers_referral, c.customers_secret, - a.entry_country_id, a.entry_company, a.entry_company, a.entry_street_address, a.entry_city, a.entry_postcode, - ci.customers_info_date_of_last_logon, ci.customers_info_date_account_created - " . $new_fields . ", - cgc.amount - from " . TABLE_CUSTOMERS . " c - left join " . TABLE_CUSTOMERS_INFO . " ci on c.customers_id= ci.customers_info_id - left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . " - left join " . TABLE_COUPON_GV_CUSTOMER . " cgc on c.customers_id = cgc.customer_id - " . $search . " - order by " . $disp_order; - -// Split Page -// reset page when page is unknown - if (($_GET['page'] == '' || $_GET['page'] == '1') && !empty($_GET['cID'])) { - $check_page = $db->Execute($customers_query_raw); - $check_count = 1; - if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER) { - foreach ($check_page as $item) { - if ($item['customers_id'] == $_GET['cID']) { - break; - } - $check_count++; - } - $_GET['page'] = round((($check_count / MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER) + (fmod_round($check_count, MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER) != 0 ? .5 : 0)), 0); -// zen_redirect(zen_href_link(FILENAME_CUSTOMERS, 'cID=' . $_GET['cID'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'NONSSL')); - } else { - $_GET['page'] = 1; - } - } - - $customers_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER, $customers_query_raw, $customers_query_numrows); - $customers = $db->Execute($customers_query_raw); - foreach ($customers as $customer) { - $sql = "SELECT customers_info_date_account_created as date_account_created, - customers_info_date_account_last_modified as date_account_last_modified, - customers_info_date_of_last_logon as date_last_logon, - customers_info_number_of_logons as number_of_logons - FROM " . TABLE_CUSTOMERS_INFO . " - WHERE customers_info_id = " . (int)$customer['customers_id']; - $info = $db->Execute($sql); - - // if no record found, create one to keep database in sync - if ($info->RecordCount() == 0) { - $insert_sql = "INSERT INTO " . TABLE_CUSTOMERS_INFO . " (customers_info_id) - VALUES ('" . (int)$customer['customers_id'] . "')"; - $db->Execute($insert_sql); - $info = $db->Execute($sql); - } - - if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $customer['customers_id']))) && !isset($cInfo)) { - $country = $db->Execute("SELECT countries_name - FROM " . TABLE_COUNTRIES . " - WHERE countries_id = " . (int)$customer['entry_country_id']); + } +?> + + + + + - $reviews = $db->Execute("SELECT COUNT(*) AS number_of_reviews - FROM " . TABLE_REVIEWS . " - WHERE customers_id = " . (int)$customer['customers_id']); + + + + + + + + + +notify( + 'NOTIFY_ADMIN_CUSTOMERS_LISTING_NEW_FIELDS', + [], + $new_fields, + $disp_order + ); + + $customers_query_raw = + "SELECT c.customers_id " . $new_fields . ", cgc.amount + FROM " . TABLE_CUSTOMERS . " c + LEFT JOIN " . TABLE_CUSTOMERS_INFO . " ci ON c.customers_id= ci.customers_info_id + LEFT JOIN " . TABLE_ADDRESS_BOOK . " a ON c.customers_id = a.customers_id AND c.customers_default_address_id = a.address_book_id + LEFT JOIN " . TABLE_COUPON_GV_CUSTOMER . " cgc ON c.customers_id = cgc.customer_id + " . $search . " + ORDER BY " . $disp_order; + + // Split Page + // reset page when page is unknown + if ((empty($_GET['page']) || $_GET['page'] === '1') && !empty($_GET['cID'])) { + $check_page = $db->Execute($customers_query_raw); + $check_count = 0; + if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER) { + foreach ($check_page as $item) { + if ($item['customers_id'] === $_GET['cID']) { + break; + } + $check_count++; + } + $_GET['page'] = round( + (($check_count / MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER) + (fmod_round( + $check_count, + MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER + ) != 0 ? .5 : 0)), + 0 + ); + // zen_redirect(zen_href_link(FILENAME_CUSTOMERS, 'cID=' . $_GET['cID'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'NONSSL')); + } else { + $_GET['page'] = '1'; + } + } - $customer_info = array_merge($country->fields, $info->fields, $reviews->fields); + $customers_split = new splitPageResults( + $_GET['page'], + MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER, + $customers_query_raw, + $customers_query_numrows + ); + $customers = $db->Execute($customers_query_raw); + foreach ($customers as $result) { + $cust = new Customer($result['customers_id']); + $customer = $cust->getData(); + if ((!isset($_GET['cID']) || (int)$_GET['cID'] === $customer['customers_id']) && !isset($cInfo)) { + $cInfo = new objectInfo($customer); + } - $cInfo_array = array_merge($customer, $customer_info); - $cInfo = new objectInfo($cInfo_array); - } + if (isset($cInfo) && is_object($cInfo) && ($customer['customers_id'] === (int)$cInfo->customers_id)) { +?> + + + +Execute("SELECT group_name, group_percentage - FROM " . TABLE_GROUP_PRICING . " - WHERE group_id = " . (int)$customer['customers_group_pricing']); + $zc_address_book_count = count($customer['addresses']); +?> + + + + + + + + +RecordCount() < 1) { - $group_name_entry = TEXT_NONE; - } else { - $group_name_entry = $group_query->fields['group_name']; - } + // ----- + // If a plugin has additional columns to add to the display, it attaches to both this "listing element" and (see above) + // the "listing heading" notifications. + // + // For the element "insert", the observer sets the $additional_headings to include a simple array of arrays. Each + // entry contains the information for one element column in the format: + // + // $additional_columns = [ + // [ + // 'content' => 'The content for the column', + // 'class' => 'Any additional class for the display', + // 'parms' => 'Any additional parameters for the display', + // ], + // ... + // ]; + // + // The 'content' element is required; the 'class' and 'parms' are optional. + // + $additional_columns = []; + $zco_notifier->notify( + 'NOTIFY_ADMIN_CUSTOMERS_LISTING_ELEMENT', + $customer, + $additional_columns + ); + if (is_array($additional_columns) && count($additional_columns) !== 0) { + if (count($additional_columns) !== $additional_heading_count) { + trigger_error( + "Mismatched additional column heading ($additional_heading_count) and column element (" . count( + $additional_columns + ) . ") counts detected for the Customers listing.", + E_USER_WARNING + ); + } + foreach ($additional_columns as $column_data) { + $additional_class = (isset($column_data['class'])) ? (' ' . $column_data['class']) : ''; + $additional_parms = (isset($column_data['parms'])) ? (' ' . $column_data['parms']) : ''; + $element_content = $column_data['content']; +?> + + + + + + + + + + + + + +
- - - ' . TABLE_HEADING_LASTNAME . '' : TABLE_HEADING_LASTNAME); ?>
- Asc' : 'Asc'); ?>  - Desc' : 'Desc'); ?> -
- ' . TABLE_HEADING_FIRSTNAME . '' : TABLE_HEADING_FIRSTNAME); ?>
- Asc' : 'Asc'); ?>  - Desc' : 'Desc'); ?> -
- ' . TABLE_HEADING_COMPANY . '' : TABLE_HEADING_COMPANY); ?>
- Asc' : 'Asc'); ?>  - Desc' : 'Desc'); ?> -
> - ' . TABLE_HEADING_ACCOUNT_CREATED . '' : TABLE_HEADING_ACCOUNT_CREATED); ?>
- Asc' : 'Asc'); ?>  - Desc' : 'Desc'); ?> -
- ' . TABLE_HEADING_LOGIN . '' : TABLE_HEADING_LOGIN); ?>
- Asc' : 'Asc'); ?>  - Desc' : 'Desc'); ?> -
- ' . TABLE_HEADING_PRICING_GROUP . '' : TABLE_HEADING_PRICING_GROUP); ?>
- Asc' : 'Asc'); ?>  - Desc' : 'Desc'); ?> -
- ' . TABLE_HEADING_GV_AMOUNT . '' : TABLE_HEADING_GV_AMOUNT); ?>
- Asc' : 'Asc'); ?>  - Desc' : 'Desc'); ?> -
- ' . TABLE_HEADING_AUTHORIZATION_APPROVAL . '' : TABLE_HEADING_AUTHORIZATION_APPROVAL); ?>
- Asc' : 'Asc'); ?>  - Desc' : 'Desc'); ?> -
+ ' . TABLE_HEADING_ACCOUNT_CREATED . '' : + TABLE_HEADING_ACCOUNT_CREATED; ?> +
+ + ' . TEXT_ASC . '' : + '' . TEXT_ASC . ''; ?> +   + + ' . TEXT_DESC . '' : + '' . TEXT_DESC . ''; ?> + +
+ ' . TABLE_HEADING_LOGIN . '' : + TABLE_HEADING_LOGIN; ?> +
+ + ' . TEXT_ASC . '' : + '' . TEXT_ASC . ''; ?> +   + + ' . TEXT_DESC . '' : + '' . TEXT_DESC . ''; ?> + +
+ ' . TABLE_HEADING_PRICING_GROUP . '' : + TABLE_HEADING_PRICING_GROUP; ?> +
+ + ' . TEXT_ASC . '' : + '' . TEXT_ASC . ''; ?> +   + + ' . TEXT_DESC . '' : + '' . TEXT_DESC . ''; ?> + +
+ ' . TABLE_HEADING_GV_AMOUNT . '' : + TABLE_HEADING_GV_AMOUNT; ?> +
+ + ' . TEXT_ASC . '' : + '' . TEXT_ASC . ''; ?> +   + + ' . TEXT_DESC . '' : + '' . TEXT_DESC . ''; ?> + +
+ ' . TABLE_HEADING_AUTHORIZATION_APPROVAL . '' : + TABLE_HEADING_AUTHORIZATION_APPROVAL; ?> +
+ + ' . TEXT_ASC . '' : + '' . TEXT_ASC . ''; ?> +   + + ' . TEXT_DESC . '' : + '' . TEXT_DESC . ''; ?> + +
+ +
+ > + + + + + + + + + format($customer['gv_balance']); ?> + + + + + '; ?> + +customers_id)) { +?> + + + + + + +
+
- if (isset($cInfo) && is_object($cInfo) && ($customer['customers_id'] == $cInfo->customers_id)) { - echo ' ' . "\n"; - } else { - echo ' ' . "\n"; - } +
+ '

' . TEXT_INFO_HEADING_DELETE_CUSTOMER . '

']; + + $contents = [ + 'form' => + zen_draw_form( + 'customers', + FILENAME_CUSTOMERS, + zen_get_all_get_params(['cID', 'action', 'search']) . 'action=deleteconfirm', + 'post', + '', + true + ) . + zen_draw_hidden_field('cID', $cInfo->customers_id) + ]; + $contents[] = [ + 'text' => + TEXT_DELETE_INTRO . '

' . + '' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '' + ]; + if (isset($cInfo->number_of_reviews) && $cInfo->number_of_reviews > 0) { + $contents[] = [ + 'text' => + '
' . + zen_draw_checkbox_field('delete_reviews', 'on', true) . + ' ' . + sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews) + ]; + } + $contents[] = [ + 'align' => 'text-center', + 'text' => + '
' . + '' . + ' ' . + '' . + ' ' . + '' . IMAGE_CANCEL . + '' + ]; + break; + case 'pwreset': + $heading[] = [ + 'text' => '

' . TEXT_INFO_HEADING_RESET_CUSTOMER_PASSWORD . '

' + ]; + $contents = [ + 'form' => + zen_draw_form( + 'customers', + FILENAME_CUSTOMERS, + zen_get_all_get_params(['cID', 'action']) . 'action=pwdresetconfirm', + 'post', + 'id="pReset" class="form-horizontal"', + true + ) . + zen_draw_hidden_field('cID', $cInfo->customers_id) + ]; + $contents[] = [ + 'text' => + TEXT_PWDRESET_INTRO . + '

' . + '' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '' + ]; + $contents[] = [ + 'text' => + '
' . + zen_draw_label(TEXT_CUST_NEW_PASSWORD, 'newpassword', 'class="control-label"') . + zen_draw_input_field( + 'newpassword', + '', + 'maxlength="40" autofocus="autofocus" autocomplete="off" id="newpassword" class="form-control"', + false, + 'text', + false + ) + ]; + $contents[] = [ + 'text' => + '
' . + zen_draw_label(TEXT_CUST_CONFIRM_PASSWORD, 'newpasswordConfirm', 'class="control-label"') . + zen_draw_input_field( + 'newpasswordConfirm', + '', + 'maxlength="40" autocomplete="off" id="newpasswordConfirm" class="form-control"', + false, + 'text', + false + ) + ]; + $contents[] = [ + 'align' => 'text-center', + 'text' => + '
' . + '' . + ' ' . + '' . IMAGE_CANCEL . + '' + ]; + break; + default: + if (isset($_GET['search'])) { + $_GET['search'] = zen_output_string_protected($_GET['search']); + } + if (isset($cInfo) && is_object($cInfo)) { + $heading[] = [ + 'text' => + '

' . + TABLE_HEADING_ID . $cInfo->customers_id . ' ' . + $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . + '

' . + '
' . + $cInfo->customers_email_address + ]; + + $contents[] = [ + 'align' => 'text-center', + 'text' => + '' . IMAGE_EDIT . + '' . + ' ' . + '' . IMAGE_DELETE . + '' + ]; + $contents[] = [ + 'align' => 'text-center', + 'text' => + ($cInfo->number_of_orders > 0 ? + '' . IMAGE_ORDERS . + '' : + '' + ) . + ' ' . + '' . IMAGE_EMAIL . + '' + ]; + $contents[] = [ + 'align' => 'text-center', + 'text' => + '' . IMAGE_RESET_PWD . + '' + ]; - $zc_address_book_count_list = zen_get_customers_address_book($customer['customers_id']); - $zc_address_book_count = $zc_address_book_count_list->RecordCount(); - ?> - 0 ? '&page=' . $_GET['page'] : '')), $zc_address_book_count)); ?> - - - - 'The content for the column', - // 'class' => 'Any additional class for the display', - // 'parms' => 'Any additional parameters for the display', - // ), - // ... - // ); - // - // The 'content' element is required; the 'class' and 'parms' are optional. + // Give an observer the opportunity to provide an override to the "Place Order" button. // - $additional_columns = array(); - $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_LISTING_ELEMENT', $customer, $additional_columns); - if (is_array($additional_columns) && count($additional_columns) != 0) { - if (count($additional_columns) != $additional_heading_count) { - trigger_error("Mismatched additional column heading ($additional_heading_count) and column element (" . count($additional_columns) . ") counts detected for the Customers listing.", E_USER_WARNING); - } - foreach ($additional_columns as $column_data) { - $additional_class = (isset($column_data['class'])) ? (' ' . $column_data['class']) : ''; - $additional_parms = (isset($column_data['parms'])) ? (' ' . $column_data['parms']) : ''; - $element_content = $column_data['content']; - ?> - > - - fields['date_account_created']); ?> - - - - format($customer['amount']); ?> - - - - - - - - - - '; ?> - - customers_id)) { - echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); - } else { - echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; - } - ?>  - - - - -
-
- '

' . TEXT_INFO_HEADING_DELETE_CUSTOMER . '

'); - - $contents = array('form' => zen_draw_form('customers', FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action', 'search')) . 'action=deleteconfirm', 'post', '', true) . zen_draw_hidden_field('cID', $cInfo->customers_id)); - $contents[] = array('text' => TEXT_DELETE_INTRO . '

' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . ''); - if (isset($cInfo->number_of_reviews) && ($cInfo->number_of_reviews) > 0) - $contents[] = array('text' => '
' . zen_draw_checkbox_field('delete_reviews', 'on', true) . ' ' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews)); - $contents[] = array('align' => 'text-center', 'text' => '
' . IMAGE_CANCEL . ''); - break; - case 'pwreset': - $heading[] = array('text' => '

' . TEXT_INFO_HEADING_RESET_CUSTOMER_PASSWORD . '

'); - $contents = array('form' => zen_draw_form('customers', FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action', 'search')) . 'action=pwdresetconfirm', 'post', 'id="pReset" class="form-horizontal"', true) . zen_draw_hidden_field('cID', $cInfo->customers_id)); - $contents[] = array('text' => TEXT_PWDRESET_INTRO . '

' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . ''); - $contents[] = array('text' => '
' . zen_draw_label(TEXT_CUST_NEW_PASSWORD, 'newpassword', 'class="control-label"') . zen_draw_input_field('newpassword', '', 'maxlength="40" autofocus="autofocus" autocomplete="off" id="newpassword" class="form-control"', false, 'text', false)); - $contents[] = array('text' => '
' . zen_draw_label(TEXT_CUST_CONFIRM_PASSWORD, 'newpasswordConfirm', 'class="control-label"') . zen_draw_input_field('newpasswordConfirm', '', 'maxlength="40" autocomplete="off" id="newpasswordConfirm" class="form-control"', false, 'text', false)); - $contents[] = array('align' => 'text-center', 'text' => '
' . IMAGE_CANCEL . ''); - break; - default: - if (isset($_GET['search'])) { - $_GET['search'] = zen_output_string_protected($_GET['search']); - } - if (isset($cInfo) && is_object($cInfo)) { - $customers_orders = $db->Execute("SELECT o.orders_id, o.date_purchased, o.order_total, o.currency, o.currency_value, - cgc.amount - FROM " . TABLE_ORDERS . " o - LEFT JOIN " . TABLE_COUPON_GV_CUSTOMER . " cgc ON o.customers_id = cgc.customer_id - WHERE customers_id = " . (int)$cInfo->customers_id . " - ORDER BY date_purchased desc"); - - $heading[] = array('text' => '

' . TABLE_HEADING_ID . $cInfo->customers_id . ' ' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '

' . '
' . $cInfo->customers_email_address); - - $contents[] = array('align' => 'text-center', 'text' => '' . IMAGE_EDIT . ' ' . IMAGE_DELETE . ''); - $contents[] = array('align' => 'text-center', 'text' => ($customers_orders->RecordCount() != 0 ? '' . IMAGE_ORDERS . '' : '') . ' ' . IMAGE_EMAIL . ''); - $contents[] = array('align' => 'text-center', 'text' => '' . IMAGE_RESET_PWD . ''); - // ----- - // Give an observer the opportunity to provide an override to the "Place Order" button. - // - $place_order_override = false; - $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_PLACE_ORDER_BUTTON', $cInfo, $contents, $place_order_override); - if ($place_order_override === false && zen_admin_authorized_to_place_order()) { - $login_form_start = '
'; - $hiddenFields = zen_draw_hidden_field('email_address', $cInfo->customers_email_address); + $place_order_override = false; + $zco_notifier->notify( + 'NOTIFY_ADMIN_CUSTOMERS_PLACE_ORDER_BUTTON', + $cInfo, + $contents, + $place_order_override + ); + if ($place_order_override === false && zen_admin_authorized_to_place_order()) { + $login_form_start = + ''; + $hiddenFields = zen_draw_hidden_field('email_address', $cInfo->customers_email_address); $hiddenFields .= zen_draw_hidden_field('empadminlogin', 'allowed'); - if (defined('EMP_LOGIN_AUTOMATIC') && EMP_LOGIN_AUTOMATIC == 'true' && ENABLE_SSL_CATALOG == 'true') { - $secret = zen_update_customers_secret($cInfo->customers_id); - $timestamp = time(); - $hmacpostdata = ['cid' => $cInfo->customers_id, 'aid' => $_SESSION['admin_id'], - 'email_address' => $cInfo->customers_email_address]; - $hmacUri = zen_create_hmac_uri($hmacpostdata, $secret); - $login_form_start = ''; - $hiddenFields .= zen_draw_hidden_field('aid', $_SESSION['admin_id']); - $hiddenFields .= zen_draw_hidden_field('cid', $cInfo->customers_id); - $hiddenFields .= zen_draw_hidden_field('timestamp', $timestamp, 'id="emp-timestamp"'); - } - $contents[] = array( - 'align' => 'text-center', - 'text' => $login_form_start . $hiddenFields . '
' - ); + if (defined('EMP_LOGIN_AUTOMATIC') && EMP_LOGIN_AUTOMATIC === 'true' && ENABLE_SSL_CATALOG === 'true') { + $secret = zen_update_customers_secret($cInfo->customers_id); + $timestamp = time(); + $hmacpostdata = [ + 'cid' => $cInfo->customers_id, + 'aid' => $_SESSION['admin_id'], + 'email_address' => $cInfo->customers_email_address + ]; + $hmacUri = zen_create_hmac_uri($hmacpostdata, $secret); + $login_form_start = '
'; + $hiddenFields .= + zen_draw_hidden_field('aid', $_SESSION['admin_id']) . + zen_draw_hidden_field('cid', $cInfo->customers_id) . + zen_draw_hidden_field('timestamp', $timestamp, 'id="emp-timestamp"'); } - $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_MENU_BUTTONS', $cInfo, $contents); - - $contents[] = array('text' => '
' . TEXT_DATE_ACCOUNT_CREATED . ' ' . zen_date_short($cInfo->date_account_created)); - $contents[] = array('text' => '
' . TEXT_DATE_ACCOUNT_LAST_MODIFIED . ' ' . zen_date_short($cInfo->date_account_last_modified)); - $contents[] = array('text' => '
' . TEXT_INFO_DATE_LAST_LOGON . ' ' . zen_date_short($cInfo->date_last_logon)); - $contents[] = array('text' => '
' . TEXT_INFO_NUMBER_OF_LOGONS . ' ' . $cInfo->number_of_logons); - - $customer_gv_balance = zen_user_has_gv_balance($cInfo->customers_id); - $contents[] = array('text' => '
' . TEXT_INFO_GV_AMOUNT . ' ' . $currencies->format($customer_gv_balance)); - - $contents[] = array('text' => '
' . TEXT_INFO_NUMBER_OF_ORDERS . ' ' . $customers_orders->RecordCount()); - if ($customers_orders->RecordCount() != 0) { - - $lifetime_value = 0; - $last_order = array( - 'date_purchased' => $customers_orders->fields['date_purchased'], - 'order_total' => $customers_orders->fields['order_total'], - 'currency' => $customers_orders->fields['currency'], - 'currency_value' => $customers_orders->fields['currency_value'], - ); - foreach($customers_orders as $result) { - $lifetime_value+= ($result['order_total'] * $result['currency_value']); - } - $contents[] = array('text' => TEXT_INFO_LIFETIME_VALUE. ' ' . $currencies->format($lifetime_value)); - $contents[] = array('text' => TEXT_INFO_LAST_ORDER . ' ' . zen_date_short($last_order['date_purchased']) . '
' . TEXT_INFO_ORDERS_TOTAL . ' ' . $currencies->format($last_order['order_total'], true, $last_order['currency'], $last_order['currency_value'])); - } - $contents[] = array('text' => '
' . TEXT_INFO_COUNTRY . ' ' . $cInfo->countries_name); - $contents[] = array('text' => '
' . TEXT_INFO_NUMBER_OF_REVIEWS . ' ' . $cInfo->number_of_reviews); - $contents[] = array('text' => '
' . CUSTOMERS_REFERRAL . ' ' . $cInfo->customers_referral); - } - break; - } - $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_MENU_BUTTONS_END', (isset($cInfo) ? $cInfo : new stdClass), $contents); + $contents[] = [ + 'align' => 'text-center', + 'text' => + $login_form_start . + $hiddenFields . + '' . + '
' + ]; + } - if ((zen_not_null($heading)) && (zen_not_null($contents))) { - $box = new box; - echo $box->infoBox($heading, $contents); - } - ?> -
-
-
- - - - - - - - - - notify('NOTIFY_ADMIN_CUSTOMERS_MENU_BUTTONS', $cInfo, $contents); + + $contents[] = [ + 'text' => + '
' . + TEXT_DATE_ACCOUNT_CREATED . ' ' . + zen_date_short($cInfo->date_account_created) + ]; + if (!empty($cInfo->registration_ip)) { + $whois_url = 'https://whois.domaintools.com/' . $cInfo->registration_ip; + $lookup_link = ' '; + $contents[] = [ + 'text' => '
' . TEXT_REGISTRATION_IP . ' ' . $lookup_link . $cInfo->registration_ip . '
' + ]; + } + $contents[] = [ + 'text' => + '
' . + TEXT_DATE_ACCOUNT_LAST_MODIFIED . ' ' . + zen_date_short($cInfo->date_account_last_modified) + ]; + $contents[] = [ + 'text' => + '
' . + TEXT_INFO_DATE_LAST_LOGON . ' ' . + zen_date_short($cInfo->date_of_last_login) + ]; + if (!empty($cInfo->last_login_ip)) { + $contents[] = [ + 'text' => + '
' . + TEXT_LAST_LOGIN_IP . ' ' . + $cInfo->last_login_ip + ]; + } + $contents[] = [ + 'text' => + '
' . + TEXT_INFO_NUMBER_OF_LOGONS . ' ' . + $cInfo->number_of_logins + ]; + + $contents[] = [ + 'text' => + '
' . + TEXT_INFO_GV_AMOUNT . ' ' . + $currencies->format($cInfo->gv_balance) + ]; + + $contents[] = [ + 'text' => + '
' . + TEXT_INFO_NUMBER_OF_ORDERS . ' ' . + $cInfo->number_of_orders + ]; + + if (!empty($cInfo->lifetime_value)) { + $contents[] = [ + 'text' => + TEXT_INFO_LIFETIME_VALUE . ' ' . + $currencies->format($cInfo->lifetime_value) + ]; + $contents[] = [ + 'text' => + TEXT_INFO_LAST_ORDER . ' ' . + zen_date_short($cInfo->last_order['date_purchased']) . + '
' . + TEXT_INFO_ORDERS_TOTAL . ' ' . + $cInfo->last_order['order_total'] + ]; + } + $contents[] = [ + 'text' => + '
' . + TEXT_INFO_COUNTRY . ' ' . + $cInfo->country_name + ]; + $contents[] = [ + 'text' => + '
' . + TEXT_INFO_NUMBER_OF_REVIEWS . ' ' . + $cInfo->number_of_reviews + ]; + $contents[] = [ + 'text' => + '
' . + CUSTOMERS_REFERRAL . ' ' . + $cInfo->customers_referral + ]; } - ?> -
display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?>display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?>
' . zen_image_button('button_reset.gif', IMAGE_RESET) . ''; ?>
-
- - + break; + } + $zco_notifier->notify('NOTIFY_ADMIN_CUSTOMERS_MENU_BUTTONS_END', $cInfo ?? new stdClass, $contents); + + if (!empty($heading) && !empty($contents)) { + $box = new box(); + echo $box->infoBox($heading, $contents); + } +?> +
+
+
+ + + + + + + + + + +
+ display_count( + $customers_query_numrows, + MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER, + $_GET['page'], + TEXT_DISPLAY_NUMBER_OF_CUSTOMERS + ); ?> + + display_links( + $customers_query_numrows, + MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER, + MAX_DISPLAY_PAGE_LINKS, + $_GET['page'], + zen_get_all_get_params(['page', 'info', 'x', 'y', 'cID']) + ); ?> +
+ + + +
+
+ +
- + - - - + + +"Forget Only" - Delete identifiable personal details from the customer record.
"Delete" - Delete the customer record from the database.'); define('TEXT_DELETE_REVIEWS', 'Delete %s review(s)'); define('TEXT_INFO_HEADING_DELETE_CUSTOMER', 'Delete Customer'); define('TYPE_BELOW', 'Type below'); @@ -70,5 +71,5 @@ define('TEXT_INFO_ADDRESS_BOOK_COUNT_SINGLE', ''); define('EMP_BUTTON_PLACEORDER_ALT', 'Place an order for this customer'); define('EMP_BUTTON_PLACEORDER', 'Place Order'); - +define('TEXT_CUSTOMER_GROUPS','Customer Groups'); define('TEXT_OPTIONAL_PAYMENT', 'Allow optional payment method?'); \ No newline at end of file diff --git a/GEAENDERTE DATEIEN/DEINADMIN/includes/languages/german/customers.php b/GEAENDERTE DATEIEN/DEINADMIN/includes/languages/german/customers.php index a063f27..2ab80fa 100644 --- a/GEAENDERTE DATEIEN/DEINADMIN/includes/languages/german/customers.php +++ b/GEAENDERTE DATEIEN/DEINADMIN/includes/languages/german/customers.php @@ -1,21 +1,20 @@ "Nur vergessen" - Löscht identifizierbare persönliche Daten aus dem Kundendatensatz.
"Löschen" - Löscht den Kundendatensatz aus der Datenbank.'); define('TEXT_DELETE_REVIEWS', 'Lösche %s Bewertung(en)'); define('TEXT_INFO_HEADING_DELETE_CUSTOMER', 'Lösche Kunde'); define('TYPE_BELOW', 'Geben Sie unten ein'); @@ -67,5 +68,5 @@ define('EMP_BUTTON_PLACEORDER_ALT', 'Als dieser Kunde einloggen'); define('EMP_BUTTON_PLACEORDER', 'Login als Kunde'); - +define('TEXT_CUSTOMER_GROUPS','Kundengruppen'); define('TEXT_OPTIONAL_PAYMENT', 'Spezielle Zahlungsart erlauben?'); \ No newline at end of file diff --git a/GEAENDERTE DATEIEN/includes/classes/payment.php b/GEAENDERTE DATEIEN/includes/classes/payment.php index 9d1dd0b..8affefa 100644 --- a/GEAENDERTE DATEIEN/includes/classes/payment.php +++ b/GEAENDERTE DATEIEN/includes/classes/payment.php @@ -2,11 +2,11 @@ /** * Payment Class. * Zen Cart German Specific (158 code in 157) - * @copyright Copyright 2003-2022 Zen Cart Development Team + * @copyright Copyright 2003-2023 Zen Cart Development Team * Zen Cart German Version - www.zen-cart-pro.at * @copyright Portions Copyright 2003 osCommerce * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0 - * @version $Id: payment.php for Zahlungsart nur fuer bestimmte Kunden anbieten 2022-12-19 09:47:16Z webchills $ + * @version $Id: payment.php for Zahlungsart nur fuer bestimmte Kunden anbieten 2023-11-13 12:14:16Z webchills $ */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); @@ -45,7 +45,7 @@ class payment extends base { public $selected_module; function __construct($module = '') { - global $PHP_SELF, $language, $credit_covers, $messageStack; + global $PHP_SELF, $language, $credit_covers, $messageStack, $languageLoader; $this->doesCollectsCardDataOnsite = false; if (defined('MODULE_PAYMENT_INSTALLED') && !empty(MODULE_PAYMENT_INSTALLED)) { @@ -97,8 +97,8 @@ function __construct($module = '') { for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) { $lang_file = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/payment/', $include_modules[$i]['file'], 'false'); - if (@file_exists($lang_file)) { - include_once($lang_file); + if ($languageLoader->hasLanguageFile(DIR_FS_CATALOG . DIR_WS_LANGUAGES, $_SESSION['language'], $include_modules[$i]['file'], '/modules/payment')) { + $languageLoader->loadExtraLanguageFiles(DIR_FS_CATALOG . DIR_WS_LANGUAGES, $_SESSION['language'], $include_modules[$i]['file'], '/modules/payment'); } else { if (is_object($messageStack)) { if (IS_ADMIN_FLAG === false) { @@ -143,7 +143,7 @@ public function checkCreditCovered() if (isset($credit_covers) && $credit_covers === true) { $credit_is_covered = true; $this->modules = ''; - $this->selected_method = ''; + $this->selected_module = ''; } return $credit_is_covered; } diff --git a/liesmich.txt b/liesmich.txt index 02a220e..916f3e4 100644 --- a/liesmich.txt +++ b/liesmich.txt @@ -1,4 +1,4 @@ -Zahlungsart nur für bestimmte Kunden anbieten 1.4.1 für Zen Cart 1.5.7 deutsch +Zahlungsart nur für bestimmte Kunden anbieten 1.5.0 für Zen Cart 1.5.7 deutsch Anpassung des Moduls Optional Payment Method von That Software Guy für die deutsche Zen Cart Version 1.5.7 https://www.zen-cart.com/downloads.php?do=file&id=1930 @@ -10,7 +10,9 @@ Beim Bearbeiten der Kunden steht ein neues Feld zur Verfügung mit denen sie fü INSTALLATION: -Dieses Modul ist nur für die deutsche Zen Cart 1.5.7 Version geeignet +Dieses Modul ist nur für die deutsche Zen Cart 1.5.7g Version geeignet. +Stellen Sie sicher, dass Sie Ihren Shop auf 1.5.7g aktualisiert haben, bevor Sie dieses Modul installieren. +Die mitgelieferten geänderten Dateien dieses Moduls sind auf dem Stand von 1.5.7g! WICHTIG: @@ -99,7 +101,7 @@ Kreuzen Sie bei den Kunden die Checkbox an, denen Sie diese Zahlungsart anbieten DEINSTALLATION -Alle von diesem Modul geänderten Dateien wieder mit den 1.5.7 Originaldateien bzw. den Dateien Ihres zuvor angelegten Backups ersetzen. +Alle von diesem Modul geänderten Dateien wieder mit den 1.5.7g Originaldateien bzw. den Dateien Ihres zuvor angelegten Backups ersetzen. Die Datei uninstall.sql im Ordner SQL mit einem Texteditor öffen und den Inhalt kopieren