#function edit_php dbase_id table_id #query select DatabaseName from `database` where DatabaseID=?dbase_id? #query select TableID, Subject, TableName, Title, Checks, Session, IDfield from `tables` where TableID=?table_id? #print page_header 'edit' dbase_id table_id #print ''' and FieldName<>'' and LookupTable='' order by `order` #if tests='' #set tests=' WHERE ' #else #set tests=tests ^ ' AND ' #end #set tests=tests ^ TableName ^ '.' ^ FieldName ^ '=\'$' ^ SessionVar ^ '\'' #end #record select fieldID, `Add`, Name, FieldName, `Type`, DisplayName, DisplayLength, Help, areaheight, areawidth, LookupTable, OrderByField, LookupIDField, SessionVar, LookupDisplayField from `fields` where TableID=?table_id? and LookupTable<>'' and SessionVar<>'' and DisplayName='' order by `order` #print '$sql->QueryItem(\"SELECT `' ^ LookupDisplayField ^ '` FROM `' ^ LookupTable ^ '` WHERE `' ^ LookupIDField ^ '` = $' ^ SessionVar ^ '\");\n' #print '$' ^ Name ^ ' = htmlspecialchars($sql->data[0]);\n' #end #print '$sql->QueryItem(\"SELECT ' #set first=true #record select fieldID, `Record`, FieldName, `Type`, DisplayName, DisplayLength, SessionVar, Help, areaheight, areawidth, ListWidth, LookupTable, OrderByField, LookupIDField, LookupDisplayField from `fields` where TableID=?table_id? and FieldName<>'' and SessionVar='' order by `order` #if not first #print ', ' #end # if LookupDisplayField='' #print TableName ^ '.' ^ FieldName ^ ' as F' ^ fieldID # else # print queryvars ('T' ^ fieldID) LookupDisplayField fieldID 1 # end #set first=false #end #print ' FROM `' ^ TableName ^ '` ' ^ tests ^ '\");\n' #set first=true #record select fieldID, Name, FieldName, `Type`, DisplayName, DisplayLength, areaheight, areawidth, LookupTable, OrderByField, LookupIDField, LookupDisplayField from `fields` where TableID=?table_id? and FieldName<>'' and SessionVar='' order by `order` #if Type='varchar' or Type='text' #print '$' ^ Name ^ ' = htmlspecialchars($sql->data[\'F' ^ fieldID ^ '\']);\n' #else #if Type='date' #print 'preg_match (\'/^(\d+)-0?(\d+)-0?(\d+)$/\', $sql->data[\'F' ^ fieldID ^ '\'], $matches);\n' #print '$' ^ Name ^ '=\"$matches[3]/$matches[2]/$matches[1]\";\n' #else #print '$' ^ Name ^ ' = $sql->data[\'F' ^ fieldID ^ '\'];\n' #end #end #end #print 'if ($_POST[\'' ^ IDfield ^ '\']!=\'\') {\n' #record select Name, FieldName, `Type`, DisplayName, DisplayLength, areaheight, areawidth, LookupTable, OrderByField, LookupIDField, LookupDisplayField from `fields` where TableID=?table_id? and Record<>'none' and FieldName<>'' order by `order` #if Type='varchar' or Type='text' #print ' $' ^ Name ^ ' = ($_POST[\'' ^ FieldName ^ '\']);\n' #else #if Type='date' #print '$' ^ Name ^ ' = date(\'j/n/Y\', strtotime($_POST[\'' ^ FieldName ^ '\']));\n' #else #print '$' ^ Name ^ ' = $_POST[\'' ^ FieldName ^ '\'];\n' #end #end #end #print '}\n' #print '?>\n' #print '\n' #print '\n' #print ' \n' #print ' ' ^ Title ^ ' wijzigen\n' #print '\n' #print '\n' #print '\n' #print '
\n' #print '\");?>\n' #print '\n' #print ' \n' #print ' \n' #print ' \n' #print ' \n' #print ' \n' #print ' \n' #record select FieldID, `Record`, FieldName, Name, `Type`, DisplayName, SessionVar, Help, AreaHeight, ListWidth*7 as pxwidth, ListWidth, LookupTable, OrderByField, LookupIDField, LookupDisplayField, `default` from `fields` where TableID=?table_id? and FieldName<>'' and Record<>'none' order by `order` #if SessionVar<>'' #print ' \">\n' #end #if Record='show' #print ' \n' #print ' \n' #print ' \n' #end #if Record<>'show' #print ' \n' #print ' \n' #print ' \n' #print ' \n' #end #end #print ' \n' #print '
\n' #print '

