<?php /** * phpTreeGraph * Linux filesystem hierarchy demo * @author Mathias Herrmann **/ //include GD rendering class require_once './classes/GDRenderer.php'; //create new GD renderer, optinal parameters: LevelSeparation, SiblingSeparation, SubtreeSeparation, defaultNodeWidth, defaultNodeHeight $objTree = new GDRenderer(30, 10, 30, 50, 20); //add nodes to the tree, parameters: id, parentid optional text, width, height, image(path) $objTree->add(1, 0, '/', 10); $objTree->add(2, 1, 'bin'); $objTree->add(3, 1, 'boot'); $objTree->add(4, 1, 'dev'); $objTree->add(5, 1, 'etc'); $objTree->add(6, 1, 'home'); $objTree->add(7, 1, 'lib'); $objTree->add(8, 1, 'lost+found', 100); $objTree->add(9, 1, 'mnt'); $objTree->add(10, 1, 'proc'); $objTree->add(11, 1, 'root'); $objTree->add(12, 1, 'sbin'); $objTree->add(13, 1, 'tmp'); $objTree->add(14, 1, 'usr'); $objTree->add(15, 1, 'var'); $objTree->add(16, 5, 'rc.d'); $objTree->add(17, 5, 'skel'); $objTree->add(18, 5, 'X11'); $objTree->add(19, 14, 'bin');
<?php /** * phpTreeGraph * Species hierarchy demo with images * @author Mathias Herrmann **/ //include GD rendering class require_once './classes/GDRenderer.php'; //create new GD renderer, optinal parameters: LevelSeparation, SiblingSeparation, SubtreeSeparation, defaultNodeWidth, defaultNodeHeight $objTree = new GDRenderer(30, 10, 30, 100, 20); //add nodes to the tree, parameters: id, parentid optional text, width, height, image(path) $objTree->add(1, 0, 'species', 90); $objTree->add(2, 1, 'plants'); $objTree->add(3, 1, 'fungi', 90, 119, 'fungi.png'); $objTree->add(4, 1, 'lichens'); $objTree->add(5, 1, 'animals'); $objTree->add(6, 2, 'mosses'); $objTree->add(7, 2, 'ferns', 60); $objTree->add(8, 2, 'gymnosperms', 120); $objTree->add(9, 2, 'dicotyledons', 120); $objTree->add(10, 2, 'monocotyledons', 130); $objTree->add(11, 5, 'invertebrates'); $objTree->add(12, 5, 'vertebrates'); $objTree->add(13, 11, 'insects'); $objTree->add(14, 11, 'molluscs'); $objTree->add(15, 11, 'crustaceans'); $objTree->add(16, 11, 'others'); $objTree->add(17, 12, 'fish', 131, 69, 'fish.png'); $objTree->add(18, 12, 'amphibians', 143, 107, 'frosch.png'); $objTree->add(19, 12, 'reptiles', 115, 124, 'croc.png');
// // case 'GET_GROUP2ACCESSPOINTS': $group = sumo_get_group_info($_GET['id']); if ($SUMO['DB']->IsConnected()) { $query = "SELECT id,node,path,name FROM " . SUMO_TABLE_ACCESSPOINTS . "\n\t\t\t WHERE (\n\t\t\t \t\t usergroup LIKE '" . $group['usergroup'] . "' \n\t\t\t\t\t OR usergroup LIKE '" . $group['usergroup'] . ";%'\n\t\t\t\t\t OR usergroup LIKE '%;" . $group['usergroup'] . "'\n\t\t\t\t\t OR usergroup LIKE '%;" . $group['usergroup'] . ";%'\n\t\t\t\t\t )\n\t\t\t ORDER BY node,name,path"; $rs = $SUMO['DB']->Execute($query); /** * phpTreeGraph * Species hierarchy demo with images * @author Mathias Herrmann **/ //include GD rendering class require_once SUMO_PATH_MODULE . '/classes/class.gdrender.php'; //create new GD renderer, optinal parameters: LevelSeparation, SiblingSeparation, SubtreeSeparation, defaultNodeWidth, defaultNodeHeight $objTree = new GDRenderer(100, 10, 30, 100, 13); //add nodes to the tree, parameters: id, parentid optional title, text, width, height, image(path) $objTree->add(1, 0, $group['usergroup']); $g = 2; while ($tab = $rs->FetchRow()) { $tab2['name'] = sumo_get_accesspoint_name($tab2['name'], $_COOKIE['language']); $objTree->add($g++, 1, $tab2['name']); } $objTree->setNodeLinks(GDRenderer::LINK_BEZIER); $objTree->setNodeTitleColor(array(245, 240, 220)); $objTree->setLinkColor(array(150, 150, 200)); $objTree->setTextTitleColor(array(0, 0, 0)); $objTree->setFTFont(SUMO_PATH . '/applications/fonts/verdana.ttf', 7); $objTree->stream(); } break;
<?php /** * phpTreeGraph * Species hierarchy demo with images * @author Mathias Herrmann **/ //include GD rendering class require_once './classes/GDRenderer.php'; //create new GD renderer, optinal parameters: LevelSeparation, SiblingSeparation, SubtreeSeparation, defaultNodeWidth, defaultNodeHeight $objTree = new GDRenderer(20, 20, 40, 175, 20); //add nodes to the tree, parameters: id, parentid optional text, width, height, image(path) $objTree->add(1, 0, '102 Students total'); $objTree->add(2, 1, '54 passed (60%)'); $objTree->add(15, 2, '48 failed (40%)'); $objTree->add(3, 15, 'They got 2 right'); $objTree->add(4, 15, 'They got 2 wrong'); $objTree->add(5, 3, '47 passed / 12 failed'); $objTree->add(6, 4, '7 passed / 36 failed'); $objTree->add(7, 5, 'They got 9 right'); $objTree->add(8, 5, 'They got 9 wrong'); $objTree->add(9, 7, '13 passed / 4 failed'); $objTree->add(10, 8, '4 passed / 10 failed'); $objTree->add(11, 6, 'They got 1 right'); $objTree->add(12, 6, 'They got 1 wrong'); $objTree->add(13, 11, '10 passed / 2 failed'); $objTree->add(14, 12, '2 passed / 6 failed'); $objTree->setNodeLinks(GDRenderer::LINK_BEZIER); $objTree->setBGColor(array(255, 183, 111)); $objTree->setNodeColor(array(0, 128, 255)); $objTree->setLinkColor(array(0, 64, 128));