remove obsolete frame divider images
[openemr.git] / library / classes / CategoryTree.class.php
blob26ba3faaf216d17d96526afec2f157d773684b73
1 <?php
3 require_once("Tree.class.php");
5 /**
6 * class CategoryTree
7 * This is a class for storing document categories using the MPTT implementation
8 */
10 class CategoryTree extends Tree {
14 * This just sits on top of the parent constructor, only a shell so that the _table var gets set
16 function CategoryTree($root,$root_type = ROOT_TYPE_ID) {
17 $this->_table = "categories";
18 parent::Tree($root,$root_type);
21 function _get_categories_array($patient_id) {
22 $categories = array();
23 $sql = "SELECT c.id, c. name, d.id AS document_id, d.type, d.url FROM categories AS c, documents AS d
24 LEFT JOIN categories_to_documents AS c2d ON c.id = c2d.category_id WHERE c2d.document_id = d.id";
25 if (is_numeric($patient_id)) {
26 $sql .= " AND d.foreign_id = '" . $patient_id . "'";
28 //echo $sql;
29 $result = $this->_db->Execute($sql);
31 while ($result && !$result->EOF) {
32 $categories[$result->fields['id']][$result->fields['document_id']] = $result->fields;
33 $result->MoveNext();
36 return $categories;