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

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

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

revision 83 by torben, Wed Nov 28 17:03:27 2007 UTC revision 101 by torben, Thu Nov 29 13:59:21 2007 UTC
# Line 13  dburl; Line 13  dburl;
13  std::string userName;  std::string userName;
14  </%session>  </%session>
15    
16    <{
17    if (userName.size() == 0)
18    {
19            reply.setHeader("Location", "index");
20            return HTTP_MOVED_TEMPORARILY;
21    }
22    }>
23    
24  <&header title="Customer administration">  <&header title="Customer administration">
25  </&header>  </&header>
26  <h2>Customers administration</h2>  <h2>Customers administration</h2>
27    
28  <a href="adm_customer_edit?id=-1">Create new customer</a><br>  <a href="adm_customer_edit?id=-1">Create new customer</a><br>
29    
 <{  
30    
31  if (userName.size() == 0)  <{
32          reply.setHeader("Refresh", "0; url=login");  tntdb::Connection conn = tntdb::connect(dburl);
   
 tntdb::Connection conn;  
   
 conn = tntdb::connect(dburl); //letting exceptions flow up and to tntnet and let it display an error message  
33    
34  std::string query = "SELECT id, name FROM customer ORDER BY name ASC";  std::string query = "SELECT id, name FROM customer ORDER BY name ASC";
35    
# Line 42  if (res.size() > 0) Line 45  if (res.size() > 0)
45                  std::string name = res[i].getString(1);                  std::string name = res[i].getString(1);
46                  out << "<li>";                  out << "<li>";
47                  out << "<a href='adm_customer_edit?id=" << id << "'>" << name << "</a>";                  out << "<a href='adm_customer_edit?id=" << id << "'>" << name << "</a>";
48                  out << " - <a href='adm_installation_list?id=" << id << "&name=" << name << "'>manage installations</a>";                  out << " - <a href='adm_installation_list?customerid=" << id << "&name=" << name << "'>manage installations</a>";
49                  out << "</li>";                  out << "</li>";
50          }          }
51          out << "</ul>";          out << "</ul>";

Legend:
Removed from v.83  
changed lines
  Added in v.101

  ViewVC Help
Powered by ViewVC 1.1.20