PHPMaker_12

October 6, 2017 | Author: kaolo | Category: Web Server, Php, Microsoft Access, Oracle Database, Internet Information Services
Share Embed Donate


Short Description

PHPMaker 12 Manual...

Description

PHPMaker 12 Help

PHPMaker 12 Help

Table of Contents 1. PHPMaker 12 ............................................................................................................................ 3 1.1 What's New in PHPMaker 12 .............................................................................................. 3 1.2 System Requirements ....................................................................................................... 14 1.3 Installation and Uninstallation .......................................................................................... 15 1.4 License and Ordering Information .................................................................................... 16 1.5 Technical Support ............................................................................................................. 16 1.6 Disclaimer of Warranty ..................................................................................................... 17 1.7 Third-party Tools ............................................................................................................... 17 1.8 Introduction to PHP and MySQL ....................................................................................... 19 1.9 Quick Start......................................................................................................................... 28 1.10 Project Setup................................................................................................................... 31 1.10.1 Database Setup ........................................................................................................ 31 1.10.2 PHP Settings ............................................................................................................. 38 1.10.3 HTML Settings .......................................................................................................... 48 1.10.4 Security Settings....................................................................................................... 52 1.10.5 Generate Settings .................................................................................................... 63 1.10.6 Table Setup .............................................................................................................. 66 1.10.7 Field Setup ............................................................................................................... 80 1.10.8 Lookup Table .......................................................................................................... 111 1.10.9 Server Events and Client Scripts ............................................................................ 120 1.10.10 Custom Templates ............................................................................................... 163 1.10.11 Using Custom View .............................................................................................. 171 1.10.12 Using Report ........................................................................................................ 176 1.10.13 Custom Files ......................................................................................................... 181 1.10.14 Custom Fields ....................................................................................................... 186 1.10.15 Linked Tables ....................................................................................................... 188 1.10.16 Multi-Language Project ........................................................................................ 193 1.11 Application Root ........................................................................................................... 198 1.12 Project File .................................................................................................................... 201 1.13 Tools .............................................................................................................................. 202 1.14 Customizing Template .................................................................................................. 223 1.14.1 Control File ............................................................................................................. 227

1

PHPMaker 12 Help 1.14.2 System Functions ................................................................................................... 231 1.14.3 Template Object Properties ................................................................................... 246 1.14.4 Using User Code ..................................................................................................... 268 1.14.5 Template Tags ........................................................................................................ 271 1.15 Tutorials ........................................................................................................................ 273 1.15.1 Connecting Remote MySQL using PHPMaker Connection Script .......................... 274 1.15.2 Master/Detail ......................................................................................................... 276 1.15.3 File Upload to Database ......................................................................................... 286 1.15.4 File Upload to Folder.............................................................................................. 291 1.15.5 Dynamic Selection List ........................................................................................... 296 1.15.6 Field Aggregation ................................................................................................... 299 1.15.7 User Registration System ....................................................................................... 301 1.15.8 Inline Add, Inline Copy, Inline Edit, Grid-Add and Grid-Edit .................................. 307 1.15.9 Advanced Security - User ID Security ..................................................................... 311 1.15.10 Advanced Security - Static User Level Security .................................................... 316 1.15.11 Advanced Security - Dynamic User Level Security ............................................... 323 1.15.12 Custom View ........................................................................................................ 331 1.15.13 Report .................................................................................................................. 337 1.15.14 Integrating with PHP Report Maker Project ........................................................ 343

2

PHPMaker 12 Help

1. PHPMaker 12

PHPMaker is a powerful automation tool that can generate a full set of PHP quickly from MySQL, PostgreSQL, Microsoft Access, Microsoft SQL Server and Oracle databases. Using PHPMaker, you can instantly create web sites that allow users to view, edit, search, add and delete records on the web. PHPMaker is designed for high flexibility, numerous options enable you to generate PHP applications that best suits your needs. The generated codes are clean, straightforward and easy-to-customize. The PHP scripts can be run on Windows servers (MySQL/PostgreSQL/Access/MSSQL/Oracle) or Linux/Unix servers (MySQL/PostgreSQL/Oracle). PHPMaker can save you tons of time and is suitable for both beginners and experienced develpers alike.

Also See: What's New in PHPMaker 12(See 1.1) License and ordering(See 1.4)

1.1 What's New in PHPMaker 12 PHPMaker 12 is a major upgrade from 11.x. It is loaded with a bunch of new features, including many frequently requested ones. PHPMaker is probably the most powerful and flexible product of its kind, and yet still easy-to-use as always.

Linked Tables from Multiple Databases Now you can add Linked Tables from other databases of different database type

3

PHPMaker 12 Help

Custom Fields Add custom fields to a table or view with SQL expression.

4

PHPMaker 12 Help

Optional Tabular Form for Desktop Mode Option to use Bootstrap table instead of Bootstrap horizontal form for Add/Edit/Search/Update/Register pages (Desktop mode only)

Tabular form

5

PHPMaker 12 Help

Horizontal form

Dropdown Selection Lists Show the options in dropdown panel (supports SELECT, RADIO and CHECKBOX) with minwidth and max-height settings.

Multi-column Radio button list

Multi-column Checkbox list

6

PHPMaker 12 Help

Selection list (select-one) / Single column radio button list

Selection list (select-multiple) / Single column checkbox list

Option Template for Dropdown Selection Lists Show options in HTML with JsRender template.

7

PHPMaker 12 Help

Improved AutoSuggest Support Option Template, min-width and max-height settings.

Session Keep Alive and Session Timeout Keeps session alive by Ajax or show session timeout countdown to remind users.

8

PHPMaker 12 Help

Anonymous User Level Anonymous User becomes a built-in dynamic User Levels so administrators can setup permissions at runtime.

New Actions to Manage User Profile (for Administrators) Administrator can now easily do the following tasks in the List page of the User table.

Password Generator and Password Strength Meter

9

PHPMaker 12 Help Improved Multi-Page Options: (To be set up by Client Script)

      

Enable submit button for the last page only Hide disabled submit button Hide inactive pages Set inactive tabs as disabled (for tabs and pills only) Hide tabs (for tabs and pills only) Show pager (Prev/Next buttons) at top and/or bottom Pager template (HTML template of the Prev/Next buttons)

Simplified Client Side Events and "fields" jQuery Plugin Add client side events easily and manipulate/validate the fields quickly with PHPMaker's "fields" jQuery plugin.

Multi-Update of Field Settings

10

PHPMaker 12 Help Set multiple properties of multiple fields at one time.

Import/Export of Theme Settings

Import/Export Feature of Multi-Language Property Editor

Dynamic Selection Lists in Master/Detail-Add/Edit

11

PHPMaker 12 Help

Local Storage of Search Criteria Saves search criteria in browser local storage.

Cancel Button for Add/Edit/Delete/Update Pages Cancel button with confirmation dialog if form data has been modified.

12

PHPMaker 12 Help

New Language Selection Buttons Use button group with tooltip.

More Server Events

 

Language_Load - For customizing the language phrases, fired after the language file is loaded. AuditTrail_Inserting - For customizing the data to be logged, fired before inserting the audit trail log.

More Advanced Settings

      

Format project file - Add indentation to XML nodes in the project file Allow login by session variables - For use with User_CustomValidate server event Session timeout period (minutes) - Specifies the session time-out period if the user does not refresh or request a page Session keep alive interval (seconds) - Specifies the interval to send Ajax request to the server for keeping the session alive Session time out countdown period (seconds) - Specifies the countdown period before session ends Use ADOdb driver for MySQL - Use the full ADOdb driver for MySQL instead of the lite version (ewmysql.php) Encrypt file path - Encrypt the file path of uploaded files in URL

13

PHPMaker 12 Help        

Reduce image size only (image resize) - Specifies if enlarging image is preferred (Migrated from previous Image Resize extension) Always keep aspect ratio (image resize) - Specifies if aspect ratio should be kept (Migrated from previous Image Resize extension) Check password strength - Specifies if the strength of inputted password for password fields should be checked Minimum password strength - Specifies the minimum acceptable password strength Generate password - Specifies if a random password generation button should be added to password field Password length - The length of the password to be generated Add plain text version in HTML email - Specifies if text version of email content is required Use tabular form for desktop - Use Boostrap table instead of Bootstrap horizontal form for Add/Edit/Search/Update/Register pages (Desktop mode only)

More

                      

Use mysqli extension by default Image Resize functionality (does not require Image Resize extension anymore) Multi-Language support for email template Lookup always by ajax ("Use Ajax" setting removed) Improved Custom Actions DetailPages property for showing and hiding detail table tabs by server event Password change by user (for md5 password) as password recovery Support Custom Attributes as PHP array SelectLimit() support for MSSQL >= 2005 Global array for passing server side values to client side "addoption" and "newoption" client side event for lookup fields (supports both lookup fields with lookup table or user values) JavaScript alerts replaced by Modal dialog jQuery, JsRender, jQuery File Upload updated tinyMCE and CKEditor extensions (for registered users only) updated with latest versions Multi-Language support for reCAPTCHA, JsCalendar, tinyMCE and CKEditor QRCode/BarCode Custom View Tags combined (Flash Files Custom View Tag removed) A new built-in "plain" theme UTF-8 output files if project charset is utf-8 PHPMailer updated Setting PHPMailer properties in Email_Sending server event mobile_detect.php updated and mobile-detect.js adopted Bootstrap 3.3.5 Many other minor improvements

1.2 System Requirements PHPMaker



Windows Vista/2008/2012/7/8

PHPMaker requires the following system files. If you do not have latest version of these files, you may experience ActiveX errors. To update your system, go the Microsoft download pages listed below.



Service Pack 6 for Visual Basic 6.0: Run-Time Redistribution Pack (vbrun60sp6.exe)

14

PHPMaker 12 Help  

MSXML Parser 3.0 IIS Express (only required if you want to use IIS Express as testing web server)

If you use Microsoft Access, SQL Server or Oracle, PHPMaker requires the following database drivers to connect to the database:

     

