📄 manufacturers.php
字号:
<?php
/* -----------------------------------------------------------------------------------------
$Id: manufacturers.php,v 1.4 2004/04/13 20:22:44 oldpa Exp $
TWE-Commerce - community made shopping http://www.oldpa.com.tw Copyright (c) 2003 TWE-Commerce
-----------------------------------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(manufacturers.php,v 1.18 2003/02/10); www.oscommerce.com
(c) 2003 nextcommerce (manufacturers.php,v 1.9 2003/08/17); www.nextcommerce.org
(c) 2003 xt-commerce www.xt-commerce.com
Released under the GNU General Public License
---------------------------------------------------------------------------------------*/
$box_smarty = new smarty;
$box_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/');
$box_content='';
// include needed funtions
require_once(DIR_FS_INC . 'twe_hide_session_id.inc.php');
require_once(DIR_FS_INC . 'twe_draw_form.inc.php');
require_once(DIR_FS_INC . 'twe_draw_pull_down_menu.inc.php');
$manufacturers_query = twe_db_query("select distinct m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " as m, " . TABLE_PRODUCTS ." as p where m.manufacturers_id=p.manufacturers_id order by m.manufacturers_name");
if (twe_db_num_rows($manufacturers_query) <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
// Display a list
$manufacturers_list = '';
while ($manufacturers = twe_db_fetch_array($manufacturers_query)) {
$manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
if (isset($_GET['manufacturers_id']) && ($_GET['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';
$manufacturers_list .= '<a href="' . twe_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';
}
} else {
// Display a drop-down
$manufacturers_array = array();
if (MAX_MANUFACTURERS_LIST < 2) {
$manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
}
while ($manufacturers = twe_db_fetch_array($manufacturers_query)) {
$manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
'text' => $manufacturers_name);
}
}
//if ($manufacturers['manufacturers_name']!='') {
$box_content=twe_draw_form('manufacturers', twe_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get').twe_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $_GET['manufacturers_id'], 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . twe_hide_session_id().'</form>';
$box_smarty->assign('BOX_CONTENT', $box_content);
$box_smarty->assign('language', $_SESSION['language']);
// set cache ID
if (USE_CACHE=='false') {
$box_smarty->caching = 0;
$box_manufacturers= $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_manufacturers.html');
} else {
$box_smarty->caching = 1;
$box_smarty->cache_lifetime=CACHE_LIFETIME;
$box_smarty->cache_modified_check=CACHE_CHECK;
$cache_id = $_SESSION['language'].$_GET['manufacturers_id'];
$box_manufacturers= $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_manufacturers.html',$cache_id);
}
$smarty->assign('box_MANUFACTURERS',$box_manufacturers);
// }
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -