Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1054 myql error, please help, thanks!! :o)


stargirlnine

Recommended Posts

HI, I recently installed the Featured Products contribution at http://www.oscommerce.com/community/contributions,651

 

The install was easy for me. Then I logged into the admin, click Catalog then Add Featured Products, I get this mysql error:

 

1054 - Unknown column 'customers_group_name' in 'field list'

 

select distinct customers_group_name, customers_group_id from customers order by customers_group_id

 

[TEP STOP]

 

I saw in the list of contribs at the same link above, a fix for a 1054 error that seemed slightly different than mine. I installed it anyway but it didn't work. Any assistance would be greatly appreciated!!Here is a copy of the sql file in blue:

 

 

create table featured (

featured_id int(11) not null auto_increment,

products_id int(11) default '0' not null ,

featured_date_added datetime ,

featured_last_modified datetime ,

expires_date datetime ,

date_status_change datetime ,

status int(1) default '1' ,

PRIMARY KEY (featured_id)

);

 

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) values ('39','Featured', 'Featured Products Display', '339', '1'

);

 

INSERT into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) values ('Display Featured Products', 'FEATURED_PRODUCTS_DISPLAY', 'true', 'Set to true or false in order to display featured.', '39', '1', now(), now()

);

 

INSERT into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) values ('Maximum Display of Featured', 'MAX_DISPLAY_FEATURED_PRODUCTS', '6', 'This is the maximum amount of items to display on the front page.', '39', '2', now(), now()

);

Link to comment
Share on other sites

I believe that 'customers_group_name' is the name of a table in SPPC (separate price per customer). Its possible you've picked up a version of Featured Products that includes code from another contribution or inadvertently included it yourself.

 

-jared

Link to comment
Share on other sites

I believe that 'customers_group_name' is the name of a table in SPPC (separate price per customer). Its possible you've picked up a version of Featured Products that includes code from another contribution or inadvertently included it yourself.

 

-jared

 

 

Thanks for your reply Jared!

 

It's strange, I tried searching for that table name in my database and I can't find it.

:blink:

Nor is anything like it in the sql file that I uploaded. this is very strange to me.

:blink:

 

do you think it could be somewhere in my php coding?

 

Thanks again!! :thumbsup:

Link to comment
Share on other sites

i have the same problem

 

i found only this (1.5.6 package)

 

may be it has something to do with the edits of the the html_output.php

 

may be only some parts have to be edited if you dont use that other contrib

 

 

but: i dont know wich if my suggestion is right

 

 

please help :-)

Link to comment
Share on other sites

i have the same problem

 

i found only this (1.5.6 package)

 

may be it has something to do with the edits of the the html_output.php

 

may be only some parts have to be edited if you dont use that other contrib

but: i dont know wich if my suggestion is right

please help :-)

 

Check your server - are you running mySQL 5.0.x?

my sites:

----------

www.preciousmetal-online.co.uk

www.liparazzi.com

www.yaoh.co.uk

Link to comment
Share on other sites

Greetings,

 

I've been chasing this same error for three days installing a different contribution. What I just did was to make absoultely sure that the order of the fields in the table was the same as the order in the error code. Fixed the problem!!! (with 5 minutes to go before my drop dead deadline). Hope this helps.

 

CRR

Link to comment
Share on other sites

I don't this error you are getting is from the contrib you listed. There is no reference in the contrib to the field 'customers_group_name', which is a non-existant field in the table customers, which is why you are getting this error. Did you add another contrib somewhere recently that would affect the admin portion and possibly did not run the sql file that would undoubted have added the field in question? Post the code for page that is giving you errors if you are not sure.

Link to comment
Share on other sites

Here is what the read me file from the contrib has you enter into the html_output file:

 

Step 13:

For this step some customizing may need to be done. The following code includes the seperate pricing contribution. You may also want to add things like a different model number field, cost, or other description...

 

edit /catalog/admin/includes/functions/html_output.php and at the very bottom right before the ?> add:

 

//draw products multiselect box

