<?php 

// Check to ensure this file is included in Freeway!
defined('_FEXEC') or die();
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0"> 
<?php 
// Set number of columns in listing
define ('NR_COLUMNS', 1);?>
<?php
// BOF: Lango Added for template MOD
if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
$header_text = '&nbsp;'
//EOF: Lango Added for template MOD
?>
      <tr> 
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> 
          <tr> 
         <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> 
            <td align="right"></td> 
          </tr> 
        </table></td> 
      </tr>
<?php
// BOF: Lango Added for template MOD
}else{
$header_text = HEADING_TITLE;
}
// EOF: Lango Added for template MOD
	if(!isset($hide_row_top)) {
?>
      <tr> 
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> 
      </tr>
<?php
	}
// BOF: Lango Added for template MOD
if (MAIN_TABLE_BORDER == 'yes'){
table_image_border_top(false, false, $header_text);
}
// EOF: Lango Added for template MOD
?>
      <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"> 
        <tr class="productListing-heading"> 
        <td align="left" class="productListing-heading">Product Name</td> 
       <td align="center" class="productListing-heading">Model</td> 
       <td align="right" class="productListing-heading">Price&nbsp;&nbsp;</td> 
       </tr> 
             <?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";
		    
          $products_query = tep_db_query("SELECT p.products_id, p.products_model, p.products_price, pd.products_name,p.products_tax_class_id 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)) 
            { 
				// discount group start
				if ($new_price = tep_get_products_special_price($products['products_id'])) {
				  $products_price = '<s>' . $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id']),'1',true) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</span>';
				} else {
				  $products_price = $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id']),'1',true);
				}
				// discount group end
               $products_array[] = array('id'=> $products['products_id'], 
                             'name'    => $products['products_name'], 
                             'model'   => $products['products_model'], 
                             'price'   => $products_price, 
                             'tax'     => $products['products_tax_class_id']); 
            } 
             
            $num_prods = sizeof($products_array);  // This optimizes that slow FOR loop... 
             
            for ($i = 0; $i < $num_prods; $i++)    // Traverse Rows 
            { 
               // Rotate Row Colors 
               if ($i % 2)  // Odd Row 
               { 
                  $row_col = 'class="productListing-odd"'; 
               } 
               else   // Guess... 
               { 
                  $row_col = 'class="productListing-even"'; 
               } 
                
						
               $this_id = $products_array[$i]['id']; 
               $this_name = $products_array[$i]['name']; 
               $this_model = $products_array[$i]['model']; 
               $this_price = $products_array[$i]['price']; 
               $this_tax = $products_array[$i]['tax']; 
               $this_url = tep_href_link(FILENAME_PRODUCT_INFO, '&products_id=' . $this_id . (($this_language_code == DEFAULT_LANGUAGE) ? '' : ('&language=' . $this_language_code)), 'NONSSL', false); 

               echo "<tr $row_col>"; 
               echo "<td class='productListing-data' align='left'><a href='$this_url'>$this_name</a></td>"; 
               echo "<td class='productListing-data' align='center'><a href='$this_url'>$this_model</a></td>"; 
               echo "<td class='productListing-data' align='right'><a href='$this_url'>". $this_price ."</a></td>"; 
               echo "</tr>\n"; 
            } 
         } 
         
         
          
?> 
            </td> 
          </tr> 
        </table></td> 
      </tr> 
<?php
// BOF: Lango Added for template MOD
if (MAIN_TABLE_BORDER == 'yes'){
table_image_border_bottom();
}
// EOF: Lango Added for template MOD
?>
      <tr> 
    <td align="right" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> 
      </tr> 
    </table>
