/[H9]/trunk/tntnet/dynamic/adm_send_config.ecpp
ViewVC logotype

Diff of /trunk/tntnet/dynamic/adm_send_config.ecpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 124 by torben, Sun Dec 2 19:32:52 2007 UTC revision 195 by torben, Sat Dec 8 16:47:03 2007 UTC
# Line 8  Line 8 
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          }          }
# Line 31  dburl; Line 31  dburl;
31    
32  <%session scope="global">  <%session scope="global">
33  std::string userName;  std::string userName;
 bool isAdmin;  
34  </%session>  </%session>
35    
36  <{  <{
# Line 48  if (userName.size() == 0) Line 47  if (userName.size() == 0)
47    
48  <{  <{
49    
50  tntdb::Connection conn = tntdb::connect(dburl);  tntdb::Connection conn = tntdb::connectCached(dburl);
51    
52  std::ostream& out = reply.out();  std::ostream& out = reply.out();
53    
# Line 113  out << "<p align='center'><b>Command his Line 112  out << "<p align='center'><b>Command his
112  out << "<table cellspacing='0' align='center' border='1'>";  out << "<table cellspacing='0' align='center' border='1'>";
113  out << "<tr><th>&nbsp;Created&nbsp;</th><th>&nbsp;Executed&nbsp;</th><th>Command</th></tr>\n";  out << "<tr><th>&nbsp;Created&nbsp;</th><th>&nbsp;Executed&nbsp;</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>&nbsp;" << res[i].getString(2) << "&nbsp;</td>";
118          out << "<td>" << res[i].getString(3) << "</td>";          out << "<td>&nbsp;" << res[i].getString(3) << "&nbsp;</td>";
119    
120          out << "<td>";          out << "<td>&nbsp;";
121    
122          switch ( res[i].getInt(4) )          switch ( res[i].getInt(4) )
123          {          {
# Line 132  for (int i=0; i<res.size(); ++i) Line 131  for (int i=0; i<res.size(); ++i)
131                          out << "Unknown command";                          out << "Unknown command";
132                          break;                          break;
133          }          }
134          out << "</td>\n";          out << "&nbsp;</td>\n";
135    
136          out << "</tr>\n";          out << "</tr>\n";
137  }  }

Legend:
Removed from v.124  
changed lines
  Added in v.195

  ViewVC Help
Powered by ViewVC 1.1.20