#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 '\";\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 ' ' #print '' ^ Title ^ ' rechten\n' #print ' \n' #print ' | \n'
#print ' |
\n' #print ' \n' #print ' ' ^ DisplayName ^'\n' #print ' \n' #print ' | \n' #print '\n' #print field_rights_link FieldID 'readonly' #print field_rights_link FieldID 'hide' #print ' | \n' #end #if Help<>'' #print ' \n' #end #print ' \n' #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' #end