html.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
#ifdef WIN32
00020
#include <Config-win.h>
00021
static int getpid() {
return 0; }
00022
#endif
00023
#include <stdio.h>
00024
#include <stdlib.h>
00025
#ifndef WIN32
00026
#include <unistd.h>
00027
#endif
00028
#include <string>
00029
#include <libcgi++.h>
00030
00031
#include "dbd.h"
00032
00033
#include "html.h"
00034
00035
00036 void error(
char *s)
00037 {
00038 fprintf(
out,
"\n");
00039
00040 fprintf(
out,
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\n");
00041 fflush(
out);
00042 fprintf(
out,
"<html><head><title>Error</title>");
00043 fprintf(
out,
"<link rel=\"STYLESHEET\" href=\"/style/dbd.css\" type=\"text/css\">");
00044 fprintf(
out,
"<link rel='SHORTCUT ICON' href='/favicon.ico'>");
00045 fprintf(
out,
"</head>\n");
00046 fprintf(
out,
"<body> <h1>Error</h1> This is the text of the error message: '%s' </body></html>\n",s);
00047 fflush(
out);
00048
#ifndef WIN32
00049
exit(-1);
00050
#endif
00051
}
00052
00053 void header_top(
char *s,
long useronline)
00054 {
00055 fprintf(
out,
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\n");
00056 fflush(
out);
00057 fprintf(
out,
"<html><head><base target=rf><title>%s</title>",s);
00058 fprintf(
out,
"<link rel=\"STYLESHEET\" href=\"/style/dbd.css\" type=\"text/css\">");
00059 fprintf(
out,
"<link rel='SHORTCUT ICON' href='/favicon.ico'>");
00060 fprintf(
out,
"</head>\n");
00061 fprintf(
out,
"<body>");
00062
if (*s)
00063 fprintf(
out,
"<h3>%s</h3>",s);
00064 }
00065
00066
00067
00068
00069 void header0(
char *s,
long useronline,Cookies *cs)
00070 {
00071
char slask[100];
00072
00073 fprintf(
out,
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\n");
00074 fflush(
out);
00075 fprintf(
out,
"<html><head><base target=rf><title>%s</title>",s);
00076 fprintf(
out,
"<link rel=\"STYLESHEET\" href=\"/style/dbd.css\" type=\"text/css\">");
00077 fprintf(
out,
"<link rel='SHORTCUT ICON' href='/favicon.ico'>");
00078 fprintf(
out,
"</head>\n");
00079 fprintf(
out,
"<body>");
00080
00081 std::string td_class =
"x";
00082 std::string a_class =
"x";
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 cs -> getvalue(
"flik",slask,20);
00108
int flik = atoi(slask);
00109 fprintf(
out,
"<table cellpadding=0 cellspacing=0><tr>");
00110 fprintf(
out,
"<td class=mbeg> </td>");
00111
00112
00113
00114 td_class = (flik == 2) ?
"y" :
"x";
00115 fprintf(
out,
"<td class=%s><a class=%s href=\"/cgi-bin/dbd/dbd?design=0\">design</a></td>",td_class.c_str(),a_class.c_str());
00116
00117
00118 td_class = (flik == 3) ?
"y" :
"x";
00119 fprintf(
out,
"<td class=%s><a class=%s href=\"/cgi-bin/dbd/dbd?ed=0\">edit</a></td>",td_class.c_str(),a_class.c_str());
00120
00121
00122 td_class = (flik == 4) ?
"y" :
"x";
00123 fprintf(
out,
"<td class=%s><a class=%s href=\"/cgi-bin/dbd/dbd?diagram=0\">diagram</a></td>",td_class.c_str(),a_class.c_str());
00124
00125
00126 td_class = (flik == 5) ?
"y" :
"x";
00127 fprintf(
out,
"<td class=%s><a class=%s href=\"/cgi-bin/dbd/dbd?sql=1\">code</a></td>",td_class.c_str(),a_class.c_str());
00128
00129
00130 td_class = (flik == 7) ?
"y" :
"x";
00131 fprintf(
out,
"<td class=%s><a class=%s href=\"/cgi-bin/dbd/dbd?dba=0\">share</a></td>",td_class.c_str(),a_class.c_str());
00132
00133
00134
00135
00136
00137 td_class = (flik == 10) ?
"y" :
"x";
00138 fprintf(
out,
"<td class='%s'><a class='%s' href='/cgi-bin/dbd/dbd?import=0'>import</a></td>",td_class.c_str(),a_class.c_str());
00139
00140
00141
00142 td_class = (flik == 6) ?
"y" :
"x";
00143 fprintf(
out,
"<td class=%s><a class=%s href=\"/cgi-bin/dbd/dbd?ui=0\">settings</a></td>",td_class.c_str(),a_class.c_str());
00144
00145 td_class =
"x";
00146 fprintf(
out,
"<td class=%s><a target=_top class=%s href=\"/cgi-bin/dbd/dbd?logout=0\">logout</a></td>",td_class.c_str(),a_class.c_str());
00147
00148 fprintf(
out,
"</tr></table>");
00149 fprintf(
out,
"<div style=\"width: 100%; height: 8px; background: #c0c0c0\">");
00150 fprintf(
out,
"</div>");
00151 fprintf(
out,
"<div style=\"width: 100%; height: 4px; background: #ffffff\">");
00152 fprintf(
out,
"</div>");
00153
00154 fprintf(
out,
"<div style=\"padding: 5px;\">");
00155
00156
if (*s)
00157 fprintf(
out,
"<h3>%s</h3>",s);
00158 }
00159
00160
00161
00162
00163 void header(
char *s,
long useronline)
00164 {
00165 fprintf(
out,
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\n");
00166 fflush(
out);
00167 fprintf(
out,
"<html><head><base target=rf><title>%s</title>",s);
00168
00169
00170
00171
00172 fprintf(
out,
"<link rel=\"STYLESHEET\" href=\"/style/dbd.css\" type=\"text/css\">");
00173 fprintf(
out,
"<link rel='SHORTCUT ICON' href='/favicon.ico'>");
00174 fprintf(
out,
"</head>\n");
00175 fprintf(
out,
"<body>");
00176 fprintf(
out,
"<table width=\"100%%\" cellpadding=0 cellspacing=0><tr><td valign=middle>");
00177
if (*s)
00178 fprintf(
out,
"<h1>%s: %s</h1>",
TITLE,s);
00179
else
00180 fprintf(
out,
"<h1>%s</h1>",
TITLE);
00181
00182 fprintf(
out,
"</td>");
00183 fprintf(
out,
"<td valign=top align=right>");
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
if (useronline)
00197 {
00198 useronline = 999;
00199 fprintf(
out,
"[\n");
00200
if (useronline == 1)
00201 fprintf(
out,
"design\n");
00202
else
00203 fprintf(
out,
"<a href=\"/cgi-bin/dbd/dbd?design=0\">design</a>\n");
00204 fprintf(
out,
"|\n");
00205 fprintf(
out,
"<a href=\"/cgi-bin/dbd/dbd?ed=0\">edit data</a>\n");
00206 fprintf(
out,
"|\n");
00207 fprintf(
out,
"<a href=\"/cgi-bin/dbd/dbd?sql=1\">generate sql</a>\n");
00208 fprintf(
out,
"|\n");
00209 fprintf(
out,
"<a href=\"/cgi-bin/dbd/dbd?diagram=0\">diagram</a>\n");
00210 fprintf(
out,
"|\n");
00211
if (useronline == 2)
00212 fprintf(
out,
"db access\n");
00213
else
00214 fprintf(
out,
"<a href=\"/cgi-bin/dbd/dbd?dba=0\">db access</a>\n");
00215 fprintf(
out,
"|\n");
00216
if (useronline == 3)
00217 fprintf(
out,
"user info\n");
00218
else
00219 fprintf(
out,
"<a href=\"/cgi-bin/dbd/dbd?ui=0\">user info</a>\n");
00220 fprintf(
out,
"|\n");
00221 fprintf(
out,
"<a target=_top href=\"/cgi-bin/dbd/dbd?logout=0\">logout</a>\n");
00222 fprintf(
out,
"]");
00223 fprintf(
out,
"<br>");
00224 fprintf(
out,
"[ <a href=\"/cgi-bin/dbd/dbd?ls=0\">live sync</a> ]");
00225 }
00226 fprintf(
out,
"</td></tr></table>");
00227 }
00228
00229 void nullheader(
char *s,
long useronline)
00230 {
00231 fprintf(
out,
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\n");
00232 fflush(
out);
00233 fprintf(
out,
"<html><head><title>%s</title>",s);
00234
00235
00236
00237
00238 fprintf(
out,
"<link rel=\"STYLESHEET\" href=\"/style/dbd.css\" type=\"text/css\">");
00239 fprintf(
out,
"<link rel='SHORTCUT ICON' href='/favicon.ico'>");
00240 fprintf(
out,
"</head>\n");
00241 fprintf(
out,
"<body style=\"padding: 10px;\">");
00242 fprintf(
out,
"<table width=\"100%%\" cellpadding=0 cellspacing=0><tr><td valign=middle>");
00243
if (*s)
00244 fprintf(
out,
"<h1>%s: %s</h1>",
TITLE,s);
00245
else
00246 fprintf(
out,
"<h1>%s</h1>",
TITLE);
00247
00248 fprintf(
out,
"</td>");
00249 fprintf(
out,
"<td valign=top align=right>");
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
if (useronline)
00263 {
00264 useronline = 999;
00265 fprintf(
out,
"[\n");
00266
if (useronline == 1)
00267 fprintf(
out,
"design\n");
00268
else
00269 fprintf(
out,
"<a href=\"/cgi-bin/dbd/dbd?design=0\">design</a>\n");
00270 fprintf(
out,
"|\n");
00271 fprintf(
out,
"<a href=\"/cgi-bin/dbd/dbd?ed=0\">edit data</a>\n");
00272 fprintf(
out,
"|\n");
00273 fprintf(
out,
"<a href=\"/cgi-bin/dbd/dbd?sql=1\">generate sql</a>\n");
00274 fprintf(
out,
"|\n");
00275 fprintf(
out,
"<a href=\"/cgi-bin/dbd/dbd?diagram=0\">diagram</a>\n");
00276 fprintf(
out,
"|\n");
00277
if (useronline == 2)
00278 fprintf(
out,
"db access\n");
00279
else
00280 fprintf(
out,
"<a href=\"/cgi-bin/dbd/dbd?dba=0\">db access</a>\n");
00281 fprintf(
out,
"|\n");
00282
if (useronline == 3)
00283 fprintf(
out,
"user info\n");
00284
else
00285 fprintf(
out,
"<a href=\"/cgi-bin/dbd/dbd?ui=0\">user info</a>\n");
00286 fprintf(
out,
"|\n");
00287 fprintf(
out,
"<a target=_top href=\"/cgi-bin/dbd/dbd?logout=0\">logout</a>\n");
00288 fprintf(
out,
"]");
00289 fprintf(
out,
"<br>");
00290 fprintf(
out,
"[ <a href=\"/cgi-bin/dbd/dbd?ls=0\">live sync</a> ]");
00291 }
00292 fprintf(
out,
"</td></tr></table>");
00293 }
00294
00295 void footer()
00296 {
00297 fprintf(
out,
"<br><br>[\n");
00298 fprintf(
out,
"<a target=_top href=\"/cgi-bin/dbd/dbd?repair=0\">repair frames</a>\n]<br>");
00299 fprintf(
out,
"<br>");
00300 fprintf(
out,
"</div>");
00301 fprintf(
out,
"</body></html>\n");
00302 }
00303
00304
00305
00306 void iplus()
00307 {
00308 fprintf(
out,
"<img src='/image/iplus-cont-0.gif' width=19 height=16 align=texttop border=0>");
00309 }
00310
00311 void iplusend()
00312 {
00313 fprintf(
out,
"<img src='/image/iplus-end-0.gif' width=19 height=16 align=texttop border=0>");
00314 }
00315
00316 void iexpanded()
00317 {
00318 fprintf(
out,
"<img src='/image/iminus-cont-0.gif' width=19 height=16 align=texttop border=0>");
00319 }
00320
00321 void inotexpanded()
00322 {
00323 fprintf(
out,
"<img src='/image/iplus-cont-0.gif' width=19 height=16 align=texttop border=0>");
00324 }
00325
00326 void iclosed()
00327 {
00328 fprintf(
out,
"<img src='/image/ifolder-closed-0.gif' width=16 height=16 align=texttop border=0>");
00329 }
00330
00331 void iminus()
00332 {
00333 fprintf(
out,
"<img src='/image/iminus-cont-0.gif' width=19 height=16 align=texttop border=0>");
00334 }
00335
00336 void iminusend()
00337 {
00338 fprintf(
out,
"<img src='/image/iminus-end-0.gif' width=19 height=16 align=texttop border=0>");
00339 }
00340
00341 void iopen()
00342 {
00343 fprintf(
out,
"<img src='/image/ifolder-open-0.gif' width=16 height=16 align=texttop border=0>");
00344 }
00345
00346 void ivertline()
00347 {
00348 fprintf(
out,
"<img src='/image/ivert-line-0.gif' width=19 height=16 align=texttop border=0>");
00349 }
00350
00351 void ibranchcont()
00352 {
00353 fprintf(
out,
"<img src='/image/ibranch-cont-0.gif' width=19 height=16 align=texttop border=0>");
00354 }
00355
00356 void ibranchend()
00357 {
00358 fprintf(
out,
"<img src='/image/ibranch-end-0.gif' width=19 height=16 align=texttop border=0>");
00359 }
00360
00361 void iglobe()
00362 {
00363 fprintf(
out,
"<img src='/image/globe.gif' width=16 height=16 align=texttop border=0>");
00364 }
00365
00366 void iglobe0()
00367 {
00368 fprintf(
out,
"<img src='/image/iglobe-0.gif' width=16 height=16 align=texttop border=0>");
00369 }
00370
00371 void ithumbsup()
00372 {
00373 fprintf(
out,
"<img src='/image/thumbsup2.gif' height=16 align=texttop border=0>");
00374 }
00375
00376 void ithumbsdown()
00377 {
00378 fprintf(
out,
"<img src='/image/thumbsdn2.gif' height=16 align=texttop border=0>");
00379 }
00380
00381 void ipascal()
00382 {
00383 fprintf(
out,
"<img src='/image/pascal.gif' height=16 align=texttop border=0>");
00384 }
00385
00386 void iempty()
00387 {
00388 fprintf(
out,
"<img src='/image/iempty.gif' height=16 align=texttop border=0>");
00389 }
Generated on Thu Feb 10 22:42:34 2005 for Distributed URL Classification Tool by
1.3.7