function tep_draw_products_mselect($name, $parameters = '', $selected_vals) {

global $currencies, $languages_id;

 

if ($exclude == '') {

$exclude = array();

}

 

$select_string = '<select name="' . $name . '"';

if ($parameters) $select_string .= ' ' . $parameters;

$select_string .= ' multiple>';

 

// BOF - Separate_Pricing_Per_Customer_v3.5

$all_groups=array();

$customers_groups_query = tep_db_query("select distinct customers_group_name, customers_group_id from " . TABLE_CUSTOMERS . " order by customers_group_id ");

while ($existing_groups = tep_db_fetch_array($customers_groups_query)) {

$all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];

}

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_code from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_code");

while ($products = tep_db_fetch_array($products_query)) {

// BOF - Separate_Pricing_Per_Customer_v3.5

// Next lines were original code

// if (!in_array($products['products_id'], $exclude)) {

// $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>';

// }

 

$price_query=tep_db_query("select customers_group_price, customers_group_id from " . TABLE_PRODUCTS_GROUPS . " where products_id = " . $products['products_id']);

$product_prices=array();

while($prices_array=tep_db_fetch_array($price_query)){

$product_prices[$prices_array['customers_group_id']]=$prices_array['customers_group_price'];

}

reset($all_groups);

$price_string="";

$sde=0;

while(list($sdek,$sdev)=each($all_groups)){

//if (!in_array((int)$products['products_id'].":".(int)$sdek, $exclude)) {

if($sde)

$price_string.=", ";

$price_string.=$sdev.": ".$currencies->format(isset($product_prices[$sdek]) ? $product_prices[$sdek]:$products['products_price']);

$sde=1;

}

//}

if (!in_array($products['products_id'], $selected_vals)) {

$select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_model'] . ' ' . $products['products_name'] . ' (' . $price_string . ')</option>\n';

} else {

$select_string .= '<option value="' . $products['products_id'] . '" SELECTED>' . $products['products_model'] . ' ' . $products['products_name'] . ' (' . $price_string . ')</option>\n';

}

// EOF - Separate_Pricing_Per_Customer_v3.5

}

 

$select_string .= '</select>';

 

return $select_string;

}

 

//draw products multiselect delete box

function tep_draw_products_delete_mselect($name, $parameters = '', $selected_vals) {

global $currencies, $languages_id;

 

if ($exclude == '') {

$exclude = array();

}

 

$select_string = '<select name="' . $name . '"';

if ($parameters) $select_string .= ' ' . $parameters;

$select_string .= ' multiple>';

 

$products_query = tep_db_query("select p.products_id, pd.products_name, s.featured_id, s.featured_date_added, s.featured_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = s.products_id order by pd.products_name");

while ($products = tep_db_fetch_array($products_query)) {

$select_string .= '<option value="' . $products['featured_id'] . '">' . $products['products_model'] . ' ' . $products['products_name'].'</option>\n';

}

 

$select_string .= '</select>';

 

return $select_string;

}

 

This error is definately from the contrib. the html output addition refernces customer_group_name twice. I defiantely dont have that field in my database, ran over it with a fine tooth comb.

 

I have already tried emailing the contributer a few days ago, but no response.

 

should we just find the SPPC (separate price per customer) module and install it? do you think that will work? I really want this featured products module that includes the select multiple categories. (the contributer combined 2 into one)

 

THANKS FOR YOUR RESPONSES!!! GREATLY APPRECIATED!! :D

Link to comment
Share on other sites

1. Backup the files in question.

2. Remove the references to the incorrect table.

3. Try it again. It will probably work now.

 

-jared

Link to comment
Share on other sites

1. Backup the files in question.

2. Remove the references to the incorrect table.

3. Try it again. It will probably work now.

 

-jared

 

Hi Jared!

 

I have tried reinstalling. As for removing the references to the incorrect table, I tried deleting them and changing them in the html_output and couldn't access my admin at all. (I am not an advanced php user, I don't know how to reconstruct php).

 

I deleted the blocks that were meant for separate pricing and it also crashed my admin.

 

any more ideas? Thanks again for your response!

Link to comment
Share on other sites

okay, so I continued to mess around with the addition to the html_output file and with this code:

 

//draw products multiselect box

