<%pre> #include #include #include #include #include "common.h" <%config> dburl; <&header title="Critical systems">

Customers and installations

<{ tntdb::Connection conn; conn = tntdb::connect(dburl); //letting exceptions flow up and to tntnet and let it display an error message std::string customer_sql = "SELECT id,name,address,phonenr,contactperson FROM customer ORDER BY name ASC"; tntdb::Result res = conn.select(customer_sql); std::ostream& out = reply.out(); if (res.size() != 0) { for (tntdb::Result::const_iterator it = res.begin(); it != res.end(); ++it) { tntdb::Row row = *it; out << "
"; out << "" << row.getString(1) << "
\n\n"; out << nl2br(row.getString(2)) << "
\n"; out << "

\n"; } } else { out << "No customer records found!"; } }> <&footer>