source: trunk/src/map/inc/node_info.php

Last change on this file was 7858, checked in by Pieter Naber, 15 years ago

Handover documentation

  • Property svn:eol-style set to native
File size: 3.2 KB
RevLine 
[7767]1<?php
[7770]2require_once("../../config.php");
3require_once($config['root']."/map/inc/kmlHandler.php");
[7828]4
[7725]5if(isset($_GET['view']))
6{
[7734]7 setcookie("view", $_GET['view']);
[7858]8 // Hack to make cookies work under Internet Explorer 7:
[7827]9 header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');
[7725]10 $view = $_GET['view'];
11}
12else
13{
[7734]14 if(isset($_COOKIE['view']))
15 {
16 $view = $_COOKIE['view'];
17 }
18 else
19 $view = "gebruiker";
[7725]20}
21
[7756]22if(isset($_GET['sel']))
23{
24 $selected = $_GET['sel'];
25}
26else
27{
28 $selected = "";
29}
30
[7735]31//TYPES of nodes. 'cluster' is a cluster node. 'single' is an individual node.
32if(!isset($_GET['type']))//
[7725]33{
34 echo <<<EOF
[7734]35 <div id="nodeinfo">
[7828]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>
[7734]38 Gebruik de <b>zoekfunctie</b> om de een specifieke node te zoeken.
39 </div>
40 <div id="timestamp">
[7828]41 Laatste update: 15:42 <br>
[7734]42 Do 25 maart
43 </div>
[7725]44EOF;
[7734]45
[7725]46}
[7735]47elseif($_GET['type'] == "single") //Info for single nodes is stored here
[7725]48{
[7784]49$markers = get_node_array($config['kml_file']);
[7770]50
[7784]51$description;
[7782]52
[7784]53foreach($markers as $marker)
54{
[7823]55 if(!$marker['location'] == null)
[7784]56 {
[7823]57 if($marker['name'] == $_GET['name'])
58 {
59 $name = $marker['name'];
60 $location = $marker['location'];
[7827]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
[7823]75 }
[7784]76 }
77}
78
[7735]79 if($view == "beheerder")//Display part for beheerder view of a single node
[7784]80 {
[7769]81 echo <<<EOF
[7784]82 <div id='nodeinfo'>
[7827]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}
[7769]96 </div>
97 <div id="timestamp">
[7827]98 Laatste update: {$lastcheck}
[7769]99 </div>
100EOF;
[7734]101 }
[7735]102 elseif($view == "gebruiker")//Display part for gebruiker view of a single node
[7734]103 {
[7769]104 echo <<<EOF
[7821]105 <div id='nodeinfo'>
[7827]106 <b>{$name}</b>
107 <div id="information">
108 <p>Locatie: {$location}
109 <p>Status: {$status}
110 <p>Type: {$type}
111 <p>Hostname: {$hostname}
[7769]112 </div>
113 <div id="timestamp">
[7858]114 Laatste update: TO:DO <br>
115 Last update TODO
[7769]116 </div>
117EOF;
[7858]118// TODO: Last update
[7734]119 }
120}
121elseif($_GET['type'] == "cluster")
122{
[7847]123 $markerTitles = unserialize(stripslashes($_GET['markers']));
[7738]124
125 echo <<<EOF
126 <div id="nodeinfo">
[7827]127 <b>Nodes:</b><br/>
128
[7828]129 Lijst met nodes in deze cluster<br>
[7821]130 <div id="clusterlist$selected" >
131 <select multiple onchange='goToMarker(this.options[this.selectedIndex].text)'>
[7738]132EOF;
133 foreach($markerTitles as $marker)
[7734]134 {
[7738]135 echo "<option value='".$marker."'>".$marker."</option>";
[7734]136 }
[7738]137
138 echo <<<EOF
[7827]139 </select>
[7734]140 </div>
[7738]141 </div>
[7734]142EOF;
143}
[7756]144?>
Note: See TracBrowser for help on using the repository browser.