<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/
$page_query = tep_db_query("select  p.pages_id, p.sort_order, p.status, p.page_type, s.pages_title, s.pages_html_text, s.intorext, s.externallink, s.link_target   from " . TABLE_PAGES . " p LEFT JOIN " .TABLE_PAGES_DESCRIPTION . " s on p.pages_id = s.pages_id where p.status = 1 and s.language_id = '" .(int)$languages_id . "' order by p.sort_order");

$boxHeading = BOX_HEADING_INFORMATION;
$corner_left = 'rounded';
$corner_right = 'rounded';
$box_base_name = 'info_pages';

$box_id = $box_base_name . 'Box';
$boxContent_attributes = ' align="center"';
$boxHeading = BOX_HEADING_PAGES;

$boxContent = '<div class="box_kont">';

while ($page = tep_db_fetch_array($page_query)) {

	if ($page['page_type'] != '5' && $page['page_type'] != '6') {
		$target="";
		 if($page['link_target']== 1)  {
		   $target="_blank";
		 } else {
		   $target="_self";
		}

		if ($page['page_type'] != '2') {
			 $link = FILENAME_PAGES;
		     $param = 'pages_id=' . $page['pages_id'];
		 } else {
			 $link = FILENAME_CONTACT_US;
			 $param = '';
		}

		if($page['intorext'] == 1)  {
		      $boxContent .= '<div class="box_list"><a class="boxLink" target="'.$target.'" href="' . $page['externallink'] . '">' . $page['pages_title'] . '</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>';
		      }
		 } else {
		      $boxContent .= '<div class="box_list"><a class="boxLink" target="'.$target.'" href="' . tep_href_link($link, $param) . '">' . $page['pages_title'] . '</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>';
		      }
		 }
	}

}

if ($module_videos == true) {
    $boxContent .= '<div class="box_list"><a class="boxLink" href="filmy.php">'.VIDEO_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>';
    } 
}

if (CZY_FAQ != '0' || !defined('CZY_FAQ')) {
	$ilerekordow = tep_db_query("select f.faq_id, fd.faq_question, fd.faq_answer, f.last_modified, f.sort_order, f.faq_status from ".TABLE_FAQ." f,  ".TABLE_FAQ_DESCRIPTION." fd where f.faq_id=fd.faq_id and f.faq_status and fd.language_id='".(int)$languages_id."'");
	$ilosc_t = tep_db_num_rows($ilerekordow);
	if ($ilosc_t > 0) {
		$boxContent .= '<div class="box_list"><a class="boxLink" href="' .tep_href_link(FILENAME_FAQ). '">' .BOX_INFORMATION_FAQ. '</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>';
        }
	}
}

if (CZY_SITEMAP != '0' || !defined('CZY_SITEMAP')) {
	$boxContent .= '<div class="box_list"><a class="boxLink" href="' .tep_href_link(FILENAME_SITEMAP). '">' .BOX_INFORMATION_SITEMAP. '</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>';
    }
}

if (CZY_ALL_PROD != '0' || !defined('CZY_ALL_PROD')) {
	if (ALL_PRODUCTS == 'true') {
		$boxContent .= '<div class="box_list"><a class="boxLink" href="' .tep_href_link(FILENAME_ALLPRODS, 'fl=a'). '">' .BOX_INFORMATION_ALLPRODS. '</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>';
$boxContent = optimize_html($boxContent);

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

