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

<table border="0" width="100%" cellspacing="0" cellpadding="0">

  <!-- Naglowek BOF -->
  <tr>
    <td>
      <?php
      $info_box_contents = array();
      $info_box_contents[] = array('text' => sprintf(HEADING_TITLE));
      new contentBoxHeading($info_box_contents);
      ?>
    </td>
  </tr>
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>
  </tr>
  <!-- Naglowek EOF -->

  <tr>
    <td>
      <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
        <tr class="infoBoxContents">
          <td>
            <table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="100%" class="main" valign="top"><?php require DIR_WS_CLASSES . 'category_tree.php'; $osC_CategoryTree = new osC_CategoryTree; echo $osC_CategoryTree->buildTree(); ?></td>
              </tr>
              <tr>
                <td width="100%" class="main" valign="top">
                  <ul>
                    <li><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . PAGE_ACCOUNT . '</a>'; ?>
                      <ul>
                        <li><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . PAGE_ACCOUNT_EDIT . '</a>'; ?></li>
                        <li><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . PAGE_ADDRESS_BOOK . '</a>'; ?></li>
                        <li><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . PAGE_ACCOUNT_HISTORY . '</a>'; ?></li>
                        <li><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') . '">' . PAGE_ACCOUNT_NOTIFICATIONS . '</a>'; ?></li>
                      </ul>
                    </li>
                    <li><?php echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . PAGE_SHOPPING_CART . '</a>'; ?></li>
                    <li><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . PAGE_CHECKOUT_SHIPPING . '</a>'; ?></li>
                    <li><?php echo '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">' . PAGE_ADVANCED_SEARCH . '</a>'; ?></li>
                    <li><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . PAGE_PRODUCTS_NEW . '</a>'; ?></li>
                    <li><?php echo '<a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . PAGE_SPECIALS . '</a>'; ?></li>
                    <li><?php echo '<a href="' . tep_href_link(FILENAME_REVIEWS) . '">' . PAGE_REVIEWS . '</a>'; ?></li>
                  </ul>
                </td>
              </tr>
              <tr>
                <td width="100%" class="main" valign="top">
                  <ul>
                    <li><?php echo BOX_HEADING_INFORMATION; ?>
                      <ul>
                        <?php
                        // Extra Pages ADDED BEGIN
                        $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, s.pages_title");

                        $rows = 0;

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

                        }

                        if (CZY_SITEMAP != '0' || !defined('CZY_SITEMAP')) {
                          echo '<li><a class="boxLink" href="' .tep_href_link(FILENAME_SITEMAP). '">' .BOX_INFORMATION_SITEMAP. '</a></li>';
                        }

                        if (CZY_ALL_PROD != '0' || !defined('CZY_ALL_PROD')) {
                          if (ALL_PRODUCTS == 'true') {
                            echo '<li><a class="boxLink" href="' .tep_href_link(FILENAME_ALLPRODS). '">' .BOX_INFORMATION_ALLPRODS. '</a></li>';
                          }
                        }
                        // Extra Pages ADDED END
                        ?>
                      </ul>
                    </li>
                  </ul>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>

  <!-- Przyciski BOF -->
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
  </tr>
  <tr>
    <td>
      <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
        <tr class="infoBoxContents">
          <td>
            <table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <!-- Przyciski EOF -->

</table>