<?php
/*
	osConcert, Online Seat Booking 
	https://www.osconcert.com
	Copyright (c) 2009-2020 osConcert
	Released under the GNU General Public License 
*/	
// Check to ensure this file is included in osConcert!
defined('_FEXEC') or die();
		
		######################################################
		//$id=$products_id;
		require_once(DIR_WS_INCLUDES . 'functions/categories_lookup.php');
		#####################################################
		// // call function to handle the order names
		//list($heading_name, $heading_venue,  $heading_date, $heading_time, $heading_title) = categories_lookup();
		######################################################	

		$template_content=tep_load_template_content('product_listing.tpl.php');	
		$template_details["VALUE_NO_PRODUCT"]='NO_PRODUCTS';
		
		//about images
		if (($category['categories_image'] == 'NULL') or ($category['categories_image'] == '')) 
		{
			$cat_image="theatre.png";	
		}else
		{
			$cat_image=$category['categories_image'];
		}

		
		
		$cPath = $current_category_id;
		
		foreach ($cPath_array as $item) 
		{
        if ($parent_id==0)
		{			
			$cat = $item;   //top
		}
		else
		{		
			$cat = $cPath; 	//current
		}
        break;
		}

		$categories_query = tep_db_query("select * from  " . TABLE_CATEGORIES_DESCRIPTION . "  WHERE categories_id = '".$cat."' and language_id = '" . (int)$FSESSION->languages_id . "'");

		while ($categories = tep_db_fetch_array($categories_query)) 
		{
			$heading_name=$categories['categories_name'];
			$heading_title = $categories["categories_heading_title"];
			$categories_description = $categories['categories_description'];
			$heading_venue = $categories['concert_venue'];
			$heading_date = $categories['concert_date'];
			$heading_time = $categories['concert_time'];
		}
			
			$template_details["VALUE_CATEGORIES_NAME"]=$heading_name;
			$template_details["VALUE_CATEGORIES_TITLE"]=$heading_title;
			$template_details["VALUE_CATEGORIES_DESC"]=$categories_description;
			$template_details["VALUE_CATEGORIES_VENUE"]=$heading_venue;
			list($formatted_date, $formatted_time) = get_category_datetime($current_category_id);
			$template_details["VALUE_CATEGORIES_DATE"] = $formatted_date;
			$template_details["VALUE_CATEGORIES_TIME"] = $formatted_time;

		//this data comes from index.php for the current category ID
		$template_details["VALUE_CATEGORY_NAME"]=$category["categories_name"];
		$template_details["VALUE_CATEGORY_TITLE"]='<h2>'.$category["categories_heading_title"].'</h2>';
		$template_details["VALUE_CATEGORY_DESC"]=$category["categories_description"];
		$template_details["VALUE_CATEGORY_VENUE"]=$category["concert_venue"];
		$template_details["VALUE_CONCERT_UNIX"] = $category['concert_date_unix'];
		$template_details["VALUE_CATEGORY_DATE"]=$category["concert_date"];
		$template_details["VALUE_CATEGORY_TIME"]=$category["concert_time"];
		$template_details["VALUE_CATEGORY_IMAGE"]=$cat_image;
		$template_details["VALUE_TEXT_TYPE"]=TEXT_TYPE;
		$template_details["VALUE_TEXT_PRICE"]=TEXT_PRICE;
		$template_details["VALUE_TEXT_QUANTITY"]=TEXT_QUANTITY;
		$template_details["VALUE_SALEMAKER"]='';
		$template_details["VALUE_GA_TOTAL"]='';
		$template_details["VALUE_SPACER"]="&nbsp;&nbsp;";
		$template_details["VALUE_TEMPLATE"]="template";
		$spacer="&nbsp;&nbsp;";
		$template_details["VALUE_FORM_START"]= tep_draw_form('add_multi', 'shopping_cart.php?action=add_multi');
		$template_details["VALUE_FORM_END"]= '';
		$serverDate = date('Y-m-d H:i',getServerDate(false));
		
		$category_ga_query = tep_db_query("select categories_GA,categories_quantity_remaining from " . TABLE_CATEGORIES . " where categories_id = '" . $cPath. "' limit 1");
		if (tep_db_num_rows($category_ga_query)) 
		{ 
			$category_ga = tep_db_fetch_array($category_ga_query);
			if(HIDE_GA_ONLY_QTY=="no")
			{	  
				if($category_ga['categories_GA']==1)
				{//this is a GA category with master quantity
				$template_details["VALUE_GA_TOTAL"]='<div class="ga_total">' . TEXT_GA_REMAIN_LEFT . '<span style="color:#ff0000">' . $category_ga['categories_quantity_remaining'] . '</span>' . TEXT_GA_REMAIN_RIGHT . '</div>';
				}else
				{
				$template_details["VALUE_GA_TOTAL"]='';
				}
			}else
			{
			$template_details["VALUE_GA_TOTAL"]=TEXT_GA_REMAIN_TICKETS;
			}
		}
		if(SHOW_GA_SOLDOUT=='no'){
		$status="and products_status>'0' ";
		}else{
		$status="";	
		}

		$check_restrict_customer="";
		$customer_group_id=0;
		$check_restrict_customer=" and ((p.restrict_to_customers='' OR ISNULL(p.restrict_to_customers)) AND (p.restrict_to_groups='' OR ISNULL(p.restrict_to_groups)))";
		if($FSESSION->is_registered('customer_id'))
		{
			$customer_group_id=get_customer_group_id();
			$check_restrict_customer=substr($check_restrict_customer,0,-1)." OR (p.restrict_to_customers like '%". tep_db_input($FSESSION->customer_id) ."%' OR p.restrict_to_groups like '%". tep_db_input($customer_group_id) ."%'))";
		}
		// === 3) Fetch all FOOD items (type A) just once ===
		$food_products = [];
		$foodQ = tep_db_query("
		  SELECT 
			p.products_id,
			pd.products_name
		  FROM " . TABLE_PRODUCTS . " p
		  JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
			ON p2c.products_id = p.products_id
		  JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd
			ON pd.products_id = p.products_id
		  WHERE p.product_type    = 'A'
			AND p2c.categories_id = '" . (int)$cPath . "'
			AND pd.language_id    = '" . (int)$FSESSION->languages_id . "'
			{$status}
		  ORDER BY p.products_sort_order, p.products_id
		");
		while ($f = tep_db_fetch_array($foodQ)) {
			$food_products[] = $f;
		}
	
		$product_repeat=array();
		$icnt=0;
		$listing_query = tep_db_query("select 
		p.products_id,
		p.color_code,
		p.products_quantity, 
		p.products_price_break,
		pd.products_name,
		pd.products_description,
		pd.products_number,
		p.products_quantity,
		p.products_model,
		p.section_id,
		p.parent_id,
		p.products_sku, 
		p.products_season,
		p.products_image_1,
		p.products_price, 
		p.products_sort_order,
		p.products_weight, 
		p.products_sort_order, 
		date_format(p.products_date_added,'%Y-%m-%d') as products_date_added, 
		date_format(p.products_last_modified,'%Y-%m-%d') as products_last_modified, 
		date_format(p.products_date_available, '%Y-%m-%d %H:%i') as products_date_available, 
		p.products_status, 
		p.products_tax_class_id,
		p.manufacturers_id,
		p.restrict_to_groups,
		p.restrict_to_customers,
		p.product_type,
		p.master_quantity 
		from " . TABLE_PRODUCTS . " p join ".TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p2c.products_id=p.products_id join ".TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id=p.products_id where p.product_type !='P' and p.product_type !='A' and p.product_type !='L' and p.product_type !='Q' and p.products_id >'0' ".$status." and p2c.categories_id = '" . $cPath . "' and pd.language_id = '" . (int)$FSESSION->languages_id . "' ". $check_restrict_customer." order by p.products_sort_order,p.products_id asc");
		

			
		while ($listing = tep_db_fetch_array($listing_query)) 
		{
			//print_r($listing);
			$salemaker_text = '';
			//multi buy check for salemaker
			$sDate=getServerDate(true);
			$sale_query = tep_db_query("select sale_id,sale_specials_condition, sale_deduction_value, sale_deduction_type,choice_text,choice_warning from " . TABLE_SALEMAKER_SALES . " where sale_discount_type='C'  and ((sale_categories_all='' and sale_products_selected='') or sale_categories_all like '%," . tep_db_input($current_category_id) . ",%' or sale_products_selected like '%," . tep_db_input($pid) .",%') and sale_status = '1' and (sale_date_start <='" . tep_db_input($sDate) . "' or sale_date_start = '0000-00-00') and (sale_date_end >= '" . tep_db_input($sDate) . "' or sale_date_end = '0000-00-00') and (sale_pricerange_from <= " . $listing['products_price'] . " or sale_pricerange_from = '0') and (sale_pricerange_to >= " . $listing['products_price'] . " or sale_pricerange_to = '0') order by sale_deduction_value");
			
			if(tep_db_num_rows($sale_query) > 0)
			{ 
			$salemaker_text = '';//TEXT_DISCOUNT_ALERT3;
			}
			//$template_details["VALUE_SALEMAKER"]=$salemaker_text;
			############################################################
			 ///////////////// alert message, if enabled
			if (defined('ENABLE_LOW_STOCK_ALERT') && ENABLE_LOW_STOCK_ALERT == 'true') 
			{

			$products_query = tep_db_query("select products_id, products_model, products_quantity, product_type from products where product_type='G' and products_quantity <= " . STOCK_REORDER_LEVEL . " order by products_id desc");

			  $num_low_stock = 0;

			  if (tep_db_num_rows($products_query)) 
			  {
				  while ($products = tep_db_fetch_array($products_query)) 
				  {
					$virtual_product = false;

					if (!$virtual_product) 
					{
					  $num_low_stock++;
					  break;
					}

				  }
				}

				if ($num_low_stock > 0) 
				{
					if(ADMIN_LOW_STOCK_EMAIL_SENT==1)
					{
						$email_text=TEXT_LOW_STOCK_ID.' = Date ID:'. $products['products_model'] .' (' . $products['products_id'] .')';
						tep_mail('Low Stock Message ', STORE_OWNER_EMAIL_ADDRESS, TEXT_LOW_STOCK_ALERT, $email_text, STORE_OWNER.":", STORE_OWNER_EMAIL_ADDRESS);
						$config_query = tep_db_query("select configuration_value from configuration where configuration_key = 'ADMIN_LOW_STOCK_EMAIL_SENT'");
						$config = tep_db_fetch_array($config_query);
						if ($config['configuration_value'] == '1') 
						{
						tep_db_query("update configuration set configuration_value = '0' where configuration_key = 'ADMIN_LOW_STOCK_EMAIL_SENT'");
						}
					}
				} 
			}
			############################################################
			// 1) Explicitly name each condition
				$isInactive          = ($listing['products_status']        < 1);
				$isOutOfStock        = ($listing['products_quantity']      < 1);
				$isCategoryGASoldOut = (
					$category_ga['categories_GA'] > 0
				 && $category_ga['categories_quantity_remaining'] < 1
				);
				$isFood              = ($listing['product_type'] === 'A');

				// 2) Compute href in one place
				$href = (
					$isInactive
				 || $isOutOfStock
				 || ($isCategoryGASoldOut && ! $isFood)
				)
					? '#'
					: tep_href_link(
						FILENAME_PRODUCT_INFO,
						($cPath
						   ? 'cPath=' . (int)$cPath . '&'
						   : ''
						)
						. 'products_id=' . (int)$listing['products_id']
					  );

			$template_details["VALUE_SALEMAKER"]='<a href="' . $href . '">' . $salemaker_text . '</a>';
			
			############################################################
			// --- c) Initialize the repeat-row with an extra BUTTONS key ---
			$product_repeat[$icnt] = [
			  'NAME'        => '',
			  'PRICE'       => '',
			  'QUANTITY'    => '',
			  'WEIGHT'      => '',
			  'IMAGE'       => '',
			  'BUY_NOW'     => '',
			  'ADD'         => '',
			  'DESCRIPTION' => '',
			  'BUTTONS'     => $buttons_html,
			];
			for ($col=0, $n=sizeof($column_list); $col<$n; $col++) 
			{ 
				switch ($column_list[$col]) 
				{
					case 'PRODUCT_LIST_NAME':

						if ($FREQUEST->getvalue('manufacturers_id')!='') 
						{
						$product_repeat[$icnt]['NAME']='<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $FREQUEST->getvalue('manufacturers_id','int') . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
						} else 
						{
						$product_repeat[$icnt]['NAME']='<a href="' . $href . '">' . $listing['products_name'] . '</a>&nbsp;&nbsp;';
						}
						break;
					case 'PRODUCT_LIST_PRICE':	
						if($listing['product_type']=='F')
						{	
							$family= '<small>'.FAMILY_TICKET.' x '.FAMILY_TICKET_QTY.'</small>';
						}else{
							$family= '';
						}
						$template_details["VALUE_TEXT_PRICE"]=TEXT_PRICE;
						if (tep_get_products_special_price($listing['products_id'])) 
						{
						$product_repeat[$icnt]['PRICE'] = '<s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']),'1',true) . '</s>&nbsp;&nbsp;<span>' . $currencies->display_price(tep_get_products_special_price($listing['products_id']), tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
						} else 
						{
						$product_repeat[$icnt]['PRICE'] = $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']),'1',true).'
						<br><span class="smallText">'.$family.'</span>';
						}
						//hard code the price here
						if($listing['products_price_break']=='Y'){
							$product_repeat[$icnt]['PRICE'] = $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']),'1',true);	
							}else{
							$product_repeat[$icnt]['PRICE'] = $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']),'1',true);
							}
						break;
					case 'PRODUCT_LIST_QUANTITY':
						if(HIDE_GA_QTY=="no")
						{
						$product_repeat[$icnt]['QUANTITY'] = ' <small>(' . $listing['products_quantity'] . ')</small>';
						}
						break;
					case 'PRODUCT_LIST_WEIGHT':
						$product_repeat[$icnt]['WEIGHT'] = '<br>' . tep_get_display_weight($listing['products_weight']);
						break;
					case 'PRODUCT_LIST_IMAGE':
							if($listing['products_image_1'] !='')
							{		
								$product_repeat[$icnt]['IMAGE'] = '<div class="col-md-2">
								<a class="img-fluid" href="' . $href . '">' . tep_product_small_image($listing['products_image_1'], $listing['products_title_1'], "title=" . '"'.$listing['products_name'].'"') . '</a>
								</div>
								<div class="col-md-5">';
							}else{
								$product_repeat[$icnt]['IMAGE'] = '<div class="col-md-7">';
							}

						break;
				case 'PRODUCT_LIST_BUY_NOW':

    // SOLD OUT logic stays the same
    if (
        ($listing['products_status'] < 1)
        || ($listing['products_quantity'] < 1)
        || (
            $category_ga['categories_GA'] > 0
            && $category_ga['categories_quantity_remaining'] < 1
        )
        && $listing['product_type'] != 'A'
    ) {

        $product_repeat[$icnt]['BUY_NOW']
            = '<span class="btn btn-primary disabled">&nbsp;'
            . SOLD_OUT
            . '&nbsp;</span>';

    } else {

        // Normal product starts at 1.
        // Price-break product starts at 10.
        $start_qty = (
            isset($listing['products_price_break'])
            && $listing['products_price_break'] == 'Y'
        ) ? 10 : 1;

        // Build qty box
        $qty_box = tep_draw_input_field(
            'qty[' . $listing['products_id'] . ']',
            0,
            'id="qty[' . $listing['products_id'] . ']"
             style="margin:16px 0 0 0;padding:0;text-align:center;min-width:55px;min-height:42px"
             size="3"
             onkeydown="return numericOnly(event);"'
        );

        // Quantity selector
        $quantity_selector = '
        <div class="quantity-selector">
            <button type="button"
                    onclick="adjustQuantity(' . (int)$listing['products_id'] . ', -1, ' . $start_qty . ')"
                    class="btn btn-primary">
                <i class="bi bi-dash"></i>
            </button>

            ' . $qty_box . '

            <button type="button"
                    onclick="adjustQuantity(' . (int)$listing['products_id'] . ', 1, ' . $start_qty . ')"
                    class="btn btn-primary">
                <i class="bi bi-plus"></i>
            </button>
        </div>

        <script>
        if (typeof adjustQuantity !== "function") {
            function adjustQuantity(productId, change, startQty) {
                var input = document.getElementById("qty[" + productId + "]");

                if (!input) {
                    return;
                }

                var currentValue = parseInt(input.value, 10);

                if (isNaN(currentValue)) {
                    currentValue = 0;
                }

                if (change > 0 && currentValue === 0) {
                    input.value = startQty;
                    return;
                }

                var newValue = currentValue + change;

                input.value = newValue < 0 ? 0 : newValue;
            }
        }
        </script>

        <style>
        .quantity-selector {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .quantity-selector input {
            max-width: 55px;
            text-align: center;
        }
        </style>';

        // Assign it back to repeat array
        $product_repeat[$icnt]['BUY_NOW'] = $quantity_selector;

        // Preserve VALUE_FORM_END logic
        if (PRODUCT_LIST_ADD == 0) {
            $template_details["VALUE_FORM_END"] = '
            <span style="float:right;cursor:pointer"
                  onclick="document.forms[\'add_multi\'].submit()">
                <strong>' . tep_template_image_button('', IMAGE_BUTTON_IN_CART) . '</strong>
            </span>&nbsp;';
        } else {
            $template_details["VALUE_FORM_END"] = '';
        }
    }

    break;

					case 'PRODUCT_LIST_ADD':
					
						if(($listing['products_status']<1) or ($listing['products_quantity']<1)or($category_ga['categories_GA']>0 && $category_ga['categories_quantity_remaining']<1)&&($listing['product_type'] !='B'))
						{
							$product_repeat[$icnt]['ADD']="";
						}else
						{						
							if(ALT_GA_TEMPLATE=='yes')
							{
							$product_repeat[$icnt]['ADD']="
							<div><strong>".TEXT_PLEASE_ADD_TO_CART."</strong><br></div>
							<span style=\"float:right;cursor:pointer\" onClick='document.forms[\"add_multi\"].submit()'><strong>" .tep_template_image_button('', IMAGE_BUTTON_IN_CART) . "</strong></span>&nbsp;
							";
							}else{
							$product_repeat[$icnt]['ADD']="";	
							}
						}
						break;
					case 'PRODUCT_LIST_DESCRIPTION':
					
						// $pex=$listing['products_date_available'];
						// if((ALLOW_PRODUCT_EXPIRY=='yes')&&(SHOW_PRODUCT_EXPIRY=='yes')&&($listing['products_date_available'] !='0000-00-00 00:00')&&($listing['products_date_available']<'2030-01-01 00:00')){		
							// $info='<br>'.TEXT_PRODUCT_EXPIRES.' '.$pex.'<br>'.TEXT_TIME_NOW.'  '.$serverDate.'';
						// }else{
							// $info='';
						// }
						$serverDate = (new DateTime())->format(EVENTS_DATE_FORMAT . ' ' . (((string)TIME_FORMAT==='12')?'g:i a':'H:i'));
						$pexFormatted = formatDisplayDate($listing['products_date_available'] ?? '');

						if (
						  ALLOW_PRODUCT_EXPIRY === 'yes' &&
						  SHOW_PRODUCT_EXPIRY === 'yes' &&
						  $pexFormatted &&
						  (new DateTime($listing['products_date_available'])) < new DateTime('2030-01-01')
						) {
						  $info = '<br>' . TEXT_PRODUCT_EXPIRES . ' ' . $pexFormatted .
								  '<br>' . TEXT_TIME_NOW . ' ' . $serverDate;
						} else {
						  $info = '';
						}

						
						
						
						
						
						$description=strip_tags($listing['products_description'],'<br>');
						//cut the description down!
						//$description = mb_strimwidth($description, 0, 150, "...");
						
						$product_repeat[$icnt]['DESCRIPTION'] = $description.$info;	  
						break;
				}
			}
			
			
			
			$ticketId = (int)$listing['products_id'];
			
			
			

$buttons_html = '';
foreach ($food_products as $food) {
    $foodId     = (int)$food['products_id'];
    $instanceId = $ticketId . '_' . $foodId;

    $buttons_html .= '
      <li>
        <input type="hidden"
               name="food_qty[' . $instanceId . ']"
               id="food_qty_' . $instanceId . '"
               value="0">
        <button type="button"
                onclick="toggleFoodItem(\'' . $instanceId . '\')"
                class="btn btn-outline-primary food-toggle-btn"
                id="food_btn_' . $instanceId . '">
          ' . tep_output_string($food['products_name']) . '
          <span class="food-badge" id="food_badge_' . $instanceId . '">0</span>
        </button>
      </li>';
}
			
	 // then assign into your repeat array:
  $product_repeat[$icnt]['BUTTONS'] = $buttons_html;		
			
		$icnt++;
		}

		$template_details["REPEAT_PRODUCT_LIST"]=$product_repeat;
		unset($product_repeat);
		mysqli_free_result($listing_query);

		$template_details["SECTION_PRODUCT"]=1;
		$template_details["SECTION_NO_PRODUCT"]=0;

		//$template_details["VALUE_SYSTEM_TIME"]='Time now is ' .date("g:i:a");
		$replaced_content=$template_content;
		$template_name = "";

		$scnt=0;
		foreach($template_details as $key => $value)
		{
			switch(substr($key,0,strpos($key,'_')))
			{
				case "VALUE":
					$replaced_content=str_replace("{{" . $key . "}}",$value,$replaced_content);
					break;
				case "SECTION":
					if ($value!=1)
					{
						$start_pos=strpos($replaced_content,"{{" . $key . "_START}}");
						$end_pos=strpos($replaced_content,"{{" . $key . "_END}}");
						$temp_content=substr($replaced_content,0,$start_pos);
						$temp_content.=substr($replaced_content,$end_pos+strlen("{{" . $key ."_END}}"));
						$replaced_content=$temp_content;
						unset($temp_content);
					} else 
					{
						$replaced_content=str_replace(array("{{" .$key . "_START}}","{{" .$key . "_END}}"),"",$replaced_content);
					}
					break;
					//I think this is it
				case "REPEAT":
					$start_pos=strpos($replaced_content,"{{" . $key . "_START}}")+strlen("{{" . $key ."_START}}");
					$end_pos=strpos($replaced_content,"{{" . $key . "_END}}");
					$repeat_content=substr($replaced_content,$start_pos,$end_pos-$start_pos);
					$merged_total_content='' . "\n";
					$col=0;
					$row=0;
					for ($icnt=0,$n=count($value);$icnt<$n;$icnt++)
					{
						$merged_content='';
						if ($col==0 || $ttotal_cols==1)
						{
							$merged_content.='';
						}
							$merged_content.='' . $repeat_content;

						reset($value[$icnt]);
						
						foreach ( array_keys($value[$icnt]) as $itemkey )
						{
							$merged_content=str_replace("{{" . $key . "_" . $itemkey . "}}",$value[$icnt][$itemkey],$merged_content);
						}
						$col++;
						if ($col==$ttotal_cols) 
						{
							$col=0;
							$row++;
						}
						if ($col==0 || $ttotal_cols==1) 
						$merged_content.='';
						$merged_total_content.="\n" . $merged_content;
					}
					
					$merged_total_content.="";
					$replaced_content=substr($replaced_content,0,$start_pos) . $merged_total_content . substr($replaced_content,$end_pos);
					unset($merged_total_content);
					$replaced_content=str_replace(array("{{" .$key . "_START}}","{{" .$key . "_END}}"),"",$replaced_content);
			}
			$scnt++;
		}
		if(($category['categories_status']==1)or($_SESSION['BoxOffice']== 999)or($_SESSION['customer_country_id']==999))
		{
		echo $replaced_content;
		unset($replaced_content);
		}
				else
				{
					echo "<h4>" . EVENT_DISABLED_MESSAGE . "</h4>";
					//echo $qty;
				}
				
?><?php 
	if(SHOW_FEATURED_CATEGORIES == 'true')
	{
	require_once(DIR_WS_MODULES  . FILENAME_FEATURED_CATEGORIES);
	}
	?>  
	<br>