#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