function tep_draw_products_mselect($name, $parameters = '', $selected_vals) {

global $currencies, $languages_id;

 

if ($exclude == '') {

$exclude = array();

}

 

$select_string = '<select name="' . $name . '"';

if ($parameters) $select_string .= ' ' . $parameters;

$select_string .= ' multiple>';

}

 

$select_string .= '</select>';

 

return $select_string;

 

//draw products multiselect delete box

function tep_draw_products_delete_mselect($name, $parameters = '', $selected_vals) {

global $currencies, $languages_id;

 

if ($exclude == '') {

$exclude = array();

}

 

$select_string = '<select name="' . $name . '"';

if ($parameters) $select_string .= ' ' . $parameters;

$select_string .= ' multiple>';

 

$products_query = tep_db_query("select p.products_id, pd.products_name, s.featured_id, s.featured_date_added, s.featured_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = s.products_id order by pd.products_name");

while ($products = tep_db_fetch_array($products_query)) {

$select_string .= '<option value="' . $products['featured_id'] . '">' . $products['products_model'] . ' ' . $products['products_name'].'</option>\n';

}

 

$select_string .= '</select>';

 

return $select_string;

}

 

 

I can ALMOST add a featured product. I don't get the 1054 error message, but the field to choose a product is not there, only the featured product expire date. for fun I chose an expiration date and clicked add, but nothing was added, nor was there an option to add the product.

 

Does anyome knw what I need to add so I can choose a product? THANKS AGAIN!!

Link to comment
Share on other sites

Stargirlnine,

I would add that element to the table customers and give it varchar(32) initial null...may be

who ever created the contri left it out in ther sql script. Its not going to hurt anything...at least you will be able to get further along and see what

else you need to fix...may nothing...

I hope this helps

Dittone

Roman

Link to comment
Share on other sites

Stargirlnine,

I would add that element to the table customers and give it varchar(32) initial null...may be

who ever created the contri left it out in ther sql script. Its not going to hurt anything...at least you will be able to get further along and see what

else you need to fix...may nothing...

I hope this helps

Dittone

Roman

 

 

i did folllowing ( and it did NOT help) i used the sql-script "sppc_v41_install.sql" of sppc wich is adding the tables

 

but the error still apeares - i dont want to install the sppc so i stoped now for the first

Link to comment
Share on other sites

HI, I recently installed the Featured Products contribution at http://www.oscommerce.com/community/contributions,651

 

The install was easy for me. Then I logged into the admin, click Catalog then Add Featured Products, I get this mysql error:

 

1054 - Unknown column 'customers_group_name' in 'field list'

 

select distinct customers_group_name, customers_group_id from customers order by customers_group_id

 

[TEP STOP]

 

Hi stargirlnine, any light on this error yet? I have just installed this mod and have come across the same error that you have.......have you been able to resolve it :huh:

 

Anyone else with any more great ideas....please :blush:

Link to comment
Share on other sites

