Jump to content
PopTheTop

[Contribution] Admin Notes

Recommended Posts

Hi Scott again,

i supposed the error

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' c.customers_notes customers c left join address_book a on c.cu

select c.customers_id, c.customers_gender, c.customers_fsk_18, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_piva, a.entry_cf, 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 from, c.customers_notes customers c left join address_book a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '72'

[TEP STOP]

 

comes from a query for the database, but the lines where the database was asked for are only at Step 7 :

 

// START Admin Notes
       $customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, 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_notes 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)$HTTP_GET_VARS['cID'] . "'");
// END Admin Notes

 

and

 

// START Admin Notes
  $customers_query_raw = "select c.customers_notes, c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname";
// END Admin Notes

 

as the database field customers_notes in the table customers would not be correctly

target.

 

Well, after isolating the error i tried to change the first change and

with several tries i found out that if i deleted the inserted

 

c.customers_notes from

 

when I press the button "EDIT" (and "DELETE" ) i can edit (and delete) my customers adding the admin note

 

Maybe this can help someone else with the same error

 

Thank you Scott again for this helpfull contribution

 

Sincerely

Roberto

 

 

Scott, as the contributions  from the Admin/Tool works, i create a new customer and added few lines admin notes. It works. Even in the database in the customer/customers_notes  field the text is added.

 

The error i get  occur only when i press the

 

1) customer/edit  and

 

2) customer/delete

 

button.

 

Thank you for your help

 

Sincerely

 

Roberto

Share this post


Link to post
Share on other sites

Hi, as I told in my last post the contribution now works.

 

I can add an admin comment to the customer pressinf the Edit button.

 

When I point at the customer i see the admin note, right down, but

 

if I edit the customer again, the admin note i just added is NOT present in the admin note box, then I cannot edit the first one, just add a new comment, will delete the old from the database.

 

Anyone knows why doesn't read the data from database and don't show it in the field?

 

Thank you for your help

 

Sincerely

Roberto

Share this post


Link to post
Share on other sites
Ok guys and gals...

 

I need your help. I just noticed that my update is not working. Can someone please help to get it to work correctly.

 

I want it so that IF the customer has an Admin Customer Note, it will display that note on the Admin / Customers page for the highlighted customer and if they DO NOT have an Admin Customer Note, it will display nothing as usual.

 

Here is the problem code...

 

 

Ok, I just stumbled upon why that was not working. I was calling $aInfo... instead of $cInfo... so it was not pulling the info from the database.

 

It is now working so that you may see the customer's notes in the box on the right when you highlight the customer from Admin / Customers

 

A new update has just been uploaded so you may download it from HERE

 

 

 

Roberto, I really do not know about your problem as I am pretty stupid when it comes to PHP. I am learning as I go. I suggest that you install the latest release and let me know if that helps.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Hi Scott,

 

I did the update replacing all files in the admin, but i still cannot have the stored informatione be read from the database.

I do not know if this is part of the contributioin as it is, or it's an error I get.

 

I'll try to explain with two pictures.

 

1) when i click the edit button for customers I can add the admin note and i get

in the customer view the notes in bottom right like

admin_note#1.jpg

everything seems to work, but

 

2) when i want to add some infos in the note and I click again the edit button

i cannot see any of the information stored. Just the empty field like

admin_note#2.jpg

 

the information are not read from the databas. But i do not what's (and where's)

the code responsible for doing that .

 

Thank you for your help

 

Sincereyl

Roberto

Share this post


Link to post
Share on other sites

Are you certain you have the new SQL file installed and installed correctly into your database?


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Hi Scott,

yes, i did run the new sql, and updated all the files in the update you posted in the 2.2 version.

 

But i think the prolem is not in the databas, as the information are written and displaid in the general customer overview but not in the admin note windows at the bottom of each customer record.

 

It seems i miss a code to call the information stored in the database when the button edit is pressen.

 

It could help me to know where the part of code responsible for it in the customer.php is.

 

Thank you for your help

 

Sincerely

Roberto

 

 

Are you certain you have the new SQL file installed and installed correctly into your database?

Share this post


Link to post
Share on other sites

Hello, I have this problem. Please Help!!

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' c.customers_notes from customers c left join address_book a on c.customers_defa' at line 1

 

select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_nip, 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_groups_id, c.customers_discount, c.customers_discount_sign, c.customers_default_address_id, c.customers_status, c.customers_info from, c.customers_notes from customers c left join address_book a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '665'

 

 

MY customers.php

 

 

<?php

