<?php
require('includes/application_top.php');
global $currencies;
$my_data = tep_db_prepare_input(tep_sanitize_string($_GET['q']));
$my_data = addslashes($my_data);
$append_query = '';
/*$sql=tep_db_query("SELECT * from customers
	where customers_firstname LIKE '%".$my_data."%' "); */
    $featured_query = tep_db_query("SELECT p.products_id, p.products_price,p.products_model, pd.products_name, pd.products_id, p.products_image
                                    FROM " . TABLE_PRODUCTS . " p,
                                         " . TABLE_PRODUCTS_DESCRIPTION . " pd
                                    WHERE p.products_id = pd.products_id
                                      and pd.language_id = " . (int)$languages_id . "
                                      and pd.products_name LIKE '%".$my_data."%'
                                      and (p.products_status = 1
                                          or (p.products_status <> 1 and p.products_parent_id <> 0))
                                      and p.products_model <> 'GIFT'
                                    ORDER BY products_name");


if(tep_db_num_rows($featured_query))
{
	while($row=tep_db_fetch_array($featured_query))
	{
		echo '<div class="autocomplete-style customer-badge"><a href="javascript:void(0)" onclick="javascript:specialProduct('.$row['products_id'].');"   class="auto_link" style=""> <div class="avatar" style="text-align: center;">'.tep_image('../'.DIR_WS_IMAGES . $row['products_image'],'','','55').' </div> <div class="details"><p class="prod_name" style="margin-bottom:5px;color:#000000;font-size:15px;">'.$row['products_name'].'</p><p>'.(($row['products_model'] != '')?'Model:'. $row['products_model']:'').(($row['products_price'] != '')?'Price: '. $row['products_price']:'').'</p></div></a></div>'."\n";

	}
}
?>