Browse Source

Created conditions for fields that will need to be handled differently

master
5 years ago
parent
commit
f88147df5d
  1. 8
      main.c

8
main.c

@ -88,10 +88,14 @@ void qresult(sqlite3_stmt * const sp, const char *c) { @@ -88,10 +88,14 @@ void qresult(sqlite3_stmt * const sp, const char *c) {
while ((e = sqlite3_step(sp)) == SQLITE_ROW) {
printf("<TR>");
for (i = 0; i < cc; i++) {
if (i != cvt) {
if (*c == 'm' && i == 1 || (*c == '\0' && i == 3) || (*c == 'p' && i == 0)) {
printf("<TD>%s</TD>", sqlite3_column_text(sp, i));
} else {
} else if ((i == 0 && *c == '\0') || (i == 1 && *c == 'p') ) {
printf("<TD><a href='/cgi/cts.py?map=%s'>%s</a></TD>", sqlite3_column_text(sp, i), sqlite3_column_text(sp, i));
} else if (i == 2 && (*c == 'm' || *c == '\0')) {
print_time(sqlite3_column_text(sp, i));
} else {
printf("<TD>%s</TD>", sqlite3_column_text(sp, i));
}
}
printf("</TR>");

Loading…
Cancel
Save