' #print '' ^ Title ^ ' wijzigen\n' #print '

\n' #print '
\n' #print ' \n' #print ' ' ^ DisplayName ^'\n' #print ' \n' #print ' \n' #print ' \n' #print ' \n' #print ' \n' #print '
\n' #print ' \n' #print ' ' ^ DisplayName ^'\n' #print ' \n' #print ' \n' #print '

\n' #if LookupTable<>'' #print ' '0' #print ' echo (\"\");\n' #end #if default='' #print ' echo \"\";\n' #end #if LookupDisplayField='' #print ' $sql->Query(\"' ^ LookupTable ^ '\");\n' #else #print ' $sql->Query(\"SELECT ' #print queryvars '' LookupDisplayField '0' 1 ^ ', `' ^ LookupTable ^ '`.' ^ LookupIDField #print ' FROM `' ^ LookupTable ^'` ' #set wcheck='' #query select Checks as wcheck from `tables` where databaseID=?dbase_id? and TableName=?LookupTable? #if wcheck<>'' #print ' \n WHERE ' ^ fieldreplace wcheck '0' ^ '\n' #end #print ' ORDER BY `' ^ LookupTable ^ '`.' ^ OrderByField ^ ' ASC\");\n' #end #print ' for ($i = 0; $i < $sql->rows; $i++)\n' #print ' {\n' #print ' $sql->Fetch($i);\n' #print ' $opzoekID = $sql->data[' ^ LookupIDField ^ '];\n' #if LookupDisplayField='' #print ' $opzoekweergave = $opzoekID;\n' #else #set expr=fieldreplace LookupDisplayField '0' #print getvars #print ' $opzoekweergave = \"' ^ expr ^ '\";\n' #end #print ' echo (\"\\n\";\n' #print ' } else {\n' #print ' echo \"\\n\";\n' #print ' }\n' #end #end #print ' echo (\"\");\n' #print ' ?>\n' #end #if Type='int' or Type='date' or Type='varchar' or Type='ordering' #print ' \");?>\n' #end #if Type='text' or Type='mediumtext' or Type='longtext' #print ' $' ^ Name ^ '\");?>\n' #end #end #if Help<>'' #print ' \n' #end #print '

\n' #print '
\n' #print '

\n' #set Code='' #query select Code from actions where TableID=?table_id? and Action='edit' and Part='complete' #if Code<>'' #print '\\n\"; }\n' #print '?>\n' #else #print '\n' #end #set sesvars='' #record select SessionVar from `fields` where TableID=?table_id? and SessionVar<>'' order by `order` #set sesvars=sesvars ^ '&' ^ SessionVar ^ '=$' ^ SessionVar #end #print '\n' #print ' \");\n' #print '}\n' #print '?>\n' #print '\n' #print '

