/* FILE tLogMonth source code of iDNS.cgi Built by mysqlRAD2.cgi (C) Gary Wallis and Hugo Urquiza 2001-2009 $Id$ PURPOSE Schema dependent RAD generated file. Program app functionality in tlogmonthfunc.h while RAD is still to be used. */ #include "mysqlrad.h" //Table Variables //Table Variables //uLog: Primary Key static unsigned uLog=0; //cLabel: Short label static char cLabel[65]={""}; //uLogType: Log Type static unsigned uLogType=0; static char cuLogTypePullDown[256]={""}; //cHash: Security hash to complicate tampering static char cHash[33]={""}; //uPermLevel: User Perm Level static unsigned uPermLevel=0; //uLoginClient: Client Number static unsigned uLoginClient=0; //cLogin: Login name static char cLogin[33]={""}; //cHost: Ip Address static char cHost[33]={""}; //uTablePK: Primar Key of the Table static char uTablePK[33]={""}; //cTableName: Name of the Table static char cTableName[33]={""}; //uOwner: Record owner static unsigned uOwner=0; //uCreatedBy: uClient for last insert static unsigned uCreatedBy=0; #define ISM3FIELDS //uCreatedDate: Unix seconds date last insert static long uCreatedDate=0; //uModBy: uClient for last update static unsigned uModBy=0; //uModDate: Unix seconds date last update static long uModDate=0; #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" //Local only void Insert_tLogMonth(void); void Update_tLogMonth(char *cRowid); void ProcesstLogMonthListVars(pentry entries[], int x); //In tLogMonthfunc.h file included below void ExtProcesstLogMonthVars(pentry entries[], int x); void ExttLogMonthCommands(pentry entries[], int x); void ExttLogMonthButtons(void); void ExttLogMonthNavBar(void); void ExttLogMonthGetHook(entry gentries[], int x); void ExttLogMonthSelect(void); void ExttLogMonthSelectRow(void); void ExttLogMonthListSelect(void); void ExttLogMonthListFilter(void); void ExttLogMonthAuxTable(void); #include "tlogmonthfunc.h" //Table Variables Assignment Function void ProcesstLogMonthVars(pentry entries[], int x) { register int i; for(i=0;i\n"); printf(""); printf(""); printf("",gluRowid); if(guI) { if(guMode==6) //printf(" Found"); printf(LANG_NBR_FOUND); else if(guMode==5) //printf(" Modified"); printf(LANG_NBR_MODIFIED); else if(guMode==4) //printf(" New"); printf(LANG_NBR_NEW); printf(LANG_NBRF_SHOWING,gluRowid,guI); } else { if(!cResult[0]) //printf(" No records found"); printf(LANG_NBR_NORECS); } if(cResult[0]) printf("%s",cResult); printf(""); printf(""); ExttLogMonthButtons(); printf(""); // OpenFieldSet("tLogMonth Record Data",100); if(guMode==2000 || guMode==2002) tLogMonthInput(1); else tLogMonthInput(0); // CloseFieldSet(); //Bottom table printf(""); ExttLogMonthAuxTable(); Footer_ism3(); }//end of tLogMonth(); void tLogMonthInput(unsigned uMode) { //uLog OpenRow(LANG_FL_tLogMonth_uLog,"black"); printf("=20 && uMode) { printf(">\n"); } else { printf("disabled>\n"); printf("\n",uLog); } //cLabel OpenRow(LANG_FL_tLogMonth_cLabel,"black"); printf("=0 && uMode) { printf(">\n"); } else { printf("disabled>\n"); printf("\n",EncodeDoubleQuotes(cLabel)); } //uLogType OpenRow(LANG_FL_tLogMonth_uLogType,"black"); if(guPermLevel>=7 && uMode) tTablePullDown("tLogType;cuLogTypePullDown","cLabel","cLabel",uLogType,1); else tTablePullDown("tLogType;cuLogTypePullDown","cLabel","cLabel",uLogType,0); //cHash OpenRow(LANG_FL_tLogMonth_cHash,"black"); printf("=7 && uMode) { printf(">\n"); } else { printf("disabled>\n"); printf("\n",EncodeDoubleQuotes(cHash)); } //uPermLevel OpenRow(LANG_FL_tLogMonth_uPermLevel,"black"); printf("=7 && uMode) { printf(">\n"); } else { printf("disabled>\n"); printf("\n",uPermLevel); } //uLoginClient OpenRow(LANG_FL_tLogMonth_uLoginClient,"black"); printf("=7 && uMode) { printf(">\n"); } else { printf("disabled>\n"); printf("\n",uLoginClient); } //cLogin OpenRow(LANG_FL_tLogMonth_cLogin,"black"); printf("=7 && uMode) { printf(">\n"); } else { printf("disabled>\n"); printf("\n",EncodeDoubleQuotes(cLogin)); } //cHost OpenRow(LANG_FL_tLogMonth_cHost,"black"); printf("=7 && uMode) { printf(">\n"); } else { printf("disabled>\n"); printf("\n",EncodeDoubleQuotes(cHost)); } //uTablePK OpenRow(LANG_FL_tLogMonth_uTablePK,"black"); printf("=7 && uMode) { printf(">\n"); } else { printf("disabled>\n"); printf("\n",EncodeDoubleQuotes(uTablePK)); } //cTableName OpenRow(LANG_FL_tLogMonth_cTableName,"black"); printf("=7 && uMode) { printf(">\n"); } else { printf("disabled>\n"); printf("\n",EncodeDoubleQuotes(cTableName)); } //uOwner OpenRow(LANG_FL_tLogMonth_uOwner,"black"); if(guPermLevel>=20 && uMode) { printf("%s\n",ForeignKey(TCLIENT,"cLabel",uOwner),uOwner); } else { printf("%s\n",ForeignKey(TCLIENT,"cLabel",uOwner),uOwner); } //uCreatedBy OpenRow(LANG_FL_tLogMonth_uCreatedBy,"black"); if(guPermLevel>=20 && uMode) { printf("%s\n",ForeignKey(TCLIENT,"cLabel",uCreatedBy),uCreatedBy); } else { printf("%s\n",ForeignKey(TCLIENT,"cLabel",uCreatedBy),uCreatedBy); } //uCreatedDate OpenRow(LANG_FL_tLogMonth_uCreatedDate,"black"); if(uCreatedDate) printf("%s\n\n",ctime(&uCreatedDate)); else printf("---\n\n"); printf("\n",uCreatedDate); //uModBy OpenRow(LANG_FL_tLogMonth_uModBy,"black"); if(guPermLevel>=20 && uMode) { printf("%s\n",ForeignKey(TCLIENT,"cLabel",uModBy),uModBy); } else { printf("%s\n",ForeignKey(TCLIENT,"cLabel",uModBy),uModBy); } //uModDate OpenRow(LANG_FL_tLogMonth_uModDate,"black"); if(uModDate) printf("%s\n\n",ctime(&uModDate)); else printf("---\n\n"); printf("\n",uModDate); printf("\n"); }//void tLogMonthInput(unsigned uMode) void tLogMonthList(void) { MYSQL_RES *res; MYSQL_ROW field; ExttLogMonthListSelect(); mysql_query(&gMysql,gcQuery); if(mysql_error(&gMysql)[0]) htmlPlainTextError(mysql_error(&gMysql)); res=mysql_store_result(&gMysql); guI=mysql_num_rows(res); PageMachine("tLogMonthList",1,"");//1 is auto header list guMode. Opens table! //Filter select drop down ExttLogMonthListFilter(); printf("",gcCommand); printf("\n"); printf("\n"); printf(""); mysql_data_seek(res,guStart-1); for(guN=0;guN<(guEnd-guStart+1);guN++) { field=mysql_fetch_row(res); if(!field) { printf("
uLogcLabeluLogTypecHashuPermLeveluLoginClientcLogincHostuTablePKcTableNameuOwneruCreatedByuCreatedDateuModByuModDate
End of data
"); Footer_ism3(); } if(guN % 2) printf(""); else printf(""); long luTime12=strtoul(field[12],NULL,10); char cBuf12[32]; if(luTime12) ctime_r(&luTime12,cBuf12); else sprintf(cBuf12,"---"); long luTime14=strtoul(field[14],NULL,10); char cBuf14[32]; if(luTime14) ctime_r(&luTime14,cBuf14); else sprintf(cBuf14,"---"); printf(" %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s" ,field[0] ,field[0] ,field[1] ,ForeignKey("tLogType","cLabel",strtoul(field[2],NULL,10)) ,field[3] ,field[4] ,field[5] ,field[6] ,field[7] ,field[8] ,field[9] ,ForeignKey(TCLIENT,"cLabel",strtoul(field[10],NULL,10)) ,ForeignKey(TCLIENT,"cLabel",strtoul(field[11],NULL,10)) ,cBuf12 ,ForeignKey(TCLIENT,"cLabel",strtoul(field[13],NULL,10)) ,cBuf14 ); } printf("\n"); Footer_ism3(); }//tLogMonthList() void CreatetLogMonth(void) { 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) )"); mysql_query(&gMysql,gcQuery); if(mysql_errno(&gMysql)) htmlPlainTextError(mysql_error(&gMysql)); }//CreatetLogMonth()