Quick Search:

View

Revision:

Diff

Diff from 208 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/trunk/oscommerce/includes/classes/category.php

Annotated File View

hpdl
208
1 <?php
2 /*
3   $Id: account.php 207 2005-09-26 01:29:31 +0200 (Mo, 26 Sep 2005) hpdl $
4
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
8   Copyright (c) 2005 osCommerce
9
10   Released under the GNU General Public License
11 */
12
13   class osC_Category {
14     var $_data = array();
15
16     function osC_Category($id) {
17       global $osC_Database;
18
19       $Qcategory = $osC_Database->query('select c.categories_id as id, c.parent_id, c.categories_image as image, cd.categories_name as name from :table_categories c, :table_categories_description cd where c.categories_id = :categories_id and c.categories_id = cd.categories_id and cd.language_id = :language_id');
20       $Qcategory->bindTable(':table_categories', TABLE_CATEGORIES);
21       $Qcategory->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
22       $Qcategory->bindInt(':categories_id', $id);
23       $Qcategory->bindInt(':language_id', $_SESSION['languages_id']);
24       $Qcategory->execute();
25
26       if ($Qcategory->numberOfRows() === 1) {
27         $this->_data = $Qcategory->toArray();
28       }
29     }
30
31     function getTitle() {
32       if (isset($this->_data['name'])) {
33         return $this->_data['name'];
34       }
35
36       return false;
37     }
38
39     function getImage() {
40       if (isset($this->_data['image'])) {
41         return $this->_data['image'];
42       }
43
44       return false;
45     }
46   }
47 ?>