1 |
torben |
71 |
<%pre> |
2 |
|
|
#include <tntdb/connect.h> |
3 |
|
|
#include <tntdb/connection.h> |
4 |
|
|
#include <tntdb/result.h> |
5 |
|
|
#include <tntdb/row.h> |
6 |
torben |
104 |
|
7 |
|
|
#include <vector> |
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
class CriticalInstallation |
12 |
|
|
{ |
13 |
|
|
public: |
14 |
|
|
CriticalInstallation() {} |
15 |
|
|
CriticalInstallation(int i, std::string m) : id(i), message(m) {} |
16 |
|
|
int id; |
17 |
|
|
std::string message; |
18 |
|
|
}; |
19 |
|
|
|
20 |
torben |
71 |
</%pre> |
21 |
|
|
|
22 |
torben |
68 |
<%config> |
23 |
|
|
dburl; |
24 |
|
|
</%config> |
25 |
|
|
|
26 |
|
|
<&header title="Critical systems"> |
27 |
|
|
</&header> |
28 |
torben |
104 |
<h2>Critical systems</h2> |
29 |
|
|
|
30 |
torben |
71 |
<{ |
31 |
torben |
68 |
|
32 |
|
|
|
33 |
torben |
104 |
std::vector<CriticalInstallation> criticals; |
34 |
|
|
|
35 |
|
|
tntdb::Connection conn = tntdb::connect(dburl); |
36 |
|
|
|
37 |
|
|
tntdb::Result res = conn.select("SELECT id FROM installation WHERE commerror = true"); |
38 |
|
|
for (int i=0; i<res.size(); ++i) |
39 |
|
|
{ |
40 |
|
|
criticals.push_back(CriticalInstallation(res[i].getInt(0), std::string("Communication Error"))); |
41 |
|
|
} |
42 |
|
|
|
43 |
torben |
111 |
|
44 |
|
|
|
45 |
torben |
71 |
}> |
46 |
|
|
|
47 |
torben |
68 |
<&footer> |
48 |
|
|
</&footer> |