'1', 'text' => ENTRY_NEWSLETTER_YES),
array('id' => '0', 'text' => ENTRY_NEWSLETTER_NO));
?>
|
|
customers_default_address_id);
echo zen_hide_session_id(); ?>
|
|
customers_gender) . ' ' . MALE . ' ' . zen_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . ' ' . FEMALE . ' ' . ENTRY_GENDER_ERROR;
} else {
echo zen_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . ' ' . MALE . ' ' . zen_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . ' ' . FEMALE;
}
?> |
'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); ?>
|
|
customers_firstname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', 50)) . ' ' . ENTRY_FIRST_NAME_ERROR;
} else {
echo $cInfo->customers_firstname . zen_draw_hidden_field('customers_firstname');
}
} else {
echo zen_draw_input_field('customers_firstname', $cInfo->customers_firstname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', 50), true);
}
?> |
|
customers_lastname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', 50)) . ' ' . ENTRY_LAST_NAME_ERROR;
} else {
echo $cInfo->customers_lastname . zen_draw_hidden_field('customers_lastname');
}
} else {
echo zen_draw_input_field('customers_lastname', $cInfo->customers_lastname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', 50), true);
}
?> |
|
customers_dob == '0001-01-01 00:00:00' ? '' : zen_date_short($cInfo->customers_dob)), 'maxlength="10"') . ' ' . ENTRY_DATE_OF_BIRTH_ERROR;
} else {
echo $cInfo->customers_dob . ($customers_dob == '0001-01-01 00:00:00' ? 'N/A' : zen_draw_hidden_field('customers_dob'));
}
} else {
echo zen_draw_input_field('customers_dob', ($customers_dob == '0001-01-01 00:00:00' ? '' : zen_date_short($cInfo->customers_dob)), 'maxlength="10"', true);
}
?> |
|
customers_email_address, zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50)) . ' ' . ENTRY_EMAIL_ADDRESS_ERROR;
} elseif ($entry_email_address_check_error == true) {
echo zen_draw_input_field('customers_email_address', $cInfo->customers_email_address, zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50)) . ' ' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
} elseif ($entry_email_address_exists == true) {
echo zen_draw_input_field('customers_email_address', $cInfo->customers_email_address, zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50)) . ' ' . 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', $cInfo->customers_email_address, zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50), true);
}
?> |
|
|
|
|
entry_company, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', 50)) . ' ' . ENTRY_COMPANY_ERROR;
} else {
echo $cInfo->entry_company . zen_draw_hidden_field('entry_company');
}
} else {
echo zen_draw_input_field('entry_company', $cInfo->entry_company, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', 50));
}
?> |
|
|
|
|
entry_street_address, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', 50)) . ' ' . 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', $cInfo->entry_street_address, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', 50), true);
}
?> |
|
entry_suburb, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', 50)) . ' ' . ENTRY_SUBURB_ERROR;
} else {
echo $cInfo->entry_suburb . zen_draw_hidden_field('entry_suburb');
}
} else {
echo zen_draw_input_field('entry_suburb', $cInfo->entry_suburb, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', 50));
}
?> |
|
entry_postcode, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', 10)) . ' ' . ENTRY_POST_CODE_ERROR;
} else {
echo $cInfo->entry_postcode . zen_draw_hidden_field('entry_postcode');
}
} else {
echo zen_draw_input_field('entry_postcode', $cInfo->entry_postcode, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', 10), true);
}
?> |
|
entry_city, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', 50)) . ' ' . ENTRY_CITY_ERROR;
} else {
echo $cInfo->entry_city . zen_draw_hidden_field('entry_city');
}
} else {
echo zen_draw_input_field('entry_city', $cInfo->entry_city, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', 50), 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 = '" . 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) . ' ' . ENTRY_STATE_ERROR;
} else {
echo zen_draw_input_field('entry_state', zen_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state)) . ' ' . 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', zen_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state));
}
?> |
|
entry_country_id) . ' ' . 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);
}
?> |
|
|
|
|
customers_telephone, zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', 15)) . ' ' . ENTRY_TELEPHONE_NUMBER_ERROR;
} else {
echo $cInfo->customers_telephone . zen_draw_hidden_field('customers_telephone');
}
} else {
echo zen_draw_input_field('customers_telephone', $cInfo->customers_telephone, zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', 15), true);
}
?> |
|
customers_fax . zen_draw_hidden_field('customers_fax');
} else {
echo zen_draw_input_field('customers_fax', $cInfo->customers_fax, zen_set_field_length(TABLE_CUSTOMERS, 'customers_fax', 15));
}
?> |
|
|
|
|
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 zen_draw_radio_field('customers_email_format', 'HTML', $email_pref_html) . ' ' . ENTRY_EMAIL_HTML_DISPLAY . ' ' . zen_draw_radio_field('customers_email_format', 'TEXT', $email_pref_text) . ' ' . ENTRY_EMAIL_TEXT_DISPLAY ;
}
?> |
|
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'));
}
?> |
|
customers_group_pricing) {
$group_query = $db->Execute("select group_name, group_percentage from " . TABLE_GROUP_PRICING . " where group_id = '" . $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);
while (!$group_array_query->EOF) {
$group_array[] = array('id'=>$group_array_query->fields['group_id'], 'text'=>$group_array_query->fields['group_name'].' '.$group_array_query->fields['group_percentage'].'%');
$group_array_query->MoveNext();
}
echo zen_draw_pull_down_menu('customers_group_pricing', $group_array, $cInfo->customers_group_pricing);
}
?> |
|
customers_referral, zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', 15)); ?>
|
|
|
' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?> |
|
|
' . zen_image_button('button_reset.gif', 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);
}
?>
|
|
|
' . TABLE_HEADING_LASTNAME . '' : TABLE_HEADING_LASTNAME); ?>
Asc' : '
Desc' : '
|
' . TABLE_HEADING_FIRSTNAME . '' : TABLE_HEADING_FIRSTNAME); ?>
Asc' : '
Desc' : ''); ?>
|
' . TABLE_HEADING_COMPANY . '' : TABLE_HEADING_COMPANY); ?>
Asc' : '
Desc' : '
|
' . TABLE_HEADING_ACCOUNT_CREATED . '' : TABLE_HEADING_ACCOUNT_CREATED); ?>
Asc' : '
Desc' : '
|
' . TABLE_HEADING_LOGIN . '' : TABLE_HEADING_LOGIN); ?>
Asc' : '
Desc' : '
|
' . TABLE_HEADING_PRICING_GROUP . '' : TABLE_HEADING_PRICING_GROUP); ?>
Asc' : '
Desc' : '
|
' . TABLE_HEADING_GV_AMOUNT . '' : TABLE_HEADING_GV_AMOUNT); ?>
Asc' : '
Desc' : '
|
' . TABLE_HEADING_AUTHORIZATION_APPROVAL . '' : TABLE_HEADING_AUTHORIZATION_APPROVAL); ?>
Asc' : '
Desc' : '
|
|
bindVars($search, ':keywords:', $keywords, 'regexp');
}
$new_fields=', c.customers_telephone, a.entry_company, a.entry_street_address, a.entry_city, a.entry_postcode, c.customers_authorization, c.customers_referral';
$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_group_pricing, a.entry_country_id, a.entry_company, 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'] == '' or $_GET['page'] == '1') and $_GET['cID'] != '') {
$check_page = $db->Execute($customers_query_raw);
$check_count=1;
if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER) {
while (!$check_page->EOF) {
if ($check_page->fields['customers_id'] == $_GET['cID']) {
break;
}
$check_count++;
$check_page->MoveNext();
}
$_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);
while (!$customers->EOF) {
$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 = '" . $customers->fields['customers_id'] . "'";
$info = $db->Execute($sql);
// if no record found, create one to keep database in sync
if (!isset($info->fields) || !is_array($info->fields)) {
$insert_sql = "insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created)
values ('" . (int)$customers->fields['customers_id'] . "', '0', now())";
$db->Execute($insert_sql);
$info = $db->Execute($sql);
}
if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $customers->fields['customers_id']))) && !isset($cInfo)) {
$country = $db->Execute("select countries_name
from " . TABLE_COUNTRIES . "
where countries_id = '" . (int)$customers->fields['entry_country_id'] . "'");
$reviews = $db->Execute("select count(*) as number_of_reviews
from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers->fields['customers_id'] . "'");
$customer_info = array_merge($country->fields, $info->fields, $reviews->fields);
$cInfo_array = array_merge($customers->fields, $customer_info);
$cInfo = new objectInfo($cInfo_array);
}
$group_query = $db->Execute("select group_name, group_percentage from " . TABLE_GROUP_PRICING . " where
group_id = '" . $customers->fields['customers_group_pricing'] . "'");
if ($group_query->RecordCount() < 1) {
$group_name_entry = TEXT_NONE;
} else {
$group_name_entry = $group_query->fields['group_name'];
}
if (isset($cInfo) && is_object($cInfo) && ($customers->fields['customers_id'] == $cInfo->customers_id)) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
$zc_address_book_count_list = zen_get_customers_address_book($customers->fields['customers_id']);
$zc_address_book_count = $zc_address_book_count_list->RecordCount();
?>
fields['customers_id'] . ($zc_address_book_count == 1 ? TEXT_INFO_ADDRESS_BOOK_COUNT . $zc_address_book_count : '' . TEXT_INFO_ADDRESS_BOOK_COUNT . $zc_address_book_count . ''); ?> |
fields['customers_lastname']; ?> |
fields['customers_firstname']; ?> |
fields['entry_company']; ?> |
fields['date_account_created']); ?> |
fields['customers_info_date_of_last_logon']); ?> |
|
format($customers->fields['amount']); ?> |
fields['customers_authorization'] == 4 ? zen_image(DIR_WS_IMAGES . 'icon_red_off.gif', IMAGE_ICON_STATUS_OFF) : ($customers->fields['customers_authorization'] == 0 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '')); ?> |
fields['customers_id'] == $cInfo->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) . ''; } ?> |
MoveNext();
}
?>
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) . ''; ?> |
|
|
'' . TEXT_INFO_HEADING_DELETE_CUSTOMER . '');
$contents = array('form' => zen_draw_form('customers', FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=deleteconfirm', 'post', '', true));
$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' => 'center', 'text' => ' ' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
default:
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='" . $cInfo->customers_id . "' order by date_purchased desc");
$heading[] = array('text' => '' . TABLE_HEADING_ID . $cInfo->customers_id . ' ' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '');
$contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . ' ' . zen_image_button('button_delete.gif', IMAGE_DELETE) . ' ' . ($customers_orders->RecordCount() != 0 ? '' . zen_image_button('button_orders.gif', IMAGE_ORDERS) . '' : '') . ' ' . zen_image_button('button_email.gif', IMAGE_EMAIL) . '');
$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);
$contents[] = array('text' => ' ' . TEXT_INFO_GV_AMOUNT . ' ' . $currencies->format($customers_orders->fields['amount']));
$contents[] = array('text' => ' ' . TEXT_INFO_NUMBER_OF_ORDERS . ' ' . $customers_orders->RecordCount());
if ($customers_orders->RecordCount() != 0) {
$contents[] = array('text' => TEXT_INFO_LAST_ORDER . ' ' . zen_date_short($customers_orders->fields['date_purchased']) . ' ' . TEXT_INFO_ORDERS_TOTAL . ' ' . $currencies->format($customers_orders->fields['order_total'], true, $customers_orders->fields['currency'], $customers_orders->fields['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;
}
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
echo ' ' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|
|