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