diff options
author | Pixel <Pixel> | 2001-09-20 23:27:01 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2001-09-20 23:27:01 +0000 |
commit | 8346d0774d2d1e076038db27f65f1d082a460f16 (patch) | |
tree | 132f84cf1ef45d5006a2b1d52d4d40b1e8e51abc /lib/Table.cc |
Initial revision
Diffstat (limited to 'lib/Table.cc')
-rw-r--r-- | lib/Table.cc | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/Table.cc b/lib/Table.cc new file mode 100644 index 0000000..776caae --- /dev/null +++ b/lib/Table.cc @@ -0,0 +1,41 @@ +#include "Table.h" +#include "HttpServ.h" + +Table::Table(const String & titre, const String & url, String * heads, String * cells, int nbc, int nbl, Action * na) : + Action(url), tit(titre), hds(heads), cls(cells), nc(nbc), nl(nbl), Next(na) { } + +String Table::GetTitle(void) { + return tit; +} + +void Table::Do(Variables * v, Handle * h) { + SendHead(h); + + (*h) << "<center><TABLE BORDER=0>" << endnl; + + if (hds) { + (*h) << "<TR>" << endnl; + for (int i = 0; i < nc; i++) { + (*h) << "<TH BGCOLOR=\"#bbbbbb\">" << hds[i] << "</TH>" << endnl; + } + (*h) << "</TR>" << endnl; + } + + for (int l = 0; l < nl; l++) { + (*h) << "<TR>" << endnl; + for (int c = 0; c < nc; c++) { + (*h) << "<TD BGCOLOR=\"#" << (l % 2 ? "cccccc" : "dddddd") << "\">" << cls[l * nc + c] << "</TD>" << endnl; + } + (*h) << "</TR>" << endnl; + } + + (*h) << "</TABLE>" + +"<FORM METHOD=\"POST\" ACTION=\"/bin/" << (Next ? Next->GetURL() : "start") << "\">" << endnl << +"<INPUT TYPE=\"SUBMIT\" VALUE=\" Ok \">" << endnl; +(*h) << "</FORM></CENTER>" << endnl; + + + SendFoot(h); + Accessed(); +} |