Table Setup

After loading the database, the tables and views will be shown in the database pane on the left pane (database pane). Click on the [Tables] or [Views] or [Custom Views] or [Reports] node to go to the Table Setup page at any time.

Note: For simplicity, we use "table" in the following description to refer to any of database object in the project. A database object can be either a table, a view, a custom view or a report.

The Table Setup pages consists of two section. The upper section is a grid showing available options of all tables. The lower section contain two panels, the [Table-specific Options] panel and the [Master/Detail] panel for the selected table.

screen shot


Notes:

  1. For all checkbox or combobox columns, if you want to apply the setting to ALL tables or views, you can choose your setting at the [Tables] or [Views] or [Custom Views] or [Reports] row.
  2. View/Edit/Search functionality works at field level and can be setup for each field in the Field Level Setup page. Please refer to the Field Setup for details. If all fields are not selected for View/Edit/Search, the function will not be generated.

You can change the display order of the menu item by drag-and-drop. Select a table by clicking the first column - [Table/View Name] column, then drag and drop to where you want. Note that a table cannot be moved out of its parent node.

IMPORTANT NOTES:

  1. It is assumed that all tables have primary key. (Composite key is supported) If there is no primary key specified, View/Add/Copy/Delete/Edit/Update settings have no effect and will be reset to disabled when the [Generate] button is pressed. Only the List page can be generated. If you add back a primary key later, you'll need to come back to this page and re-enable them. Since reports are read-only, View/Add/Copy/Delete/Edit/Update settings are not applicable to reports.

  2. Views or Custom Views involving more than one table are usually NOT updatable. Although you can force PHPMaker to enable the Add/Copy/Delete/Edit/Update pages by specifying a primary key, the generated pages will not work if these views or Custom Views cannot be updated like regular tables.

 

The available table level settings are as follows:

General

Generate Select/unselect a particular table for generation
Caption

To change the caption of a table, click on [Caption] box to make the necessary change.

Note: Avoid special characters, you can use HTML entities instead. See Project File for more details.

Filter

Specify a filter (WHERE clause) for the table. Click the [...] button in [Filter] column, the Filter Editor will popup. Enter your filter, you can drag the field names from the left pane to the editor, the SQL identifier quote characters will also be added for you automatically.

Note: The filter must be a valid PHP string as the WHERE clause will be concatenated to the SQL string. For example, "State = 'CA'".

Sort

Specify the sort fields (ORDER BY clause) for the table. Click the [...] button in [Sort] column, the following dialog box will popup. You can choose up to 6 fields, in either ascending or descending order.

Default Set a Table as the Default Table. The Default table is the first table the user see when visiting your site. Select the table you want in the [Default] column.
Menu Item Uncheck the table in the [Menu Item] column if you don't want to show the table in the navigation menu generated by PHPMaker.

 

List
Settings for List pages:

Inline Add

Enable/disable Inline Add function for the table. Inline Add allows users to add a record within the List page. Default is disabled.

Inline Copy Enable/disable Inline Copy function for the table. Inline Copy allows users to copy a record within the List page. Default is disabled.
Inline Edit Enable/disable Inline Edit function for the table. Inline Edit allows users to edit a record within the List page. Default is disabled.
Grid-Edit

Enable/disable Grid-Edit function for table. Grid-Edit allows users to edit multiple records within the List page. Default is disabled.

Requires Search Critera

Specifies if the List page requires search criteria. Default is disabled.

Notes:

  1. If enabled, the List page always requires search criteria. When the page is initially loaded, no records will be displayed until searching is done. (Remember to enable Quick Search, including Extended Quick Search, or Advanced Search or both. See below.)

  2. If a record is added but the new record does not meet the search criteria (or there is no search criteria yet), the record will not appear in the List page. So this option is best for tables which are for browsing only.

 

View

View

If enabled, a View page for the table will be generated (for displaying a record). Default is enabled.

Note: The table must have primary key or this setting will be unchecked during generation.

 

Add
Settings for Add pages:

Add

If enabled, an Add page for the table will be generated (for adding/copying a record). Default is enabled.

Note: The table must have primary key or this setting will be unchecked during generation.

Copy

If enabled, Add page will be generated and "Copy" links will be generated for record(s) in List/View page (for copying). Default is enabled. (If this setting is enabled, the "Add" setting is also enabled by default as copying requires the Add page.)

Note: The table must have primary key or this setting will be unchecked during generation.

CAPTCHA

Enable/disable CAPTCHA function for the Add page. Default is disabled. (CAPTCHA requires that the user type the letters or digits of a distorted image before submitting a form to prevent automated software from posting spam to your PHP application.)

Notes:

  1. CAPTCHA function requires CAPTCHA extension, click Tools->Extensions from the main menu to enable. Also see Third-party Tools.
  2. CAPTCHA function is not applicable to Inline-Add/Copy.
