а как добавить данное решение к прайс-листу.
Я пытался изменить этот кусок кода, но не выходит, что я делаю не так помогите !!!
$q1 = db_query("select categoryID, name from ".CATEGORIES_TABLE.
" where parent=$parent order by sort_order, name") or die (db_error());
while ($row = db_fetch_row($q1))
{
//define back color of the cell
$r = hexdec(substr(CONF_MIDDLE_COLOR, 0, 2));
$g = hexdec(substr(CONF_MIDDLE_COLOR, 2, 2));
$b = hexdec(substr(CONF_MIDDLE_COLOR, 4, 2));
$m = (float)max($r, max($g,$b));
$r = round((190+20*min($level,3))*$r/$m);
$g = round((190+20*min($level,3))*$g/$m);
$b = round((190+20*min($level,3))*$b/$m);
$c = dechex($r).dechex($g).dechex($b); //final color
//add category to the output
$out[$cnt][0] = $row[0];
$out[$cnt][1] = $row[1];
$out[$cnt][2] = $level;
$out[$cnt][3] = $c;
$out[$cnt][4] = 0; //0 is for category, 1 - product
$cnt++;
if ( !isset($_GET["sort"]) )
$order_clause = "order by sort_order";
else
{
//verify $_GET["sort"]
switch ($_GET["sort"]){
default:
$_GET["sort"] = "name";
case 'name':
case 'Price':
case 'customers_rating':
break;
}
$order_clause = " order by ".$_GET["sort"];
if ( isset($_GET["direction"]) )
{
if ( !strcmp( $_GET["direction"] , "DESC" ) )
$order_clause .= " DESC ";
else
$order_clause .= " ASC ";
}
}
$sql = "
select productID, name, Price, in_stock from ".PRODUCTS_TABLE.
" where categoryID=".$row[0]." and Price>0 and enabled=1 ".
$order_clause."
";
Добавлено через 45 секунд
Это фаил pricelist.php