Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how to list company name in admin/customers.php


roadkill

Recommended Posts

I would like to list the field company_name in the list of customers. Could anyone help me out with adding the field to the query? We use mySQL 5.

 

  $customers_query_raw = 'select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_notes as notes, c.customers_email_address, c.customers_telephone, c.customers_dob, ci.customers_info_date_of_last_logon as last_logon, ci.customers_info_number_of_logons as num_logons, ci.customers_info_date_account_created as date_account_created, a.entry_city as city, a.entry_state as state_alt, z.zone_name as state, ctry.countries_iso_code_2 as country,c.customers_newsletter, 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 left join ' . TABLE_CUSTOMERS_INFO . ' ci on c.customers_id = ci.customers_info_id left join ' . TABLE_COUNTRIES . ' ctry on a.entry_country_id = ctry.countries_id left join ' . TABLE_ZONES . ' z on a.entry_zone_id = z.zone_id ' . $search . ' order by ' . $db_orderby . ' ' . $sort;

$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);

Link to comment
Share on other sites

nevermind, i found it myself :rolleyes:

 

admin/customers.php: change (backup first!)

$customers_query_raw = 'select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_notes as notes, c.customers_email_address, c.customers_telephone, c.customers_dob, ci.customers_info_date_of_last_logon as last_logon, ci.customers_info_number_of_logons as num_logons, ci.customers_info_date_account_created as date_account_created, a.entry_city as city, a.entry_state as state_alt, z.zone_name as state, ctry.countries_iso_code_2 as country,c.customers_newsletter, 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 left join ' . TABLE_CUSTOMERS_INFO . ' ci on c.customers_id = ci.customers_info_id left join ' . TABLE_COUNTRIES . ' ctry on a.entry_country_id = ctry.countries_id left join ' . TABLE_ZONES . ' z on a.entry_zone_id = z.zone_id ' . $search . ' order by ' . $db_orderby . ' ' . $sort;

 

to

 

$customers_query_raw = 'select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_notes as notes, c.customers_email_address, c.customers_telephone, c.customers_dob, ci.customers_info_date_of_last_logon as last_logon, ci.customers_info_number_of_logons as num_logons, ci.customers_info_date_account_created as date_account_created, a.entry_company, a.entry_city as city, a.entry_state as state_alt, z.zone_name as state, ctry.countries_iso_code_2 as country,c.customers_newsletter, 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 left join ' . TABLE_CUSTOMERS_INFO . ' ci on c.customers_id = ci.customers_info_id left join ' . TABLE_COUNTRIES . ' ctry on a.entry_country_id = ctry.countries_id left join ' . TABLE_ZONES . ' z on a.entry_zone_id = z.zone_id ' . $search . ' order by ' . $db_orderby . ' ' . $sort;

 

after:

				<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ACTIONS; ?></td>

 

add:

				<td class="dataTableHeadingContent" nowrap><?php echo print_sort(TABLE_HEADING_COMPANY, 'company', 'ASC'); ?></td>

 

and BEFORE:

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

 

add:

				 <td class="dataTableContent"><?php echo ucwords($customers['entry_company']); ?></td>

 

my oscommerce is far from vanilla, so i am not cetrain if this 'modification' could be applied to any version....

Link to comment
Share on other sites

  • 9 months later...

I will be needing this later subscribing

The Site can be viewed at www.performanceautopartsonline.com

 

The site is live (despite these minor glitches) please respect that and do not sign up etc...

 

maybe a contribution one day when I get this site the way I want it.

 

I don't make spelling mistakes! I have dyslecsic fingers.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...