require("site.phtml");
$c = xconnect();
$product_list = array();
$homepage_features_list = array();
$qs = "select * from
m_products p, m_categories c, m_category_items ci
where
p.product_key = ci.product_key and c.category_key = ci.category_key
and c.short_name = 'Homepage Features' and p.status = 'active'";
$res = xquery($qs, $c);
while($a = xfetch($res)) {
$qs_sub = "
select *
from m_product_files
where product_key = '$a[product_key]'
and is_deleted = 0";
$res_sub = xquery($qs_sub, $c);
$a["has_files"] = 0;
if (xnum_rows($res_sub) > 0) {
$a["has_files"] = 1;
}
$product_list[] = $a;
}
$qs = "select * from
m_homepage_features where status = 'active'";
$res = xquery($qs, $c);
while($a = xfetch($res)) {
$homepage_features_list[] = $a;
}
display_template("index.phtml", $GLOBALS);
?>