8 |
std::string createInstallationSelector(tntdb::Connection& conn) |
std::string createInstallationSelector(tntdb::Connection& conn) |
9 |
{ |
{ |
10 |
std::stringstream out; |
std::stringstream out; |
11 |
tntdb::Result res = conn.select("SELECT c.name, i.id, i.description FROM customer c INNER JOIN installation i ON c.id = i.customerid"); |
tntdb::Result res = conn.select("SELECT c.name, i.id, i.description FROM customer c INNER JOIN installation i ON c.id = i.customerid ORDER BY name,description"); |
12 |
|
|
13 |
out << "<select name='installation'>\n"; |
out << "<select name='installation'>\n"; |
14 |
|
|
15 |
for (int i=0; i<res.size(); ++i) |
for (unsigned int i=0; i<res.size(); ++i) |
16 |
{ |
{ |
17 |
out << " <option value='" << res[i].getInt(1) << "'>" << res[i].getString(0) << " :: " << res[i].getString(2) << "</option>\n"; |
out << " <option value='" << res[i].getInt(1) << "'>" << res[i].getString(0) << " :: " << res[i].getString(2) << "</option>\n"; |
18 |
} |
} |
31 |
|
|
32 |
<%session scope="global"> |
<%session scope="global"> |
33 |
std::string userName; |
std::string userName; |
|
bool isAdmin; |
|
34 |
</%session> |
</%session> |
35 |
|
|
36 |
<{ |
<{ |
112 |
out << "<table cellspacing='0' align='center' border='1'>"; |
out << "<table cellspacing='0' align='center' border='1'>"; |
113 |
out << "<tr><th> Created </th><th> Executed </th><th>Command</th></tr>\n"; |
out << "<tr><th> Created </th><th> Executed </th><th>Command</th></tr>\n"; |
114 |
|
|
115 |
for (int i=0; i<res.size(); ++i) |
for (unsigned int i=0; i<res.size(); ++i) |
116 |
{ |
{ |
117 |
out << "<tr><td>" << res[i].getString(2) << "</td>"; |
out << "<tr><td> " << res[i].getString(2) << " </td>"; |
118 |
out << "<td>" << res[i].getString(3) << "</td>"; |
out << "<td> " << res[i].getString(3) << " </td>"; |
119 |
|
|
120 |
out << "<td>"; |
out << "<td> "; |
121 |
|
|
122 |
switch ( res[i].getInt(4) ) |
switch ( res[i].getInt(4) ) |
123 |
{ |
{ |
131 |
out << "Unknown command"; |
out << "Unknown command"; |
132 |
break; |
break; |
133 |
} |
} |
134 |
out << "</td>\n"; |
out << " </td>\n"; |
135 |
|
|
136 |
out << "</tr>\n"; |
out << "</tr>\n"; |
137 |
} |
} |