<?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(CENNIK_NAGLOWEK));
   new contentBoxHeading($info_box_contents);
   ?>
  </td>
 </tr>

 <tr>
  <td style="padding-top:3px">
      <table border="0" width="100%" class="TableFrame">
        <tr><td align="center" valign="top">
            <table border="0" width="90%">
              <?php
              foreach ($kategorie as $tablica) {
                echo '<tr>';
                $modul_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE categories_id = '".$tablica['id']."'");
                $sa_prd = false;
                if ((int)tep_db_num_rows($modul_query) > 0) {
                    $sa_prd = true;
                }
                
                echo '<td class="smallText" width="85%" '.(($sa_prd==false) ? ' colspan="4"' : '').'>';
                
                $ilosc_prod = '';
                if (CZY_ILOSC_PROD == true) {
                    if (tep_db_num_rows($modul_query) > 0) {
                        $ilosc_prod = ' ('.tep_db_num_rows($modul_query).')';
                      } else {
                        $ilosc_prod = '';
                    }
                }
                
                if (substr($tablica['text'],0,1) == '&') {
                    echo $tablica['text'].$ilosc_prod;
                   } else {
                    echo '<b>'.$tablica['text'].'</b>'.$ilosc_prod;
                }                
                echo '</td>';                
                if ($sa_prd == true) {
                    if (CZY_EXCEL_CENNIK == true) {
                        echo '<td width="5%"><a href="'.tep_href_link('cennik.php','cPath='.$tablica['id'].'&type=excel').'">'.tep_image('xls/img/_excel.png').'</a></td>';
                    }
                    if (CZY_PDF_CENNIK == true) {
                        echo '<td width="5%"><a href="'.tep_href_link('cennik.php','cPath='.$tablica['id'].'&type=pdf').'">'.tep_image('xls/img/_pdf.png').'</a></td>';
                    }
                    if (CZY_HTML_CENNIK == true) {
                        echo '<td width="5%"><a href="'.tep_href_link('cennik.php','cPath='.$tablica['id'].'&type=html').'">'.tep_image('xls/img/_html.png').'</a></td>';
                    }
                }
                echo '</tr>';                
              }
              ?>
            </table>
        </td></tr>
      </table>
  </td>
 </tr>  

 <tr>
  <td style="padding-top:3px">
    <table border="0" width="100%" class="TableFrame">
        <tr>
        <td style="padding-left:10px"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
        </tr>
    </table>
  </td>
 </tr>

</table>
