35 |
conn = tntdb::connect(dburl); |
conn = tntdb::connect(dburl); |
36 |
|
|
37 |
std::stringstream query; |
std::stringstream query; |
38 |
query << "SELECT c.name, c.address AS caddress, i.description, i.address AS iadress, i.furnacetype, i.updaterate "; |
query << "SELECT c.name, c.address AS caddress, i.description, i.address AS iadress, i.furnacetype, i.updaterate, i.commerror "; |
39 |
query << "FROM installation i INNER JOIN customer c ON c.id = i.customerid "; |
query << "FROM installation i INNER JOIN customer c ON c.id = i.customerid "; |
40 |
query << "WHERE i.id = " << id; |
query << "WHERE i.id = " << id; |
41 |
|
|
72 |
<td>Update rate: </td> |
<td>Update rate: </td> |
73 |
<td><$ res[0].getInt(5) $></td> |
<td><$ res[0].getInt(5) $></td> |
74 |
</tr> |
</tr> |
75 |
|
<tr> |
76 |
|
<td>Comm. status: </td> |
77 |
|
<td><img src="bullet.php?rgb=<$ (res[0].getBool(6) ? "ff0000" : "00ff00") $>" alt="Status Indicator"></td> |
78 |
|
</tr> |
79 |
|
|
80 |
|
|
81 |
</table> |
</table> |
82 |
|
|
83 |
|
|
84 |
<p align="center"><img src="temperaturegraph?id=<$id$>"></p> |
<p align="center"><img src="temperaturegraph?id=<$id$>" alt="Temperature graph"></p> |
85 |
|
|
86 |
<{ |
<{ |
87 |
query.str(""); //reset stringstream |
query.str(""); //reset stringstream |
95 |
out << "<table border=1 cellspacing=0 align='center'>\n"; |
out << "<table border=1 cellspacing=0 align='center'>\n"; |
96 |
out << "<tr><th> Message# </th><th> Logtime </th><th> Temperature </th><th> Flamedetector </th><th> Solidfuel empty </th><th> Conveyor error </th><th> Power failure </th></tr>\n"; |
out << "<tr><th> Message# </th><th> Logtime </th><th> Temperature </th><th> Flamedetector </th><th> Solidfuel empty </th><th> Conveyor error </th><th> Power failure </th></tr>\n"; |
97 |
|
|
98 |
for (int i=0; i<res.size(); ++i) |
for (unsigned int i=0; i<res.size(); ++i) |
99 |
{ |
{ |
100 |
int messagenr = res[i].getInt(0); |
int messagenr = res[i].getInt(0); |
101 |
std::string logtime = res[i].getString(1); |
std::string logtime = res[i].getString(1); |
119 |
|
|
120 |
out << "</tr>"; |
out << "</tr>"; |
121 |
} |
} |
122 |
|
out << "</table>\n"; |
123 |
|
|
124 |
|
|
125 |
}> |
}> |