OK, I am posting step 14 that came in the readme file. As is suggested with this step we may need to make our own adjustments as it has 'seperate pricing per customer' included. Any great advice on what I should remove, as I do not have 'seperate pricing per customer' contrib added to my store. I am presuming that it is from within this piece of code that may be causing the 1054 error :(

Step 13:

For this step some customizing may need to be done. The following code includes the seperate pricing contribution. You may also want to add things like a different model number field, cost, or other description...

 

edit /catalog/admin/includes/functions/html_output.php and at the very bottom right before the ?> add:

 

//draw products multiselect box

function tep_draw_products_mselect($name, $parameters = '', $selected_vals) {

global $currencies, $languages_id;

 

if ($exclude == '') {

$exclude = array();

}

 

$select_string = '<select name="' . $name . '"';

if ($parameters) $select_string .= ' ' . $parameters;

$select_string .= ' multiple>';

 

// BOF - Separate_Pricing_Per_Customer_v3.5

$all_groups=array();

$customers_groups_query = tep_db_query("select distinct customers_group_name, customers_group_id from " . TABLE_CUSTOMERS . " order by customers_group_id ");

while ($existing_groups = tep_db_fetch_array($customers_groups_query)) {

$all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];

}

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_code from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_code");

while ($products = tep_db_fetch_array($products_query)) {

// BOF - Separate_Pricing_Per_Customer_v3.5

// Next lines were original code

// if (!in_array($products['products_id'], $exclude)) {

// $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>';

// }

 

$price_query=tep_db_query("select customers_group_price, customers_group_id from " . TABLE_PRODUCTS_GROUPS . " where products_id = " . $products['products_id']);

$product_prices=array();

while($prices_array=tep_db_fetch_array($price_query)){

$product_prices[$prices_array['customers_group_id']]=$prices_array['customers_group_price'];

}

reset($all_groups);

$price_string="";

$sde=0;

while(list($sdek,$sdev)=each($all_groups)){

//if (!in_array((int)$products['products_id'].":".(int)$sdek, $exclude)) {

if($sde)

$price_string.=", ";

$price_string.=$sdev.": ".$currencies->format(isset($product_prices[$sdek]) ? $product_prices[$sdek]:$products['products_price']);

$sde=1;

}

//}

if (!in_array($products['products_id'], $selected_vals)) {

$select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_model'] . ' ' . $products['products_name'] . ' (' . $price_string . ')</option>\n';

} else {

$select_string .= '<option value="' . $products['products_id'] . '" SELECTED>' . $products['products_model'] . ' ' . $products['products_name'] . ' (' . $price_string . ')</option>\n';

}

// EOF - Separate_Pricing_Per_Customer_v3.5

}

 

$select_string .= '</select>';

 

return $select_string;

}

 

//draw products multiselect delete box

function tep_draw_products_delete_mselect($name, $parameters = '', $selected_vals) {

global $currencies, $languages_id;

 

if ($exclude == '') {

$exclude = array();

}

 

$select_string = '<select name="' . $name . '"';

if ($parameters) $select_string .= ' ' . $parameters;

$select_string .= ' multiple>';

 

$products_query = tep_db_query("select p.products_id, pd.products_name, s.featured_id, s.featured_date_added, s.featured_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = s.products_id order by pd.products_name");

while ($products = tep_db_fetch_array($products_query)) {

$select_string .= '<option value="' . $products['featured_id'] . '">' . $products['products_model'] . ' ' . $products['products_name'].'</option>\n';

}

 

$select_string .= '</select>';

 

return $select_string;

}

THANX in advance :)

Link to comment
Share on other sites

OK, I am posting step 14 that came in the readme file. As is suggested with this step we may need to make our own adjustments as it has 'seperate pricing per customer' included. Any great advice on what I should remove, as I do not have 'seperate pricing per customer' contrib added to my store. I am presuming that it is from within this piece of code that may be causing the 1054 error :(

 

THANX in advance :)

Bump?! :blush:

Link to comment
Share on other sites

Hi Guys,

 

I'm getting the same error and it drove me bonkers!!!

 

It seemed someone has added another contrib into this and thats why we get the error (of course, you know that)

Not being an advanced php programmer myself, I decided to try to install an earlier version. Firstly uninstall your current featured products version.

 

