<?php
/*
  $Id: allprods.php,v 1.5 2002/09/29 1

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2002 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');

// Set number of columns in listing
define ('NR_COLUMNS', 2);
//
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<LINK href="images/favicon.ico" rel="shortcut icon">
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<?php
// BOF: WebMakers.com Changed: Header Tag Controller v1.0
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
  require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?>
  <title><?php echo TITLE ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v1.0
?>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="<? echo THEMA_STYLE;?>">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
  <tr>
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
    </table></td>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading">All Products</td>
            <td align="right"></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <?php
                         $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");
                         while ($languages = tep_db_fetch_array($languages_query)) {
                                $languages_array[] = array('id'                        => $languages['languages_id'],
                                                                                   'name'                => $languages['name'],
                                                    'code'                => $languages['code'],
                                                    'image'                => $languages['image'],
                                           'directory'        => $languages['directory']);
                         }
                   for ($i=0; $i<sizeof($languages_array); $i++) {
                     $this_language_id = $languages_array[$i]['id'];
                                $this_language_name = $languages_array[$i]['name'];
                                $this_language_code = $languages_array[$i]['code'];
                                $this_language_image = $languages_array[$i]['image'];
                                $this_language_directory = $languages_array[$i]['directory'];
                                echo " <tr>\n";
                                echo "   <td class=main>\n";
                                echo "     " . tep_image(DIR_WS_LANGUAGES . $this_language_directory . '/images/' . $this_language_image, $this_language_name) . "&nbsp;<b>" . $this_language_name . "</b>";
                                echo "   </td>\n";
                                echo " </tr>\n";
                                echo " <tr>\n";
                     $products_query = tep_db_query("SELECT p.products_id, pd.products_name FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.products_id = pd.products_id AND p.products_status = 1 AND pd.language_id = $this_language_id ORDER BY pd.products_name");
                                $products_array = array();
                                while($products = tep_db_fetch_array($products_query)) {
                                   $products_array[] = array('id'   => $products['products_id'],
                                                                                            'name' => $products['products_name']);
                                }
                                for ($j=0; $j<NR_COLUMNS; $j++) {
                                        echo "   <td class=main>\n";
                                        for ($k=$j; $k<sizeof($products_array); $k+=NR_COLUMNS) {
                                                $this_products_id   = $products_array[$k]['id'];
                                                $this_products_name = $products_array[$k]['name'];
                                                print("     <a href=\"" . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $this_products_id . '&language=' . $this_language_code . '&kill_sid=true', 'NONSSL', false) . "\">" . $this_products_name . "</a><br>\n");
                                        }
                                        echo "   </td>\n";
                                }
                            echo " </tr>\n";
                        }
?>
            </td>
          </tr>
        </table></td>
      </tr>
      <tr>
    <td align="right" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
    </table></td>
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>