<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

$expected_query = tep_db_query("select p.products_id, p.products_image, pd.products_name, products_date_available as date_expected from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and c.categories_id = p2c.categories_id and c.categories_status=1 and to_days(products_date_available) >= to_days(now()) and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . " limit 10");
if (tep_db_num_rows($expected_query) > 0) {

   $boxHeading = TABLE_HEADING_UPCOMING_PRODUCTS;
   $corner_left = 'rounded';
   $corner_right = 'rounded';
   $box_base_name = 'zapowiedzi';
   $boxContent_attributes = ' align="center"';
   $boxContent = '<div class="box_kont">';

   while ($expected = tep_db_fetch_array($expected_query)) {
        $boxContent .= '<div class="box_list"><a class="boxLink" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected['products_id']) . '">' . osc_trunc_string($expected['products_name'], 50, 1) . '</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
  }

?>