Menu

[r19]: / src / screens / edit.cs  Maximize  Restore  History

Download this file

497 lines (477 with data), 20.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
#function edit_php project table_id
#query select name as application from `project` where project=?project?
#query select `table`, name as tablename, `sql` as tablesql, title as tabletitle, `where`, id_field from `table` where `table`=?table_id?
#print page_header 'edit' project table_id
#print '<?php\n'
#record select Code from actions where `table`=?table_id? and Action='edit' and Part='session'
#print Code ^ '\n'
#end
#set tests=''
#record select name, field.sql as fieldsql, SessionVar from `field` where `table`=?table_id? and SessionVar<>'' and field.sql<>'' order by `order`
#if tests=''
#set tests=' WHERE '
#else
#set tests=tests ^ ' AND '
#end
#set tests=tests ^ tablesql ^ '.' ^ fieldsql ^ '=\'$' ^ SessionVar ^ '\''
#end
#record select field, `Add`, name, field.sql as fieldsql, `Type`, title, width, height, link_table, link_field, SessionVar, link_display from `field` where `table`=?table_id? and link_table<>'' and (Record='show' or Edit='show' or title='') order by `order`
#print '$sql->QueryItem(\"SELECT ' ^ queryvars ('T' ^ field) link_display field 1 ^ ' FROM `' ^ link_table ^ '` as T' ^ field ^ ' WHERE `' ^ link_field ^ '` = $' ^ SessionVar ^ '\");\n'
#set getvars=''
#set expr=fieldreplace link_display field
#print getvars
#print ' $' ^ name ^ '_lup = \"' ^ expr ^ '\";\n'
#end
#print '$sql->QueryItem(\"SELECT '
#set first=true
#record select field, `Record`, name, field.sql as fieldsql, `Type`, title, width, SessionVar, height, link_table, link_field, link_display from `field` where `table`=?table_id? and field.sql<>'' and SessionVar='' order by `order`
#if not first
#print ', '
#end
# if link_display=''
#print tablesql ^ '.' ^ fieldsql ^ ' as F' ^ field
# else
# print queryvars ('T' ^ field) link_display field 1
# end
#set first=false
#end
#print ' FROM `' ^ tablesql ^ '` ' ^ tests ^ '\");\n'
#set first=true
#record select field, name, field.sql as fieldsql, `Type`, title, width, height, link_table, link_field, link_display from `field` where `table`=?table_id? and field.sql<>'' and SessionVar='' order by `order`
#if Type='varchar' or Type='text'
#print '$' ^ name ^ ' = htmlspecialchars($sql->data[\'F' ^ field ^ '\']);\n'
#else
#if Type='password'
#print '$' ^ name ^ ' = \'\';\n'
#else
#if Type='date'
#print 'preg_match (\'/^(\d+)-0?(\d+)-0?(\d+)$/\', $sql->data[\'F' ^ field ^ '\'], $matches);\n'
#print '$' ^ name ^ '=\"$matches[3]/$matches[2]/$matches[1]\";\n'
#else
#print '$' ^ name ^ ' = htmlspecialchars($sql->data[\'F' ^ field ^ '\']);\n'
#end
#end
#end
#end
#print 'if ($_POST[\'' ^ id_field ^ '\']!=\'\') {\n'
#record select name, field.sql as fieldsql, `Type`, title, width, height, link_table, link_field, link_display from `field` where `table`=?table_id? and Record<>'none' and field.sql<>'' order by `order`
#if Type='varchar' or Type='text'
#print ' $' ^ name ^ ' = htmlspecialchars($_POST[\'' ^ name ^ '\']);\n'
#else
#if Type='password'
#print '$' ^ name ^ ' = \'\';\n'
#else
#if Type='date'
#print '$' ^ name ^ ' = date(\'j/n/Y\', strtotime($_POST[\'' ^ name ^ '\']));\n'
#else
#print '$' ^ name ^ ' = htmlspecialchars($_POST[\'' ^ name ^ '\']);\n'
#end
#end
#end
#end
#print '}\n'
#print '?>\n'
#print '<HTML>\n'
#print '<HEAD>\n'
#print ' <META HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=windows-1252\">\n'
#print ' <TITLE>' ^ tabletitle ^ ' wijzigen</TITLE>\n'
#print '<script>\n'
#print 'function confirmDelete(delUrl) {\n'
#print ' if (confirm(\"' ^ tabletitle ^ ' verwijderen?\")) {\n'
#print ' document.location = delUrl;\n'
#print ' }\n'
#print '}\n'
#print '</script>\n'
#print '</HEAD>\n'
#print '<BODY LANG=\"en-US\" DIR=\"LTR\" ONLOAD=\"Edit.<?php\n'
#set fid='0'
#set ff=''
#record select field, `Record`, `Edit`, field.sql as fieldsql, name, `Type`, title, SessionVar, height, link_table, link_field, link_display, `default` from `field` where `table`=?table_id? and field.sql<>'' and Record<>'none' and `Edit`<>'false' order by `order`
#if ff=''
#set ff=name
#end
#if fid>'0'
#print 'if ($_POST[FOCUS]==' ^ fid ^ ') {echo \'' ^ name ^ '\';}\nelse '
#set fid='0'
#end
#if link_table<>'' or Type='enum'
#set fid=field
#end
#end
#print '{echo \'' ^ ff ^ '\';}\n'
#print '?>.focus();\">\n'
#print '<FORM NAME=\"Edit\" ACTION=\"postedit' ^ tablename ^ '.php\" METHOD=POST>\n'
#print '<INPUT TYPE=\"HIDDEN\" NAME=\"FOCUS\" VALUE=\"\">\n'
#print '<?php echo(\"<INPUT TYPE=HIDDEN NAME=\\"' ^ id_field ^ '\\" SIZE=5 VALUE=\\"$' ^ id_field ^ '\\">\");?>\n'
#print '<TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=1>\n'
#print ' <THEAD>\n'
#print ' <TR>\n'
#print ' <TD COLSPAN=2 WIDTH=100% VALIGN=TOP BGCOLOR=\"#000080\">\n'
#print ' <P><FONT COLOR=\"#ffffff\"><FONT FACE=\"Verdana, sans-serif\"><FONT SIZE=1 STYLE=\"font-size: 8pt\">'
#print '<B>' ^ tabletitle ^ ' wijzigen\n'
#print ' </B></FONT></FONT></FONT></P>\n'
#print ' </TD>\n'
#print ' </TR>\n'
#print ' </THEAD>\n'
#print ' <TBODY>\n'
#record select field, `Record`, `Edit`, field.sql as fieldsql, name, `Type`, title, SessionVar, width * 7 as width, width as ListWidth, height, link_table, link_field, link_display, `default` from `field` where `table`=?table_id? and field.sql<>'' and Record<>'none' and `Edit`<>'false' order by `order`
#if SessionVar<>''
#print ' <INPUT TYPE=HIDDEN NAME=\"' ^ SessionVar ^ '\" VALUE=\"<?php echo $' ^ SessionVar ^ '; ?>\">\n'
#end
#if Record='show' or Edit='show'
#print ' <TR VALIGN=TOP>\n'
#print ' <TD WIDTH=20% BGCOLOR=\"#e6e6ff\">\n'
#print ' <FONT COLOR=\"#000080\" FACE=\"Verdana, sans-serif\" STYLE=\"font-size: 8pt\">\n'
#print ' ' ^ title ^'\n'
#print ' </FONT>\n'
#print ' </TD>\n'
#print ' <TD WIDTH=80%>\n'
#print ' <FONT COLOR=\"#000080\" FACE=\"Verdana, sans-serif\" STYLE=\"font-size: 10pt\">\n'
#print ' <?php echo ($' ^ name ^ (if link_table<>'' then '_lup' else '') ^ '); ?>\n'
#print ' </FONT>\n'
#print ' </TD>\n'
#end
#if Record<>'show' and Edit<>'show'
#print ' <TR VALIGN=TOP>\n'
#print ' <TD WIDTH=20% BGCOLOR=\"#e6e6ff\">\n'
#print ' <FONT COLOR=\"#000080\" FACE=\"Verdana, sans-serif\" STYLE=\"font-size: 8pt\">\n'
#print ' ' ^ title ^'\n'
#print ' </FONT>\n'
#print ' </TD>\n'
#print ' <TD WIDTH=80%>\n'
#print ' <P><FONT COLOR=\"#000080\"><FONT FACE=\"Verdana, sans-serif\"><FONT SIZE=1 STYLE=\"font-size: 8pt\">\n'
#if link_table<>''
#print ' <?php\n'
#if width<>'0'
#print ' echo (\"<SELECT NAME=\\\"' ^ name ^ '\\\" STYLE=\\\"width: ' ^ width ^ 'px\\\" OnChange=\\\"Edit.action=\'\'; Edit.FOCUS.value=\'' ^ field ^ '\'; Edit.submit();\\\">\");\n'
#else
#print ' echo (\"<SELECT NAME=\\\"' ^ name ^ '\\\" OnChange=\\\"Edit.action=\'\'; Edit.FOCUS.value=\'' ^ field ^'\'; Edit.submit();\\\">\");\n'
#end
#if default='<empty>'
#print ' echo \"<OPTION VALUE=\\\"\\\"></OPTION>\";\n'
#end
#if link_display=''
#print ' $sql->Query(\"' ^ link_table ^ '\");\n'
#else
#print ' $sql->Query(\"SELECT '
#print queryvars '' link_display '0' 1 ^ ', `' ^ link_table ^ '`.' ^ link_field
#print ' FROM `' ^ link_table ^'` '
#set wcheck=''
#query select `where` as wcheck from `table` where project=?project? and sql=?link_table?
#if wcheck<>''
#print ' \n WHERE ' ^ fieldreplace wcheck '0' ^ '\n'
#end
## order by fields from link_display
## print ' ORDER BY `' ^ link_table ^ '`.' ^ OrderByField ^ ' ASC\");\n'
#end
#print ' for ($i = 0; $i < $sql->rows; $i++)\n'
#print ' {\n'
#print ' $sql->Fetch($i);\n'
#print ' $opzoekID = $sql->data[' ^ link_field ^ '];\n'
#if link_display=''
#print ' $opzoekweergave = $opzoekID;\n'
#else
#set expr=fieldreplace link_display '0'
#print getvars
#print ' $opzoekweergave = \"' ^ expr ^ '\";\n'
#end
#print ' echo (\"<OPTION \");\n'
#print ' if ($opzoekID == $' ^ name ^') {echo \"SELECTED \";};\n'
#print ' echo \"VALUE=\\\"$opzoekID\\\">$opzoekweergave\";\n'
#print ' }\n'
#print ' echo (\"</SELECT>\");\n'
#print ' ?>\n'
#else
#if Type='enum'
#print ' <?php\n'
#if width<>'0'
#print ' echo (\"<SELECT NAME=\\\"' ^ name ^ '\\\" STYLE=\\\"width: ' ^ width ^ 'px\\\" OnChange=\\\"Edit.action=\'\'; Edit.FOCUS.value=\'' ^ field ^'\'; Edit.submit();\\\">\");\n'
#else
#print ' echo (\"<SELECT NAME=\\\"' ^ name ^ '\\\" OnChange=\\\"Edit.action=\'\'; Edit.FOCUS.value=\'' ^ field ^'\'; Edit.submit();\\\">\");\n'
#end
#set val=enum data_connection tablesql fieldsql
#split res=val on ,
#match res with '\(.*\)' into res
#print ' if ($'^ name ^'==\''^res^'\') {\n'
#print ' echo \"<OPTION VALUE=\\\"' ^ res ^ '\\\" SELECTED>' ^ res ^ '</OPTION>\\n\";\n'
#print ' } else {\n'
#print ' echo \"<OPTION VALUE=\\\"' ^ res ^ '\\\">' ^ res ^ '</OPTION>\\n\";\n'
#print ' }\n'
#end
#end
#print ' echo (\"</SELECT></FONT></FONT>\");\n'
#print ' ?>\n'
#end
#if Type='int' or Type='date' or Type='varchar' or Type='ordering' or Type='password'
#print ' <?php echo(\"<INPUT TYPE=TEXT NAME=\\"' ^ name ^ '\\" SIZE=' ^ ListWidth ^ ' VALUE=\\"$' ^ name ^ '\\">\");?>\n'
#end
#if Type='text' or Type='mediumtext' or Type='longtext'
#print ' <?php echo(\"<TEXTAREA NAME=\\"' ^ name ^ '\\" ROWS=' ^ height ^ ' COLS=' ^ ListWidth ^ '>$' ^ name ^ '</TEXTAREA>\");?>\n'
#end
#end
#print ' </FONT></FONT></FONT></P>\n'
#print ' </TD>\n'
#print ' </TR>\n'
#end
#end
#print ' </TBODY>\n'
#print '</TABLE>\n'
#print '<P ALIGN=RIGHT>\n'
#set Code=''
#query select Code from actions where `table`=?table_id? and Action='edit' and Part='complete'
#if Code<>''
#print '<?php\n'
#print 'if ('^ Code ^') { echo \"<INPUT TYPE=submit VALUE=Change>\\n\"; }\n'
#print '?>\n'
#else
#print '<INPUT TYPE=\"submit\" VALUE=\"Change\">\n'
#end
#set sesvars=''
#record select SessionVar from `field` where `table`=?table_id? and SessionVar<>'' order by `order`
#set sesvars=sesvars ^ '&' ^ SessionVar ^ '=$' ^ SessionVar
#end
#print '<?php\n'
#print '$test=true;\n'
#print 'if ($test) {\n'
#print ' echo (\"\n'
#print ' <INPUT TYPE=BUTTON VALUE=\\"Delete\\" onClick=\\"confirmDelete(\'postdelete' ^ tablename ^ '.php?' ^ id_field ^ '=$' ^ id_field ^ sesvars ^ '\')\\">\n'
#print ' \");\n'
#print '}\n'
#print '?>\n'
#print '<INPUT TYPE=BUTTON VALUE=\"Cancel\" onClick=\"window.close()\">\n'
#print '</P>\n'
#print '</FORM>\n'
#record select Code from actions where `table`=?table_id? and Action='edit' and Part='footer'
#print '<?php\n' ^ Code ^ '\n?>\n'
#end
#print '</BODY>\n'
#print '</HTML>\n'
#end
#function postedit_php project table_id
#query select name as application from `project` where project=?project?
#query select `sql` as tablesql, name as tablename, `where`, id_field from `table` where `table`=?table_id?
#print page_header 'postedit' project table_id
#print '<?php\n'
#print '$sql = new MySQL_class;\n'
#print '$sql->Create(\"' ^ application ^ '\");\n'
#print '$' ^ id_field ^ '=($_POST[\'' ^ id_field ^ '\']);\n'
#record select field.sql as fieldsql, name, `Type`, title, width, height, link_table, link_field, link_display from `field` where `table`=?table_id? and `Record`<>'none' and field.sql<>'' order by `order`
#if Type='date'
#print 'preg_match (\'/^(\d+)\/(\d+)\/(\d+)$/\', $_POST[\'' ^ name ^ '\'], $matches);\n'
#print '$' ^ name ^ '=\"\'$matches[3]-$matches[2]-$matches[1]\'\";\n'
#else
#print '$' ^ name ^ '=quote($_POST[\'' ^ name ^ '\']);\n'
#end
#if link_table<>''
#set str=fieldreplace link_table '0'
#print ' $field = $sql->data[' ^ fieldsql ^ '];\n'
#print ' if ($field <> 0) {\n'
#split qry=str on ; +
#print ' $esql->QueryItem(\"' ^ qry ^ ' and `' ^ link_field ^ '`=$field\");\n'
#if string_sub qry 0 4<>'use '
#print 'if ($esql->data[LNR]==0) {die (\'No valid data in \\\'' ^ title ^ '\\\'\'); }\n'
#end
#end
#print ' }\n'
#end
#end
#set tests=''
#record select field.sql as fieldsql, name, SessionVar from `field` where `table`=?table_id? and SessionVar<>'' and field.sql<>'' order by `order`
#if tests=''
#set tests=' WHERE '
#else
#set tests=tests ^ ' AND '
#end
#set tests=tests ^ '`' ^ fieldsql ^ '`=\'$' ^ SessionVar ^ '\''
#end
#print '$sql->Update(\"UPDATE `' ^ tablesql ^ '` SET\n'
#set first=true
#record select field.sql as fieldsql, name, `Type`, title, width, height, link_table, link_field, link_display from `field` where `table`=?table_id? and `Record`<>'none' and field.sql<>'' order by `order`
#if Type='password'
#print '\".(($_POST[' ^ name ^']==\'\')?\'\':\"'
#end
#if first
#set first=false
#else
#print ',\n'
#end
#print '`' ^ fieldsql ^ '`=$' ^ name
#if Type='password'
#print '\").\"'
#end
#end
#print tests ^ '\");\n'
#print '$affected_rows = $sql->a_rows;\n'
#record select Code from actions where `table`=?table_id? and Action='edit' and Part='onchange'
#print 'if ($affected_rows>0) {\n' ^ Code ^ '\n}\n'
#end
#print 'echo \"<P><FONT FACE=\\\"Verdana, sans-serif\\\"><FONT SIZE=1 STYLE=\\\"font-size: 8pt\\\">\";\n'
#print 'echo \"Er is/zijn $affected_rows records gewijzigd<BR>\";\n'
#record select `Add`, field.sql as fieldsql, name, `Type`, title, width, height, link_table, link_field, link_display from `field` where `table`=?table_id? order by `order`
#if Add='true'
#print 'echo \"$' ^ name ^ '<BR>\";\n'
#end
#end
#print 'echo \"</P>\";\n'
#print 'if ($affected_rows=1) {\n'
#print ' echo \"<script>window.opener.location.reload(true)</script>\";\n'
#print ' echo \"<script>window.close(self)</script>\";\n'
#print '}\n'
## Create a set of all current order variables
## record select `Add`, field.sql as fieldsql, name, `Type`, title, width, height, link_table, link_field, link_display, SessionVar from `field` where `table`=?table_id? and field.sql<>'' and field.sql<>?id_field? and field.sql=?ListOrderByField?
## print '$_SESSION[last_'^table_id^']=$' ^ name ^ ';\n'
## end
#print '?>\n'
#print '<INPUT TYPE=BUTTON VALUE=\"Close\" onClick=\"window.opener.location.reload(true);self.close()\">\n'
#end
#function rights_edit_php project table_id
#query select name as application from `project` where project=?project?
#query select `table`, name as tablename, `sql` as tablesql, title as tabletitle, `where`, id_field from `table` where `table`=?table_id?
#print page_header 'edit' project table_id
#print '<?php\n'
#record select Code from actions where `table`=?table_id? and Action='edit' and Part='session'
#print Code ^ '\n'
#end
#print '?>\n'
#print '<HTML>\n'
#print '<HEAD>\n'
#print ' <META HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=windows-1252\">\n'
#print ' <TITLE>' ^ tabletitle ^ ' rechten</TITLE>\n'
#print '</HEAD>\n'
#print '<BODY LANG=\"en-US\" DIR=\"LTR\">\n'
#print '<TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=1>\n'
#print ' <THEAD>\n'
#print ' <TR>\n'
#print ' <TD COLSPAN=2 WIDTH=100% VALIGN=TOP BGCOLOR=\"#000080\">\n'
#print ' <P><FONT COLOR=\"#ffffff\"><FONT FACE=\"Verdana, sans-serif\"><FONT SIZE=1 STYLE=\"font-size: 8pt\">'
#print '<B>' ^ tabletitle ^ ' rechten\n'
#print ' </B></FONT></FONT></FONT></P>\n'
#print ' </TD>\n'
#print ' </TR>\n'
#print ' </THEAD>\n'
#print ' <TBODY>\n'
#record select `field`, `Record`, field.sql as fieldsql, name, `Type`, title, SessionVar, height, link_table, link_field, link_display from `field` where `table`=?table_id? and field.sql<>'' and Record<>'none' order by `order`
#print ' <TR VALIGN=TOP>\n'
#print ' <TD WIDTH=20% BGCOLOR=\"#e6e6ff\">\n'
#print ' <FONT COLOR=\"#000080\" FACE=\"Verdana, sans-serif\" STYLE=\"font-size: 8pt\">\n'
#print ' ' ^ title ^'\n'
#print ' </FONT>\n'
#print ' </TD>\n'
#print ' <TD WIDTH=80%>\n'
#print field_rights_link field 'readonly'
#print field_rights_link field 'hide'
#print ' </TD>\n'
#end
#print ' </FONT></FONT></FONT></P>\n'
#print ' </TD>\n'
#print ' </TR>\n'
#print ' </TBODY>\n'
#print '</TABLE>\n'
#print '<P ALIGN=RIGHT>\n'
#print '<INPUT TYPE=\"submit\" VALUE=\"Change\" onClick=\"window.close()\">\n'
#print '<INPUT TYPE=BUTTON VALUE=\"Delete\" onClick=\"window.close()\">\n'
#set part=''
#query select `part` from `part` where `table`=?table_id? and `link`=`screen`
#if part<>''
#print part_rights_link part 'nodelete'
#end
#print '<INPUT TYPE=BUTTON VALUE=\"Cancel\" onClick=\"window.close()\">\n'
#print '</P>\n'
#print '</FORM>\n'
#record select Code from actions where `table`=?table_id? and Action='edit' and Part='footer'
#print '<?php\n' ^ Code ^ '\n?>\n'
#end
#print '</BODY>\n'
#print '</HTML>\n'
#end
#function generate_edit project table_id
#query select name as application from `project` where project=?project?
#query select `table`, name as tablename, `sql` as tablesql, title as tabletitle, `where`, id_field from `table` where `table`=?table_id?
#print '<div><FORM NAME=Edit METHOD=POST>\n<?php\n'
#record select field.sql as fieldsql, name, `Type`, SessionVar, title, width, height, link_table, link_field, link_display from `field` where `table`=?table_id? and Record<>'none' and field.sql<>'' order by `order`
#print 'if ($_POST[\'' ^ name ^ '\']!=\'\') {\n'
#if Type='varchar' or Type='text'
#print ' $' ^ name ^ ' = ($_POST[\'' ^ name ^ '\']);\n'
#else
#if Type='password'
#print ' $' ^ name ^ ' = \'\';\n'
#else
#if Type='date'
#print ' $' ^ name ^ ' = date(\'j/n/Y\', strtotime($_POST[\'' ^ name ^ '\']));\n'
#else
#print ' $' ^ name ^ ' = $_POST[\'' ^ name ^ '\'];\n'
#end
#end
#end
#if SessionVar<>''
#print ' $_SESSION[var_' ^ SessionVar ^ ']=$' ^ name ^ ';\n'
#end
#print '}\n'
#end
#record select field, `Record`, field.sql as fieldsql, name, `Type`, title, SessionVar, width as ListWidth, width*7 as width, height, link_table, link_field, link_display from `field` where `table`=?table_id? and field.sql<>'' and Record<>'none' order by `order`
#if Record<>'show'
#if link_table<>''
#if width<>'0'
#print 'echo (\"<SELECT NAME=\\\"' ^ name ^ '\\\" STYLE=\\\"width: ' ^ width ^ 'px\\\" OnChange=\\\"Edit.action=\'\'; Edit.submit();\\\">\");\n'
#else
#print 'echo (\"<SELECT NAME=\\\"' ^ name ^ '\\\" OnChange=\\\"Edit.action=\'\'; Edit.submit();\\\">\");\n'
#end
#print '$sql->Query(\"SELECT '
#print queryvars 'T' link_display '0' 1 ^ ', T.' ^ link_field
#print ' FROM `' ^ link_table ^'` as T'
#set wcheck=''
#query select `where` as wcheck from `table` where project=?project? and sql=?link_table?
#if wcheck<>''
#print ' \n WHERE ' ^ fieldreplace wcheck '0'
#end
## sort by fields from link_display
## print '\n ORDER BY ' ^ OrderByField ^ ' ASC\");\n'
#print 'for ($i = 0; $i < $sql->rows; $i++)\n'
#print '{\n'
#print ' $sql->Fetch($i);\n'
#print ' $opzoekID = $sql->data[' ^ link_field ^ '];\n'
#set expr=fieldreplace link_display '0'
#print getvars
#print ' $opzoekweergave = \"' ^ expr ^ '\";\n'
#print ' echo (\"<OPTION \");\n'
#print ' if ($opzoekID == $' ^ name ^') {echo \"SELECTED \";};\n'
#print ' echo \"VALUE=\\\"$opzoekID\\\">$opzoekweergave\";\n'
#print '}\n'
#print 'echo (\"</SELECT>\");\n'
#else
#if Type='enum'
#if width<>'0'
#print 'echo (\"<SELECT NAME=\\\"' ^ name ^ '\\\" STYLE=\\\"width: ' ^ width ^ 'px\\\" OnChange=\\\"Edit.action=\'\'; Edit.submit();\\\">\");\n'
#else
#print 'echo (\"<SELECT NAME=\\\"' ^ name ^ '\\\" OnChange=\\\"Edit.action=\'\'; Edit.submit();\\\">\");\n'
#end
#set val=enum data_connection tablesql fieldsql
#split res=val on ,
#match res with '\(.*\)' into res
#print 'if ($'^ name ^'==\''^res^'\') {\n'
#print ' echo \"<OPTION VALUE=\\\"' ^ res ^ '\\\" SELECTED>' ^ res ^ '</OPTION>\\n\";\n'
#print '} else {\n'
#print ' echo \"<OPTION VALUE=\\\"' ^ res ^ '\\\">' ^ res ^ '</OPTION>\\n\";\n'
#print '}\n'
#end
#end
#print 'echo (\"</SELECT>\");\n'
#end
#if Type='int' or Type='date' or Type='varchar' or Type='password'
#print 'echo(\"<INPUT TYPE=TEXT NAME=\\"' ^ name ^ '\\" SIZE=' ^ ListWidth ^ ' VALUE=\\"$' ^ name ^ '\\">\");\n'
#end
#if Type='text' or Type='mediumtext' or Type='longtext'
#print 'echo(\"<TEXTAREA NAME=\\"' ^ name ^ '\\" ROWS=' ^ height ^ ' COLS=' ^ ListWidth ^ '>$' ^ name ^ '</TEXTAREA>\");\n'
#end
#end
#end
#end
#set Code=''
#query select Code from actions where actions.`table`=?table_id? and Action='edit' and Part='complete'
#if Code<>''
#print 'if ('^ Code ^') { echo \"<INPUT TYPE=submit VALUE=Alter>\\n\"; }\n'
#else
#print 'echo \"<INPUT TYPE=submit VALUE=Alter>\\n\";\n'
#end
#print '?></FORM></div>\n'
#end
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.