--- trunk/tntnet/dynamic/customerlist.ecpp 2007/11/27 17:08:11 71 +++ trunk/tntnet/dynamic/customerlist.ecpp 2007/11/27 22:25:36 74 @@ -5,6 +5,8 @@ #include #include "common.h" + +#include <%config> @@ -32,11 +34,44 @@ for (tntdb::Result::const_iterator it = res.begin(); it != res.end(); ++it) { tntdb::Row row = *it; - out << "
"; + int customerid = row.getInt(0); + out << "
"; out << "" << row.getString(1) << "
\n\n"; - out << nl2br(row.getString(2)) << "
\n"; + out << nl2br(trim(row.getString(2))) << "
\n"; + + out << "Phone: " << row.getString(3) << "
\n"; + out << "Contact: " << row.getString(4) << "
\n"; + + out << "
\n"; + + + std::stringstream sqlstream; + sqlstream << "SELECT id, description FROM installation "; + sqlstream << "WHERE customerid = " << customerid; + + tntdb::Result instres = conn.select(sqlstream.str()); + + if (instres.size() > 0) + { + out << "Installations:\n"; + out << "
    \n"; + for (tntdb::Result::const_iterator instit = instres.begin(); instit != instres.end(); ++instit) + { + tntdb::Row instrow = *instit; + out << "
  1. "; + out << instrow.getString(1) << "
  2. "; + } + out << "
\n"; + } + else + { + out << "No installations !\n"; + } + + + out << "

\n";