/*

$Id: customers.php,v 1.82 2003/06/30 13:54:14 dgw_ Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

$error = false;

$processed = false;

 

if (tep_not_null($action)) {

switch ($action) {

//TotalB2B start

case 'setflag':

 

 

if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {

if ($HTTP_GET_VARS['cID']) {

tep_set_customers_status($HTTP_GET_VARS['cID'], $HTTP_GET_VARS['flag']);

}

}

 

tep_redirect(tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL'));

break;

//TotalB2B end

case 'update':

$customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);

$customers_firstname = tep_db_prepare_input($HTTP_POST_VARS['customers_firstname']);

$customers_lastname = tep_db_prepare_input($HTTP_POST_VARS['customers_lastname']);

$customers_email_address = tep_db_prepare_input($HTTP_POST_VARS['customers_email_address']);

$customers_telephone = tep_db_prepare_input($HTTP_POST_VARS['customers_telephone']);

$customers_fax = tep_db_prepare_input($HTTP_POST_VARS['customers_fax']);

$customers_info = tep_db_prepare_input($HTTP_POST_VARS['customers_info']);

$customers_newsletter = tep_db_prepare_input($HTTP_POST_VARS['customers_newsletter']);

 

//TotalB2B start

$customers_discount_sign = tep_db_prepare_input($HTTP_POST_VARS['customers_discount_sign']);

$customers_discount = tep_db_prepare_input($HTTP_POST_VARS['customers_discount']);

$customers_groups_id = tep_db_prepare_input($HTTP_POST_VARS['customers_groups_id']);

$customers_status = tep_db_prepare_input($HTTP_POST_VARS['customers_status']);

 

//TotalB2B end

 

 

$customers_gender = tep_db_prepare_input($HTTP_POST_VARS['customers_gender']);

$customers_dob = tep_db_prepare_input($HTTP_POST_VARS['customers_dob']);

// START Admin Notes

$customers_notes = tep_db_prepare_input($HTTP_POST_VARS['customers_notes']);

// END Admin Notes

 

$default_address_id = tep_db_prepare_input($HTTP_POST_VARS['default_address_id']);

$entry_street_address = tep_db_prepare_input($HTTP_POST_VARS['entry_street_address']);

$entry_suburb = tep_db_prepare_input($HTTP_POST_VARS['entry_suburb']);

$entry_postcode = tep_db_prepare_input($HTTP_POST_VARS['entry_postcode']);

$entry_city = tep_db_prepare_input($HTTP_POST_VARS['entry_city']);

$entry_country_id = tep_db_prepare_input($HTTP_POST_VARS['entry_country_id']);

 

$entry_company = tep_db_prepare_input($HTTP_POST_VARS['entry_company']);

$entry_nip = tep_db_prepare_input($HTTP_POST_VARS['entry_nip']);

$entry_state = tep_db_prepare_input($HTTP_POST_VARS['entry_state']);

if (isset($HTTP_POST_VARS['entry_zone_id'])) $entry_zone_id = tep_db_prepare_input($HTTP_POST_VARS['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 (checkdate(substr(tep_date_raw($customers_dob), 4, 2), substr(tep_date_raw($customers_dob), 6, 2), substr(tep_date_raw($customers_dob), 0, 4))) {

$entry_date_of_birth_error = false;

} else {

$error = true;

$entry_date_of_birth_error = true;

}

}

 

if (strlen($customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {

$error = true;

$entry_email_address_error = true;

} else {

$entry_email_address_error = false;

}

 

if (!tep_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_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$entry_country_id . "'");

$check_value = tep_db_fetch_array($check_query);

$entry_state_has_zones = ($check_value['total'] > 0);

if ($entry_state_has_zones == true) {

$zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$entry_country_id . "' and zone_name = '" . tep_db_input($entry_state) . "'");

if (tep_db_num_rows($zone_query) == 1) {

$zone_values = tep_db_fetch_array($zone_query);

$entry_zone_id = $zone_values['zone_id'];

} else {

$error = true;

$entry_state_error = true;

}

} else {

if ($entry_state == false) {

$error = true;

$entry_state_error = true;

}

}

}

}

 

if (strlen($customers_telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {

$error = true;

$entry_telephone_error = true;

} else {

$entry_telephone_error = false;

}

 

$check_email = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "' and customers_id != '" . (int)$customers_id . "'");

if (tep_db_num_rows($check_email)) {

$error = true;

$entry_email_address_exists = true;

} else {

$entry_email_address_exists = false;

}

 

if ($error == false) {

 

$sql_data_array = array('customers_firstname' => $customers_firstname,

'customers_lastname' => $customers_lastname,

'customers_email_address' => $customers_email_address,

'customers_telephone' => $customers_telephone,

'customers_fax' => $customers_fax,

'customers_info' => $customers_info,

'customers_status' => $customers_status,

'customers_discount' => $customers_discount,

'customers_discount_sign' => $customers_discount_sign,

'customers_newsletter' => $customers_newsletter,

'customers_notes' => $customers_notes, // START \ END Admin Notes

'customers_groups_id' => $customers_groups_id);

 

if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $customers_gender;

if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($customers_dob);

 

tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "'");

 

tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customers_id . "'");

 

if ($entry_zone_id > 0) $entry_state = '';

 

$sql_data_array = array('entry_firstname' => $customers_firstname,

'entry_lastname' => $customers_lastname,

'entry_street_address' => $entry_street_address,

'entry_postcode' => $entry_postcode,

'entry_city' => $entry_city,

'entry_country_id' => $entry_country_id);

 

if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $entry_company;

if (ACCOUNT_NIP == 'true') $sql_data_array['entry_nip'] = $entry_nip;

if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $entry_suburb;

 

if (ACCOUNT_STATE == 'true') {

if ($entry_zone_id > 0) {

$sql_data_array['entry_zone_id'] = $entry_zone_id;

$sql_data_array['entry_state'] = '';

} else {

$sql_data_array['entry_zone_id'] = '0';

$sql_data_array['entry_state'] = $entry_state;

}

}

 

tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$default_address_id . "'");

 

tep_redirect(tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $customers_id));

 

} else if ($error == true) {

$cInfo = new objectInfo($HTTP_POST_VARS);

$processed = true;

}

 

break;

case 'deleteconfirm':

$customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);

 

if (isset($HTTP_POST_VARS['delete_reviews']) && ($HTTP_POST_VARS['delete_reviews'] == 'on')) {

$reviews_query = tep_db_query("select reviews_id from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers_id . "'");

while ($reviews = tep_db_fetch_array($reviews_query)) {

tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$reviews['reviews_id'] . "'");

}

 

tep_db_query("delete from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers_id . "'");

} else {

tep_db_query("update " . TABLE_REVIEWS . " set customers_id = null where customers_id = '" . (int)$customers_id . "'");

}

 

tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customers_id . "'");

tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customers_id . "'");

tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customers_id . "'");

tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customers_id . "'");

tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customers_id . "'");

tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . (int)$customers_id . "'");

 

tep_redirect(tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action'))));

break;

 

 

 

 

default:

//TotalB2B start

$customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_nip, 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_groups_id, c.customers_discount, c.customers_discount_sign, c.customers_default_address_id, c.customers_status, c.customers_info from, c.customers_notes 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)$HTTP_GET_VARS['cID'] . "'");

//TotalB2B end

$customers = tep_db_fetch_array($customers_query);

$cInfo = new objectInfo($customers);

}

}

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

<script language="javascript" src="includes/general.js"></script>

<?php

if ($action == 'edit' || $action == 'update') {

?>

<script language="javascript"><!--

 

function check_form() {

var error = 0;

var error_message = "<?php echo JS_ERROR; ?>";

 

var customers_firstname = document.customers.customers_firstname.value;

var customers_lastname = document.customers.customers_lastname.value;

<?php if (ACCOUNT_COMPANY == 'true') echo 'var entry_company = document.customers.entry_company.value;' . "\n"; ?>

<?php if (ACCOUNT_NIP == 'true') echo 'var entry_nip = document.customers.entry_nip.value;' . "\n"; ?>

<?php if (ACCOUNT_DOB == 'true') echo 'var customers_dob = document.customers.customers_dob.value;' . "\n"; ?>

var customers_email_address = document.customers.customers_email_address.value;

var entry_street_address = document.customers.entry_street_address.value;

var entry_postcode = document.customers.entry_postcode.value;

var entry_city = document.customers.entry_city.value;

var customers_telephone = document.customers.customers_telephone.value;

 

<?php if (ACCOUNT_GENDER == 'true') { ?>

if (document.customers.customers_gender[0].checked || document.customers.customers_gender[1].checked) {

} else {

error_message = error_message + "<?php echo JS_GENDER; ?>";

error = 1;

}

<?php } ?>

 

if (customers_firstname == "" || customers_firstname.length < <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>) {

error_message = error_message + "<?php echo JS_FIRST_NAME; ?>";

error = 1;

}

 

if (customers_lastname == "" || customers_lastname.length < <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>) {

error_message = error_message + "<?php echo JS_LAST_NAME; ?>";

error = 1;

}

 

<?php if (ACCOUNT_DOB == 'true') { ?>

if (customers_dob == "" || customers_dob.length < <?php echo ENTRY_DOB_MIN_LENGTH; ?>) {

error_message = error_message + "<?php echo JS_DOB; ?>";

error = 1;

}

<?php } ?>

 

if (customers_email_address == "" || customers_email_address.length < <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>) {

error_message = error_message + "<?php echo JS_EMAIL_ADDRESS; ?>";

error = 1;

}

 

if (entry_street_address == "" || entry_street_address.length < <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>) {

error_message = error_message + "<?php echo JS_ADDRESS; ?>";

error = 1;

}

 

if (entry_postcode == "" || entry_postcode.length < <?php echo ENTRY_POSTCODE_MIN_LENGTH; ?>) {

error_message = error_message + "<?php echo JS_POST_CODE; ?>";

error = 1;

}

 

if (entry_city == "" || entry_city.length < <?php echo ENTRY_CITY_MIN_LENGTH; ?>) {

error_message = error_message + "<?php echo JS_CITY; ?>";

error = 1;

}

 

<?php

if (ACCOUNT_STATE == 'true') {

?>

if (document.customers.elements['entry_state'].type != "hidden") {

if (document.customers.entry_state.value == '' || document.customers.entry_state.value.length < <?php echo ENTRY_STATE_MIN_LENGTH; ?> ) {

error_message = error_message + "<?php echo JS_STATE; ?>";

error = 1;

}

}

<?php

}

?>

 

if (document.customers.elements['entry_country_id'].type != "hidden") {

if (document.customers.entry_country_id.value == 0) {

error_message = error_message + "<?php echo JS_COUNTRY; ?>";

error = 1;

}

}

if (document.customers.elements['customers_groups_id'].type != "hidden") {

if (document.customers.customers_groups_id.value == 0) {

error_message = error_message + "<?php echo JS_COUNTRY; ?>";

error = 1;

}

}

 

if (customers_telephone == "" || customers_telephone.length < <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>) {

error_message = error_message + "<?php echo JS_TELEPHONE; ?>";

error = 1;

}

 

if (error == 1) {

alert(error_message);

return false;

} else {

return true;

}

}

//--></script>

<?php

}

?>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<?php

if ($action == 'edit' || $action == 'update') {

$newsletter_array = array(array('id' => '1', 'text' => ENTRY_NEWSLETTER_YES),

array('id' => '0', 'text' => ENTRY_NEWSLETTER_NO));

 

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr><?php echo tep_draw_form('customers', FILENAME_CUSTOMERS, tep_get_all_get_params(array('action')) . 'action=update', 'post', 'onSubmit="return check_form();"') . tep_draw_hidden_field('default_address_id', $cInfo->customers_default_address_id); ?>

<td class="formAreaTitle"><?php echo CATEGORY_PERSONAL; ?></td>

</tr>

<tr>

<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">

<tr>

<?php

 

if ($customers['customers_status'] == '1') {

 

echo tep_draw_radio_field('customers_status', '1', checked) . ' ' . 'aktywny' . ' ' . tep_draw_radio_field('customers_status', '0') . ' nieaktywny  ';

 

echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10);

 

 

} else {

 

echo tep_draw_radio_field('customers_status', '1') . ' ' . 'aktywny' . ' ' . tep_draw_radio_field('customers_status', '0',checked) . ' nieaktywny  ';

echo tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);

 

}

?>

 

</tr>

 

 

<?php

if (ACCOUNT_GENDER == 'true') {

?>

<tr>

<td class="main"><?php echo ENTRY_GENDER; ?></td>

<td class="main">

<?php

if ($error == true) {

if ($entry_gender_error == true) {

echo tep_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . '  ' . MALE . '  ' . tep_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . '  ' . FEMALE . ' ' . ENTRY_GENDER_ERROR;

} else {

echo ($cInfo->customers_gender == 'm') ? MALE : FEMALE;

echo tep_draw_hidden_field('customers_gender');

}

} else {

echo tep_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . '  ' . MALE . '  ' . tep_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . '  ' . FEMALE;

}

?></td>

</tr>

<?php

}

?>

<tr>

<td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>

<td class="main">

<?php

if ($error == true) {

if ($entry_firstname_error == true) {

echo tep_draw_input_field('customers_firstname', $cInfo->customers_firstname, 'maxlength="32"') . ' ' . ENTRY_FIRST_NAME_ERROR;

} else {

echo $cInfo->customers_firstname . tep_draw_hidden_field('customers_firstname');

}

} else {

echo tep_draw_input_field('customers_firstname', $cInfo->customers_firstname, 'maxlength="32"', true);

}

?></td>

</tr>

<tr>

<td class="main"><?php echo ENTRY_LAST_NAME; ?></td>

<td class="main">

<?php

if ($error == true) {

if ($entry_lastname_error == true) {

echo tep_draw_input_field('customers_lastname', $cInfo->customers_lastname, 'maxlength="32"') . ' ' . ENTRY_LAST_NAME_ERROR;

} else {

echo $cInfo->customers_lastname . tep_draw_hidden_field('customers_lastname');

}

} else {

echo tep_draw_input_field('customers_lastname', $cInfo->customers_lastname, 'maxlength="32"', true);

}

?></td>

</tr>

<?php

if (ACCOUNT_DOB == 'true') {

?>

<tr>

<td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>

<td class="main">

 

<?php

if ($error == true) {

if ($entry_date_of_birth_error == true) {

echo tep_draw_input_field('customers_dob', tep_date_short($cInfo->customers_dob), 'maxlength="10"') . ' ' . ENTRY_DATE_OF_BIRTH_ERROR;

} else {

echo $cInfo->customers_dob . tep_draw_hidden_field('customers_dob');

}

} else {

echo tep_draw_input_field('customers_dob', tep_date_short($cInfo->customers_dob), 'maxlength="10"', true);

}

?></td>

</tr>

<?php

}

?>

<tr>

<td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>

<td class="main">

<?php

if ($error == true) {

if ($entry_email_address_error == true) {

echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"') . ' ' . ENTRY_EMAIL_ADDRESS_ERROR;

} elseif ($entry_email_address_check_error == true) {

echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"') . ' ' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;

} elseif ($entry_email_address_exists == true) {

echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"') . ' ' . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;

} else {

echo $customers_email_address . tep_draw_hidden_field('customers_email_address');

}

} else {

echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"', true);

}

?></td>

</tr>

</table></td>

</tr>

<?php

if (ACCOUNT_COMPANY == 'true') {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="formAreaTitle"><?php echo CATEGORY_COMPANY; ?></td>

</tr>

<tr>

<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">

<tr>

<td class="main"><?php echo ENTRY_COMPANY; ?></td>

<td class="main">

<?php

if ($error == true) {

if ($entry_company_error == true) {

echo tep_draw_input_field('entry_company', $cInfo->entry_company, 'maxlength="32"') . ' ' . ENTRY_COMPANY_ERROR;

} else {

echo $cInfo->entry_company . tep_draw_hidden_field('entry_company');

}

} else {

echo tep_draw_input_field('entry_company', $cInfo->entry_company, 'maxlength="32"');

}

?></td>

</tr>

 

<!-- Insert Pazio pazio@sitenet.pl start -->

<tr>

<td class="main"><?php echo ENTRY_NIP; ?></td>

<td class="main">

<?php

if ($error == true) {

if ($entry_nip_error == true) {

echo tep_draw_input_field('entry_nip', $cInfo->entry_nip, 'maxlength="13"') . ' ' . ENTRY_NIP_ERROR;

} else {

echo $cInfo->entry_nip . tep_draw_hidden_field('entry_nip');

}

} else {

echo tep_draw_input_field('entry_nip', $cInfo->entry_nip, 'maxlength="13"');

}

?></td>

</tr>

<!-- Insert Pazio pazio@sitenet.pl end -->

 

</table></td>

</tr>

<?php

}

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="formAreaTitle"><?php echo CATEGORY_ADDRESS; ?></td>

</tr>

<tr>

<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">

<tr>

<td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>

<td class="main">

<?php

if ($error == true) {

if ($entry_street_address_error == true) {

echo tep_draw_input_field('entry_street_address', $cInfo->entry_street_address, 'maxlength="64"') . ' ' . ENTRY_STREET_ADDRESS_ERROR;

} else {

echo $cInfo->entry_street_address . tep_draw_hidden_field('entry_street_address');

}

} else {

echo tep_draw_input_field('entry_street_address', $cInfo->entry_street_address, 'maxlength="64"', true);

}

?></td>

</tr>

<?php

if (ACCOUNT_SUBURB == 'true') {

?>

<tr>

<td class="main"><?php echo ENTRY_SUBURB; ?></td>

<td class="main">

<?php

if ($error == true) {

if ($entry_suburb_error == true) {

echo tep_draw_input_field('suburb', $cInfo->entry_suburb, 'maxlength="32"') . ' ' . ENTRY_SUBURB_ERROR;

} else {

echo $cInfo->entry_suburb . tep_draw_hidden_field('entry_suburb');

}

} else {

echo tep_draw_input_field('entry_suburb', $cInfo->entry_suburb, 'maxlength="32"');

}

?></td>

</tr>

<?php

}

?>

<tr>

<td class="main"><?php echo ENTRY_POST_CODE; ?></td>

<td class="main">

<?php

if ($error == true) {

if ($entry_post_code_error == true) {

echo tep_draw_input_field('entry_postcode', $cInfo->entry_postcode, 'maxlength="8"') . ' ' . ENTRY_POST_CODE_ERROR;

} else {

echo $cInfo->entry_postcode . tep_draw_hidden_field('entry_postcode');

}

} else {

echo tep_draw_input_field('entry_postcode', $cInfo->entry_postcode, 'maxlength="8"', true);

}

?></td>

</tr>

<tr>

<td class="main"><?php echo ENTRY_CITY; ?></td>

<td class="main">

<?php

if ($error == true) {

if ($entry_city_error == true) {

echo tep_draw_input_field('entry_city', $cInfo->entry_city, 'maxlength="32"') . ' ' . ENTRY_CITY_ERROR;

} else {

echo $cInfo->entry_city . tep_draw_hidden_field('entry_city');

}

} else {

echo tep_draw_input_field('entry_city', $cInfo->entry_city, 'maxlength="32"', true);

}

?></td>

</tr>

<?php

if (ACCOUNT_STATE == 'true') {

?>

<tr>

<td class="main"><?php echo ENTRY_STATE; ?></td>

<td class="main">

<?php

$entry_state = tep_get_zone_name($cInfo->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_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($cInfo->entry_country_id) . "' order by zone_name");

while ($zones_values = tep_db_fetch_array($zones_query)) {

$zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);

}

echo tep_draw_pull_down_menu('entry_state', $zones_array) . ' ' . ENTRY_STATE_ERROR;

} else {

echo tep_draw_input_field('entry_state', tep_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state)) . ' ' . ENTRY_STATE_ERROR;

}

} else {

echo $entry_state . tep_draw_hidden_field('entry_zone_id') . tep_draw_hidden_field('entry_state');

}

} else {

echo tep_draw_input_field('entry_state', tep_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state));

}

 

?></td>

</tr>

<?php

}

?>

<tr>

<td class="main"><?php echo ENTRY_COUNTRY; ?></td>

<td class="main">

<?php

if ($error == true) {

if ($entry_country_error == true) {

echo tep_draw_pull_down_menu('entry_country_id', tep_get_countries(), $cInfo->entry_country_id) . ' ' . ENTRY_COUNTRY_ERROR;

} else {

echo tep_get_country_name($cInfo->entry_country_id) . tep_draw_hidden_field('entry_country_id');

}

} else {

echo tep_draw_pull_down_menu('entry_country_id', tep_get_countries(), $cInfo->entry_country_id);

}

?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="formAreaTitle"><?php echo CATEGORY_CONTACT; ?></td>

</tr>

<tr>

<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">

<tr>

<td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>

<td class="main">

<?php

if ($error == true) {

if ($entry_telephone_error == true) {

echo tep_draw_input_field('customers_telephone', $cInfo->customers_telephone, 'maxlength="32"') . ' ' . ENTRY_TELEPHONE_NUMBER_ERROR;

} else {

echo $cInfo->customers_telephone . tep_draw_hidden_field('customers_telephone');

}

} else {

echo tep_draw_input_field('customers_telephone', $cInfo->customers_telephone, 'maxlength="32"', true);

}

?></td>

</tr>

<tr>

<td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>

<td class="main">

<?php

if ($processed == true) {

echo $cInfo->customers_fax . tep_draw_hidden_field('customers_fax');

} else {

echo tep_draw_input_field('customers_fax', $cInfo->customers_fax, 'maxlength="32"');

}

?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="formAreaTitle"><?php echo CATEGORY_OPTIONS; ?></td>

</tr>

<tr>

<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">

<tr>

<td class="main"><?php echo ENTRY_NEWSLETTER; ?></td>

<td class="main">

<?php

if ($processed == true) {

if ($cInfo->customers_newsletter == '1') {

echo ENTRY_NEWSLETTER_YES;

} else {

echo ENTRY_NEWSLETTER_NO;

}

echo tep_draw_hidden_field('customers_newsletter');

} else {

echo tep_draw_pull_down_menu('customers_newsletter', $newsletter_array, (($cInfo->customers_newsletter == '1') ? '1' : '0'));

}

?></td>

</tr> <?php

// START Admin Notes

?>

<tr>

<td valign="top" class="main">Admin Notes:</td>

<td class="main">

<?php

if ($processed == true) {

echo $cInfo->customers_notes . tep_draw_hidden_field('customers_notes');

} else {

echo tep_draw_textarea_field('customers_notes', 'soft', '75', '5', ($cInfo->customers_notes));

}

?></td>

</tr>

<?php

// END Admin Notes

?>

 

 

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="formAreaTitle"><?php echo 'Poziom rabatu dla klienta (w %)'; ?></td>

</tr>

<tr>

<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">

<tr>

<tr>

<td class="main"><?php echo 'Ustaw poziom rabatu<br>dla klienta:'; ?></td>

<td class="main">

 

<?php

 

if ($processed == true) {

echo $cInfo->customers_discount_sign . tep_draw_hidden_field('customers_discount_sign');

 

} else {

 

echo tep_draw_input_field('customers_discount_sign', $cInfo->customers_discount_sign, 'maxlength="9"');

}

?> % (w stosunku do maksymalnego rabatu dla produktu)

 

 

 

</td>

 

 

 

 

 

 

 

 

 

</td>

</tr>

 

 

 

 

 

 

 

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="formAreaTitle"><?php echo 'Grupa klient?w:'; ?></td>

</tr>

<tr>

<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">

<tr>

<tr>

<td class="main"><?php echo 'Przypisz klienta do grupy:'; ?></td>

<td class="main">

<?php

 

if ($error == true) {

if ($entry_groups_error == true) {

echo tep_draw_pull_down_menu('customers_groups_id', tep_get_customers_groups(), $cInfo->customers_groups_id) . ' ' . ENTRY_GROUPS_ERROR;

} else {

echo tep_get_customers_groups($cInfo->customers_groups_id) . tep_draw_hidden_field('customers_groups_id');

}

} else {

echo tep_draw_pull_down_menu('customers_groups_id', tep_get_customers_groups(), $cInfo->customers_groups_id);

}

?>  Rabat grupy zsumuje się z rabatem indywidualnym. </td>

</tr>

</table></td>

</tr>

 

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="formAreaTitle"><?php echo 'Uwagi o kliencie:'; ?></td>

</tr>

<tr>

<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">

<tr>

<tr>

<td class="main"><?php echo 'WprowadĽ tre?ć<br>notki o kliencie:'; ?></td>

<td class="main">

 

 

<?php

if ($processed == true) {

echo $cInfo->customers_info . tep_draw_hidden_field('customers_info');

} else {

echo tep_draw_textarea_field('customers_info', 'soft', '70', '15', $customers['customers_info']);

}

?>  Tylko do wiadomo?ci personelu sklepu. </td>

</tr>

</table></td>

</tr>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td align="center" class="main"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('action'))) .'">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>

</tr></form>

<?php

} else {

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr><?php echo tep_draw_form('search', FILENAME_CUSTOMERS, '', 'get'); ?>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>

<td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td>

</form></tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LASTNAME; ?></td>

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FIRSTNAME; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACCOUNT_CREATED; ?></td>

 

<!--TotalB2B start-->

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_CUSTOMERS_STATUS; ?></td>

<!--TotalB2B end-->

 

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

</tr>

<?php

$search = '';

if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {

$keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));

$search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%'";

}

//TotalB2B start

$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_status, c.customers_email_address, c.customers_groups_id, c.customers_info, c.customers_discount, c.customers_discount_sign, a.entry_country_id from, c.customers_notes from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname";

//TotalB2B end

 

$customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows);

$customers_query = tep_db_query($customers_query_raw);

while ($customers = tep_db_fetch_array($customers_query)) {

$info_query = tep_db_query("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['customers_id'] . "'");

$info = tep_db_fetch_array($info_query);

 

if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $customers['customers_id']))) && !isset($cInfo)) {

$country_query = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$customers['entry_country_id'] . "'");

$country = tep_db_fetch_array($country_query);

 

$reviews_query = tep_db_query("select count(*) as number_of_reviews from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers['customers_id'] . "'");

$reviews = tep_db_fetch_array($reviews_query);

 

$customer_info = array_merge($country, $info, $reviews);

 

$cInfo_array = array_merge($customers, $customer_info);

$cInfo = new objectInfo($cInfo_array);

}

 

if (isset($cInfo) && is_object($cInfo) && ($customers['customers_id'] == $cInfo->customers_id)) {

echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '\'">' . "\n";

} else {

echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '\'">' . "\n";

}

?>

<td class="dataTableContent"><?php echo $customers['customers_lastname']; ?></td>

<td class="dataTableContent"><?php echo $customers['customers_firstname']; ?></td>

<td class="dataTableContent" align="right"><?php echo tep_date_short($info['date_account_created']); ?></td>

 

<!--TotalB2B start-->

<td class="dataTableContent" align="right"><?php if ($customers['customers_status'] == '1') {

echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '  <a href="' . tep_href_link(FILENAME_CUSTOMERS, 'action=setflag&flag=0&cID=' . $customers['customers_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';

} else {

echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS, 'action=setflag&flag=1&cID=' . $customers['customers_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);

} ?></td>

<!--TotalB2B end-->

 

 

<td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($customers['customers_id'] == $cInfo->customers_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

</tr>

<?php

}

?>

<tr>

<td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="smallText" valign="top"><?php echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>

<td class="smallText" align="right"><?php echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?></td>

</tr>

<?php

if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {

?>

<tr>

<td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS) . '">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>

</tr>

<?php

}

?>

</table></td>

</tr>

</table></td>

<?php

$heading = array();

$contents = array();

 

switch ($action) {

case 'confirm':

$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CUSTOMER . '</b>');

 

$contents = array('form' => tep_draw_form('customers', FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=deleteconfirm'));

$contents[] = array('text' => TEXT_DELETE_INTRO . '<br><br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');

if (isset($cInfo->number_of_reviews) && ($cInfo->number_of_reviews) > 0) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_reviews', 'on', true) . ' ' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews));

$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');

break;

default:

 

if (isset($cInfo) && is_object($cInfo)) {

$heading[] = array('text' => '<b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=confirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, 'cID=' . $cInfo->customers_id) . '">' . tep_image_button('button_orders.gif', IMAGE_ORDERS) . '</a> <a href="' . tep_href_link(FILENAME_MAIL, 'selected_box=tools&customer=' . $cInfo->customers_email_address) . '">' . tep_image_button('button_email.gif', IMAGE_EMAIL) . '</a>');

$contents[] = array('text' => '<br>' . TEXT_DATE_ACCOUNT_CREATED . ' ' . tep_date_short($cInfo->date_account_created));

$contents[] = array('text' => '<br>' . TEXT_DATE_ACCOUNT_LAST_MODIFIED . ' ' . tep_date_short($cInfo->date_account_last_modified));

$contents[] = array('text' => '<br>' . TEXT_INFO_DATE_LAST_LOGON . ' ' . tep_date_short($cInfo->date_last_logon));

 

$contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_OF_LOGONS . ' ' . $cInfo->number_of_logons);

$contents[] = array('text' => '<br>' . 'przypisany poziom upustu <br>w stosunku do<br> upustu produktu: <br><b> ' . $cInfo->customers_discount_sign .'</b> %');

$contents[] = array('text' => '<br>' . 'należy do grupy: <br><b> ' . tep_customers_groups_name($cInfo->customers_groups_id) .'</b>');

 

$contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . ' ' . $cInfo->countries_name);

$contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_OF_REVIEWS . ' ' . $cInfo->number_of_reviews);

$contents[] = array('text' => '<br>' . 'uwagi: <br><b> ' . $cInfo

Share this post


Link to post
Share on other sites

Hi Mark,

this seems to be the same problem I had.

Please have a look on my posts at page 4 of this Thread.

 

Hope it will help you.

 

Sincerely

Roberto

Share this post


Link to post
Share on other sites

You added c.customers_notes after the word "from".

ie: c.customers_info from, c.customers_notes from " . TABLE_CUSTOMERS

 

 

Thy this...

 

REPLACE:

//TotalB2B start
$customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_nip, 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_groups_id, c.customers_discount, c.customers_discount_sign, c.customers_default_address_id, c.customers_status, c.customers_info from, c.customers_notes 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)$HTTP_GET_VARS['cID'] . "'");

 

With this:

//TotalB2B start
$customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_nip, 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_groups_id, c.customers_discount, c.customers_discount_sign, c.customers_default_address_id, c.customers_status, c.customers_info, c.customers_notes 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)$HTTP_GET_VARS['cID'] . "'");

 

 

Also, please NEVER post ANY code unless you use the [ code ] tags.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites
Hi Mark,

this seems to be the same problem I had.

Please have a look on my posts at page 4 of this Thread.

 

Hope it will help you.

 

Sincerely

Roberto

 

 

Look at your code, it says this:

c.customers_info from, c.customers_notes

 

Should be this:

c.customers_info, c.customers_notes, from


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Hi Scott,

 

well, even if i change the code in admin/customers.php like

 

$customers_query = tep_db_query("select c.customers_id, c.customers_gender,  c.customers_firstname, 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 from, c.customers_info, c.customers_notes, 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)$HTTP_GET_VARS['cID'] . "'");

 

 

i always get the error:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' c.customers_info, c.customers_notes, from customers c left joi

 

select c.customers_id, c.customers_gender, c.customers_fsk_18, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_piva, a.entry_cf, 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 from, c.customers_info, c.customers_notes, from customers c left join address_book a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '72'

 

 

but if i remove : c.customers_info, c.customers_notes, from

 

from the line, the contribution works, exept i do not get the database values for the notes read in the admin notes customer field.

 

It's definitly this piece of code making the error.

 

What do i do wrong?

 

Thank you for your help

Sincerely

 

Roberto

 

 

Look at your code, it says this:

c.customers_info from, c.customers_notes

 

Should be this:

c.customers_info, c.customers_notes, from

Share this post


Link to post
Share on other sites
Hi Scott,

 

well, even if i change the code in admin/customers.php like

 

$customers_query = tep_db_query("select c.customers_id, c.customers_gender, ?c.customers_firstname, 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 from, c.customers_info, c.customers_notes, 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)$HTTP_GET_VARS['cID'] . "'");

i always get the error:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' c.customers_info, c.customers_notes, from customers c left joi

 

select c.customers_id, c.customers_gender, c.customers_fsk_18, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_piva, a.entry_cf, 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 from, c.customers_info, c.customers_notes, from customers c left join address_book a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '72'

but if i remove? :? c.customers_info, c.customers_notes, from

 

from the line, the contribution works, exept i do not get the database values for the notes read in the admin notes customer field.

 

It's definitly this piece of code making the error.

 

What do i do wrong?

 

Thank you for your help

Sincerely

 

Roberto

 

 

That is because you did it wrong AGAIN...

 

You state that you have this:

c.customers_info, c.customers_notes, from

 

If you look at my post when I stated to change it to... It should be this:

c.customers_info, c.customers_notes from

 

As you can see in red, you left the comma in this time

c.customers_info, c.customers_notes, from

 

ALSO, you still have 2 FROM and there should only be 1

 

See the quote from you above, see the items in RED. Then look at what I told you to do a few posts above, there is not a 2nd FROM anywhere in there.

Edited by PopTheTop

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

No problem, that is great that it is working for you...


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Scott ! i've got it :-)

 

It was the "from" which made me n**s.

 

I must let out the > c.customers_info < out of the code 'cause it makes also an error, but now the database entries are in the admin field when i edit the customer record again !

 

Sorry for making you getting crazy with me

 

Thank you for your help

 

Sincerely

Roberto

Share this post


Link to post
Share on other sites

LOL, sorry to make it sound that way, after reading my post to you I can see that it looked like I may have been annoyed or yelling but I wasn't. Glad to help when I can.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Hi,

 

I installed the contribution because it sounds great. I can put a note to a customer, but when I go to the Admin Notes screen in the Admin, the whole explorer locks up. Any idea what that might be? :(

 

Maurice

Share this post


Link to post
Share on other sites
Hi,

 

I installed the contribution because it sounds great. I can put a note to a customer, but when I go to the Admin Notes screen in the Admin, the whole explorer locks up. Any idea what that might be? :(

 

Maurice

 

 

Not sure why. This is a 1st I ever heard of this. It should not lock up due to this MOD. Did you go through step by step and make sure you did "everything" in the installation file? Have you tried using a different web browser like FireFox from http://www.mozilla.org/products/firefox ?


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Sorry, I do not know then...


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

hi

 

just wanted to say this is a very good contribution.. i installed it today and am playing around with it...

 

thanks alot for the fantastic module


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites
hi

 

just wanted to say this is a very good contribution.. i installed it today and am playing around with it...

 

thanks alot for the fantastic module

 

 

hmm... i spoke too soon...

 

unfortunately when i select a customer edit and then go to the admin box at the bottom to write my memo - the whole box is out of place and the page has to scroll sideways to get a full view.

 

please advise!!

 

thanks


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites
hmm... i spoke too soon...

 

unfortunately when i select a customer edit and then go to the admin box at the bottom to write my memo - the whole box is out of place and the page has to scroll sideways to get a full view.

 

please advise!!

 

thanks

 

 

That is a problem with your HTML code, most likely the HTML tables. load the customer edit page, view the source code from within your web browser and use a website or computer program that validates HTML code to check for errors.

Edited by PopTheTop

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×