1 | <?php
|
---|
2 | require_once("../../config.php");
|
---|
3 | require_once($config['root']."/map/inc/kmlHandler.php");
|
---|
4 |
|
---|
5 | if(isset($_GET['view']))
|
---|
6 | {
|
---|
7 | setcookie("view", $_GET['view']);
|
---|
8 | // Hack to make cookies work under Internet Explorer 7:
|
---|
9 | header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');
|
---|
10 | $view = $_GET['view'];
|
---|
11 | }
|
---|
12 | else
|
---|
13 | {
|
---|
14 | if(isset($_COOKIE['view']))
|
---|
15 | {
|
---|
16 | $view = $_COOKIE['view'];
|
---|
17 | }
|
---|
18 | else
|
---|
19 | $view = "gebruiker";
|
---|
20 | }
|
---|
21 |
|
---|
22 | if(isset($_GET['sel']))
|
---|
23 | {
|
---|
24 | $selected = $_GET['sel'];
|
---|
25 | }
|
---|
26 | else
|
---|
27 | {
|
---|
28 | $selected = "";
|
---|
29 | }
|
---|
30 |
|
---|
31 | //TYPES of nodes. 'cluster' is a cluster node. 'single' is an individual node.
|
---|
32 | if(!isset($_GET['type']))//
|
---|
33 | {
|
---|
34 | echo <<<EOF
|
---|
35 | <div id="nodeinfo">
|
---|
36 | <b>Mouse over</b> een node voor meer informatie.<br><br>
|
---|
37 | <b>Klik</b> op een node om deze te selecteren.<br><br>
|
---|
38 | Gebruik de <b>zoekfunctie</b> om de een specifieke node te zoeken.
|
---|
39 | </div>
|
---|
40 | <div id="timestamp">
|
---|
41 | Laatste update: 15:42 <br>
|
---|
42 | Do 25 maart
|
---|
43 | </div>
|
---|
44 | EOF;
|
---|
45 |
|
---|
46 | }
|
---|
47 | elseif($_GET['type'] == "single") //Info for single nodes is stored here
|
---|
48 | {
|
---|
49 | $markers = get_node_array($config['kml_file']);
|
---|
50 |
|
---|
51 | $description;
|
---|
52 |
|
---|
53 | foreach($markers as $marker)
|
---|
54 | {
|
---|
55 | if(!$marker['location'] == null)
|
---|
56 | {
|
---|
57 | if($marker['name'] == $_GET['name'])
|
---|
58 | {
|
---|
59 | $name = $marker['name'];
|
---|
60 | $location = $marker['location'];
|
---|
61 | $status = $marker['status'];
|
---|
62 | $interfaces = $marker['interfaces'];
|
---|
63 | $masterIP = $marker['masterIP'];
|
---|
64 | $nodeType = $marker['nodeType'];
|
---|
65 | $type = $marker['type'];
|
---|
66 | $hostname = $marker['hostname'];
|
---|
67 | $hasBeenChecked = $marker['hasBeenChecked'];
|
---|
68 | $checkExecutionTime = $marker['checkExecutionTime'];
|
---|
69 | $currentState = $marker['currentState'];
|
---|
70 | $problemHasBeenAcknowledged = $marker['problemHasBeenAcknowledged'];
|
---|
71 |
|
---|
72 | $lastcheck = $marker['lastCheck'];
|
---|
73 | $lastcheck = date('d-m-Y H:i:s', (int)$lastcheck);
|
---|
74 |
|
---|
75 | }
|
---|
76 | }
|
---|
77 | }
|
---|
78 |
|
---|
79 | if($view == "beheerder")//Display part for beheerder view of a single node
|
---|
80 | {
|
---|
81 | echo <<<EOF
|
---|
82 | <div id='nodeinfo'>
|
---|
83 | <b>{$name}</b>
|
---|
84 | <div id="information">
|
---|
85 | <p>Locatie: {$location}
|
---|
86 | <p>Status: {$status}
|
---|
87 | <p>Inferfaces: {$interfaces}
|
---|
88 | <p>Master IP: {$masterIP}
|
---|
89 | <p>Node type: {$nodeType}
|
---|
90 | <p>Type: {$type}
|
---|
91 | <p>Hostname: {$hostname}
|
---|
92 | <p>Has been check: {$hasBeenChecked}
|
---|
93 | <p>Check execution time: {$checkExecutionTime}
|
---|
94 | <p>Current state: {$currentState}
|
---|
95 | <p>Problem has been acknowledged: {$problemHasBeenAcknowledged}
|
---|
96 | </div>
|
---|
97 | <div id="timestamp">
|
---|
98 | Laatste update: {$lastcheck}
|
---|
99 | </div>
|
---|
100 | EOF;
|
---|
101 | }
|
---|
102 | elseif($view == "gebruiker")//Display part for gebruiker view of a single node
|
---|
103 | {
|
---|
104 | echo <<<EOF
|
---|
105 | <div id='nodeinfo'>
|
---|
106 | <b>{$name}</b>
|
---|
107 | <div id="information">
|
---|
108 | <p>Locatie: {$location}
|
---|
109 | <p>Status: {$status}
|
---|
110 | <p>Type: {$type}
|
---|
111 | <p>Hostname: {$hostname}
|
---|
112 | </div>
|
---|
113 | <div id="timestamp">
|
---|
114 | Laatste update: TO:DO <br>
|
---|
115 | Last update TODO
|
---|
116 | </div>
|
---|
117 | EOF;
|
---|
118 | // TODO: Last update
|
---|
119 | }
|
---|
120 | }
|
---|
121 | elseif($_GET['type'] == "cluster")
|
---|
122 | {
|
---|
123 | $markerTitles = unserialize(stripslashes($_GET['markers']));
|
---|
124 |
|
---|
125 | echo <<<EOF
|
---|
126 | <div id="nodeinfo">
|
---|
127 | <b>Nodes:</b><br/>
|
---|
128 |
|
---|
129 | Lijst met nodes in deze cluster<br>
|
---|
130 | <div id="clusterlist$selected" >
|
---|
131 | <select multiple onchange='goToMarker(this.options[this.selectedIndex].text)'>
|
---|
132 | EOF;
|
---|
133 | foreach($markerTitles as $marker)
|
---|
134 | {
|
---|
135 | echo "<option value='".$marker."'>".$marker."</option>";
|
---|
136 | }
|
---|
137 |
|
---|
138 | echo <<<EOF
|
---|
139 | </select>
|
---|
140 | </div>
|
---|
141 | </div>
|
---|
142 | EOF;
|
---|
143 | }
|
---|
144 | ?>
|
---|