Worked part of the day on finalizing the db structure and getting used to the adaptive db code. Martin has abstraction in mind, which will make most of this obsolete, but until then, this is how to make the adaptive db edit your db.
You need to edit 7 files to get this working:
connect.php
has the connection info for accessing your db
enter.php
In span id="tabInstructions" make sure to create/edit the nested span ids and onclick events to reflect the tabs you want to display
Span ids need to be set, but naming is not important, however, the onclick event needs to know which tab to display, so keeping the span id name in line with the tab name is a good idea. The onclick needs to have the name of tab (an arbitrary 'alias'), which is used/named in save_rec.php, local_classes.php, get_rec.php, get_reclist.php and del_rec.php. It is also used (although only for clarity) in the div near the end of enter.php, like this: <div id="pnlGrsE2E" class="tabPanel">
In the php that begins after this:
<div id="pnlGroups" class="tabPanel">
the getRecordList function takes 3 args: tableName, number of columns to display, and number of records to display
local_classes.php is the meat and potatoes file
You can choose from several field types:
* MdhIntField: an integer field. Takes fieldName,display name and an (?) integer
* MdhStrLookupField: custom widget which displays previously entered values like a select box, but allows a new entry. Takes fieldName, display name, some always empty field, tableName, fieldName, maxLength (tie this to the actual maxlength in the DB), true/false for whether this widget is to offer sortability in the gui.
* MdhStrSelectField: select box constructor which takes fieldName, display name, some integer(?), tableName, fieldName, fieldName, true/false, true/false. The second tableName/fieldName declarations are the lookups to get actual values to display instead of ints stored in the inital table.
* MdhTextField: large text field (memo-type widget), taking fieldName, display name, empty slot(?), maxLength
* MdhStrField: regular text field (standard text field widget), taking fieldName, display name, empty slot(?), maxLength
* MdhLatLongField: a special field for latitude and longitude. This has a special javascript validator to determine if it's a legal lat/lon
get_rec.php, del_rec.php, save_rec.php
All contain a switch with tableNames and 'aliases'. You need to add a new case for each table in use.
get_reclist.php
Contains a switch using tableNames, fieldNames and 'aliases'. Edit the orderByField to change sorting behaviour. Add a new case for each panel you need to add.