root/trunk/tlogtypefunc.h

Revision 1380, 5.8 KB (checked in by Gary, 2 years ago)

unxsVZ corrected permissions code for type and status public tables.

  • Property svn:keywords set to id
Line 
1/*
2FILE
3        $Id$
4        (Built initially by unixservice.com mysqlRAD2)
5PURPOSE
6        Non schema-dependent table and application table related functions.
7AUTHOR/LEGAL
8        (C) 2001-2010 Gary Wallis for Unixservice, LLC.
9        GPLv2 license applies. See LICENSE file.
10*/
11
12//ModuleFunctionProtos()
13
14
15void tLogTypeNavList(void);
16
17void ExtProcesstLogTypeVars(pentry entries[], int x)
18{
19        /*
20        register int i;
21        for(i=0;i<x;i++)
22        {
23        }
24        */
25}//void ExtProcesstLogTypeVars(pentry entries[], int x)
26
27
28void ExttLogTypeCommands(pentry entries[], int x)
29{
30
31        if(!strcmp(gcFunction,"tLogTypeTools"))
32        {
33                //ModuleFunctionProcess()
34
35                if(!strcmp(gcCommand,LANG_NB_NEW))
36                {
37                        if(guPermLevel>=12)
38                        {
39                                ProcesstLogTypeVars(entries,x);
40                                guMode=2000;
41                                tLogType(LANG_NB_CONFIRMNEW);
42                        }
43                }
44                else if(!strcmp(gcCommand,LANG_NB_CONFIRMNEW))
45                {
46                        if(guPermLevel>=12)
47                        {
48                                ProcesstLogTypeVars(entries,x);
49
50                                guMode=2000;
51                                //Check entries here
52                                guMode=0;
53
54                                uLogType=0;
55                                uCreatedBy=guLoginClient;
56                                uOwner=guCompany;
57                                uModBy=0;//Never modified
58                                uModDate=0;//Never modified
59                                NewtLogType(0);
60                        }
61                }
62                else if(!strcmp(gcCommand,LANG_NB_DELETE))
63                {
64                        ProcesstLogTypeVars(entries,x);
65                        if(guPermLevel>=12 && guLoginClient==1)
66                        {
67                                guMode=2001;
68                                tLogType(LANG_NB_CONFIRMDEL);
69                        }
70                }
71                else if(!strcmp(gcCommand,LANG_NB_CONFIRMDEL))
72                {
73                        ProcesstLogTypeVars(entries,x);
74                        if(guPermLevel>=12 && guLoginClient==1)
75                        {
76                                guMode=5;
77                                DeletetLogType();
78                        }
79                }
80                else if(!strcmp(gcCommand,LANG_NB_MODIFY))
81                {
82                        ProcesstLogTypeVars(entries,x);
83                        if(guPermLevel>=12)
84                        {
85                                guMode=2002;
86                                tLogType(LANG_NB_CONFIRMMOD);
87                        }
88                }
89                else if(!strcmp(gcCommand,LANG_NB_CONFIRMMOD))
90                {
91                        ProcesstLogTypeVars(entries,x);
92                        if(guPermLevel>=12)
93                        {
94                                guMode=2002;
95                                //Check entries here
96                                guMode=0;
97
98                                uModBy=guLoginClient;
99                                ModtLogType();
100                        }
101                }
102        }
103
104}//void ExttLogTypeCommands(pentry entries[], int x)
105
106
107void ExttLogTypeButtons(void)
108{
109        OpenFieldSet("tLogType Aux Panel",100);
110        switch(guMode)
111        {
112                case 2000:
113                        printf("<p><u>Enter/mod data</u><br>");
114                        printf(LANG_NBB_CONFIRMNEW);
115                break;
116
117                case 2001:
118                        printf("<p><u>Think twice</u><br>");
119                        printf(LANG_NBB_CONFIRMDEL);
120                break;
121
122                case 2002:
123                        printf("<p><u>Review changes</u><br>");
124                        printf(LANG_NBB_CONFIRMMOD);
125                break;
126
127                default:
128
129                        tLogTypeNavList();
130        }
131        CloseFieldSet();
132
133}//void ExttLogTypeButtons(void)
134
135
136void ExttLogTypeAuxTable(void)
137{
138
139}//void ExttLogTypeAuxTable(void)
140
141
142void ExttLogTypeGetHook(entry gentries[], int x)
143{
144        register int i;
145
146        for(i=0;i<x;i++)
147        {
148                if(!strcmp(gentries[i].name,"uLogType"))
149                {
150                        sscanf(gentries[i].val,"%u",&uLogType);
151                        guMode=6;
152                }
153        }
154        tLogType("");
155
156}//void ExttLogTypeGetHook(entry gentries[], int x)
157
158
159void ExttLogTypeSelect(void)
160{
161        ExtSelectPublic("tLogType",VAR_LIST_tLogType);
162
163}//void ExttLogTypeSelect(void)
164
165
166void ExttLogTypeSelectRow(void)
167{
168        ExtSelectRowPublic("tLogType",VAR_LIST_tLogType,uLogType);
169
170}//void ExttLogTypeSelectRow(void)
171
172
173void ExttLogTypeListSelect(void)
174{
175        char cCat[512];
176
177        ExtListSelectPublic("tLogType",VAR_LIST_tLogType);
178       
179        //Changes here must be reflected below in ExttLogTypeListFilter()
180        if(!strcmp(gcFilter,"uLogType"))
181        {
182                sscanf(gcCommand,"%u",&uLogType);
183                sprintf(cCat," WHERE tLogType.uLogType=%u ORDER BY uLogType",
184                                                uLogType);
185                strcat(gcQuery,cCat);
186        }
187        else if(1)
188        {
189                //None NO FILTER
190                strcpy(gcFilter,"None");
191                strcat(gcQuery," ORDER BY uLogType");
192        }
193
194}//void ExttLogTypeListSelect(void)
195
196
197void ExttLogTypeListFilter(void)
198{
199        //Filter
200        printf("&nbsp;&nbsp;&nbsp;Filter on ");
201        printf("<select name=gcFilter>");
202        if(strcmp(gcFilter,"uLogType"))
203                printf("<option>uLogType</option>");
204        else
205                printf("<option selected>uLogType</option>");
206        if(strcmp(gcFilter,"None"))
207                printf("<option>None</option>");
208        else
209                printf("<option selected>None</option>");
210        printf("</select>");
211
212}//void ExttLogTypeListFilter(void)
213
214
215void ExttLogTypeNavBar(void)
216{
217        if(uOwner) GetClientOwner(uOwner,&guReseller);
218
219        printf(LANG_NBB_SKIPFIRST);
220        printf(LANG_NBB_SKIPBACK);
221        printf(LANG_NBB_SEARCH);
222
223        if(guPermLevel>=12 && !guListMode)
224                printf(LANG_NBB_NEW);
225
226        if(guPermLevel>=12)
227                printf(LANG_NBB_MODIFY);
228
229        if(guPermLevel>=12 && guLoginClient==1)
230                printf(LANG_NBB_DELETE);
231
232        if(uOwner)
233                printf(LANG_NBB_LIST);
234
235        printf(LANG_NBB_SKIPNEXT);
236        printf(LANG_NBB_SKIPLAST);
237        printf("&nbsp;&nbsp;&nbsp;\n");
238
239}//void ExttLogTypeNavBar(void)
240
241
242void tLogTypeNavList(void)
243{
244        MYSQL_RES *res;
245        MYSQL_ROW field;
246
247        ExtSelectPublic("tLogType","tLogType.uLogType,tLogType.cLabel");
248       
249        mysql_query(&gMysql,gcQuery);
250        if(mysql_errno(&gMysql))
251        {
252                printf("<p><u>tLogTypeNavList</u><br>\n");
253                printf("%s",mysql_error(&gMysql));
254                return;
255        }
256
257        res=mysql_store_result(&gMysql);
258        if(mysql_num_rows(res))
259        {       
260                printf("<p><u>tLogTypeNavList</u><br>\n");
261
262                while((field=mysql_fetch_row(res)))
263                        printf("<a class=darkLink href=unxsVZ.cgi?gcFunction=tLogType&uLogType=%s>%s</a><br>\n",
264                                field[0],field[1]);
265        }
266        mysql_free_result(res);
267
268}//void tLogTypeNavList(void)
269
Note: See TracBrowser for help on using the browser.