<?php require_once 'Connection.class.php'; require_once '__conf.php'; require_once 'i18n/i18n.php'; i18n_set_map('en', $LANG, false); /** * Builds the Zabbix service tree. */ class ServiceTree { /** * Retrieves the root services list. * @param PDO $dbh Database connection handle. * @return array Services list. */ public static function GetRootList(PDO $dbh) { try { $stmt = Connection::QueryDatabase($dbh, ' SELECT DISTINCT(name) as name FROM services s INNER JOIN services_links sl ON sl.serviceupid = s.serviceid WHERE NOT EXISTS ( SELECT * FROM services_links sl2 WHERE sl2.servicedownid = s.serviceid ) '); } catch (Exception $e) { Connection::HttpError(500, I('Failed to query service list') . '<br/>' . $e->getMessage());
require_once 'inc/ServiceTree.class.php'; session_start(); function_exists('curl_init') or die('cURL module not found.'); $dbh = Connection::GetDatabase(); Install::CheckDbTables($dbh); $colors = ServiceTree::GetColors($dbh); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="icon" type="image/x-icon" href="img/favicon.ico"/> <?php require_once 'i18n/i18n.php'; i18n_set_map('en', $LANG); ?> <style type="text/css"> html,body { height:100%; margin:0; overflow:hidden; } body,table,input,select { font:10pt Arial; color:#181818; } a { color:#1853AD; } a:hover { color:#FE5E00; } hr { height:1px; border:0; color:#CCC; background-color:#CCC; } div#theBigOne { width:100%; height:100%; background:url('img/serpro.png') no-repeat bottom right; } #treeLoading { position:fixed; top:50%; left:50%; margin-top:-75px; margin-left:-75px; } /*canvas#treePlot { width:100%; height:100%; }*/ div#topLeftOne { background:rgba(250,250,250,0.5); border:1px solid #EEE; padding:4px; position:fixed; top:8px; left:8px; font:bold 13pt Arial; color:#BBB; } div#topRiteOne { background:rgba(230,230,230,0.5); border:1px solid #D4D4D4; padding:6px; position:fixed; top:10px; right:10px; } div#toolbox { position:fixed; left:10px; bottom:10px; border:1px solid #CCC; background:rgba(230,230,230,0.5); padding:1px 6px; } .numStatus { border:1px solid #CCC; padding:0px 4px; } #statusTxt { font-size:8pt; }