| 1 | /* |
|---|
| 2 | FILE |
|---|
| 3 | tLogMonth source code of unxsVZ.cgi |
|---|
| 4 | Built by mysqlRAD2.cgi (C) Gary Wallis 2001-2007 |
|---|
| 5 | $Id$ |
|---|
| 6 | PURPOSE |
|---|
| 7 | Schema dependent RAD generated file. |
|---|
| 8 | Program app functionality in tlogmonthfunc.h while |
|---|
| 9 | RAD is still to be used. |
|---|
| 10 | */ |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | #include "mysqlrad.h" |
|---|
| 14 | |
|---|
| 15 | //Table Variables |
|---|
| 16 | //Table Variables |
|---|
| 17 | //uLog: Primary Key |
|---|
| 18 | static unsigned uLog=0; |
|---|
| 19 | //cLabel: Short label |
|---|
| 20 | static char cLabel[65]={""}; |
|---|
| 21 | //uLogType: Log Type |
|---|
| 22 | static unsigned uLogType=0; |
|---|
| 23 | static char cuLogTypePullDown[256]={""}; |
|---|
| 24 | //cHash: Security hash to complicate tampering |
|---|
| 25 | static char cHash[33]={""}; |
|---|
| 26 | //uPermLevel: User Perm Level |
|---|
| 27 | static unsigned uPermLevel=0; |
|---|
| 28 | //uLoginClient: Client Number |
|---|
| 29 | static unsigned uLoginClient=0; |
|---|
| 30 | //cLogin: Login name |
|---|
| 31 | static char cLogin[33]={""}; |
|---|
| 32 | //cHost: Ip Address |
|---|
| 33 | static char cHost[33]={""}; |
|---|
| 34 | //uTablePK: Primar Key of the Table |
|---|
| 35 | static char uTablePK[33]={""}; |
|---|
| 36 | //cTableName: Name of the Table |
|---|
| 37 | static char cTableName[33]={""}; |
|---|
| 38 | //uOwner: Record owner |
|---|
| 39 | static unsigned uOwner=0; |
|---|
| 40 | //uCreatedBy: uClient for last insert |
|---|
| 41 | static unsigned uCreatedBy=0; |
|---|
| 42 | #define ISM3FIELDS |
|---|
| 43 | //uCreatedDate: Unix seconds date last insert |
|---|
| 44 | static time_t uCreatedDate=0; |
|---|
| 45 | //uModBy: uClient for last update |
|---|
| 46 | static unsigned uModBy=0; |
|---|
| 47 | //uModDate: Unix seconds date last update |
|---|
| 48 | static time_t uModDate=0; |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | #define VAR_LIST_tLogMonth "tLogMonth.uLog,tLogMonth.cLabel,tLogMonth.uLogType,tLogMonth.cHash,tLogMonth.uPermLevel,tLogMonth.uLoginClient,tLogMonth.cLogin,tLogMonth.cHost,tLogMonth.uTablePK,tLogMonth.cTableName,tLogMonth.uOwner,tLogMonth.uCreatedBy,tLogMonth.uCreatedDate,tLogMonth.uModBy,tLogMonth.uModDate" |
|---|
| 53 | |
|---|
| 54 | //Local only |
|---|
| 55 | void Insert_tLogMonth(void); |
|---|
| 56 | void Update_tLogMonth(char *cRowid); |
|---|
| 57 | void ProcesstLogMonthListVars(pentry entries[], int x); |
|---|
| 58 | |
|---|
| 59 | //In tLogMonthfunc.h file included below |
|---|
| 60 | void ExtProcesstLogMonthVars(pentry entries[], int x); |
|---|
| 61 | void ExttLogMonthCommands(pentry entries[], int x); |
|---|
| 62 | void ExttLogMonthButtons(void); |
|---|
| 63 | void ExttLogMonthNavBar(void); |
|---|
| 64 | void ExttLogMonthGetHook(entry gentries[], int x); |
|---|
| 65 | void ExttLogMonthSelect(void); |
|---|
| 66 | void ExttLogMonthSelectRow(void); |
|---|
| 67 | void ExttLogMonthListSelect(void); |
|---|
| 68 | void ExttLogMonthListFilter(void); |
|---|
| 69 | void ExttLogMonthAuxTable(void); |
|---|
| 70 | |
|---|
| 71 | #include "tlogmonthfunc.h" |
|---|
| 72 | |
|---|
| 73 | //Table Variables Assignment Function |
|---|
| 74 | void ProcesstLogMonthVars(pentry entries[], int x) |
|---|
| 75 | { |
|---|
| 76 | register int i; |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | for(i=0;i<x;i++) |
|---|
| 80 | { |
|---|
| 81 | if(!strcmp(entries[i].name,"uLog")) |
|---|
| 82 | sscanf(entries[i].val,"%u",&uLog); |
|---|
| 83 | else if(!strcmp(entries[i].name,"cLabel")) |
|---|
| 84 | sprintf(cLabel,"%.64s",entries[i].val); |
|---|
| 85 | else if(!strcmp(entries[i].name,"uLogType")) |
|---|
| 86 | sscanf(entries[i].val,"%u",&uLogType); |
|---|
| 87 | else if(!strcmp(entries[i].name,"cuLogTypePullDown")) |
|---|
| 88 | { |
|---|
| 89 | sprintf(cuLogTypePullDown,"%.255s",entries[i].val); |
|---|
| 90 | uLogType=ReadPullDown("tLogType","cLabel",cuLogTypePullDown); |
|---|
| 91 | } |
|---|
| 92 | else if(!strcmp(entries[i].name,"cHash")) |
|---|
| 93 | sprintf(cHash,"%.32s",entries[i].val); |
|---|
| 94 | else if(!strcmp(entries[i].name,"uPermLevel")) |
|---|
| 95 | sscanf(entries[i].val,"%u",&uPermLevel); |
|---|
| 96 | else if(!strcmp(entries[i].name,"uLoginClient")) |
|---|
| 97 | sscanf(entries[i].val,"%u",&uLoginClient); |
|---|
| 98 | else if(!strcmp(entries[i].name,"cLogin")) |
|---|
| 99 | sprintf(cLogin,"%.32s",entries[i].val); |
|---|
| 100 | else if(!strcmp(entries[i].name,"cHost")) |
|---|
| 101 | sprintf(cHost,"%.32s",entries[i].val); |
|---|
| 102 | else if(!strcmp(entries[i].name,"uTablePK")) |
|---|
| 103 | sprintf(uTablePK,"%.32s",entries[i].val); |
|---|
| 104 | else if(!strcmp(entries[i].name,"cTableName")) |
|---|
| 105 | sprintf(cTableName,"%.32s",entries[i].val); |
|---|
| 106 | else if(!strcmp(entries[i].name,"uOwner")) |
|---|
| 107 | sscanf(entries[i].val,"%u",&uOwner); |
|---|
| 108 | else if(!strcmp(entries[i].name,"uCreatedBy")) |
|---|
| 109 | sscanf(entries[i].val,"%u",&uCreatedBy); |
|---|
| 110 | else if(!strcmp(entries[i].name,"uCreatedDate")) |
|---|
| 111 | sscanf(entries[i].val,"%lu",&uCreatedDate); |
|---|
| 112 | else if(!strcmp(entries[i].name,"uModBy")) |
|---|
| 113 | sscanf(entries[i].val,"%u",&uModBy); |
|---|
| 114 | else if(!strcmp(entries[i].name,"uModDate")) |
|---|
| 115 | sscanf(entries[i].val,"%lu",&uModDate); |
|---|
| 116 | |
|---|
| 117 | } |
|---|
| 118 | |
|---|
| 119 | //After so we can overwrite form data if needed. |
|---|
| 120 | ExtProcesstLogMonthVars(entries,x); |
|---|
| 121 | |
|---|
| 122 | }//ProcesstLogMonthVars() |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | void ProcesstLogMonthListVars(pentry entries[], int x) |
|---|
| 126 | { |
|---|
| 127 | register int i; |
|---|
| 128 | |
|---|
| 129 | for(i=0;i<x;i++) |
|---|
| 130 | { |
|---|
| 131 | if(!strncmp(entries[i].name,"ED",2)) |
|---|
| 132 | { |
|---|
| 133 | sscanf(entries[i].name+2,"%u",&uLog); |
|---|
| 134 | guMode=2002; |
|---|
| 135 | tLogMonth(""); |
|---|
| 136 | } |
|---|
| 137 | } |
|---|
| 138 | }//void ProcesstLogMonthListVars(pentry entries[], int x) |
|---|
| 139 | |
|---|
| 140 | |
|---|
| 141 | int tLogMonthCommands(pentry entries[], int x) |
|---|
| 142 | { |
|---|
| 143 | ProcessControlVars(entries,x); |
|---|
| 144 | |
|---|
| 145 | ExttLogMonthCommands(entries,x); |
|---|
| 146 | |
|---|
| 147 | if(!strcmp(gcFunction,"tLogMonthTools")) |
|---|
| 148 | { |
|---|
| 149 | if(!strcmp(gcFind,LANG_NB_LIST)) |
|---|
| 150 | { |
|---|
| 151 | tLogMonthList(); |
|---|
| 152 | } |
|---|
| 153 | |
|---|
| 154 | //Default |
|---|
| 155 | ProcesstLogMonthVars(entries,x); |
|---|
| 156 | tLogMonth(""); |
|---|
| 157 | } |
|---|
| 158 | else if(!strcmp(gcFunction,"tLogMonthList")) |
|---|
| 159 | { |
|---|
| 160 | ProcessControlVars(entries,x); |
|---|
| 161 | ProcesstLogMonthListVars(entries,x); |
|---|
| 162 | tLogMonthList(); |
|---|
| 163 | } |
|---|
| 164 | |
|---|
| 165 | return(0); |
|---|
| 166 | |
|---|
| 167 | }//tLogMonthCommands() |
|---|
| 168 | |
|---|
| 169 | |
|---|
| 170 | void tLogMonth(const char *cResult) |
|---|
| 171 | { |
|---|
| 172 | MYSQL_RES *res; |
|---|
| 173 | MYSQL_RES *res2; |
|---|
| 174 | MYSQL_ROW field; |
|---|
| 175 | |
|---|
| 176 | //Internal skip reloading |
|---|
| 177 | if(!cResult[0]) |
|---|
| 178 | { |
|---|
| 179 | if(guMode) |
|---|
| 180 | ExttLogMonthSelectRow(); |
|---|
| 181 | else |
|---|
| 182 | ExttLogMonthSelect(); |
|---|
| 183 | |
|---|
| 184 | mysql_query(&gMysql,gcQuery); |
|---|
| 185 | if(mysql_errno(&gMysql)) |
|---|
| 186 | { |
|---|
| 187 | if(strstr(mysql_error(&gMysql)," doesn't exist")) |
|---|
| 188 | { |
|---|
| 189 | CreatetLogMonth(); |
|---|
| 190 | unxsVZ("New tLogMonth table created"); |
|---|
| 191 | } |
|---|
| 192 | else |
|---|
| 193 | { |
|---|
| 194 | htmlPlainTextError(mysql_error(&gMysql)); |
|---|
| 195 | } |
|---|
| 196 | } |
|---|
| 197 | |
|---|
| 198 | res=mysql_store_result(&gMysql); |
|---|
| 199 | if((guI=mysql_num_rows(res))) |
|---|
| 200 | { |
|---|
| 201 | if(guMode==6) |
|---|
| 202 | { |
|---|
| 203 | sprintf(gcQuery,"SELECT _rowid FROM tLogMonth WHERE uLog=%u" |
|---|
| 204 | ,uLog); |
|---|
| 205 | MYSQL_RUN_STORE(res2); |
|---|
| 206 | field=mysql_fetch_row(res2); |
|---|
| 207 | sscanf(field[0],"%lu",&gluRowid); |
|---|
| 208 | gluRowid++; |
|---|
| 209 | } |
|---|
| 210 | PageMachine("",0,""); |
|---|
| 211 | if(!guMode) mysql_data_seek(res,gluRowid-1); |
|---|
| 212 | field=mysql_fetch_row(res); |
|---|
| 213 | sscanf(field[0],"%u",&uLog); |
|---|
| 214 | sprintf(cLabel,"%.64s",field[1]); |
|---|
| 215 | sscanf(field[2],"%u",&uLogType); |
|---|
| 216 | sprintf(cHash,"%.32s",field[3]); |
|---|
| 217 | sscanf(field[4],"%u",&uPermLevel); |
|---|
| 218 | sscanf(field[5],"%u",&uLoginClient); |
|---|
| 219 | sprintf(cLogin,"%.32s",field[6]); |
|---|
| 220 | sprintf(cHost,"%.32s",field[7]); |
|---|
| 221 | sprintf(uTablePK,"%.32s",field[8]); |
|---|
| 222 | sprintf(cTableName,"%.32s",field[9]); |
|---|
| 223 | sscanf(field[10],"%u",&uOwner); |
|---|
| 224 | sscanf(field[11],"%u",&uCreatedBy); |
|---|
| 225 | sscanf(field[12],"%lu",&uCreatedDate); |
|---|
| 226 | sscanf(field[13],"%u",&uModBy); |
|---|
| 227 | sscanf(field[14],"%lu",&uModDate); |
|---|
| 228 | |
|---|
| 229 | } |
|---|
| 230 | |
|---|
| 231 | }//Internal Skip |
|---|
| 232 | |
|---|
| 233 | Header_ism3(":: tLogMonth",0); |
|---|
| 234 | printf("<table width=100%% cellspacing=0 cellpadding=0>\n"); |
|---|
| 235 | printf("<tr><td colspan=2 align=right valign=center>"); |
|---|
| 236 | |
|---|
| 237 | |
|---|
| 238 | printf("<input type=hidden name=gcFunction value=tLogMonthTools>"); |
|---|
| 239 | printf("<input type=hidden name=gluRowid value=%lu>",gluRowid); |
|---|
| 240 | if(guI) |
|---|
| 241 | { |
|---|
| 242 | if(guMode==6) |
|---|
| 243 | //printf(" Found"); |
|---|
| 244 | printf(LANG_NBR_FOUND); |
|---|
| 245 | else if(guMode==5) |
|---|
| 246 | //printf(" Modified"); |
|---|
| 247 | printf(LANG_NBR_MODIFIED); |
|---|
| 248 | else if(guMode==4) |
|---|
| 249 | //printf(" New"); |
|---|
| 250 | printf(LANG_NBR_NEW); |
|---|
| 251 | printf(LANG_NBRF_SHOWING,gluRowid,guI); |
|---|
| 252 | } |
|---|
| 253 | else |
|---|
| 254 | { |
|---|
| 255 | if(!cResult[0]) |
|---|
| 256 | //printf(" No records found"); |
|---|
| 257 | printf(LANG_NBR_NORECS); |
|---|
| 258 | } |
|---|
| 259 | if(cResult[0]) printf("%s",cResult); |
|---|
| 260 | printf("</td></tr>"); |
|---|
| 261 | printf("<tr><td valign=top width=25%%>"); |
|---|
| 262 | |
|---|
| 263 | ExttLogMonthButtons(); |
|---|
| 264 | |
|---|
| 265 | printf("</td><td valign=top>"); |
|---|
| 266 | // |
|---|
| 267 | OpenFieldSet("tLogMonth Record Data",100); |
|---|
| 268 | |
|---|
| 269 | if(guMode==2000 || guMode==2002) |
|---|
| 270 | tLogMonthInput(1); |
|---|
| 271 | else |
|---|
| 272 | tLogMonthInput(0); |
|---|
| 273 | |
|---|
| 274 | // |
|---|
| 275 | CloseFieldSet(); |
|---|
| 276 | |
|---|
| 277 | //Bottom table |
|---|
| 278 | printf("<tr><td colspan=2>"); |
|---|
| 279 | ExttLogMonthAuxTable(); |
|---|
| 280 | |
|---|
| 281 | Footer_ism3(); |
|---|
| 282 | |
|---|
| 283 | }//end of tLogMonth(); |
|---|
| 284 | |
|---|
| 285 | |
|---|
| 286 | void tLogMonthInput(unsigned uMode) |
|---|
| 287 | { |
|---|
| 288 | |
|---|
| 289 | //uLog |
|---|
| 290 | OpenRow(LANG_FL_tLogMonth_uLog,"black"); |
|---|
| 291 | printf("<input title='%s' type=text name=uLog value=%u size=16 maxlength=10 " |
|---|
| 292 | ,LANG_FT_tLogMonth_uLog,uLog); |
|---|
| 293 | if(guPermLevel>=20 && uMode) |
|---|
| 294 | { |
|---|
| 295 | printf("></td></tr>\n"); |
|---|
| 296 | } |
|---|
| 297 | else |
|---|
| 298 | { |
|---|
| 299 | printf("disabled></td></tr>\n"); |
|---|
| 300 | printf("<input type=hidden name=uLog value=%u >\n",uLog); |
|---|
| 301 | } |
|---|
| 302 | //cLabel |
|---|
| 303 | OpenRow(LANG_FL_tLogMonth_cLabel,"black"); |
|---|
| 304 | printf("<input title='%s' type=text name=cLabel value=\"%s\" size=64 maxlength=64 " |
|---|
| 305 | ,LANG_FT_tLogMonth_cLabel,EncodeDoubleQuotes(cLabel)); |
|---|
| 306 | if(guPermLevel>=0 && uMode) |
|---|
| 307 | { |
|---|
| 308 | printf("></td></tr>\n"); |
|---|
| 309 | } |
|---|
| 310 | else |
|---|
| 311 | { |
|---|
| 312 | printf("disabled></td></tr>\n"); |
|---|
| 313 | printf("<input type=hidden name=cLabel value=\"%s\">\n",EncodeDoubleQuotes(cLabel)); |
|---|
| 314 | } |
|---|
| 315 | //uLogType |
|---|
| 316 | OpenRow(LANG_FL_tLogMonth_uLogType,"black"); |
|---|
| 317 | if(guPermLevel>=7 && uMode) |
|---|
| 318 | tTablePullDown("tLogType;cuLogTypePullDown","cLabel","cLabel",uLogType,1); |
|---|
| 319 | else |
|---|
| 320 | tTablePullDown("tLogType;cuLogTypePullDown","cLabel","cLabel",uLogType,0); |
|---|
| 321 | //cHash |
|---|
| 322 | OpenRow(LANG_FL_tLogMonth_cHash,"black"); |
|---|
| 323 | printf("<input title='%s' type=text name=cHash value=\"%s\" size=40 maxlength=32 " |
|---|
| 324 | ,LANG_FT_tLogMonth_cHash,EncodeDoubleQuotes(cHash)); |
|---|
| 325 | if(guPermLevel>=7 && uMode) |
|---|
| 326 | { |
|---|
| 327 | printf("></td></tr>\n"); |
|---|
| 328 | } |
|---|
| 329 | else |
|---|
| 330 | { |
|---|
| 331 | printf("disabled></td></tr>\n"); |
|---|
| 332 | printf("<input type=hidden name=cHash value=\"%s\">\n",EncodeDoubleQuotes(cHash)); |
|---|
| 333 | } |
|---|
| 334 | //uPermLevel |
|---|
| 335 | OpenRow(LANG_FL_tLogMonth_uPermLevel,"black"); |
|---|
| 336 | printf("<input title='%s' type=text name=uPermLevel value=%u size=16 maxlength=32 " |
|---|
| 337 | ,LANG_FT_tLogMonth_uPermLevel,uPermLevel); |
|---|
| 338 | if(guPermLevel>=7 && uMode) |
|---|
| 339 | { |
|---|
| 340 | printf("></td></tr>\n"); |
|---|
| 341 | } |
|---|
| 342 | else |
|---|
| 343 | { |
|---|
| 344 | printf("disabled></td></tr>\n"); |
|---|
| 345 | printf("<input type=hidden name=uPermLevel value=%u >\n",uPermLevel); |
|---|
| 346 | } |
|---|
| 347 | //uLoginClient |
|---|
| 348 | OpenRow(LANG_FL_tLogMonth_uLoginClient,"black"); |
|---|
| 349 | printf("<input title='%s' type=text name=uLoginClient value=%u size=16 maxlength=32 " |
|---|
| 350 | ,LANG_FT_tLogMonth_uLoginClient,uLoginClient); |
|---|
| 351 | if(guPermLevel>=7 && uMode) |
|---|
| 352 | { |
|---|
| 353 | printf("></td></tr>\n"); |
|---|
| 354 | } |
|---|
| 355 | else |
|---|
| 356 | { |
|---|
| 357 | printf("disabled></td></tr>\n"); |
|---|
| 358 | printf("<input type=hidden name=uLoginClient value=%u >\n",uLoginClient); |
|---|
| 359 | } |
|---|
| 360 | //cLogin |
|---|
| 361 | OpenRow(LANG_FL_tLogMonth_cLogin,"black"); |
|---|
| 362 | printf("<input title='%s' type=text name=cLogin value=\"%s\" size=40 maxlength=32 " |
|---|
| 363 | ,LANG_FT_tLogMonth_cLogin,EncodeDoubleQuotes(cLogin)); |
|---|
| 364 | if(guPermLevel>=7 && uMode) |
|---|
| 365 | { |
|---|
| 366 | printf("></td></tr>\n"); |
|---|
| 367 | } |
|---|
| 368 | else |
|---|
| 369 | { |
|---|
| 370 | printf("disabled></td></tr>\n"); |
|---|
| 371 | printf("<input type=hidden name=cLogin value=\"%s\">\n",EncodeDoubleQuotes(cLogin)); |
|---|
| 372 | } |
|---|
| 373 | //cHost |
|---|
| 374 | OpenRow(LANG_FL_tLogMonth_cHost,"black"); |
|---|
| 375 | printf("<input title='%s' type=text name=cHost value=\"%s\" size=40 maxlength=32 " |
|---|
| 376 | ,LANG_FT_tLogMonth_cHost,EncodeDoubleQuotes(cHost)); |
|---|
| 377 | if(guPermLevel>=7 && uMode) |
|---|
| 378 | { |
|---|
| 379 | printf("></td></tr>\n"); |
|---|
| 380 | } |
|---|
| 381 | else |
|---|
| 382 | { |
|---|
| 383 | printf("disabled></td></tr>\n"); |
|---|
| 384 | printf("<input type=hidden name=cHost value=\"%s\">\n",EncodeDoubleQuotes(cHost)); |
|---|
| 385 | } |
|---|
| 386 | //uTablePK |
|---|
| 387 | OpenRow(LANG_FL_tLogMonth_uTablePK,"black"); |
|---|
| 388 | printf("<input title='%s' type=text name=uTablePK value=\"%s\" size=40 maxlength=32 " |
|---|
| 389 | ,LANG_FT_tLogMonth_uTablePK,EncodeDoubleQuotes(uTablePK)); |
|---|
| 390 | if(guPermLevel>=7 && uMode) |
|---|
| 391 | { |
|---|
| 392 | printf("></td></tr>\n"); |
|---|
| 393 | } |
|---|
| 394 | else |
|---|
| 395 | { |
|---|
| 396 | printf("disabled></td></tr>\n"); |
|---|
| 397 | printf("<input type=hidden name=uTablePK value=\"%s\">\n",EncodeDoubleQuotes(uTablePK)); |
|---|
| 398 | } |
|---|
| 399 | //cTableName |
|---|
| 400 | OpenRow(LANG_FL_tLogMonth_cTableName,"black"); |
|---|
| 401 | printf("<input title='%s' type=text name=cTableName value=\"%s\" size=40 maxlength=32 " |
|---|
| 402 | ,LANG_FT_tLogMonth_cTableName,EncodeDoubleQuotes(cTableName)); |
|---|
| 403 | if(guPermLevel>=7 && uMode) |
|---|
| 404 | { |
|---|
| 405 | printf("></td></tr>\n"); |
|---|
| 406 | } |
|---|
| 407 | else |
|---|
| 408 | { |
|---|
| 409 | printf("disabled></td></tr>\n"); |
|---|
| 410 | printf("<input type=hidden name=cTableName value=\"%s\">\n",EncodeDoubleQuotes(cTableName)); |
|---|
| 411 | } |
|---|
| 412 | //uOwner |
|---|
| 413 | OpenRow(LANG_FL_tLogMonth_uOwner,"black"); |
|---|
| 414 | if(guPermLevel>=20 && uMode) |
|---|
| 415 | { |
|---|
| 416 | printf("%s<input type=hidden name=uOwner value=%u >\n",ForeignKey("tClient","cLabel",uOwner),uOwner); |
|---|
| 417 | } |
|---|
| 418 | else |
|---|
| 419 | { |
|---|
| 420 | printf("%s<input type=hidden name=uOwner value=%u >\n",ForeignKey("tClient","cLabel",uOwner),uOwner); |
|---|
| 421 | } |
|---|
| 422 | //uCreatedBy |
|---|
| 423 | OpenRow(LANG_FL_tLogMonth_uCreatedBy,"black"); |
|---|
| 424 | if(guPermLevel>=20 && uMode) |
|---|
| 425 | { |
|---|
| 426 | printf("%s<input type=hidden name=uCreatedBy value=%u >\n",ForeignKey("tClient","cLabel",uCreatedBy),uCreatedBy); |
|---|
| 427 | } |
|---|
| 428 | else |
|---|
| 429 | { |
|---|
| 430 | printf("%s<input type=hidden name=uCreatedBy value=%u >\n",ForeignKey("tClient","cLabel",uCreatedBy),uCreatedBy); |
|---|
| 431 | } |
|---|
| 432 | //uCreatedDate |
|---|
| 433 | OpenRow(LANG_FL_tLogMonth_uCreatedDate,"black"); |
|---|
| 434 | if(uCreatedDate) |
|---|
| 435 | printf("%s\n\n",ctime(&uCreatedDate)); |
|---|
| 436 | else |
|---|
| 437 | printf("---\n\n"); |
|---|
| 438 | printf("<input type=hidden name=uCreatedDate value=%lu >\n",uCreatedDate); |
|---|
| 439 | //uModBy |
|---|
| 440 | OpenRow(LANG_FL_tLogMonth_uModBy,"black"); |
|---|
| 441 | if(guPermLevel>=20 && uMode) |
|---|
| 442 | { |
|---|
| 443 | printf("%s<input type=hidden name=uModBy value=%u >\n",ForeignKey("tClient","cLabel",uModBy),uModBy); |
|---|
| 444 | } |
|---|
| 445 | else |
|---|
| 446 | { |
|---|
| 447 | printf("%s<input type=hidden name=uModBy value=%u >\n",ForeignKey("tClient","cLabel",uModBy),uModBy); |
|---|
| 448 | } |
|---|
| 449 | //uModDate |
|---|
| 450 | OpenRow(LANG_FL_tLogMonth_uModDate,"black"); |
|---|
| 451 | if(uModDate) |
|---|
| 452 | printf("%s\n\n",ctime(&uModDate)); |
|---|
| 453 | else |
|---|
| 454 | printf("---\n\n"); |
|---|
| 455 | printf("<input type=hidden name=uModDate value=%lu >\n",uModDate); |
|---|
| 456 | printf("</tr>\n"); |
|---|
| 457 | |
|---|
| 458 | |
|---|
| 459 | |
|---|
| 460 | }//void tLogMonthInput(unsigned uMode) |
|---|
| 461 | |
|---|
| 462 | |
|---|
| 463 | void tLogMonthList(void) |
|---|
| 464 | { |
|---|
| 465 | MYSQL_RES *res; |
|---|
| 466 | MYSQL_ROW field; |
|---|
| 467 | |
|---|
| 468 | ExttLogMonthListSelect(); |
|---|
| 469 | |
|---|
| 470 | MYSQL_RUN_STORE(res); |
|---|
| 471 | guI=mysql_num_rows(res); |
|---|
| 472 | |
|---|
| 473 | PageMachine("tLogMonthList",1,"");//1 is auto header list guMode. Opens table! |
|---|
| 474 | |
|---|
| 475 | //Filter select drop down |
|---|
| 476 | ExttLogMonthListFilter(); |
|---|
| 477 | |
|---|
| 478 | printf("<input type=text size=16 name=gcCommand maxlength=98 value=\"%s\" >",gcCommand); |
|---|
| 479 | |
|---|
| 480 | printf("</table>\n"); |
|---|
| 481 | |
|---|
| 482 | printf("<table bgcolor=#9BC1B3 border=0 width=100%%>\n"); |
|---|
| 483 | printf("<tr bgcolor=black><td><font face=arial,helvetica color=white>uLog<td><font face=arial,helvetica color=white>cLabel<td><font face=arial,helvetica color=white>uLogType<td><font face=arial,helvetica color=white>cHash<td><font face=arial,helvetica color=white>uPermLevel<td><font face=arial,helvetica color=white>uLoginClient<td><font face=arial,helvetica color=white>cLogin<td><font face=arial,helvetica color=white>cHost<td><font face=arial,helvetica color=white>uTablePK<td><font face=arial,helvetica color=white>cTableName<td><font face=arial,helvetica color=white>uOwner<td><font face=arial,helvetica color=white>uCreatedBy<td><font face=arial,helvetica color=white>uCreatedDate<td><font face=arial,helvetica color=white>uModBy<td><font face=arial,helvetica color=white>uModDate</tr>"); |
|---|
| 484 | |
|---|
| 485 | |
|---|
| 486 | |
|---|
| 487 | mysql_data_seek(res,guStart-1); |
|---|
| 488 | |
|---|
| 489 | for(guN=0;guN<(guEnd-guStart+1);guN++) |
|---|
| 490 | { |
|---|
| 491 | field=mysql_fetch_row(res); |
|---|
| 492 | if(!field) |
|---|
| 493 | { |
|---|
| 494 | printf("<tr><td><font face=arial,helvetica>End of data</table>"); |
|---|
| 495 | Footer_ism3(); |
|---|
| 496 | } |
|---|
| 497 | if(guN % 2) |
|---|
| 498 | printf("<tr bgcolor=#BBE1D3>"); |
|---|
| 499 | else |
|---|
| 500 | printf("<tr>"); |
|---|
| 501 | time_t luTime12=strtoul(field[12],NULL,10); |
|---|
| 502 | char cBuf12[32]; |
|---|
| 503 | if(luTime12) |
|---|
| 504 | ctime_r(&luTime12,cBuf12); |
|---|
| 505 | else |
|---|
| 506 | sprintf(cBuf12,"---"); |
|---|
| 507 | time_t luTime14=strtoul(field[14],NULL,10); |
|---|
| 508 | char cBuf14[32]; |
|---|
| 509 | if(luTime14) |
|---|
| 510 | ctime_r(&luTime14,cBuf14); |
|---|
| 511 | else |
|---|
| 512 | sprintf(cBuf14,"---"); |
|---|
| 513 | printf("<td><input type=submit name=ED%s value=Edit> %s<td>%s<td>%s<td>%s<td>%s<td>%s<td>%s<td>%s<td>%s<td>%s<td>%s<td>%s<td>%s<td>%s<td>%s</tr>" |
|---|
| 514 | ,field[0] |
|---|
| 515 | ,field[0] |
|---|
| 516 | ,field[1] |
|---|
| 517 | ,ForeignKey("tLogType","cLabel",strtoul(field[2],NULL,10)) |
|---|
| 518 | ,field[3] |
|---|
| 519 | ,field[4] |
|---|
| 520 | ,field[5] |
|---|
| 521 | ,field[6] |
|---|
| 522 | ,field[7] |
|---|
| 523 | ,field[8] |
|---|
| 524 | ,field[9] |
|---|
| 525 | ,ForeignKey("tClient","cLabel",strtoul(field[10],NULL,10)) |
|---|
| 526 | ,ForeignKey("tClient","cLabel",strtoul(field[11],NULL,10)) |
|---|
| 527 | ,cBuf12 |
|---|
| 528 | ,ForeignKey("tClient","cLabel",strtoul(field[13],NULL,10)) |
|---|
| 529 | ,cBuf14 |
|---|
| 530 | ); |
|---|
| 531 | |
|---|
| 532 | } |
|---|
| 533 | |
|---|
| 534 | printf("</table></form>\n"); |
|---|
| 535 | Footer_ism3(); |
|---|
| 536 | |
|---|
| 537 | }//tLogMonthList() |
|---|
| 538 | |
|---|
| 539 | |
|---|
| 540 | void CreatetLogMonth(void) |
|---|
| 541 | { |
|---|
| 542 | sprintf(gcQuery,"CREATE TABLE IF NOT EXISTS tLogMonth ( uTablePK VARCHAR(32) NOT NULL DEFAULT '', cHost VARCHAR(32) NOT NULL DEFAULT '', uLoginClient INT UNSIGNED NOT NULL DEFAULT 0, cLogin VARCHAR(32) NOT NULL DEFAULT '', uPermLevel INT UNSIGNED NOT NULL DEFAULT 0, cTableName VARCHAR(32) NOT NULL DEFAULT '', uLog INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, cLabel VARCHAR(64) NOT NULL DEFAULT '', uOwner INT UNSIGNED NOT NULL DEFAULT 0,index (uOwner), uCreatedBy INT UNSIGNED NOT NULL DEFAULT 0, uCreatedDate INT UNSIGNED NOT NULL DEFAULT 0, uModBy INT UNSIGNED NOT NULL DEFAULT 0, uModDate INT UNSIGNED NOT NULL DEFAULT 0, cHash VARCHAR(32) NOT NULL DEFAULT '', uLogType INT UNSIGNED NOT NULL DEFAULT 0,index (uLogType) )"); |
|---|
| 543 | MYSQL_RUN; |
|---|
| 544 | |
|---|
| 545 | }//CreatetLogMonth() |
|---|
| 546 | |
|---|