class model_index extends model public function productsCount subcateg

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?
class model_index extends model
{
public function productsCount($subcategory_id = 0)
{
return $this->DB->querySingle('SELECT COUNT(*)FROM `products`');
}
public function setHot($id = 0)
{
$hot =
$this->DB->queryFetch('SELECT `id`, `stick`
FROM `hots`
WHERE `id` = ?', array ($id));
$this->DB->query('UPDATE `hots`
SET `c` =?
WHERE `id`= ? ', array (($hot['stick']==0?1:0), $hot['id']));
}
public function easy($new_parent = 0){
global $fenom;
$_categories = $this->DB->query('SELECT * FROM `categories` WHERE `child` = ?', array($new_parent));
$fenom->assign('_categories', $_categories);
$fenom->display('index/category_tree_item.tpl');
}
}