(alternatively if you don't want to do that, then make a few edits by comparing the readme files in the two different packages, and upload the files in the new contrib to overwrite the old ones. There are only a couple of changes, bascially you have to remove all references to featured_products.php)

 

Then go to the featured product download page and download the contrib:

 

Featured Products 1.5 by Jesse Labrocca 21 Jan 2004

 

This is the module without the prcing system we seem to be having the problem with. It works and posts to the catalog, however I do get an error about headers not being sent after I have added the featured product in admin, but I'm working on this!!

 

- hope that helps, if you get past the error I'm getting, please collaborate, lets see if we can get this one working together!!

 

John

Link to comment
Share on other sites

Hi Guys,

 

I'm getting the same error and it drove me bonkers!!!

 

It seemed someone has added another contrib into this and thats why we get the error (of course, you know that)

Not being an advanced php programmer myself, I decided to try to install an earlier version. Firstly uninstall your current featured products version.

 

(alternatively if you don't want to do that, then make a few edits by comparing the readme files in the two different packages, and upload the files in the new contrib to overwrite the old ones. There are only a couple of changes, bascially you have to remove all references to featured_products.php)

 

Then go to the featured product download page and download the contrib:

 

Featured Products 1.5 by Jesse Labrocca 21 Jan 2004

 

This is the module without the prcing system we seem to be having the problem with. It works and posts to the catalog, however I do get an error about headers not being sent after I have added the featured product in admin, but I'm working on this!!

 

- hope that helps, if you get past the error I'm getting, please collaborate, lets see if we can get this one working together!!

 

John

 

Don't use the contrib I stated above, use this one, it gets rid of the erros I was getting

 

Featured Products 1.5.1 Erik Chumley 22 Jan 2004

 

John

Link to comment
Share on other sites

Don't use the contrib I stated above, use this one, it gets rid of the erros I was getting

 

Featured Products 1.5.1 Erik Chumley 22 Jan 2004

 

John

Thanxs heaps for your help John :thumbsup:

Will give it a go :D

Link to comment
Share on other sites

Don't use the contrib I stated above, use this one, it gets rid of the erros I was getting

 

Featured Products 1.5.1 Erik Chumley 22 Jan 2004

 

John

 

Hie.

 

Yes that works. But even better, I have just ran a compare and I isolated some code in the version 1.5.6 I suspected to be offensive. The only file that seem to be affected is admin\featured.php. Here is the corrected file.

 

BE WARNED. I am not a programmer at all so use the code with caution. I would suggest that somebody looks at it first before we use it, but it is working. Can insert, delete and view featured products on the index.php.

 

Line 34 - 38, Line 39 - 42 and line 246

 

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License

 Featured Products admin
*/

 require('includes/application_top.php');

 function tep_set_featured_status($featured_id, $status) {
if ($status == '1') {
  return tep_db_query("update " . TABLE_FEATURED . " set status = '1', expires_date = NULL, date_status_change = NULL where featured_id = '" . $featured_id . "'");
} elseif ($status == '0') {
  return tep_db_query("update " . TABLE_FEATURED . " set status = '0', date_status_change = now() where featured_id = '" . $featured_id . "'");
} else {
  return -1;
}
 }

 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

 switch ($HTTP_GET_VARS['action']) {
case 'setflag':
  tep_set_featured_status($HTTP_GET_VARS['id'], $HTTP_GET_VARS['flag']);
  tep_redirect(tep_href_link(FILENAME_FEATURED, '', 'NONSSL'));
  break;
case 'insert':
  $expires_date = '';
  if ($HTTP_POST_VARS['day'] && $HTTP_POST_VARS['month'] && $HTTP_POST_VARS['year']) {
	$expires_date = $HTTP_POST_VARS['year'];
	$expires_date .= (strlen($HTTP_POST_VARS['month']) == 1) ? '0' . $HTTP_POST_VARS['month'] : $HTTP_POST_VARS['month'];
	$expires_date .= (strlen($HTTP_POST_VARS['day']) == 1) ? '0' . $HTTP_POST_VARS['day'] : $HTTP_POST_VARS['day'];
  }

  tep_db_query("insert into " . TABLE_FEATURED . " (products_id, featured_date_added, expires_date, status) values ('" . $HTTP_POST_VARS['products_id'] . "', now(), '" . $expires_date . "', '1')");
  tep_redirect(tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page']));
 $selected_catids = $HTTP_POST_VARS['products_id'];
 if ($selected_catids)
 {
	foreach ($selected_catids as $current_category_id)
	{
	tep_db_query("insert into " . TABLE_FEATURED . " (products_id, featured_date_added, expires_date, status) values ('" . $current_category_id . "', now(), '" . $expires_date . "', '1')");
	}
 }	  
tep_redirect(tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page']));
  break;
case 'update':
  $expires_date = '';
  if ($HTTP_POST_VARS['day'] && $HTTP_POST_VARS['month'] && $HTTP_POST_VARS['year']) {
	$expires_date = $HTTP_POST_VARS['year'];
	$expires_date .= (strlen($HTTP_POST_VARS['month']) == 1) ? '0' . $HTTP_POST_VARS['month'] : $HTTP_POST_VARS['month'];
	$expires_date .= (strlen($HTTP_POST_VARS['day']) == 1) ? '0' . $HTTP_POST_VARS['day'] : $HTTP_POST_VARS['day'];
  }

  tep_db_query("update " . TABLE_FEATURED . " set featured_last_modified = now(), expires_date = '" . $expires_date . "' where featured_id = '" . $HTTP_POST_VARS['featured_id'] . "'");
  tep_redirect(tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $featured_id));
  break;
case 'deleteconfirm':
  //$featured_id = tep_db_prepare_input($HTTP_GET_VARS['sID']);

  //tep_db_query("delete from " . TABLE_FEATURED . " where featured_id = '" . tep_db_input($featured_id) . "'");

 $selected_catids = $HTTP_POST_VARS['delete_featured_id'];
 if ($selected_catids)
 {
	foreach ($selected_catids as $current_category_id)
	{
	tep_db_query("delete from " . TABLE_FEATURED . " where featured_id = '" . $current_category_id . "'");
	}
 } 
  tep_redirect(tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page']));
  break;
 }
?>
<!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 ( ($HTTP_GET_VARS['action'] == 'new') || ($HTTP_GET_VARS['action'] == 'edit') ) {
?>
<link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css">
<script language="JavaScript" src="includes/javascript/calendarcode.js"></script>
<?php
 }
?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<div id="popupcalendar" class="text"></div>
<!-- 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">
  <tr>
	<td width="100%"><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>
<?php
 if ( ($HTTP_GET_VARS['action'] == 'new') || ($HTTP_GET_VARS['action'] == 'edit') ) {
$form_action = 'insert';
if ( ($HTTP_GET_VARS['action'] == 'edit') && ($HTTP_GET_VARS['sID']) ) {
  $form_action = 'update';

  $product_query = tep_db_query("select p.products_id, pd.products_name, s.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_FEATURED . " s where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = s.products_id and s.featured_id = '" . $HTTP_GET_VARS['sID'] . "' order by pd.products_name");
  $product = tep_db_fetch_array($product_query);

  $sInfo = new objectInfo($product);
} else {
  $sInfo = new objectInfo(array());

// create an array of featured products, which will be excluded from the pull down menu of products
// (when creating a new featured product)
  $featured_array = array();
  $featured_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " s where s.products_id = p.products_id");
  while ($featured = tep_db_fetch_array($featured_query)) {
	$featured_array[] = $featured['products_id'];
  }
}
?>
  <tr><form name="new_feature" <?php echo 'action="' . tep_href_link(FILENAME_FEATURED, 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('featured_id', $HTTP_GET_VARS['sID']); ?>
	<td><br><table border="0" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><?php echo TEXT_FEATURED_PRODUCT; ?>?</td>
<td class="main"><?php echo ($sInfo->products_name) ? $sInfo->products_name : tep_draw_products_pull_down('products_id', 'style="font-size:10px"', $featured_array); echo tep_draw_hidden_field('products_price', $sInfo->products_price); ?></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo TEXT_FEATURED_EXPIRES_DATE; ?>?</td>
		<td class="main"><?php echo tep_draw_input_field('day', substr($sInfo->expires_date, 8, 2), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month', substr($sInfo->expires_date, 5, 2), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year', substr($sInfo->expires_date, 0, 4), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="java script:calClick();return false;" onmouseover="calSwapImg('BTN_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_date', 'img_Date_DOWN');showCalendar('new_feature','dteWhen','BTN_date');return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_date"'); ?></a></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '???<a href="' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $HTTP_GET_VARS['sID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
	  </tr>
	</table></td>
  </form></tr>
<?php
 } else {
?>
  <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_PRODUCTS; ?></td>
			<td class="dataTableHeadingContent" align="right">?</td>
			<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
			<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>?</td>
		  </tr>
<?php
$featured_query_raw = "select p.products_id, pd.products_name, s.featured_id, s.featured_date_added, s.featured_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = s.products_id order by pd.products_name";
$featured_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $featured_query_raw, $featured_query_numrows);
$featured_query = tep_db_query($featured_query_raw);
while ($featured = tep_db_fetch_array($featured_query)) {
  if ( ((!$HTTP_GET_VARS['sID']) || ($HTTP_GET_VARS['sID'] == $featured['featured_id'])) && (!$sInfo) ) {

	$products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . $featured['products_id'] . "'");
	$products = tep_db_fetch_array($products_query);
	$sInfo_array = array_merge($featured, $products);
	$sInfo = new objectInfo($sInfo_array);
  }

  if ( (is_object($sInfo)) && ($featured['featured_id'] == $sInfo->featured_id) ) {
	echo '				  <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->featured_id . '&action=edit') . '\'">' . "\n";
  } else {
	echo '				  <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $featured['featured_id']) . '\'">' . "\n";
  }
?>
			<td  class="dataTableContent"><?php echo $featured['products_name']; ?></td>
			<td  class="dataTableContent" align="right">?</td>
			<td  class="dataTableContent" align="right">
<?php
  if ($featured['status'] == '1') {
	echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '??<a href="' . tep_href_link(FILENAME_FEATURED, 'action=setflag&flag=0&id=' . $featured['featured_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_FEATURED, 'action=setflag&flag=1&id=' . $featured['featured_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>
			<td class="dataTableContent" align="right"><?php if ( (is_object($sInfo)) && ($featured['featured_id'] == $sInfo->featured_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $featured['featured_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%" cellpadding="0"cellspacing="2">
			  <tr>
				<td class="smallText" valign="top"><?php echo $featured_split->display_count($featured_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_FEATURED); ?></td>
				<td class="smallText" align="right"><?php echo $featured_split->display_links($featured_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
			  </tr>
<?php
 if (!$HTTP_GET_VARS['action']) {
?>
			  <tr> 
				<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?></td>
			  </tr>
<?php
 }
?>
			</table></td>
		  </tr>
		</table></td>
<?php
 $heading = array();
 $contents = array();
 switch ($HTTP_GET_VARS['action']) {
case 'delete':
  $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_FEATURED . '</b>');

  $contents = array('form' => tep_draw_form('featured', FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->featured_id . '&action=deleteconfirm'));
  $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
  $contents[] = array('text' => tep_draw_products_delete_mselect('delete_featured_id[]', 'style="font-size:10px"', ''));
  $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . '?<a href="' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->featured_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  break;
default:
  if (is_object($sInfo)) {
	$heading[] = array('text' => '<b>' . $sInfo->products_name . '</b>');

	$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->featured_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->featured_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
	$contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($sInfo->featured_date_added));
	$contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($sInfo->featured_last_modified));
	$contents[] = array('align' => 'center', 'text' => '<br>' . tep_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));

	$contents[] = array('text' => '<br>' . TEXT_INFO_EXPIRES_DATE . ' <b>' . tep_date_short($sInfo->expires_date) . '</b>');
	$contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . ' ' . tep_date_short($sInfo->date_status_change));
  }
  break;
 }
 if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
echo '			<td width="25%" valign="top">' . "\n";

$box = new box;
echo $box->infoBox($heading, $contents);

echo '			</td>' . "\n";
 }
}
?>
	  </tr>
	</table></td>
  </tr>
</table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

// BOF - Separate_Pricing_Per_Customer_v3.5

$all_groups=array();

$customers_groups_query = tep_db_query("select distinct customers_group_name, customers_group_id from " . TABLE_CUSTOMERS . " order by customers_group_id ");

while ($existing_groups = tep_db_fetch_array($customers_groups_query)) {

$all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];

}

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_code from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_code");

while ($products = tep_db_fetch_array($products_query)) {

// BOF - Separate_Pricing_Per_Customer_v3.5

 

what happens if you remove this code above from the file

 

/catalog/admin/includes/functions/html_output.php

 

just a thought

 

regards

 

mark

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

what happens if you remove this code above from the file

 

/catalog/admin/includes/functions/html_output.php

 

just a thought

 

regards

 

mark

I tried that, didn't work. I got a variety of strange errors. I would suggest trying the above instructions

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...