<%pre> #include #include #include #include <%config> dburl; <%session scope="global"> std::string userName; <&header title="Customer administration">

Customers administration

Create new customer
<{ if (userName.size() == 0) reply.setHeader("Refresh", "0; url=login"); tntdb::Connection conn; conn = tntdb::connect(dburl); //letting exceptions flow up and to tntnet and let it display an error message std::string query = "SELECT id, name FROM customer ORDER BY name ASC"; tntdb::Result res = conn.select(query); std::ostream& out = reply.out(); if (res.size() > 0) { out << ""; } else { out << "No customers found!"; } }> <&footer>