1 |
<%pre> |
2 |
#include <tntdb/connect.h> |
3 |
#include <tntdb/connection.h> |
4 |
#include <tntdb/result.h> |
5 |
#include <tntdb/row.h> |
6 |
|
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 |
</%pre> |
21 |
|
22 |
<%config> |
23 |
dburl; |
24 |
</%config> |
25 |
|
26 |
<&header title="Critical systems"> |
27 |
</&header> |
28 |
<h2>Critical systems</h2> |
29 |
|
30 |
<{ |
31 |
|
32 |
|
33 |
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 |
}> |
44 |
|
45 |
<&footer> |
46 |
</&footer> |