Confirm

Enable/disable confirmation function for the Add page. Default is disabled. If enabled, there will be a confirmation step in the Add page, users will be able check their input before actually inserting the record.

Note: Confirmation function is not applicable to Inline-Add/Copy.

 

Edit

Edit

If enabled, an Edit page for the table will be generated (for updating a record). Default is enabled.

Note: The table must have primary key or this setting will be unchecked during generation.

Confirm

Enable/disable confirmation function for the Edit page. Default is disabled. If enabled, there will be a confirmation step in the Edit page, users will be able check their input before actually updating the record.

Note: Confirmation function is not applicable to Inline-Edit.

 

Delete

Delete

If enabled, a Delete page for the table will be generated (for deleting record or multiple records). Default is enabled.

Note: The table must have primary key or this setting will be unchecked during generation.

 

Multi-Update
PHPMaker 5 supports Multi-Update.

Multi-Update

If enabled, a Multi-Update page for the table will be generated (for updating multiple records). Default is disabled. With this feature you can select multiple records in the List page and update all records at the same time. You can select fields (see Field Setup page) to be included in the Multi-Update page.

Note: The table must have primary key or this setting will be unchecked during generation.

Confirm Enable/disable confirmation function for the Multi-Update page. Default is disabled. If enabled, there will be a confirmation step in the Multi-Update page, users will be able check their input before actually updating the selected records.

 

Search

Quick

If enabled, Quick Search panel (including Extended Quick Search) will be generated with the List page. Default is enabled.

Note: Quick Search searches text fields and optionally numeric fields only. These fields are selectable in Field Setup page. You may want to hide the Quick Search form for tables that do not have searchable fields.

Advanced If enabled, an Advanced Search Page will be generated and linked to the List page. Default is disabled.
Highlight

If this setting is checked, the search criteria in the search result (List page) will be highlighted. Default is disabled.

Note: The highlight style can be modified by customizing the CSS stylesheet.


Audit Trail
PHPMaker supports audit trail.

Audit Trail

If audit trail for a table is enabled, when an user add/copy/edit/delete a record or login/logout, the related information will be logged in a log file. To use this feature, you must also specify the [Audit Trail folder] under [PHP]->[General Options] tab. See PHP Setup for details.

 

Email Notification
PHPMaker supports sending notification emails. To use this feature, you must also specify the [Email Settings] under [PHP]->[Email Settings] tab. See PHP Setup for details.

On Add

If enabled, when an user add a record, an email will be send to pre-set recipient email address(es). Default is disabled.

On Edit

If enabled, when an user edit a record, an email will be send to pre-set recipient email address(es). Default is disabled.

On Delete

If enabled, when an user delete a record, an email will be send to pre-set recipient email address(es). Default is disabled.

 

Table-specific Options
There otpions are same as the list page options as described in PHP Setup except that the options are table-specific, meaning that you can have different list page options for different tables. To use table-specific options, select a table in the grid, uncheck [Use global settings] in the [Table-specific Options] panel, the panel will be enabled for you to setup.

 

Multiple Master/Detail
When you set up a master/detail relationship, you link two tables so that all the records of one table (the detail table) always correspond to the single current record in the other table (the master table). PHPMaker (5+) supports multiple master/detail, which means that each table can have multiple master tables and details tables.

You can establish master/detail (one-to-many) relationship between two tables as follows

  1. Select a table in the table grid,
  2. Then in [Master/Detail] panel at the bottom right corner of the page, click [Modify...] to bring up the visual master/detail relationship editor.
  3. Click [Add table] to add the master and detail table to the diagram.
  4. Create a relationship between them by dragging from the master field (key field in master table) to the detail field (foreign key field in the detail table). If there are more linked field, repeat the step until all the relationships are setup.

If you want to remove a relationship, select the link in the diagram and click [Delete]. After setup, click [OK] to confirm.

Note: The diagram only shows master/detail relationships of the selected table. Although you can setup relationships for other tables in the diagram and view them in the [Master/Detail] panel immediately after clicking [OK], the relationships for other tables will not be loaded again if you go to other table and then come back to this table. Instead, the relationships will only be displayed when you change to the related tables.

In most cases, master and detail tables are joined by one field, you have one link between the master/detail table and you have one row in the Master/Detail panel only.

If you want to use Detail Record Preview feature, click Tools->Extensions to enable to YUI Container extension (for registered users only).

Note: The Detail Record Preview feature is not applicable to reports (as detail table) and aggregate values (if any) for the detail records are currently not supported in the preview.

 

Also See:

Tutorial - Master/Detail

 

 


 
 ©2002-2007 e.World Technology Ltd. All rights reserved.