<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/
  $manufacturers_query = tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m left join " . TABLE_PRODUCTS . " p on m.manufacturers_id = p.manufacturers_id left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id left join " . TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id where c.categories_status = '1' and p.products_status = '1' order by m.manufacturers_name");
  if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
    $boxHeading = BOX_HEADING_MANUFACTURERS;
    $corner_left = 'rounded';
    $corner_right = 'rounded';

    $box_base_name = 'manufacturers'; 
    $box_id = $box_base_name . 'Box';
    $boxContent_attributes = ' align="center"';
    
    $boxContent = '<div class="box_kont">';

    while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? osc_trunc_string($manufacturers['manufacturers_name'], MAX_DISPLAY_MANUFACTURER_NAME_LEN, 1) . '..' : $manufacturers['manufacturers_name']);
        if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';
        
        $boxContent .= '<div class="box_list"><a class="boxLink" href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a></div>';   
        if (file_exists(DIR_WS_TEMPLATES . 'images/infobox/category_line.gif')) {
            $boxContent .= '<div class="box_line">' . tep_image(DIR_WS_TEMPLATES . 'images/infobox/category_line.gif') . '</div>';
        }  
    }

    $boxContent .= '</div>';

    include (bts_select('boxes', $box_base_name)); // BTS 1.5
  }
?>