\n' #print '
\n' #record select Code from actions where TableID=?table_id? and Action='edit' and Part='footer' #print '\n' #end #print '\n' #print '\n' #end #function postedit_php dbase_id table_id #query select DatabaseName from `database` where DatabaseID=?dbase_id? #query select TableName, Subject, Checks, Session, IDfield, Include, ListOrderByField from `tables` where TableID=?table_id? #print page_header 'postedit' dbase_id table_id #print 'Create(\"' ^ DatabaseName ^ '\");\n' #print '$' ^ IDfield ^ '=($_POST[\'' ^ IDfield ^ '\']);\n' #record select FieldName, `Type`, DisplayName, DisplayLength, areaheight, areawidth, LookupTable, OrderByField, LookupIDField, LookupDisplayField from `fields` where TableID=?table_id? and `Record`<>'none' and FieldName<>'' order by `order` #if Type='date' #print 'preg_match (\'/^(\d+)\/(\d+)\/(\d+)$/\', $_POST[\'' ^ FieldName ^ '\'], $matches);\n' #print '$' ^ FieldName ^ '=\"\'$matches[3]-$matches[2]-$matches[1]\'\";\n' #else #print '$' ^ FieldName ^ '=quote($_POST[\'' ^ FieldName ^ '\']);\n' #end #if LookupTable<>'' #set str=fieldreplace LookupTable '0' #print ' $field = $sql->data[' ^ FieldName ^ '];\n' #print ' if ($field <> 0) {\n' #split qry=str on ; + #print ' $esql->QueryItem(\"' ^ qry ^ ' and `' ^ LookupIDField ^ '`=$field\");\n' #if string_sub qry 0 4<>'use ' #print 'if ($esql->data[LNR]==0) {die (\'No valid data in \\\'' ^ DisplayName ^ '\\\'\'); }\n' #end #end #print ' }\n' #end #end #set tests='' #record select FieldName, SessionVar from `fields` where TableID=?table_id? and SessionVar<>'' and FieldName<>'' order by `order` #if tests='' #set tests=' WHERE ' #else #set tests=tests ^ ' AND ' #end #set tests=tests ^ '`' ^ FieldName ^ '`=\'$' ^ SessionVar ^ '\'' #end #print '$sql->Update(\"UPDATE `' ^ TableName ^ '` SET\n' #set first=true #record select FieldName, `Type`, DisplayName, DisplayLength, areaheight, areawidth, LookupTable, OrderByField, LookupIDField, LookupDisplayField from `fields` where TableID=?table_id? and `Record`<>'none' and FieldName<>'' order by `order` #if first #set first=false #else #print ',\n' #end #print '`' ^ FieldName ^ '`=$' ^ FieldName #end #print tests ^ '\");\n' #print '$affected_rows = $sql->a_rows;\n' #record select Code from actions where TableID=?table_id? and Action='edit' and Part='onchange' #print 'if ($affected_rows>0) {\n' ^ Code ^ '\n}\n' #end #print 'echo \"

\";\n' #print 'echo \"Er is/zijn $affected_rows records gewijzigd
\";\n' #record select `Add`, FieldName, `Type`, DisplayName, DisplayLength, areaheight, areawidth, LookupTable, OrderByField, LookupIDField, LookupDisplayField from `fields` where TableID=?table_id? order by `order` #if Add='true' #print 'echo \"$' ^ FieldName ^ '
\";\n' #end #end #print 'echo \"

\";\n' #print 'if ($affected_rows=1) {\n' #print ' echo \"\";\n' #print ' echo \"\";\n' #print '}\n' #record select `Add`, FieldName, `Type`, DisplayName, DisplayLength, areaheight, areawidth, LookupTable, OrderByField, LookupIDField, LookupDisplayField, SessionVar from `fields` where TableID=?table_id? and FieldName<>'' and FieldName<>?IDfield? and FieldName=?ListOrderByField? #if SessionVar<>'' #print '$_SESSION[last_'^table_id^']=\'$' ^ SessionVar ^'\';\n' #else #print '$_SESSION[last_'^table_id^']=$' ^ FieldName ^ ';\n' #end #end #print '?>\n' #print '\n' #end #function rights_edit_php dbase_id table_id #query select DatabaseName from `database` where DatabaseID=?dbase_id? #query select TableID, Subject, TableName, Title, Checks, Session, IDfield from `tables` where TableID=?table_id? #print page_header 'edit' dbase_id table_id #print '\n' #print '\n' #print '\n' #print ' \n' #print ' ' ^ Title ^ ' rechten\n' #print '\n' #print '\n' #print '\n' #print ' \n' #print ' \n' #print ' \n' #print ' \n' #print ' \n' #print ' \n' #set Help='' #record select `FieldID`, `Record`, FieldName, `Type`, DisplayName, SessionVar, Help, AreaHeight, ListWidth*7 as pxwidth, ListWidth, LookupTable, OrderByField, LookupIDField, LookupDisplayField from `fields` where TableID=?table_id? and FieldName<>'' and Record<>'none' order by `order` #print ' \n' #print ' \n' #print ' \n' #end #if Help<>'' #print ' \n' #end #print '

\n' #print ' \n' #print ' \n' #print ' \n' #print '
\n' #print '

' #print '' ^ Title ^ ' rechten\n' #print '

\n' #print '
\n' #print ' \n' #print ' ' ^ DisplayName ^'\n' #print ' \n' #print ' \n' #print field_rights_link FieldID 'readonly' #print field_rights_link FieldID 'hide' #print '
\n' #print '

\n' #print '\n' #print '\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 '\n' #print '

\n' #print '\n' #record select Code from actions where TableID=?table_id? and Action='edit' and Part='footer' #print '\n' #end #print '\n' #print '\n' #end #function generate_edit dbase_id table_id #query select DatabaseName from `database` where DatabaseID=?dbase_id? #query select TableID, Subject, TableName, Title, Checks, Session, IDfield from `tables` where TableID=?table_id? #print '
\n'none' and FieldName<>'' order by `order` #print 'if ($_POST[\'' ^ FieldName ^ '\']!=\'\') {\n' #if Type='varchar' or Type='text' #print ' $' ^ FieldName ^ ' = ($_POST[\'' ^ FieldName ^ '\']);\n' #else #if Type='date' #print ' $' ^ FieldName ^ ' = date(\'j/n/Y\', strtotime($_POST[\'' ^ FieldName ^ '\']));\n' #else #print ' $' ^ FieldName ^ ' = $_POST[\'' ^ FieldName ^ '\'];\n' #end #end #print ' $_SESSION[var_' ^ FieldName ^ ']=$' ^ FieldName ^ ';\n' #print '}\n' #end #record select FieldID, `Record`, FieldName, `Type`, DisplayName, SessionVar, Help, AreaHeight, ListWidth*7 as pxwidth, ListWidth, LookupTable, OrderByField, LookupIDField, LookupDisplayField from `fields` where TableID=?table_id? and FieldName<>'' and Record<>'none' order by `order` #if Record<>'show' #if LookupTable<>'' #if pxwidth<>'0' #print 'echo (\"\");\n' #end #print '$sql->Query(\"SELECT ' #print queryvars 'T' LookupDisplayField '0' 1 ^ ', T.' ^ LookupIDField #print ' FROM `' ^ LookupTable ^'` as T' #set wcheck='' #query select Checks as wcheck from `tables` where databaseID=?dbase_id? and TableName=?LookupTable? #if wcheck<>'' #print ' \n WHERE ' ^ fieldreplace wcheck '0' #end #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[' ^ LookupIDField ^ '];\n' #set expr=fieldreplace LookupDisplayField '0' #print getvars #print ' $opzoekweergave = \"' ^ expr ^ '\";\n' #print ' echo (\"\\n\";\n' #print '} else {\n' #print ' echo \"\\n\";\n' #print '}\n' #end #end #print 'echo (\"\");\n' #end #if Type='int' or Type='date' or Type='varchar' #print 'echo(\"\");\n' #end #if Type='text' or Type='mediumtext' or Type='longtext' #print 'echo(\"\");\n' #end #end #end #end #set Code='' #query select Code from actions where TableID=?table_id? and Action='edit' and Part='complete' #if Code<>'' #print 'if ('^ Code ^') { echo \"\\n\"; }\n' #else #print 'echo \"\\n\";\n' #end #print '?>
\n' #end