[ Index ] |
PHP Cross Reference of osCMax 2.0.4 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 $Id: manufacturers.php 3 2006-05-27 04:59:07Z user $ 4 5 osCMax Power E-Commerce 6 http://oscdox.com 7 8 Copyright 2006 osCMax 9 10 Released under the GNU General Public License 11 */ 12 13 // Most of this file is changed or moved to BTS - Basic Template System - format. 14 15 if ((USE_CACHE == 'true') && empty($SID)) { 16 echo tep_cache_manufacturers_box(); 17 } else { 18 $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); 19 if ($number_of_rows = tep_db_num_rows($manufacturers_query)) { 20 ?> 21 <!-- manufacturers //--> 22 <?php 23 $boxHeading = BOX_HEADING_MANUFACTURERS; 24 $corner_left = 'square'; 25 $corner_right = 'square'; 26 $box_base_name = 'manufacturers'; // for easy unique box template setup (added BTSv1.2) 27 28 $box_id = $box_base_name . 'Box'; // for CSS styling paulm (editted BTSv1.2) 29 if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) { 30 // Display a list 31 $boxContent = ''; 32 while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { 33 $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']); 34 if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>'; 35 $boxContent .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>'; 36 } 37 38 $boxContent = substr($boxContent, 0, -4); 39 40 } else { 41 // Display a drop-down 42 $manufacturers_array = array(); 43 if (MAX_MANUFACTURERS_LIST < 2) { 44 $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT); 45 } 46 47 while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { 48 $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']); 49 $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 50 'text' => $manufacturers_name); 51 } 52 53 $boxContent = tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'); 54 /* moved style to stylesheet BTSv1-1 55 $boxContent .= tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"'); 56 */ 57 $boxContent .= tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '"'); 58 $boxContent .= tep_hide_session_id(); 59 $boxContent .= '</form>'; 60 } 61 62 63 64 include (bts_select('boxes', $box_base_name)); // BTS 1.5 65 } 66 } 67 ?> 68 <!-- manufacturers eof//-->
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Jan 1 13:43:16 2010 | Cross-referenced by PHPXref 0.7 |