Microsoft Data Access Components (MDAC) 2.8 (for Microsoft Access, SQL Server and Oracle) Microsoft Jet 4.0 Service Pack 8 (SP8) (for Microsoft Access = 5.3

Browser



IE 9+, Chrome/Firefox/Safari/Opera (current stable version and the version that preceded it).

1.3 Installation and Uninstallation Before you install PHPMaker, you must log in Windows as an user with administrative privileges. Important

PHPMaker 12 can co-exist with previous version of PHPMaker. You do NOT need to uninstall previous version of PHPMaker if you don't want to. Double-click on the downloaded installer to start the installation process. Follow the prompts and change the settings whenever necessary. To uninstall PHPMaker, go to [Control Panel]. Click [Add/Remove Programs] and select [PHPMaker 12].

Note for Windows Vista/2008/2012/7/8 users: In Windows Vista/2008/2012/7/8, User Account Control (UAC) is enabled by default, members of the administrators group do NOT have full administrator privileges. When you install (by double-clicking the installer or right-clicking the installer and choose Run as administrator), an User Account Control prompt may be displayed and ask you if you allow the program to make changes to your computer, click Yes to let the installer run elevated. If you still cannot install successfully, log in Windows as the built-in administrator account to install. The built-in administrator account is disabled by default, you may need to enable the built-in administrator account first:

15

PHPMaker 12 Help 1. Login as administrator. Open a command prompt (under All Programs -> Accessories) in administrator mode by right-clicking and choosing Run as administrator, 2. Type the command: net user administrator /active:yes. You should see: "The command completed successfully." 3. Log out. You'll now see the Administrator account show up on the login screen. Log in as the built-in administrator and install again. After successful installation, if you want to disable the built-in administrator account. Logout and re-login as your regular user account, and then open an administrator mode command prompt as above. Type the command: net user administrator /active:no. The administrator account will now be disabled, and should not show up on the login screen anymore.

1.4 License and Ordering Information PHPMaker is not a free software. You are permitted to use this program for a period of 30 days. Continued use after that will require payment of the registration fee. Benefits for registered users

    

Free upgrades of all minor versions for 12 months Free email support for 6 months Email notifications of upgrades Access to registered user site Additional extensions (if any)

After receiving your license key, register by clicking [Help]->[Register]. To register the program in Windows Vista/2008/2012/7/8 (or later), you need administrative privileges and you may need to start the program by right clicking the program file (.exe file) in the installed folder or its shortcut on the desktop and choose Run as administrator. For more info on User Account Control (UAC), read: http://support.microsoft.com/kb/922708 Note

Registration can be done as follows: Credit Card Payment http://www.hkvstore.com/phpmaker/purchase.asp Mail order or Wire Transfer Hong Kong Dollars Cheque or Money Order (List price), OR International Bank Cheque or International Money Order or Wire Transfer or other payment method (List price plus 25%) Please contact [email protected] for information about our bank account.

1.5 Technical Support Registered users are entitled to 6 months free email support. Send your technical support request to [email protected]. Your email message should include the following information:

16

PHPMaker 12 Help 1. Is the problem reproducible? If so, provide the steps to reproduce it? 2. What version of Windows is your PC running? 3. What version of PHPMaker are you running? (Click [Help] and then [About...] to check) 4. What database and what version are you using? 5. What OS is the server running? Windows or Linux? What version of PHP is running? (Note that PHP 4 is not supported.) 6. If any error message was displayed, please include the full text of error message. If not, describe the problem in detail. 7. Your project file (.pmp file) and your database (.sql file) with enough data for reproducing the problem. 8. Your license information. Emails without license information will be ignored. While we are happy to support your usage of our software, please note that technical support does NOT entail customization of templates, extensions or generated code, writing server events or client scripts (JavaScripts) or custom template, integrating third-party code, setting up web server, or any other issues not directly related to the workings of the software. Request for debugging or modifying code not generated from the original template will be ignored. Note

1.6 Disclaimer of Warranty PHPMaker is supplied "AS IS". The authors disclaim all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The authors assume no liability for damages, direct or consequential, which may result from the use of PHPMaker. Please note this program is Shareware. It is not Freeware. You are permitted to try the program for a maximum of 30 days. Continued use will require payment of the registration fee. Please refer to the License and Ordering(See 1.4) Section for details.

1.7 Third-party Tools All the following tools are not developed by the author of PHPMaker and are not part of PHPMaker, NO TECHNICAL SUPPORT WILL BE PROVIDED. Note

PHPMaker uses the following third-party tools in template/extensions: CKeditor Website: http://ckeditor.com CKEditor is distributed under the MPL Open Source license. If IE, requires IE >= 9. JSCalandar Website: http://www.dynarch.com/projects/calendar/old This program is available under the terms of the GNU Lesser General Public License version 2.1 or above. PHPMailer Website: http://phpmailer.sourceforge.net This program is available under the terms of the GNU Lesser General Public License version 2.1 or above. DOMPDF Website: http://code.google.com/p/dompdf DOMPDF is available under the terms of the LGPL License. Requires MBString and DOM extensions.

17

PHPMaker 12 Help This extension is EXPERIMENTAL only. There are some known issues of DOMPDF, please read the developer website for more information. Known issues includes (but now limited to): Warning

  

not particularly tolerant to poorly-formed HTML input large files can take a while to render use a lot of memory

jQuery Website: http://jquery.com/ jQuery is released under MIT License. JsRender Website: https://github.com/BorisMoore/jsrender JsRender is released under MIT License. Bootstrap Website: http://getbootstrap.com/ Bootstrap is licensed under Apache License v2.0. Barcode and QRCode Website: http://www.phpclasses.org/package/2441-PHP-Generate-barcode-graphs-usingdifferent-standards.html The class is distributed for free without warranty. PHP Thumb Website: https://github.com/masterexploder/PHPThumb PHP Thumb is distributed under the MIT License. Supports GIF, JPEG and PNG images only. Requires PHP GD2 extension. pGenerator and pStrength Website: https://github.com/M1Sh0u/pGenerator and https://github.com/M1Sh0u/pStrength/blob/master/pStrength.jquery.js Both are released under the MIT License.

Additional extensions: (for registered users only) Additional extensions are provided for registered users as examples of customzing and extending template only, NO TECHNICAL SUPPORT WILL BE PROVIDED. Registered users will be provided information to download the extensions. These tools will NOT automatically work with PHPMaker without the extensions. Note

Horizontal Menu Replaces the graphical extension for previous versions. Uses Bootstrap Navbar as horizontal menu. FCKeditor File Manager (for CKEditor) FCKeditor is the previous version of CKEditor and has been discontinued after version 2. FCKeditor extension had been dropped by PHPMaker. This extension only applies the free File Manager from FCKeditor to CKEditor (so the commerical product CKFinder is not required), based on http://www.mixedwaves.com/2010/02/integrating-fckeditorfilemanager-in-ckeditor/. FCKeditor Website: http://sourceforge.net/projects/fckeditor/ FCKeditor is distributed under the LGPL Open Source license.

18

PHPMaker 12 Help TinyMCE Website: http://tinymce.moxiecode.com TinyMCE is distributed under the LGPL Open Source license. If IE, requires IE >= 9. Time Picker Website: http://jonthornton.github.io/jquery-timepicker/ Timepicker Plugin for jQuery is made available under the open source MIT License. PHPExcel Website: http://phpexcel.codeplex.com This program is available under the terms of the GNU Lesser General Public License version 2.1 or above. Requires PHP version 5.2.0 or higher, PHP extension php_zip enabled (for Excel2007 format), PHP extension php_xml enabled and PHP extension php_gd2 enabled (if not compiled in). PHPWord Website: http://phpword.codeplex.com This program is available under the terms of the GNU Lesser General Public License version 2.1 or above. Requires PHP version 5.2.0 or higher, PHP extension php_zip enabled, PHP extension php_xml enabled and PHP extension php_gd2 enabled (if not compiled in). Detail Preview Allow previewing detail records in an expanded row of the main table in List page, and/or in a popup overlay by Bootstrap Popover. Scrollable Table Scrolling table example. Enable X/Y scrolling of the main table in the List page. If IE, requires IE >= 9. CAPTCHA Generates CAPTCHA image. Requires PHP GD extension with GD2. Also support reCAPTCHA (https://developers.google.com/recaptcha/). reCAPTCHA is OPTIONAL. If you choose to use reCAPTCHA, note that reCAPTCHA is a Web service, meaning that the CAPTCHA images are served directly from reCAPTCHA's servers to the end users, the end users need to be online. To use the service, you must register at the reCAPTCHA Web site and obtain public and private keys.

1.8 Introduction to PHP and MySQL What is PHP? PHP is a widely-used general-purpose server-side scripting language that can be embedded into HTML. You can think of it as a "plug-in" for your Web server that will allow it to do more than just send plain Web pages when browsers request them. With PHP installed, your Web server will be able to read a new kind of file (called a PHP script) that can do things like retrieve up-to-the-minute information from a database and insert it into a Web page before sending it to the browser that requested it. PHP is completely free to download and use. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. PHP Home Page Manual Download

What is MySQL?

19

PHPMaker 12 Help MySQL is a relational database management system, or RDBMS. It has become the world's most popular open source database because of its consistent fast performance, high reliability and ease of use. PHP has MySQL extension which makes it really easy to access data in MySQL. MySQL Home Page Manual Download

Useful MySQL Database Administration Tools phpMyAdmin (freeware)

Installing PHP and MySQL on Windows Both PHP and MySQL support various platforms, including Windows. It is recommended that you install MySQL and PHP on your computer so you can easily develop and test your PHP locally before uploading to your production server. If you use Internet Information Services (IIS), you can install PHP on your Windows system PHP for Windows installer which installs PHP for IIS, it configures the web server as well. Alternatively, you can use Microsoft Web Platform Installer, see http://php.iis.net/. If you do not have IIS, you can use other Web server such as Apache. If you have difficulties installing PHP and MySQL, you might as well try EasyPHP which is an "out of the box" Apache, MySQL, and PHP installation for Windows. For PHP 5, MySQL is not enabled by default, so the php_mysql.dll (or php_mysqli.dll) DLL must be enabled in php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. The next step is to set up a valid configuration file for PHP, the php.ini. PHP searches for php.ini in the locations described in The configuration file. If you're using NTFS on Windows, make sure that the user running the web server has read permissions to your php.ini (e.g. make it readable by Everyone). Note

Some Important Settings in php.ini for Using PHP on Windows extension_dir - In what directory PHP should look for dynamically loadable extensions. It should be set to the folder where your extensions are installed, e.g. extension_dir="C:\Program Files (x86)\PHP\ext" session.save_path - This is the path where session data files are stored. Make sure this setting points to an existing folder on your machine, e.g. session.save_path="C:\Windows\Temp" If you're using NTFS on Windows, make sure that the user running the web server has write permissions to this folder (e.g. make it readable and writable by Everyone). See the section Configuring Permissions below. Note

upload_tmp_dir - If you want to use file upload, make sure this setting points to an existing folder on your machine, e.g. upload_tmp_dir="C:\Windows\Temp"

20

PHPMaker 12 Help If you're using NTFS on Windows, make sure that the user running the web server has write permissions to this folder (e.g. make it readable and writable by Everyone). See the section Configuring Permissions below. Note

php_com_dotnet.dll - If you use MS Access or MS SQL Server (on Windows server), the COM extension is required. As of PHP 5.3.15 / 5.4.5, the COM extension requires php_com_dotnet.dll to be enabled inside of php.ini, i.e. extension=php_com_dotnet.dll Also make sure you have installed the php_com_dotnet.dll in the extension folder (extension_dir) specified in php.ini. Note

Internet Information Services (IIS) IIS 7.x or later is included with Windows Vista/2008/2012/7/8/10 and is installed via Programs->Turn on or off Windows features in the Control Panel. Read: http://www.iis.net/learn/install/installing-iis-7/installing-iis-on-windows-vista-and-windows7

Creating Virtual Directories in IIS 7 (Windows Vista or Later)

The IIS manager user interface consists of three panes.

The left hand side pane is Connections, the middle pane is Workspace and the right hand side pane is Actions. The Connections pane lists application pools and websites. The workspace pane consists of two tabs at the bottom namely Features View and Content View. The Features View allows you to work with the settings of the selected item from Connections pane whereas the Content View displays all the child nodes (content) of the selected item.

21

PHPMaker 12 Help Application pool is a group of IIS applications that are isolated from other application pools. Each application pool runs in its own worker process. Any problem with that process affects the applications residing in it and not the rest of the applications. You can configure application pools individually. In order to create a new application pool, select "Application Pools" under Connections pane. Then click on "Add application pool" from Actions pane. This will open a dialog as shown below:

Specify a name for the new pool to be created. Select .NET framework version that all the applications from the pool will use. Also select pipeline mode. There are two pipeline modes viz. integrated and classic. The integrated mode uses the integrated request processing model whereas the classic mode uses the older request processing model. Click OK to create the application pool. Your new application pool will now be displayed in the Workspace pane. To configure the application pool click on the "Advanced Settings" option under Actions pane. The following figure shows many of the configurable properties of an application pool.

22

PHPMaker 12 Help

If you use 64-bit Windows, set Enable 32-Bit Applications to True. (See Running on 64bit Windows Operating System below.) To create a new web site, select Web Sites node under Connections pane and then click on "Add Web Site" under Actions pane. This opens a dialog as shown below:

23

PHPMaker 12 Help

Here, you can specify properties of the new web site including its application pool and physical location. Creating an IIS application or a Virtual Directory is quick and simple. Just right click on the web site and choose either "Add Application" or "Add Virtual Directory" to open respective dialogs (see below).

24

PHPMaker 12 Help

An existing Virtual directory can be marked as an IIS application by right clicking on it and selecting "Convert to Application". If you use IE, you may encounter the following error messages when you run PHP pages with IIS 7: An error occurred on the server when processing the URL. Please contact the system administrator. Go to Internet Options -> Advanced, disable Show friendly HTTP error messages.

25

PHPMaker 12 Help

Configuring Permissions An important aspect of working with file upload to a folder on the Web server is to correctly configure permissions. When a Web application uses a file, the application must have Read permission to the file so the application can access the data. Additionally, the application must have Write permission to the folder that contains the file. Write permission is required because the file may be created at run time. If you use Linux/Unix, CHMOD your upload folder to "777" by using your FTP software. To use an Access database in an PHP Web application, you must configure the folder that contains the Access database to have both Read and Write permissions for the IIS user account. The default anonymous IIS user depends on IIS version. In IIS 5, it is IUSR_. In IIS 6 and IIS 7 it can be NETWORKSERVICE or IUSR. In IIS 7.5 it depends on Application Pool, read Application Pool Identities for detail. To set permissions in the folder (if you're using NTFS on Windows),

26

PHPMaker 12 Help 1. In Windows Explorer, move to the root folder for the Web site. e.g. C:\Inetpub\wwwroot\ExampleSite. 2. If the folder does not already exist, create one. 3. Right-click the folder, click Properties, and then click the Security tab.

4. Under Group or user names, look for or add the user. 5. Verify that the account has Read and Write permissions for the folder. Similarly, set permissions in the folder where the audit trail log file reside.

Running on 64-bit Windows Operating System

Windows Server 2008 or Windows 7 64-bit (IIS 7.x) On 64-bit Windows 2008/7, IIS 7.x can run both 32-bit and 64-bit worker processes simultaneously. To run 32-bit Web applications in IIS 7.x on 64-bit Windows all it needs is to assign the 32-bit applications to a separate application pool in IIS and turn on the Enable 32-Bit Applications switch for that application pool. To do this, open IIS Manager, open Application Pool, select the application pool, and then click Advanced Settings. In Enable 32-Bit Applications, select True.

27

PHPMaker 12 Help

1.9 Quick Start PHPMaker connects to your database, extracts tables and fields information, and generates PHP scripts instantly based on these information. For each table, it will generate a list page, add/copy page, view page, edit page, delete page and search page all linked up properly. To generate scripts, you just need to follow the tabs and setup the options, that is: [Database] > [PHP] > [HTML] > [Security] > [Generate] However, if you are a first time user, we recommend you to generate a basic PHP application and get to know how PHPMaker and PHP works first. If you have not used PHP before, it is recommended that you read Introduction to PHP and MySQL(See 1.8) first. Note

To generate your first PHP project, you can skip the options and use default settings first. In other words, you skip the intermediate steps and go directly to the [Generate] tab after connecting to your data source, that is: [Database] > [Generate] You can generate the web site quickly by the following steps: 1. Start up PHPMaker. There are two connection methods to connect to your MySQL server DIRECT or URL. As explained in Introduction to PHP and MySQL(See 1.8), it is recommended that you have a local MySQL server during development. You usually connect to MySQL by the DIRECT method, the URL method is only used when you want to conenct to a remote MySQL server which does not allow direct connection. (See Tutorial - Connecting Remote MySQL using PHPMaker Connection Script(See 1.15.1).) 2. In this example, we use direct connection. Enter connection details for the MySQL Server .

28

PHPMaker 12 Help

3. Click the [Connect] button to load the database information. Tables and fields information will be loaded and displayed on the left hand side.

4. Click the [Generate] tab and select the follows: Template file - The zipped file that contains the template of the generated pages. Just use the default template is shipped with PHPMaker. Application root folder - The root folder of your PHP application. (See Application Root(See 1.11)) Destination folder - The folder that the generated scripts will reside. This can be same as the application root folder or a subfolder under the application root folder. In this case, we use the same folder for simplicity.

29

PHPMaker 12 Help

To run PHP you need to setup a website or virtual directory (See Introduction to PHP and MySQL (See 1.8)). If you are not familiar with web server, you can install IIS Express which can be downloaded from Microsoft website. Then select [IIS Express] and [Browse after generation] in PHPMaker. 5. Click the [Generate] button, the generation process will begin. After the web site is generated successfully, a completion message will be displayed. The web site should then be ready to run. If [Browse after generation] is enabled, PHPMaker will open your browser, and - voila! - you'll see PHP displaying the data in your first PHP website.

30

PHPMaker 12 Help After understanding how it works, you can then take advantages of various other options provided by PHPMaker and setup your project more precisely. See Project Setup(See 1.10) for full details.

1.10 Project Setup To make use of the various features of PHPMaker and create scripts that best suit your Web sites, read the following information and get to know the options PHPMaker provide. It is assumed that you have basic knowledges of HTML and PHP and the technical terms are used without further explanation. To generate a Web site, please perform the following steps: 1. 2. 3. 4. 5.

Database(See 1.10.1) PHP(See 1.10.2) HTML(See 1.10.3) Security(See 1.10.4) Generate(See 1.10.5)

To further control the functionality of the generated scripts, you can setup different options for each table/field:

 

Table Setup(See 1.10.6) Field Setup(See 1.10.7)

You can also setup additional database objects for your project in PHPMaker:

   

Custom View(See 1.10.11) Report(See 1.10.12) Custom File(See 1.10.13) Linked Table(See 1.10.15)

1.10.1 Database Setup If you are not at the [Database] tab yet, clicking the icon in the toolbar to go to [Database] tab. PHPMaker can connect to MySQL, PostgresSQL, Microsoft Access, Microsoft SQL Server and Oracle. 1. MySQL Select MySQL as database type.

31

PHPMaker 12 Help

There are 2 connection methods you can choose: Direct Connection (default) 1. Enter your database host/server name (or IP address), username, password and port number (default is 3306 for MySQL), 2. Select your database, 3. Select the SQL Identifier Quote Character, default is backquote (`) for MySQL, 4. Click the [Connect] button to load the database information. The server name or IP should be valid on your production Web server also. Otherwise you'll need to modify the generated connection info in ewcfg*.php before you upload it to your production server. For example, if you have a testing MySQL Server installed on the same computer, you can use "localhost" as server name when you connect to it with PHPMaker. The generated scripts will then try to connect to a MySQL Server on the same computer as the production Web server, if this is not the case, the connection will fail. URL Connection (for remote database) Note

(Also see Tutorial - Connecting Remote MySQL using PHPMaker Connection Script(See 1.15.1)) While the direct connection method is quick and easy, some remote MySQL server may not allow direct connection. PHPMaker provides an alternative simple way to connect remote servers: 1. Upload the PHP connection script provided by PHPMaker to your site. Note that: a. b.

The script is named "phpmaker.php" and can be found under your installed folder, usually C:\PHPMaker, Always use the script shipped with your version of PHPMaker. PHPMaker may not work with script shipped with previous versions.

2. If it is the first time that you use this script, you may want to test the script with your browser:

32

PHPMaker 12 Help a.

Browse to this script with your browser,

b.

Enter the connection info,

c.

Click "Get Database List" and then "View Schema", you should be able to view the schema of your database in XML properly. Now go back to PHPMaker.

3. Enter the SAME connection information, select URL for connection method, enter the URL of the script (e.g. http://servername/path/phpmaker.php), you can test the URL by clicking the [Test] button,

4. Click the [Connect] button to load the database information. PHPMaker will connect to the database server through the PHP script over HTTP.

33

PHPMaker 12 Help

2. PostgreSQL Select PostgreSQL as database type.

There are 2 connection methods you can choose: Direct Connection (default) 1. Enter your database host/server name (or IP address), username, password and port number (default is 5432 for PostgreSQL), 2. Select your database, 3. Select the SQL Identifier Quote Character, default is double quote (") for PostgreSQL, 4. Click the [Connect] button to load the database information. The server name or IP should be valid on your production Web server also. Otherwise you'll need to modify the generated connection info in ewcfg*.php before you upload it to your production server. For example, if you have a testing PostgreSQL Server installed on the same computer, you can use "localhost" as server name when you connect to it with PHPMaker. The generated scripts will then try to connect to a PostgreSQL Server on the same computer as the production Web server, if this is not the case, the connection will fail. URL Connection (for remote database) Note

Similar to above for MySQL.

3. Microsoft Access (Windows only) If you use Microsoft Access database, you need to have OLEDB drivers installed on both the PC running PHPMaker and on the web server. See System Requirements(See 1.2). (ODBC connection is not supported.) Note

34

PHPMaker 12 Help   

Select Microsoft Access as database type,



Click the

Select the Microsoft Access database file by clicking the button, Specify the database path where the database file will reside under the your application root, Connect button to load the database information.

Notes

1. Database path is relative to application root. Use slashes "/" as path delimiter, no leading slash. e.g. If the application root of your website is C:\Inetpub\wwwroot\demo and you enter "data/" in this textbox, the folder for the database will be C:\Inetpub\wwwroot\demo\data. If you are not sure which folder is application root, please read Creating Virtual Directories in IIS(See 1.8). 2. PHP COM extension is required on the web server. As of PHP 5.3.15 / 5.4.5, the COM extension requires php_com_dotnet.dll to be enabled inside of php.ini in order to use these functions. Previous versions of PHP enabled this extension by default. Read http://php.net/manual/en/book.com.php.

4. Microsoft SQL Server (Windows only) Notes

1. If you use SQL Server 2000/2005/2008/2012 and have installed SQL Server 2012 Native Client on your computer, then Microsoft SQL Server and Microsoft SQL Server 2005/2008/2012 database type will be available for selection. You can use this database type for connection to SQL Server 2000, 2005, 2008 or 2012. You can download SQL Server 2012 Native Client from the Microsoft website. See System Requirements(See 1.2). The native client must also be installed on the web server. (ODBC connection is not supported.) 2. PHPMaker connects to the SQL Server by TCP/IP (NOT Windows authentication), make sure TCP/IP protocols is enabled for your SQL server, you can use SQL Server Configuration Manager to check and configure. 3. If the SQL Server is a remote server (not on the same machine as PHPMaker), make sure your SQL Server allows remote connection, you can use SQL Server Management Studio to check and configure.

35

PHPMaker 12 Help 4. If you have firewall enabled on the server, make sure it allows inbound traffic on port 1433 for TCP/IP. If the SQL Server uses another port number, make sure you have set up the firewall rules accordingly.

    

Select Microsoft SQL Server (or Microsoft SQL Server 2005/2008/2012 if you use SQL Server 2005/2008/2012 or later) as database type, Enter the name or IP of the SQL server, Enter the User ID and Password, Select the database you want or just enter the name of your database, Click the

Connect button to load the database information.

Notes

1. If Microsoft SQL Server 2005/2008/2012, make sure the server name includes the instance name, e.g. localhost/SQLEXPRESS. 2. The server name or IP should be valid on your production Web server also. Otherwise you'll need to modify the generated connection string in ewcfg*.php before you upload it to your production server. For example, if you have a testing SQL Server installed on the same computer, you can use "(local)" as server name when you connect to it with PHPMaker. The generated scripts will then try to connect to a SQL Server on the same computer as the production Web server, if this is not the case on the server, the connection will fail. It is common that SQL Server is installed on a different server in production environment. 3. PHP COM extension is required on the web server. As of PHP 5.3.15 / 5.4.5, the COM extension requires php_com_dotnet.dll to be enabled inside of php.ini in order to use these functions. Previous versions of PHP enabled this extension by default. Read http://php.net/manual/en/book.com.php.

5. Oracle

36

PHPMaker 12 Help If you have installed Oracle client on your computer, this database type will be available for selection. You can download Oracle client from the Oracle website. Make sure the path of your Oracle client (e.g. oci.dll) is among the Path variable under Windows Environment Variables -> System variable. Note

    

Select Oracle as database type, Enter the Oracle Service name, Enter the User ID and Password, Select the Schema you want or just enter the Schema name, Click the

Connect button to load the database information.

The service name should be valid on your production Web server also. Otherwise you'll need to modify the generated connection info in ewcfg*.php before you upload it to your production server. The service name must be set to the appropriate Net8 name which is known to the naming method in use. For example, for Local Naming, it is the alias in the tnsnames.ora file; for Oracle Names, it is the Net8 Service Name. Note

Load from PMP Project File If you previously saved your project file (.pmp file), you can load it back by clicking the open button on the tool bar (or select "Project", "Open" from the menu bar). At completion, the tables and fields information will be loaded and displayed on the left pane.

37

PHPMaker 12 Help

The database pane is dockable. If you prefer to display the database pane on the right hand side, simply drag it to the right side. Dynamic Table Loading By default all tables in the database are loaded. It is convenient but loading and sychronization could be slow if your database contains a large number of tables or fields. If this option is enabled, a table will only be loaded when you select it in the database pane. If you just use a few tables out of a large database, this feature enables you to work much faster than before. To enable this feature, simply check [Load tables dynamically] BEFORE pressing the [Connect] button.

1.10.2 PHP Settings General Options

38

PHPMaker 12 Help

Add shell call

(For Unix-based server only) If you put the PHP parser binary somewhere outside of the web tree of files, for example, in /usr/local/bin, you will have to put a line similar to: #!/usr/local/bin/php as the first line of any file containing PHP tags. (You will also need to make the file executable.)

Set locale

Set locale information. PHPMaker uses localeconv() which returns data based upon the current locale as set by setlocale(). Different systems have different naming schemes for locales. If you do not know the correct locale string on your server or you want to override system locale and use your own locale settings, click the [...] button and enter your locale settings.

39

PHPMaker 12 Help

Refer to localeconv() for the definition of the settings. If you use Multi-Language (see below), DO NOT use this setting unless all languages share the same locale settings. Each language has its own locale settings and you should specify locale settings for each language in the respective language file. (See Customizing Template(See 1.14)) Note

Default Date Format

The default date format for the scripts. Possible values are: yyyy/mm/dd, mm/dd/yyyy, dd/mm/yyyy, yyyy-mm-dd, mm-dd-yyyy, dd-mm-yyyy, yyyy.mm.dd, mm.dd.yyyy, dd.mm.yyyy with or without time (hh:mm:ss). The selected date format also determines the date separator ("/" or "-" or ".").

No Cache

Whether caching is required on browser

Multi-Language

Enable multi-language project. If enabled, a combobox will appear on the top of the generated scripts for user to select language. See Tools(See 1.13) for selecting languages for the multi-language project. Important

1. Multi-Language project must use utf-8 encoding. The charset of the project must be "utf-8". 2. The data in your database must be stored in unicode, otherwise your data will not be displayed properly. 3. If you have customized the template and put unicode characters in the template directly instead of using language files, enable the Advanced Setting UTF-8 output files (see Customizing

40

PHPMaker 12 Help Template(See 1.14) and Tools(See 1.13)). Default Language Default language of the project. It must be compatible with Charset (see HTML Settings(See 1.10.3)). Default is English. There is always one default language for a project. Only the English language file (english.xml) is shipped with PHPMaker. If your project is single language but you use another language, create a language file for your language (see Customizing Template(See 1.14)), put it in the "languages" subfolder under the installation folder and then select your default language using this combobox. If you enable Multi-Language, you must select one of the selected languages as the default language.

File Upload

Upload folder - The global folder where the uploaded files resides. If you do not enter a specific folder for a file upload field in the Edit Tag panel of the Field Setup(See 1.10.7) page, all the uploaded files will be put in this folder. Always specify an upload folder if you allow file upload. This folder is used as the root folder of temporary folders for file upload fields during Add/Edit. It is also used as the root folder of the user files folder of CKEditor. Important

Notes

1. Unlike the field specific upload folder setting (which is a PHP expression), this field specific setting must be a constant string (without double quotes). If you want dynamic upload folders for different fields, specify upload folder for each field (see Field Setup(See 1.10.7)). 2. Make sure that the Web server user have read/write access to the folder. 3. The path is relative to application root. Use slashes "/" as path delimiter, no leading slash. e.g. If the application root of your website is C:\Inetpub\wwwroot\demo and you enter "uploads/" in this textbox, the folder for the uploaded files will be C:\Inetpub\wwwroot\demo\uploads. If you are not sure which folder is application root, please read Application Root(See 1.11). Max File Size - Maximum file upload size in bytes. If 0. Possible values: 1, 2, 3, 4, 6, 12

Paging section at top

Show the paging section at top (also applies to View page)

Paging section at bottom

Show the paging section at bottom (also applies to View page)

Paging section in View page

Show paging section in View page also

Paging section in Edit page

Show paging section in Edit page also

Multiple delete

Show checkboxes in the list page for selecting multiple records to delete

Inline delete

Delete records directly without showing delete confirm page

Links on left side

Show the links in record row on the left instead of right

Use buttons as links

Show the links in record row as a button group instead of individual icons or links.

Use button dropdown for links

Show the links in record row as a button with dropdown menu instead of individual icons or links.

Use button dropdown in paging section

Show the links in paging section as buttons with dropdown menu instead of individual links.

Use modal dialog for Advanced Search

Show the Advanced Search page in a modal dialog

Export

Enable export in List page - allow export in List pages Enable export in View page - allow export in View pages also Use button dropdown - show the export links as a button with dropdown menu. Default is showing the export links as a row of icons. Print/CSV/HTML/Excel/Word/XML/PDF/Em ail - Records can be exported to Print (printerfriendly), CSV, HTML, Excel, Word, XML, PDF format or sent as HTML email content. The fields in printer friendly version are same as in List/View page, while the fields in other format are determined by the Export setting of the field in Field Setup(See 1.10.7) page. Note

Note that the fields in printer friendly version are same as in List/View page, while the fields in other format are determined by the Export setting

45

PHPMaker 12 Help of the field in Field Setup(See 1.10.7) page. Export type - Determines which records to export. The follows are supported:

  

All Pages - Records in all pages are exported Current Page - All records in current page are exported Selected Record - If selected, a checkbox will be displayed in each row for selection. Only selected records in the current page are exported. (Selecting records in different pages is not allowed.) To select records primary key is required, Current Page export type will be used for tables without primary key.

Notes

1. Binary data (BLOB fields) cannot be exported. 2. Export to HTML/CSV/XML/PDF are not applicable to reports. 3. Images cannot be exported to Word/Excel/CSV/XML. 4. Export-to-XML requires PHP DOM (part of PHP 5 core). 5. Export-to-Word/Excel works by exporting data in HTML format for Word/Excel to convert/import, the exported file is not native .doc/.xls format. (Registered user can use the PHPExcel extension which output native Excel file format.) Notes (Export to PDF)

1. The extension is an experimental extension only. There are known issues, see Third-party Tools(See 1.7) and read the note in the extension setup page (see Tools -> Extensions(See 1.13)) for more information before use. Only enable it if necessary. 2. The extension performs best if you are using non-unicode alphanumerical characters (e.g. iso-8859-1) only. If you use unicode, configure advanced settings for the extension, read the note in the extension setup page (see Tools -> Extensions(See 1.13)) for more information. 3. By default export is only enabled in View page. If you want to enable it in the List page also (the number of records to be exported is not large), you can set the advanced settings of the extension (see Tools -> Extensions(See 1.13)). 4. The extension supports images (jpg, gif and png only), but a temporary folder is required during export, the extension uses the Upload folder (see File Upload

46

PHPMaker 12 Help above) because write permission for the folder should be already setup properly. If you do not use file upload to folder, but you use export to PDF with images, then make sure you still specify an upload folder and set up the write permission.

Email Settings PHPMaker supports many features that can send emails. If you use these features, you'll need to specify a SMTP server. From v9, PHPMailer (see Third-party Tools(See 1.7)) is always used as the email component. Make sure you generate and upload the subfolder named "phpmailer" to your website. Note

SMTP server

The host name or IP of the SMTP server. Some servers do not support "localhost" as SMTP server, in such case you need to specify a valid SMTP server in the network. Note

SMTP server port

Port number of SMTP server. Default is 25.

SMTP server username

User name for SMTP server authentication. If your SMTP server does not require authentication, leave it blank.

SMTP server password

Password for SMTP server authentication. If your SMTP server does not require authentication, leave it blank.

Sender (Email address)

Email address of the sender of all emails

Recipient (Email address)Email address of the recipient(s) for notification emails when a record is added/edited/deleted (if enabled, see Table Setup(See 1.10.6)). If there are multiple recipients, separate them by comma.

47

PHPMaker 12 Help Protocol used by the SMTP server. Possible values are: SSL or TLS.

Security

Leave this setting empty if your SMTP server does not use such protocols. Note

1.10.3 HTML Settings General

Title

Title displayed on all pages. If you use Multi-Language (see PHP Settings(See 1.10.2)), use MultiLanguage Property Editor, see Tools(See 1.13) for details. Note

Charset

Charset setting used in the META tag of the site and for exporting data. If you use Multi-Language (see PHP Settings(See 1.10.2)), this setting must be utf-8. Note

Font

Default font. If not specified, Bootstrap (see below) @font-family-sans-serif will be used, default is: "Helvetica Neue", Helvetica, Arial, sans-serif.

Size

Default font size (pixel). Unit must be in pixel for working with Bootstrap (see below). Default is 14.

Site icon

Icon of the site. For browsers to show your URL with an icon. Must be an .ico file.

Site header Logo image in the header logo Note This setting is enabled in registered version only. Registered version allows no logo. Site footer Footer text (e.g. copyright statement) text Notes

48

PHPMaker 12 Help 1. If you use Multi-Language (see PHP Settings(See 1.10.2)), use MultiLanguage Property Editor, see Tools(See 1.13) for details. 2. This setting is enabled in registered version only.

Theme Provides over a dozen of themes for you to setup the look and feel of your project quickly.

You can change the various properties of the selected theme to suit your style. The property name are self-explanatory. Themes are intergrated with Bootstrap, you can customize Bootstrap properties directly in the Theme tab, scroll down to find the Bootstrap variables which start with "@". To export custom theme settings, click the [Export theme] button to export the theme to an external xml file. To import custom theme settings from earlier saved xml files, click the [Import theme] button.

49

PHPMaker 12 Help

There are some settings related to Bootstrap but they are not Bootstrap "@xxx" variables: Mobile Menu - Inverted

Modify the look of the mobile menu by adding CSS class ".navbar-inverse". Default is FALSE. Mobile menu uses Bootstrap Navbar which support "inverted" style, see Inverted Navbar.

Theme (Bootstrap) - Use Bootstrap Theme

Load the optional Bootstrap theme for a visually enhanced experience. See Bootstrap Theme. Default is TRUE.

Notes

1. Changing a setting in the user interface does not change the corresponding setting in the theme definitions, it only changes the setting for the project. The theme definition files (in XML format) are installed in the subfolder "themes" under the installation folder. You can easily add your own themes by duplicating one of the theme definition file (except the theme.xml which is for defining the settings and data type in a theme), rename it and modify the settings in the file, just make sure you give your theme an unique theme name. 2. Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, to get started, checkout http://getbootstrap.com. 3. After changing theme properties, make sure you re-generate *.css files.

50

PHPMaker 12 Help Styles

Edit styles

A separate CSS stylesheet will be generated for each project. Click the [Edit styles] button to open CSS editor. Notes

1. All projects use CSS stylesheet. 2. If you have TopStyle Pro (v1.5+) or TopStyle Lite (v1.5-3.1) installed on your PC, PHPMaker will use it automatically. Notes

When you edit the CSS styles in the editor, note the follows:

1. DO NOT MODIFY the system styles section, it is generated by the system, your modifications will be overwritten. If you want to change the stylesheet template, modify the ew.css in the "themes" subfolder under the installed directory. Only modify the ew.css if you have the necessary knowledges in CSS. 2. DO NOT REMOVE THE FOLLOWING COMMENTS:

BEGIN_USER_STYLES END_USER_STYLES You MUST write your styles between these two comment lines, styles outside this user styles section will be discarded. 3. If you want to override the system styles, you can copy the styles to the User Styles Section, or you can use a separate user stylesheet. User StylesheetSpecify an external user stylesheet (will be copied across during generation) You can see the effect of new settings immediately in the preview window at the bottom of the HTML tab.

51

PHPMaker 12 Help

Other than choosing color from the palettes, the color picker can also pick color directly from screen using the "eyedropper".

1.10.4 Security Settings

Field Description: Administrator Login (HardCoded)

Administrator user id and password

Login Name

Login Name for administrator

Password

Password for administrator

Use Existing Table

Link to existing table for login name and password validation

52

PHPMaker 12 Help Table

Existing table in database containing login name and password information

Login Name Field

Login Name field in table used for authentication

Password Field

Password field in table used for authentication

Login Options

Login options in the login page: Auto-login - Auto login until the user logout explicitly

When you enable the auto-login feature, a few cookies will be placed on the user's computer to identify the user, meaning that the user do not have to type username and password every time he/she visit the site. For this reason, you should advise your users not to use this feature on a public or shared computer, as any other user of the computer will be able to access the account.

Remember username - Save the user's user name in cookie

Always ask - Do not save user name and password, always ask for them in the login page

Advanced Security Advanced Security feature allows you to setup User ID, assign User Levels to users and create a complete user registration system. To setup, click the [Advanced] button. PHPMaker supports two types of security - User ID and User Level. User ID Security secures data at record level. User Level Security secures data at table level. They complements each other and they can work independently or together. Users get their User ID and User Level after login. Before login, an user's identity is unknown and the user is an Anonymous User.

53

PHPMaker 12 Help

User ID User ID Security secures data at record level. Protected tables must have an User ID field for identifying which user a record belongs to. The User ID field names can be different in tables though. When User ID security is enabled, users can only access their own data.

Steps to setup User ID security for different tables/views: 1. Click on User ID in the left pane. 2. Select the [User ID field] from your user table, this field is usually the primary key of the User Table. (Note: if this field is not set, the feature is disabled) 3. (Optional) Select the [Parent User ID field] from your user table. Parent User ID field stores the parent User ID that the user belongs to, parent user can modify the child user's records. Parent User ID is hierarchical, parent users can access the records owned by the child users of their child users. (Note: if this field is not set, the Parent User feature is disabled.) 4. In the [User ID Field] column, select the User ID Field for the tables/views that requires User ID security. 5. (Optional) Enable [Allow View All] if you allow all logged in users (not including Anonymous User) to list/search/view (but not add/copy/edit/delete) all records in the table.

User Level User Level Security secures data at table level. Each user level is granted with specific permissions to tables in the database. There are 2 types of User Level security: 1. Static User Levels - the User Levels and the permissions are defined in this form and the User Levels are not to be changed after script generation.

54

PHPMaker 12 Help

Steps to setup static User Level security for different tables/views: 1. Click on User Levels in the left pane, 2. Select an integer field in your user table as the [User Level field], (Note: if this field is not set, the feature is disabled) 3. Define your user levels, click user level.

icon the add an user level and

icon to delete an

2. Dynamic User Levels - the User Levels and the permissions are defined in 2 tables in the database, the User Levels can still be changed with the generated scripts.

Steps to setup dynamic User Level security for different tables/views: 1. Click on User Levels in the left pane,

55

PHPMaker 12 Help 2. Select an integer field in your user table as the [User Level field],(note: if this field is not set, the feature is disabled) 3. Switch to the [Dynamic User Levels] tab, check [Enable Dynamic User Levels], 4. Select your User Level Table and User Level Permission Table and the required fields. The User Level Table and User Level Permission Table must have the following fields, note the data types, User Level ID and the Permission fields must be of integer type, the field names can be different though:

If you want PHPMaker to create these 2 tables in your database, click the [Create tables] button, the following form will display for you to change the table/field names if necessary. You can change the table/field names and then click OK to continue.

If you have projects created by previous versions of PHPMaker you may want to use dynamic User Levels and migrate the previously defined static User Levels in the project to the database. After selecting or creating the User Level and User Level Permission tables/fields, just click the [Migrate] button to let PHPMaker do that for you.

56

PHPMaker 12 Help After setting the user levels, PHPMaker will populate the user levels to the User Level field's Edit Tag (also see Field Setup(See 1.10.7)) so administrators can assign user levels using the generated pages. Important Notes on Anonymous Users

1. From v12, the permissions for anonymous users are integrated in the User Level security settings. See built-in user levels for anonymous users below. There are three built-in user levels: Anonymous - Anonymous user level is a built-in user level for the anonymous user (i.e. users that have not logged in). The User Level ID of the anonymous user is -2. Administrator - Administrator user level is a built-in user level that has all permissions plus the privileges to modify User IDs and User Levels. Its permissions are same as that of the hard-coded Administrator. The User Level ID of Administrator is -1. Default - Default user level is built-in user level with user level = 0. Since User Level field is an integer field, if you set a default value of 0 for this field, this user level will become the default user level for the user after registration and before the Administrator assigning another higher user level. Important Notes on User Levels

1. Even you enable all permissions for an user defined User Level, the User Level will NOT become same as this Administrator User Level. User defined User Levels will not have the permissions to manage users. 2. From v9, the permissions for List/Search/View are separate in newly created projects. However, for backward compatibility, the permissions for List/View/Search in converted projects (created by previous versions) are the same unless you have enabled Separate permssions for List/View/Search in Advanced Settings(See 1.13). 3. You may need to use the hard-coded Administrator Login to log on and assign dynamic user levels to users initially. 4. It is possible to use single login and common Dynamic User Levels for multiple projects provided that ALL projects use the same project name and same Advanced Security tables (i.e. User Table, User Level Table and User Level Permission Table). If all projects uses the same database and same Advanced Security tables, then the latter condition is automatically fulfilled. However, if the projects use different databases, you need to use Database_Connecting(See 1.10.9) server event to change the connection info so the user can get the Dynamic User Levels from the common Advanced Security tables correctly during login. For the projects not using the database with the common Advanced Security tables, you still need to create dummy Advanced Security tables (with same table/field names as the common Advanced Security tables) in the project database so you can setup Advanced Security.

User Login Options User Login Options allows you to create a complete user registration system for your Web site, with options to let user register, change password and recover password.

57

PHPMaker 12 Help

Login Track failed attempts

If enabled, number of failed login attempts (invalid password) will be tracked. If exceeded, the user will be locked out and the password must be reset.

Maximum failed attempts

The maximum number of failed login attempts

Failed attempts windows (minutes)

The time window, in minutes, during which failed password attempts are tracked.

58

PHPMaker 12 Help Disallow concurrent login

If enabled, only one session is allowed for each user (except the hard-coded Administrator). If one user has already logged in, other users trying to login with the same username (and password) will be rejected. Users are distinguished by Session ID as recognized by the web server. If you login again with your PC in another window of the same browser or in just another tab of your browser, you can still login. If you login again with another browser or another PC, the Session ID will be different and the login will be rejected. Note

Maximum concurrent user session countFor use with Disallow concurrent login. By default only one session is allowed fror each user. But you may want to give more than one chance to user so they will not be rejected after unexpected incidents such as a system crash. Please be reminded that this option somewhat compromise the Disallow concurrent login feature. Use this option discreetly and always use the smallest possible value. Note

Login status timeout (minutes)

The number of idle minutes after which the login status will be considered as logged out and login will be allowed again. If a logged-in user does not explicitly log out (for example, close the browser directly), the user session is not closed and the user's login status will remain as "logged in". Attempts to login again will fail. This timeout setting ensures login will be allowed again after a period of idle time.

CAPTCHA (requires extension)

Optionally requires user to type letters or digits from a distorted image that appears on the screen.. Requires CAPTCHA extension, click Tools > Extensions from the main menu to enable. Also see Third-party Tools(See 1.7). Note

Password MD5 password

Use MD5 password Notes

1. If you enable MD5 password, make sure that the passwords in your user table are stored as MD5 hash (32-

59

PHPMaker 12 Help character hexadecimal number) of the clear text password. If you also use case-insensitive password, convert the clear text passwords to lower case first before calculating MD5 hash. Otherwise, existing users will not be able to login. MD5 hash is irreversible, password will be reset during password recovery. Note that the reset password is also in the format of 16-character hexadecimal number, it is NOT the MD5 hash of the old password. 2. PHPMaker will try to detect salted password created by other application. (PHPMaker itself does NOT create salted password.) If salted, the password must be stored in ':' format, and the hashed string must be the md5 hash of the concatenated string of the clear text password and the salt. Other salt algorithm is not supported, you can however customize the function ew_EncryptPassword() in the template to suit your applcation. Case-sensitive password

Use case-sensitive password

Enable password expiry

If enabled, user password will expire after a period of time (except the hard-coded Administrator password)

Password expiry time (days)

For use with Enable password expiry, user password will expire after the specified number of days

User Registration Page Enabled

Generate user registration page and add a link in login page.

Fields

Select fields (from the user table) to show in the registration page. Click the [...] button the select the fields.

Confirm before submit

Optionally send email confirmation after registration

Send registration email

Optionally send email confirmation after registration

Requires activation

Optionally requires user click an activation link in the email sent after registration to activate the user account. Send email must be enabled for sending the email with activation link. Note

Auto login after registration/activation Optionally auto-login the user after registration or activation.

60

PHPMaker 12 Help Requires activation is enabled, the user is not activated yet after registration, auto login will be applied when the user clicks the activation link in the email. Note

CAPTCHA (requires extension)

Optionally requires user to type letters or digits from a distorted image that appears on the screen.. Requires CAPTCHA extension, click Tools > Extensions from the main menu to enable. Also see Third-party Tools(See 1.7). Note

Change Password Page Enabled

Generate change password page

Send email

Optional email confirmation after changing password

CAPTCHA (requires extension)

Optionally requires user to type letters or digits from a distorted image that appears on the screen. Requires CAPTCHA extension, click Tools > Extensions from the main menu to enable. Also see Third-party Tools(See 1.7). Note

Password Recovery Page Enabled

Generate password recovery page (forgot password page) and add a link in login page. User name and password will be sent to the user's email address.

CAPTCHA (requires extension)

Optionally requires user to type letters or digits from a distorted image that appears on the screen. Requires CAPTCHA extension, click Tools > Extensions from the main menu to enable. Also see Third-party Tools(See 1.7). Note

User Table Fields Email address field

Email address field in user table used for sending email

Activated field

Email activated field in user table used for storing the status of user. A boolean field is recommended, although an integer field or a string field will also work. Notes

1. To enable user account activation, the Requires activation and Send email options under User Registration Page must be checked. The user needs to

61

PHPMaker 12 Help click an activation link in the email sent after registration to activate the user account. 2. If enabled, make sure the activated field for existing users in your user table is updated with your activation values (e.g. True/False, 1/0, Y/N) or the existing users cannot login because they are not recognized as activated. You can enable Multi-Update feature for the user table so administrators can activate or deactivate existing users easily. Profile field

A memo field for persisting all the additional user information. This field is required if the following options are used:

  

Track failed attempts Disallow concurrent login Enable password expiry

User Table List Page Options Reset concurrent user session count

If enabled, a new option is generated in the User Table list page for the administrator to reset the concurrent user session count for an user to 0

Reset login failed attempts

If enabled, a new option is generated in the User Table list page for the administrator to reset the login failed attempts for an user to 0

Reset login failed attempts

If enabled, a new option is generated in the User Table list page for the administrator to reset the login failed attempts for an user to 0

Set password expired

If enabled, a new option is generated in the User Table list page for the administrator to set the password of an user as expired

Resend registration email

If enabled, a new option is generated in the User Table list page for the administrator to resend the registration email to an user

Email Template The email sending function and the email contents can be customized in the template. The following special tags are used in the email templates:

is sender email address is user email address is user password (without the $ symbol) is the field value. For example, is the field value of the field "LastName".

62

PHPMaker 12 Help You can also dynamically change the email by code using Email_Sending event before the email is sent. (See Server Events and Client Scripts)(See 1.10.9)

Email Templates for Multi-Language projects

1. To set up email templates for Multi-Language projects, read the topic Tutorial Multi-Language Project Setup(See 1.10.16)

Also See: Tutorial Tutorial Tutorial Tutorial Tutorial

-

User ID Security(See 1.15.9) Static User Level Security(See 1.15.10) Dynamic User Level Security(See 1.15.11) User Registration System(See 1.15.7) Multi-Language Project Setup(See 1.10.16)

1.10.5 Generate Settings

Template file Application root folder

Template archive (zip file) The root folder of the PHP application. (See Application Root (See

63

PHPMaker 12 Help 1.11) for more info on application root) Destination folder

The destination folder where the PHP scripts are to be generated. The folder is usually same as the application root folder or a subfolder under the application root folder.

Output filename

None - no prefix/infix/suffix is added Prefix - a prefix is added to all output file names Infix - an infix (between table name and page ID) is added to all table-specifc file names Suffix - a suffix is added to all output file names

Prefix/Infix/Suffix

The string to be concatenated to output file names when the Prefix or Infix or Suffix option is specified

Lowercase

Specify whether output file names are in lowercase

Extension

Extension name of the generated scripts, default is "php".

Default page

File name of the start page, default is "index.php". This is just the file name of a website's default page usually named index.php. This is NOT the start page (see below) of the generated site. Note

Start page

Specify the first page that the default page (usually "index.php") should redirect users to. If this setting is left blank, user will be redirected to the List page of the default table (see Table Setup(See 1.10.6)) or the first table that the user have permission to access. If this setting is not blank, the default page will simply redirect user to the page you specify, e.g. a page not generated by the current project or a custom file. If you start the site by the typical index.php, leave this setting blank, do NOT enter index.php or there will be a indefinite loop.

Testing web server

Specify the web server that you want to use to test the generated site. For use with Browse after generation (see below). You can choose IIS Express or Other. Requires IIS Express installed on the same machine as PHPMaker. IIS Express is a simpler and self-contained version of IIS that is optimized for developers. IIS Express is free, does not require administrative privileges to run. It can be downloaded from microsoft.com. If you choose Other web server (e.g. you use IIS or Apache), you need to specify Testing root URL (see below) also.

Browse after generationSpecify whether to open a browser to test the generated site after script generation. Testing root URL

Specify the URL of your testing site that maps to the Application root folder (see above). For use with Browse after generation. If you use IIS Express, this setting is NOT

64

PHPMaker 12 Help required. For example, if you have set up a website like: Application root folder: C:\Users\Administrator\Documents\mycompany.com Destination folder: C:\Users\Administrator\Documents\mycompany.com\project1 and you have setup your testing website's document root at the application root folder, so that you browse the main site by: http://localhost/ and browse the PHPMaker generated site by: http://localhost/project1/ Then the Testing root URL should be: http://localhost/ (NOT http://localhost/project1/, which points to the Destination folder). PHPMaker will calculate the relative path and add "project1/" to the Testing root URL when opening the browser.

After setting above, click the [Generate] button to generate scripts. PHPMaker allows you select scripts to generate, just select the files you want to generate in the [Output] column. If you want include PHPMaker scripts into your custom PHP scripts, you may not want to generate header and footer in those pages. Then you can enable [No header/footer] for those pages. Note that header/footer means the header row containing the site header logo and the footer row containing the site footer text. After selection, click the [Generate] button to generate scripts. If it is your first generation for the project or you have changed some project level settings, you must select [Other files] to generate the non table-specific pages. Note

If you modify settings for a table and want to re-generate script for that table only, you can click [Unselect All], then select the files you want to re-generate and click the [Generate] button to generate again. If you are not sure which files to re-generate, click [Select All] and re-generate all files. You can also right-click the column header of [Output] or [No header/footer] to quickly select all or unselect all items in the column.

65

PHPMaker 12 Help

If you need to abort script generation in the middle of the process, just click the [Cancel] button under the progress bar that displayed during generation.

Also See: Customizing Template(See 1.14) Project File (See 1.12)

1.10.6 Table Setup 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, a report or a Linked Table. Note

After loading the database, the tables will be shown in the database pane on the left pane. To access ALL setting for a table (including Multi-page, Table-specific Options and Master/Detail), click the table node of any table in the database pane and then click the [Table] tab to go to the Table Setup page. This is the setup page for a single table.

66

PHPMaker 12 Help

You can also click on the [Tables] or [Views] or [Custom Views] or [Reports] or [Linked Tables] node in the database pane to go to the Tables Setup page which is a grid showing the most frequently used settings for all tables. If you need to set these settings for multiple tables, this page allow you to view and set them quickly. Note that this page does not include Multi-page, Table-specific Options and Master/Detail.

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] or [Linked Tables] row.

67

PHPMaker 12 Help 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(See 1.10.7) for details. If all fields are not selected for View/Edit/Search, the function will not be generated. If you prefer to view the tables in alphabetical order, click [Tools]->[Sort Tables Alphabetically] (see Tools(See 1.13)). You can still 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. Note that changing the display order of table in this Table Setup page does not change the display order of the tables in the menu. To change the display order of the menu item, click [Tools]->[Menu Editor] (see Tools(See 1.13)). Important

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. If you use Multi-Language (see PHP Settings(See 1.10.2)), use Multi-Language Property Editor, see Tools(See 1.13) for details. Note

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.

68

PHPMaker 12 Help

The filter must be a valid PHP expression and it will be concatenated to the SQL. If it is a string, it should be double quoted. Note

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.

69

PHPMaker 12 Help

Output folder

For use with Custom File only. The output folder is relative to application root(See 1.11).

Include custom files

For use with Custom File and for PHP file only. Include common files such as header and footer so the custom file will have the same layout .

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.

List 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 Add

Enable/disable Grid-Add function for table. Allows users to add multiple records to the table. 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.

Detail Add

Enable/disable Master/Detail-Add function for table (as detail

70

PHPMaker 12 Help table). Allows users to add multiple records to the detail table in the Add page of the master table. Default is disabled. Detail Edit

Enable/disable Master/Detail-Edit function for table (as detail table). Allows users to edit multiple records of the detail table in the Edit page of the master table. Default is disabled.

Detail View

Enable/disable Master/Detail-View function for table (as detail table). Allows users to view multiple detail records in the View page of the master table. Default is disabled.

Multiple Detail Tables

Enable/disable multiple Detail Add/Edit/View. By default each pair of Master/Detail tables are handled separately, meaning that in a page, there are one master table (the current table) and one of its detail tables only. If this option is enabled, all detail tables will be displayed together in the same page. Enabling this option will hide separate Master/Detail table pairs.

Requires Search CriteriaSpecifies 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. Detail Record Count

Specifies if the number of detail records for the master record should be displayed. Default is disabled. Note

1. Applicable to master tables with master/detail relationships defined in PHPMaker only, see below. 2. If the detail table is a report, this feature is NOT applicable, there will be NO detail record counts for the detail report. 3. The counts are retrieved by using a subquery for each detail table. The more detail tables, the more performance penalty. You should enable this feature discreetly. Sequence number

Add a column to show the sequence number (record index) of the record in the recordset.

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

71

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

Add Add

If enabled, an Add page for the table will be generated (for adding/copying a record). Default is enabled. The table must have primary key or this setting will be unchecked during generation. Note

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.) The table must have primary key or this setting will be unchecked during generation. Note

CAPTCHAEnable/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 web application.) Notes

1. Requires CAPTCHA extension, click Tools -> Extensions from the main menu to enable. Also see Third-party Tools(See 1.7). 2. Not applicable to Inline/Grid-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

Not applicable to Inline/Grid-Add/Copy.

Edit Edit

If enabled, an Edit page for the table will be generated (for updating a record). Default is enabled. The table must have primary key or this setting will be unchecked during generation. Note

CAPTCHA

Enable/disable CAPTCHA function for the Edit 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 web application.) Notes

1. Requires CAPTCHA extension, click Tools -> Extensions from the main menu to enable. Also see Third-party Tools(See 1.7). 2. Not applicable to Inline/Grid-Edit.

72

PHPMaker 12 Help 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

Not applicable to Inline/Grid-Edit.

Check ConflictsCheck if the record is changed by other user before updating the record. Notes

1. Since processing of current data for later comparison is required, using this feature will increase the time required to load the page. For better performance only the first hundreds of bytes of the BLOB fields are processed by default, but there are chances that change of BLOB data is not detected (if the first nth bytes are not changed). You can increase the number of bytes in Advanced Setting(See 1.13), if you want to process all bytes, enter 0. 2. You can use the Row_UpdateConflict server event (see Server Events and Client Scripts(See 1.10.9)) to resolve the conflicts according to your business logic by code. 3. Not applicable to Inline/Grid-Edit.

Delete DeleteIf enabled, a Delete page for the table will be generated (for deleting record or multiple records). Default is enabled. The table must have primary key or this setting will be unchecked during generation. Note

Multi-Update Multi-UpdateIf 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(See 1.10.7) page) to be included in the MultiUpdate page. The table must have primary key or this setting will be unchecked during generation. Note

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. Quick Search searches text fields and optionally numeric fields only. These fields are selectable in Field Setup(See 1.10.7) page. You may want to hide the Quick Search form for tables that do not have searchable fields.

73

PHPMaker 12 Help Default value

Default value for Quick Search. If no user input for Quick Search, this default value will be used. After users entering their search criteria, the default value will not be used.

Default search typeDefault search type for Quick Search. Possible values are:

  

Any words All words Exact match

Extended

If enabled, Extended Quick Search inputs will be generated in the List page. Default is enabled.

Fields per Row

For use with Extended Quick Search. Specifies the number of fields per row in the Quick Search panel. Default is 0 (unspecifed), which means one field per row.

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.

Audit Trail To use this feature, you must also specify the [Audit Trail folder] or database table and field under [PHP]->[General Options] tab. See PHP Settings(See 1.10.2) for details. Audit TrailIf 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 or into the specified database table. By default all add(copy)/edit/delete info will be logged, if you want to select what to log, or want to log search/view activities also, use the Audit Trail Extension, also see [Tools]->[Extensions(See 1.13)]. Note

Email Notification To use this feature, you must also specify the [Email Settings] under [PHP]->[Email Settings] tab. See PHP Setup(See 1.10.2) 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 DeleteIf enabled, when an user delete a record, an email will be send to pre-set recipient email address(es). Default is disabled.

Other than above Tables Setup page, you can also click on a particular table node (under [Tables] or [Views] or [Custom Views] or [Reports] or [Linked Tables] node) in the

74

PHPMaker 12 Help database pane to go to the Table Setup page for that table. The Table Setup page includes the following tabs: Table, Fields(See 1.10.7), and Server Events/Client Scripts(See 1.10.9). Click on the Table tab you'll see settings for the selected table only. The right side includes two panel - the [Table-specific Options] panel and the [Master/Detail] panel (see below), the left side contains settings same as above (but for the selected table only) plus the following additional settings:

Multi-page Normally each field is displayed as a table row in the View/Add/Edit page, this Multi-Page features allow you to display divide the fields into pages and display only one page at a time. To enable, at least one field with page number larger than 1 must be set up in Field Setup(See 1.10.7) page. This feature is presented as tabs. Multi-Page type

Specifies how to display the pages. Possible values are:

   Page Labels

Tabs - use Bootstrap basic tabs (default) Pills - use Bootstrap basic pills Accordion - use Bootstrap Collapse

Specifies the page captions of each page in the Multi-Page. Click the [...] button and enter the page captions and click [OK] to save.

75

PHPMaker 12 Help

If page captions are not specified, "Page n" will be used by default. To add a page, go to Field Setup(See 1.10.7) page, specify the page number for the fields in the page first. If you use Multi-Language (see PHP Settings(See 1.10.2)), use Multi-Language Property Editor, see Tools(See 1.13) for details. Note

Add page

Specifies if Multi-Page is enabled for Add page.

Edit page

Specifies if Multi-Page is enabled for Edit page.

View page

Specifies if Multi-Page is enabled for View page.

Search page

Specifies if Multi-Page is enabled for Advanced Search page.

Registration pageSpecifies if Multi-Page is enabled for registration page. This setting is only available for the user table specified in Security Settings(See 1.10.4).

Return Pages After Add

Specifies the return URL after a new record is added. The URL must be a valid PHP expression. If it is a string, it should be double quoted. Note

Example 1 If you want to redirect user to a custom page, enter: (with quotes)

"MyPage.php" Example 2 If you want to pass field values, enter: (with quotes)

"MyPage.php?xxx=" . urlencode($this->->CurrentValue) e.g.

"MyPage.php?ID=" . urlencode($this->ID->CurrentValue)

76

PHPMaker 12 Help Example 3 If you have just added a master record and want to go to Grid-Add page of the detail table, enter: (with quotes)

"list.php?a=gridadd&showmaster=&fk_=" . urlencode($this->->CurrentValue) e.g.

"OrderDetailslist.php?a=gridadd&showmaster=Orders&fk_OrderI D=" . urlencode($this->OrderID->CurrentValue) Example 4 If you have just added a master record and want to go to Add page of the detail table, enter: (with quotes)

"add.php?showmaster=&fk_=" . urlencode($this->->CurrentValue) e.g.

"OrderDetailsadd.php?showmaster=Orders&fk_OrderID=" . urlencode($this->OrderID->CurrentValue) After Edit

Specifies the return URL after a record is edited. The URL must be a valid PHP expression. If it is a string, it should be double quoted. Note

After Register

Specifies the return URL after an user is registered. This setting is only available for the user table specified in Security Settings(See 1.10.4). The URL must be a valid PHP expression. If it is a string, it should be double quoted. Note

Table-specific Options These options are same as the list page options as described in PHP Settings(See 1.10.2) 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.

77

PHPMaker 12 Help

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). 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.

78

PHPMaker 12 Help

If you want to remove a relationship, select the link in the diagram and click [Delete]. After setup, click [OK] to confirm. 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. Note

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.

Referential IntegritySpecifies that user may not add/update a record in the detail table unless the foreign key points to a valid record in the master table. Cascade Delete

Specifies that if a record in the master table is deleted, all corresponding records in the detail table will be deleted. If you have used ON DELETE CASCADE for the table in the database, no need to enable this setting. Note

79

PHPMaker 12 Help Cascade Update

Specifies that if the primary key for a record in the master table changes, all corresponding records in the detail table will be updated. If you have used ON UPDATE CASCADE for the table in the database, no need to enable this setting. Note

Also See: Tutorial - Master/Detail(See 1.15.2)

1.10.7 Field Setup After loading the database, the database objects (tables, views, custom views, reports and linked tables) will be shown in the left pane (the database pane). Click on any table to go to the Field Setup Page for that table at any time. 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, a report or a Linked Table. Note

PHPMaker support most commonly used data types. If PHPMaker finds any unsupported fields in a table, an [Unsupported Fields] tab will appear. You can click on the tab to view the list of fields that are not supported. The Field Setup pages consists of two section. The upper section is a grid showing available options of all fields. The lower section contain two panels, the [Edit tag] panel and the [View tag] panel for the selected field.

80

PHPMaker 12 Help

The grid consists of the following sections:

      

General List Page View Page Edit Page Add Page Multi-Update Page Advanced Search Page

General

Properties Field Name

Field Name (read only)

Data Type

Data Type (read only)

Size

Maximum field length (read only)

Expression

The expression for custom field (Custom Fields only). See also Custom Fields(See 1.10.14)

Caption

Field caption to be displayed

Primary Key

Primary Key of the table. Composite key is supported. Important

1. You should use the same primary key as declared in the database, do not change it unless you are absolutely sure that the selected field(s) values are unique. Otherwise a record cannot be located properly and unexpected results may occur. 2. Primary key is uneditable in the edit page. Page No.

Page number of the field. For use with Multi-Page. By default all the fields are in page 1 and Multi-Page is disabled. Multi-Page is supported for Add/Edit/View/Search pages, you can optionally enable it for each page. Page labels are also supported. See Table Setup(See 1.10.6). If Multi-Page is enabled and the page number is 0, the field will appear in all pages. Note

You can multi-select the fields by ctrl-click or shift-click the Field

81

PHPMaker 12 Help Name column and then right click to set the page number for the selected fields simultaneously. Auto-Update ValueA dynamic value to update the field function automatically in Add/Edit pages. The dropdown list for this setting is preloaded with a few functions for your selection. For example, you may want to record the last modified date of a record, then you can select "ew_CurrentDate". Do not select a function that return values of unmatching data type, for example, you should not select a function that return a non-numeric string for a numeric field. Notes

1. This setting will make the field hidden automatically and it overrides the default value in Add page and custom value for Hidden Edit tag in Edit page. (see section below) 2. You can add your own PHP functions, the function must accept no argument and return a value. You can add your function names (comma separated) for the Advanced Settings AutoUpdate values (See Tools - Advanced Settings(See 1.13)), e.g. You can enter: (no quotes)

MyAutoValueFunction1,MyAutoValueFunction2 Then put your functions under server side Global Code section, see Server Events and Client Scripts(See 1.10.9). Change Field Display Order by Drag-and-Drop You can change the field order defined in the database by simple drag-and-drop. Simply ctrlclick or shift-click the Field Name column to select multiple fields, then drag it to where you want. PHPMaker will generate scripts and display records according to this order.

Change Multiple Field Properties Some field properties allow mulit-update. You can ctrl-click or shift-click the Field Name column to select multiple fields, then right click and select Set field properties... to update them at the same time.

82

PHPMaker 12 Help

List Page

Properties List

Show field in list page The setting is also used for Inline/Grid-Add/Edit and Master/DetailAdd/Edit/View. Note

Export

Include the field when export

Aggregate

Enable Field Aggregation. Aggregated values will be shown at Page Footer. Not applicable in multi-column view. Aggregate options include: - TOTAL (sum of all field values in current page) - COUNT (count of records in current page)

83

PHPMaker 12 Help - AVERAGE (average field value in current page) Width

Specify CSS width property for field column width . e.g. If you enter: (no quotes)

200px the output will be:

style="width: 200px" If your table is too wide, browsers will try to best fit the content into screen and the specified width may be overridden. Note

Wrap

Enable/Disable text-wrap for field value If you enable text-wrap but the field value has no line-breaking points (e.g. spaces or punctuation), the text still cannot be wrapped. Note

Quick SearchInclude this field when performing Quick(Basic) Search in the List page. Only text fields and numeric fields are supported in Quick Search. By default only text fields are enabled. Note

Ext. Search

Use this field in Extended Quick Search Extended Quick Search is enhancement of Quick Search. If a field is checked for Ext. Search, a form element for the field will be shown in the Quick(Basic) Search form and the user input criteria for this field will be included when performing Quick(Basic) Search. Extended Quick Search will use the same search operators specified under the "Advanced Search Page" section (see below). Extended Quick Search only works with field selected to show in the List page or the search criteria cannot be highlighted (if enabled, see Table Setup(See 1.10.6)) and may confuse some users. Note

View Page

Properties View

Show field in view page

View Tag

HTML tag to display the field. Used in List/View pages.

84

PHPMaker 12 Help You can either click the [View Tag] column and select a View Tag from the drop down box or click the icon on the View Tag panel toolbar to select. After selecting the View Tag, you can further setup its properties in the View tag panel.

View Tag There are two types of View Tag, Formatted Text and Image. Formatted Text - View Tag to display the field value as formatted text using tag with optional hyperlink. Properties:

DIV Tag attributes Style

Align - Left/Center/Right/Justify. Align the data. Italic - Display as Italic Bold - Display as Bold

Custom Attributes Other custom attributes for the or tag. For example, you can enter as string, e.g. (string with single/double quotes)

"onmouseover='my_js_function();' onmouseout='my_js_function2();'" or preferably as an array (array for PHP < 5.4), e.g.

array("onmouseover" => "my_js_function();", "onmouseout" => "my_js_function2();")

85

PHPMaker 12 Help or (array for PHP >= 5.4), e.g.

["onmouseover" => "my_js_function();", "onmouseout" => "my_js_function2();"] Notes

1. The setting must be a valid PHP expression. If it is string, it should be single/double quoted. 2. If you use your own JavaScript functions for the client events. You can put your JavaScript functions in the Global Code for client scripts (see Server Events and Client Scripts(See 1.10.9)) so it is available for use in the generated scripts. 3. Sometimes the generated code already uses some attributes (e.g. onchange event, class attribute, style attribute), if you add the same attribute/event using the string format, there will be more than one event/attributes of the same name and it will be ignored by browsers. But if you add the same attribute using the array format, the attributes will be concatenated together. Therefore, the array format is recommended over the string format. Format None

No formatting

Currency

Display as formatted currency

Date/Time

Display as formatted date For simplicity the Date/Time named format indicates the date format with "/" as the date separator regardless of the Default date format setting, but the actual date separator used in the generated scripts is determined by the Default date format setting (see PHP Settings(See 1.10.2)). Note

Number

Display as formatted number

Percent

Display as formatted percentage

String

Format the field value with specified PHP string function or custom function

Replace CR+LF by Display the fields with CR+LF replaced by Note This setting only applied to memo fields. Max Length (List page)

Truncate the field value at specified max. length and append "..." to the end. This setting only applied to memo fields in list page and must be larger than 0 to take effect. Note

Hyperlink HREF field

Display the field as hyperlink with the href attribute set to the value of this field. It can be the field itself.

Original field value

Use original field value of the Href field in the hyperlink instead of display field value.

86

PHPMaker 12 Help If the HREF field has lookup table or user values, by default the display value will be used. If this option is enabled, the original field value will be used instead. Target

Target attribute of the hyperlink. Possible values are: _top, _parent, _self, or _blank. You can also enter your own.

Prefix

Prefix added before the HREF field value. You can select one of the follows: -

None (no prefix, relative path of URL) http:// (prefix http:// added, absolute path of URL) mailto: (prefix mailto: added, email link) ftp:// (prefix ftp:// added, ftp link) file:// (prefix file:// added, file link) news:// (prefix news:// added, newsgroup link)

You can also enter your own partial URL (preceding the HREF field value) This setting is a string to be quoted by double quotes, if you want to use PHP variable, wrap it in "{" and "}". Since "{" can not be escaped, this syntax will only be recognized when the "$" immediately follows the "{". Read PHP Strings for more information on parsing variable in string. Note

For example, you can enter: (no quotes)

mypage.php?id= The value of the HREF field will be appended to the end of the your prefix in the outputted HTML. If you want pass a field value, you can enter: (no quotes)

mypage.php?myfield={$this->UrlEncode($this->MyField>CurrentValue)}&id= If you need to pass parameters which should not be URL-encoded, for example, if you use ew_Encrypt() to encrypt your parameter, you can enter: (no quotes)

mypage.php?myfield={$this->Raw(ew_Encrypt($this>MyField->CurrentValue))}&id= Suffix

Suffix added after the HREF field value. You can use this setting to append additional URL parameters. For example, you can enter: (no quotes)

&field2={$this->UrlEncode($this->Field2>CurrentValue)} If the suffix is URL parameter(s), you should use "&" at the beginning of the string. Note

Custom Attributes Custom attributes for the tag. For example, you can enter a string, e.g. (string with single/double

87

PHPMaker 12 Help quotes)

"rel='xxx'" or preferably as array, e.g. (array for PHP < 5.4)

array("rel" => "xxx") or, e.g. (array for PHP >= 5.4)

["rel" => "xxx"] Notes

1. The setting must be a valid PHP expression. If it is string, it should be single/double quoted. 2. If you use your own JavaScript functions for the client events. You can put your JavaScript functions in the Global Code for client scripts (see Server Events and Client Scripts(See 1.10.9)) so it is available for use in the generated scripts. 3. Sometimes the generated code already uses some attributes (e.g. onchange event, class attribute, style attribute), if you add the same attribute/event using the string format, there will be more than one event/attributes of the same name and it will be ignored by browsers. But if you add the same attribute using the array format, the attributes will be concatenated together. Therefore, the array format is recommended over the string format. Tooltip Tooltip field

Display the field as tooltip

Tooltip width

The width of the tooltip in pixels. Default is 0 (auto). By default the width is not specified and the width will depend on the field value. However, when the tooltip field is a long text field, the width can take up the browser width, which may be unwanted. Then you can specify a value to limit the width.

Custom View Tag Custom View Tag Display the field value in List/View page by custom code. Custom View Tag overrides ALL above View Tag settings. Important

There are some ready-to-use Custom View Tag for you to choose:

  

Google Maps Barcode and QR code YouTube videos

If your data stores information for above, just click the down arrow button to open the setup form, enable one of them, read the notes at the bottom panel carefully, then click the Settings tab to setup, and click OK to save your settings. Notes

1. Only one of above Custom View Tag can be selected at a time.

88

PHPMaker 12 Help All records will use the same Custom View Tag. For instance, you can NOT use Barcode for a record and use Google Maps for next record. 2. The above Custom View Tags are provided as examples only. The third party tools used are not developed by the author of PHPMaker and are not part of PHPMaker, NO TECHNICAL SUPPORT WILL BE PROVIDED. You can also create your Custom View Tag, they are implemented in exactly the same way as template extensions (see Customizing Template(See 1.14)). Custom View Tags must be placed under the subfolder "customviewtags" of the installation folder. Each Custom View Tag must have a XML description file so it can be loaded for selection. You can open an XML file in the "customviewtags" subfolder to see the content, which is self-explanatory. Unzip the zip file to see how it is implemented. If you want absolute freedom, click the [...] button to enter your own code to display the your data in your own PHP, HTML and JavaScript. If you choose to enter your own code, you are completely on your own to display the field value. Intermediate knowledge in PHP, HTML and JavaScript is required. Important

Custom View Tag is HTML, if you want to embed PHP code, use , if you want to use JavaScript, use and . Note

DO NOT use $this in your PHP code. There is no $this in the

context, you can use CurrentPage() to get the current page object. To reuse the original code, you can generate scripts without Custom View Tag first, then customize the field in View page as needed. When done, copy and paste your customized code to PHPMaker user interface as your Custom View Tag. The original code will also be generated in a hidden DIV with id="orig__", you can also reuse it by JavaScript. Example 1 Output the field value conditionally:

Example 2 Output a custom link:

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF