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

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

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

revision 73 by torben, Tue Nov 27 17:08:11 2007 UTC revision 74 by torben, Tue Nov 27 22:25:36 2007 UTC
# Line 5  Line 5 
5  #include <tntdb/row.h>  #include <tntdb/row.h>
6    
7  #include "common.h"  #include "common.h"
8    
9    #include <sstream>
10  </%pre>  </%pre>
11    
12  <%config>  <%config>
# Line 32  if (res.size() != 0) Line 34  if (res.size() != 0)
34          for (tntdb::Result::const_iterator it = res.begin(); it != res.end(); ++it)          for (tntdb::Result::const_iterator it = res.begin(); it != res.end(); ++it)
35          {          {
36                  tntdb::Row row = *it;                  tntdb::Row row = *it;
37                  out << "<table border=1 width=80% cellspacing=0 align=center><tr><td>";                  int customerid = row.getInt(0);
38                    out << "<table border=1 width='80%' cellspacing=0 align=center><tr><td>";
39                  out << "<b>" << row.getString(1) << "</b><br>\n\n";                  out << "<b>" << row.getString(1) << "</b><br>\n\n";
40    
41    
42                  out << nl2br(row.getString(2)) << "<br>\n";                  out << nl2br(trim(row.getString(2))) << "<br>\n";
43    
44                    out << "<i>Phone:</i> " << row.getString(3) << "<br>\n";
45                    out << "<i>Contact:</i> " << row.getString(4) << "<br>\n";
46    
47                    out << "<br>\n";
48    
49    
50                    std::stringstream sqlstream;
51                    sqlstream << "SELECT id, description FROM installation ";
52                    sqlstream << "WHERE customerid = " << customerid;
53    
54                    tntdb::Result instres = conn.select(sqlstream.str());
55    
56                    if (instres.size() > 0)
57                    {
58                            out << "Installations:\n";
59                            out << "<ol style='margin-top:0px;'>\n";
60                            for (tntdb::Result::const_iterator instit = instres.begin(); instit != instres.end(); ++instit)
61                            {
62                                    tntdb::Row instrow = *instit;
63                                    out << "<li><a href='installationdetails?id=" << instrow.getString(0) << "'>";
64                                    out << instrow.getString(1) << "</a></li>";
65                            }
66                            out << "</ol>\n";
67                    }
68                    else
69                    {
70                            out << "<i>No installations !</i>\n";
71                    }
72    
73    
74    
75    
76    
77                  out << "</td></tr></table><br>\n";                  out << "</td></tr></table><br>\n";

Legend:
Removed from v.73  
changed lines
  Added in v.74

  ViewVC Help
Powered by ViewVC 1.1.20