Jump to content
PopTheTop

[Contribution] Admin Notes

Recommended Posts

Hi there I am getting the same error as Denise was

Parse error: syntax error, unexpected $end in /mounted-storage/home10/sub003/xxxxxxxxxx/xxxxxxxxxxx/admin/customers.php on line 857

when I go try to access my customer tab in Admin.

 

Here is my customer.php file

 

<?php

/*

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

 

osCommerce, Open Source E-Commerce Solutions

[url=http://www.oscommerce.com]http://www.oscommerce.com[/url]

 

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) {

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_newsletter = tep_db_prepare_input($HTTP_POST_VARS['customers_newsletter']);

 

$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_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_notes' => $customers_notes, // START \ END Admin Notes

'customers_newsletter' => $customers_newsletter);

 

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_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_db_query("delete from " . TABLE_SOURCES_OTHER . " where customers_id = '" . (int)$customers_id . "'");

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

break;

default:

// 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

$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_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 (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">

<?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>

</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="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 align="right" 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=&

Edited by Proud

Share this post


Link to post
Share on other sites

I have some errors coming up all of the sudden. Heres the errors:

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/mysite/public_html/catalog/set8up8/admin_notes.php on line 278

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/mysite/public_html/catalog/set8up8/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/mysite/public_html/catalog/set8up8/includes/classes/object_info.php on line 18

 

Heres the things that have changed since I know it was working with no errors:

*just moved to a new webhost, so any number of server settings COULD be different

*just applied the 'MySQL 5.0 Compatibility' part of the OSC 051113 update(although server is still using MySQL 4.X)

 

Any ideas why I would now be getting the above errors? Thanks :thumbsup:

Share this post


Link to post
Share on other sites
I have some errors coming up all of the sudden. Heres the errors:

Heres the things that have changed since I know it was working with no errors:

*just moved to a new webhost, so any number of server settings COULD be different

*just applied the 'MySQL 5.0 Compatibility' part of the OSC 051113 update(although server is still using MySQL 4.X)

 

Any ideas why I would now be getting the above errors? Thanks :thumbsup:

 

in admin/admin_notes.php

Line 278

$sInfo_array = array_merge($admin_quer,'');

Change it to:

$sInfo_array = array_merge($admin_quer);

Share this post


Link to post
Share on other sites
I have some errors coming up all of the sudden. Heres the errors:

Heres the things that have changed since I know it was working with no errors:

*just moved to a new webhost, so any number of server settings COULD be different

*just applied the 'MySQL 5.0 Compatibility' part of the OSC 051113 update(although server is still using MySQL 4.X)

 

Any ideas why I would now be getting the above errors? Thanks :thumbsup:

 

in admin/admin_notes.php

Line 278

$sInfo_array = array_merge($admin_quer,'');

Change it to:

$sInfo_array = array_merge($admin_quer);

Share this post


Link to post
Share on other sites

Hey, installed this contribution and it seems to work fine... till I go to my admin/orders.php page and get the following error instead:

 

1146 - Table 'silkspla_test.TABLE_ORDERS_COMMENT' doesn't exist

 

select orders_comment_id, orders_comment_name from TABLE_ORDERS_COMMENT where language_id = '1'

 

[TEP STOP]

 

clearly I am missing something in the SQL side of the install... but any suggestions exactly what to fix?

 

Thanks.

Share this post


Link to post
Share on other sites

Having problems with the update of a note in the admin_notes.php..

 

OK i create a note.. no problem shows in the list and everytyhing is fine...

 

When i goto edit the note the note appears i make a change... Press Update... and ehhhh... the note is still there in the list but the title disppears.. When i go view the nots again.. nothing is in there... the note is blank..

 

 

Any light on this much appreciated..

Share this post


Link to post
Share on other sites

peteruittilburg- thanks for the fix, it worked. Any idea WHY I suddenly had that problem?

 

Also, I just noticed that if I click on one of the colored marker buttons on teh main admin notes page....after it reloads the page with the new marker setting the INSERT button is gone.

Share this post


Link to post
Share on other sites

Hey, first off, thanks for this contribution, it is very helpful for recording production and shipping errors on a per customer basis. I am trying to get each customer's notes show up on the orders page in admin. I want it to show beneath the line containing order, customer name, order total, date purchased, status, action for each order on the page... without having to click on a specific order. Any help in this would be very much appreciated. very much.

 

Thanks.

Share this post


Link to post
Share on other sites

Excellent contribution and very useful.

 

To be even more useful, is it possible to

 

1. add an extra column in the admin_notes.php page to display the Dates to Remember with most especially, the ability to sort by the dates?

 

2. be notified by e-mail when a Date to Remember is reached, or to have another type of remonder upon entering the Admin section?

 

Regards,

Share this post


Link to post
Share on other sites

Hi, i figured out what the problem was..

There are some typo's in the manual

 

admin/includes/database_tables.php

old

// START - Admin Notes
 define('TABLE_ADMIN_NOTES','admin_notes');
 define('TABLE_ADMIN_NOTES_TYPE','admin_notes_type');
// END - Admin Notes

New:

// START - Admin Notes
 define('TABLE_ADMIN_NOTES', 'admin_notes');
 define('TABLE_ADMIN_NOTES_TYPE', 'admin_notes_type');
// END - Admin Notes

 

admin/includes/filenames.php

old:

// START - Admin Notes
 define('TABLE_ADMIN_NOTES','admin_notes');
 define('TABLE_ADMIN_NOTES_TYPE','admin_notes_type');
// END - Admin Notes

New:

// START - Admin Notes
 define('FILENAME_ADMIN_NOTES', 'admin_notes.php');
 define('FILENAME_ADMIN_NOTES_HELP', 'admin_notes_help.php');
// END - Admin Notes

 

The missing white spaces were creating this error..

Maybee somebody could fix the manual?, would be handy for other people

Share this post


Link to post
Share on other sites

i am very surprised that nobody notice the problem of ' SYNTAX ERROR' when you add a note contening an apostroph like " Martin's Brother " , the string submitted in the admin note should be rework to not make this syntax error :'(


MS2

Share this post


Link to post
Share on other sites
Having problems with the update of a note in the admin_notes.php..

 

OK i create a note.. no problem shows in the list and everytyhing is fine...

 

When i goto edit the note the note appears i make a change... Press Update... and ehhhh... the note is still there in the list but the title disppears.. When i go view the nots again.. nothing is in there... the note is blank..

Any light on this much appreciated..

I am also getting this problem - can anyone shed some light here please. It shows up on the customers page and order page so it obviously is still in the database.

Share this post


Link to post
Share on other sites

Very neat Contribution, Thank you!

 

I haven't tried putting an apostrophe in the Notes, but it sounds like one to watch out for?

 

On another point. If you add your own Notes Categories via the blank box to the right of 'Select Category' when making a Note, then that new Category e.g. 'MP' is successfully added to the categories list.

 

However - the new category does not show up when hovering over the Note title, and the new Category can't be filtered on from the drop down menu.

 

Looking at the admin_notes table shows that the 'category' field is blank instead of saying 'MP', so I'm guessing the new category isn't writing into the database fieldas it should?

Share this post


Link to post
Share on other sites

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\xxx\xxx\Catalog\Admin\admin_notes.php on line 279

 

 

 

upon installation i had errors on the array_merge function, I readup about it on php.net and it is summit to do with php5 changes ???

 

find this

$sInfo_array = array_merge($admin_quer, '');

 

replace with this

$aa = array();

$sInfo_array = array_merge((array)$admin_quer, (array)$aa);

 

 

Many thanks for a great contrib :thumbsup:


if at first it doesn't work... use a bigger hammer

Share this post


Link to post
Share on other sites

ignore the above sorry :blush: just after I worked that out I found the same info on the contributions update (DOH!)

 

The only remaining problem I have now is this SYNTAX ERROR with ' LOL, I wouldn't know where to start in PHP so I will leave this for someone else to come up with a solution ;)


if at first it doesn't work... use a bigger hammer

Share this post


Link to post
Share on other sites

Hello,

 

Could someone please tell me what I have forgotten to add, (probably some code) I did add the code to admin/database and filenames and Ive ran the SQL.

 

In admin/admin_notes.php I get this error:

 

1146 - Table 'wwwshop_osc1.admin_notes' doesn't exist

 

select count(*) as total from admin_notes

 

[TEP STOP]

 

If I select a catagory then it changes to: (whatever catagory is chosen from the pull down menu)

 

select count(*) as total from admin_notes where category = 'Administration'

 

Thanks

Share this post


Link to post
Share on other sites

Thanks for the contrib. Just installed it and it seems to work pretty good.

 

We are a couople of admins and this will surely help in our communication with eachother :)

Share this post


Link to post
Share on other sites

I've installed this contribution and love it. The only thing that I would like to do is have more than 25 notes viewable on a single page. What file do I need to edit to make this possible, and will editing the file to make this change affect other admin pages? I ask because I believe it's a variable that has a wider scope than just this contribution. Thanks.

Share this post


Link to post
Share on other sites
Having problems with the update of a note in the admin_notes.php..

 

OK i create a note.. no problem shows in the list and everytyhing is fine...

 

When i goto edit the note the note appears i make a change... Press Update... and ehhhh... the note is still there in the list but the title disppears.. When i go view the nots again.. nothing is in there... the note is blank..

Any light on this much appreciated..

 

Have anyone found a solution for this problem? Can't figure it out...

Share this post


Link to post
Share on other sites

I've also got the same update problem as others. I have this installation my personal store running MS2 but I've justed added this to a clients RC2 store that I started last week and cannot get the update function to work, shows blank as described as others. If anyone who has posted here in the past has found the solution please report back with the fix.

Share this post


Link to post
Share on other sites
I've also got the same update problem as others. I have this installation my personal store running MS2 but I've justed added this to a clients RC2 store that I started last week and cannot get the update function to work, shows blank as described as others. If anyone who has posted here in the past has found the solution please report back with the fix.

 

 

I think this problem occurs with register_globals = off. I also fixed the date_status_change problem. My fixes are located in 2 places in /catalog/admin/admin_notes.php

 

Near line 57 locate the following code:

case 'update':
     tep_db_query("update " . TABLE_ADMIN_NOTES . " set contr_last_modified = now(), status =  '" . $status . "', admin_note =  '" . $admin_note_new . "', category =  '" . $file_type_id . "', config_comments = '" . $config_comments . "', last_update = '" . $last_update . "' where contr_id = '" . $HTTP_POST_VARS['contr_id'] . "'");
     tep_redirect(tep_href_link(FILENAME_ADMIN_NOTES, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $contr_id . '&sort=' . $HTTP_GET_VARS['sort']));
     break;

 

Replace that code with the following code:

case 'update':
// Custom - Fix date_status_change	
  if ($HTTP_POST_VARS['date_status_change']) tep_db_query("update " . TABLE_ADMIN_NOTES . " set date_status_change = now() " . " where contr_id = '" . $HTTP_POST_VARS['contr_id'] . "'");
// Custom - Use $HTTP_POST_VARS with register_globals = off 
  tep_db_query("update " . TABLE_ADMIN_NOTES . " set contr_last_modified = now(), status = '" . $HTTP_POST_VARS['status'] . "', admin_note = '" . $HTTP_POST_VARS['admin_note_new'] . "', category =  '" . $HTTP_POST_VARS['file_type_id'] . "', config_comments = '" . $HTTP_POST_VARS['config_comments'] . "', last_update = '" . $HTTP_POST_VARS['last_update'] . "' where contr_id = '" . $HTTP_POST_VARS['contr_id'] . "'");
  tep_redirect(tep_href_link(FILENAME_ADMIN_NOTES, 'page=' . $HTTP_POST_VARS['page'] . '&sID=' . $HTTP_POST_VARS['contr_id'] . '&sort=' . $HTTP_POST_VARS['sort']));
     break;

 

Near line 182 locate the following code:

<script language="javascript">
 var LastUpdate = new ctlSpiffyCalendarBox("LastUpdate", "new_contr", "last_update","btnDate1","<?php echo $sInfo->last_update; ?>",scBTNMODE_CUSTOMBLUE);
</script>

     <tr><form name="new_contr" <?php echo 'action="' . tep_href_link(FILENAME_ADMIN_NOTES, tep_get_all_get_params(array('action', 'info', 'sID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('contr_id', $HTTP_GET_VARS['sID']) ; ?>
       <td><br><table border="0" cellspacing="0" cellpadding="2">

 

Replace that code with the following code:

<script language="javascript">
 var LastUpdate = new ctlSpiffyCalendarBox("LastUpdate", "new_contr", "last_update","btnDate1","<?php echo $sInfo->last_update; ?>",scBTNMODE_CUSTOMBLUE);
</script>
<?php
// Custom - Initial "Status" setting
$initial_status = $sInfo->status; 
// Custom - Fix date_status_change in 1st line of form statement below 
?>
     <tr><form name="new_contr" <?php echo 'action="' . tep_href_link(FILENAME_ADMIN_NOTES, tep_get_all_get_params(array('action', 'info', 'sID', 'date_status_change')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('contr_id', $HTTP_GET_VARS['sID']); if($initial_status != $HTTP_GET_VARS['status']) echo tep_draw_hidden_field('date_status_change', 'true') ?>
       <td><br><table border="0" cellspacing="0" cellpadding="2">

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

×