include ("cust.inc.php");
$menu_offset = 20;
$submenu = 1;
$numValidMakes = 0;
/*
* Count number of makes with cars in them, so
* we know how many submenus there will be.
*/
$make = get_root_make();
$children = $make->get_children();
foreach ($children as $c)
{
$vars = null;
$vars["make_id"] = $c->get("make_id");
$vars["_date_sold-op"] = "<=";
$vars["date_sold"] = "1999-01-01";
$cars = null;
$car_count = get_cars($vars, 0, 20, $cars, $user);
if ($car_count)
{
$numValidMakes++;
}
}
$cars = null;
$car_count = get_recent_sold(21, $cars, $user);
if ($car_count)
{
$numValidMakes++;
}
?>
= SITE_NAME ?> Inventory
$menu_pos = 0 ?>
$car_count = get_featured($cars, "inv", $user);
if ($car_count)
{
?>
$menu_pos += 20;
?>
}
?>
$cars = null;
$car_count = get_specials($cars, "inv", $user);
if ($car_count)
{
?>
$menu_pos += 20;
?>
}
?>
$cars = null;
$car_count = get_recent_additions(40, $cars, $user);
/*
* work around for bug in return value.
*/
$car_count = count($cars);
if ($car_count)
{
?>
$menu_pos += 20;
?>
}
?>
/*
* Set PORSCHE apart from the others.
*/
$vars = null;
$cars = null;
$vars["make_id"] = "15";
$vars["_date_sold-op"] = "<=";
$vars["date_sold"] = "1999-01-01";
$car_count = get_cars($vars, 0, 20, $cars, $user);
if ($car_count)
{
?>
$menu_pos += 20;
?>
}
?>
reset($children);
foreach ($children as $c)
{
if ($c->get("make_id") == "15") continue;
$vars["make_id"] = $c->get("make_id");
$cars = null;
$car_count = get_cars($vars, 0, 20, $cars, $user);
if ($car_count)
{
?>
$menu_pos += $menu_offset;
}
}
?>
$cars = null;
$car = null;
$car_count = get_recent_sold(21, $cars, $user);
if ($car_count)
{
?>
$menu_pos += 20;
?>
}
?>
$menu_pos += 20 ?>
$menu_pos += 20 ?>
$menu_pos += 20 ?>