My Php Generator

May 9, 2018 | Author: satmania | Category: Php, My Sql, Application Software, Computing, Technology


Comments



Description

PHP Generator for MySQLUser's guide Copyright © 2002-2017 SQL Maestro Group I PHP Generator for MySQL Help Table of Contents Foreword 0 I Welcome to PHP Generator for MySQL 1 1 System................................................................................................................................... Requirements 2 2 Installation ................................................................................................................................... 3 3 How can ................................................................................................................................... I purchase PHP Generator for MySQL? 4 4 License................................................................................................................................... Agreement 5 5 About SQL ................................................................................................................................... Maestro Group 7 6 What's................................................................................................................................... new 10 II Getting started 11 1 How to................................................................................................................................... connect to MySQL 13 2 Projects ................................................................................................................................... 17 3 Command ................................................................................................................................... line options 18 4 Report................................................................................................................................... sending 19 5 Shortcut ................................................................................................................................... keys 20 6 Deployment ................................................................................................................................... 21 III Configuring datasources 22 1 Tables................................................................................................................................... and views 24 2 Custom ................................................................................................................................... SQL queries 25 IV Page Management 27 1 Root level ................................................................................................................................... pages 28 2 Detail ................................................................................................................................... pages 31 V Page Editor 33 1 Columns ................................................................................................................................... 35 Lookup settings .......................................................................................................................................................... 37 View controls.......................................................................................................................................................... 41 Text ......................................................................................................................................................... 42 DateTime ......................................................................................................................................................... 44 Checkbox ......................................................................................................................................................... 45 File download ......................................................................................................................................................... 46 Image ......................................................................................................................................................... 47 External File ......................................................................................................................................................... 48 External Image ......................................................................................................................................................... 49 External Audio ......................................................................................................................................................... 50 External Video ......................................................................................................................................................... 51 Embedded......................................................................................................................................................... Video 53 Edit controls .......................................................................................................................................................... 54 Text ......................................................................................................................................................... 56 © 2017 SQL Maestro Group Contents II Combo box......................................................................................................................................................... 58 Radio group ......................................................................................................................................................... 60 Autocomplete......................................................................................................................................................... editor 62 Multi-level autocomplete ......................................................................................................................................................... editor 63 Check box......................................................................................................................................................... 70 Check box......................................................................................................................................................... group 71 Multiple select ......................................................................................................................................................... 72 DateTime ......................................................................................................................................................... 73 Time ......................................................................................................................................................... 74 Spin edit ......................................................................................................................................................... 74 Range edit......................................................................................................................................................... 75 Color edit ......................................................................................................................................................... 76 Mask edit ......................................................................................................................................................... 77 Text area ......................................................................................................................................................... 78 Html Wysiwyg......................................................................................................................................................... 79 Password ......................................................................................................................................................... 81 File upload......................................................................................................................................................... 81 Image upload......................................................................................................................................................... 82 Upload file......................................................................................................................................................... to folder 84 Upload image......................................................................................................................................................... to folder 85 2 String ................................................................................................................................... templates 88 3 Master-Detail ................................................................................................................................... Presentations 89 4 Events................................................................................................................................... 95 Application-level .......................................................................................................................................................... (global) Events 95 OnBeforePageExecute ......................................................................................................................................................... 97 OnAfterLogin ......................................................................................................................................................... 97 OnBeforeLogout ......................................................................................................................................................... 97 OnPreparePage ......................................................................................................................................................... 98 OnCustomHTMLHeader ......................................................................................................................................................... 98 OnGetCustomTemplate ......................................................................................................................................................... 99 OnBeforeInsertRecord ......................................................................................................................................................... 107 OnBeforeUpdateRecord ......................................................................................................................................................... 107 OnBeforeDeleteRecord ......................................................................................................................................................... 108 OnAfterInsertRecord ......................................................................................................................................................... 108 OnAfterUpdateRecord ......................................................................................................................................................... 109 OnAfterDeleteRecord ......................................................................................................................................................... 110 OnGetFieldValue ......................................................................................................................................................... 111 OnGetCustomExportOptions ......................................................................................................................................................... 111 OnCustomizePageList ......................................................................................................................................................... 112 OnGetCustomPagePermissions ......................................................................................................................................................... 113 Client Side Page .......................................................................................................................................................... Events 113 OnBeforePageLoad ......................................................................................................................................................... 114 OnAfterPageLoad ......................................................................................................................................................... 114 OnInsertFormValidate ......................................................................................................................................................... 115 OnEditFormValidate ......................................................................................................................................................... 115 OnInsertFormEditorValueChanged ......................................................................................................................................................... 116 OnEditFormEditorValueChanged ......................................................................................................................................................... 118 OnInsertFormLoaded ......................................................................................................................................................... 120 OnEditFormLoaded ......................................................................................................................................................... 121 Server Side Page .......................................................................................................................................................... Events 122 OnBeforePageExecute ......................................................................................................................................................... 123 OnPreparePage ......................................................................................................................................................... 123 OnPageLoaded ......................................................................................................................................................... 124 © 2017 SQL Maestro Group II III PHP Generator for MySQL Help OnCustomRenderColumn ......................................................................................................................................................... 125 OnCustomRenderPrintColumn ......................................................................................................................................................... 128 OnCustomRenderExportColumn ......................................................................................................................................................... 128 OnCustomHTMLHeader ......................................................................................................................................................... 128 OnExtendedCustomDrawRow ......................................................................................................................................................... 129 OnCustomRenderTotals ......................................................................................................................................................... 132 OnGetCustomTemplate ......................................................................................................................................................... 133 OnCustomDrawRow ......................................................................................................................................................... 141 OnAfterInsertRecord ......................................................................................................................................................... 142 OnAfterUpdateRecord ......................................................................................................................................................... 142 OnAfterDeleteRecord ......................................................................................................................................................... 143 OnBeforeInsertRecord ......................................................................................................................................................... 144 OnBeforeUpdateRecord ......................................................................................................................................................... 145 OnBeforeDeleteRecord ......................................................................................................................................................... 145 OnGetFieldValue ......................................................................................................................................................... 146 OnGetCustomExportOptions ......................................................................................................................................................... 146 OnPrepareFilterBuilder ......................................................................................................................................................... 147 OnPrepareColumnFilter ......................................................................................................................................................... 148 OnGetCustomFormLayout ......................................................................................................................................................... 149 OnGetCustomColumnGroup ......................................................................................................................................................... 150 OnCustomCompareValues ......................................................................................................................................................... 151 OnGetCustomUploadFileName ......................................................................................................................................................... 152 OnGetCustomPagePermissions ......................................................................................................................................................... 153 OnGetCustomRecordPermissions ......................................................................................................................................................... 153 Using Variables .......................................................................................................................................................... 155 5 Filter................................................................................................................................... 157 6 Charts ................................................................................................................................... 158 Data Query .......................................................................................................................................................... 158 Common options .......................................................................................................................................................... 160 Advanced options .......................................................................................................................................................... 160 7 Page................................................................................................................................... Properties 162 Common properties .......................................................................................................................................................... 163 RSS options .......................................................................................................................................................... 167 Abilities .......................................................................................................................................................... 167 Export and Print .......................................................................................................................................................... 170 Options .......................................................................................................................................................... 172 8 Data ................................................................................................................................... Partitioning 176 9 Data ................................................................................................................................... Validation 179 VI Project Options 181 1 Page................................................................................................................................... 183 Abilities .......................................................................................................................................................... 186 Export and Print .......................................................................................................................................................... 189 2 Shared ................................................................................................................................... options 192 VII More customization options 195 1 Color................................................................................................................................... schemes 198 2 Header ................................................................................................................................... and Footer 199 3 User-defined ................................................................................................................................... styles 200 © 2017 SQL Maestro Group Contents IV 4 User ................................................................................................................................... JavaScript 202 5 Custom ................................................................................................................................... templates 203 VIII Security settings 205 1 Hard-coded ................................................................................................................................... authorization 207 2 Table-based ................................................................................................................................... authorization 209 Custom Password .......................................................................................................................................................... Encryption 211 Email-based .......................................................................................................................................................... features 213 OnBeforeUserRegistration ......................................................................................................................................................... event 214 OnAfterUserRegistration ......................................................................................................................................................... event 214 OnPasswordResetRequest ......................................................................................................................................................... event 215 OnPasswordResetComplete ......................................................................................................................................................... event 215 3 Database ................................................................................................................................... server authorization 217 4 User-defined ................................................................................................................................... authorization 218 5 Permission ................................................................................................................................... manager 220 6 Record-level ................................................................................................................................... security 224 7 Inactivity ................................................................................................................................... Timeout 225 IX Interface language 226 X Common generation options 228 XI Developer Reference 230 1 Client................................................................................................................................... Side API 231 All editors .......................................................................................................................................................... 231 getValue ......................................................................................................................................................... 231 setValue ......................................................................................................................................................... 233 getEnabled ......................................................................................................................................................... 235 setEnabled ......................................................................................................................................................... 235 getReadonly......................................................................................................................................................... 237 setReadonly......................................................................................................................................................... 237 getVisible......................................................................................................................................................... 237 setVisible......................................................................................................................................................... 238 getRequired......................................................................................................................................................... 238 setRequired......................................................................................................................................................... 238 getState ......................................................................................................................................................... 238 setState ......................................................................................................................................................... 239 setHint ......................................................................................................................................................... 239 getFieldName ......................................................................................................................................................... 239 Text editor .......................................................................................................................................................... 241 getPlaceholder ......................................................................................................................................................... 241 setPlaceholder ......................................................................................................................................................... 241 Text area .......................................................................................................................................................... 242 getPlaceholder ......................................................................................................................................................... 242 setPlaceholder ......................................................................................................................................................... 242 Combobox .......................................................................................................................................................... 243 addItem ......................................................................................................................................................... 243 removeItem ......................................................................................................................................................... 245 getItemCount ......................................................................................................................................................... 247 © 2017 SQL Maestro Group IV V PHP Generator for MySQL Help getCaption......................................................................................................................................................... 247 clear ......................................................................................................................................................... 247 Radio group .......................................................................................................................................................... 248 addItem ......................................................................................................................................................... 248 removeItem......................................................................................................................................................... 249 getItemCount ......................................................................................................................................................... 251 getCaption......................................................................................................................................................... 251 clear ......................................................................................................................................................... 251 Checkbox group .......................................................................................................................................................... and Multiple select 252 addItem ......................................................................................................................................................... 252 removeItem......................................................................................................................................................... 253 getItemCount ......................................................................................................................................................... 254 clear ......................................................................................................................................................... 255 2 Server ................................................................................................................................... Side API 257 class Page .......................................................................................................................................................... 257 GetEnvVar......................................................................................................................................................... 257 GetConnection ......................................................................................................................................................... 257 class Application .......................................................................................................................................................... 258 IsGETValueSet ......................................................................................................................................................... 258 GetGETValue ......................................................................................................................................................... 258 IsPOSTValueSet ......................................................................................................................................................... 259 GetPOSTValue ......................................................................................................................................................... 259 IsLoggedInAsAdmin ......................................................................................................................................................... 259 class EngConnection .......................................................................................................................................................... 259 ExecScalarSQL ......................................................................................................................................................... 260 ExecSQL......................................................................................................................................................... 260 ExecQueryToArray ......................................................................................................................................................... 260 class PermissionSet .......................................................................................................................................................... 260 Global functions .......................................................................................................................................................... 261 GetApplication ......................................................................................................................................................... 261 sendMailMessage ......................................................................................................................................................... 261 createConnection ......................................................................................................................................................... 262 3 Style................................................................................................................................... sheets internals 264 XII Options 265 1 Application ................................................................................................................................... 266 Page .......................................................................................................................................................... 266 Export and ......................................................................................................................................................... Print 270 Abilities ......................................................................................................................................................... 272 Generation rules .......................................................................................................................................................... 275 Display formats .......................................................................................................................................................... 276 Output .......................................................................................................................................................... 276 Confirmations .......................................................................................................................................................... 277 2 Editors ................................................................................................................................... & Viewers 279 General .......................................................................................................................................................... 279 Display .......................................................................................................................................................... 280 SQL highlight.......................................................................................................................................................... 281 XML highlight .......................................................................................................................................................... 282 PHP highlight.......................................................................................................................................................... 283 Code Insight.......................................................................................................................................................... 284 Code Folding.......................................................................................................................................................... 285 3 Appearance ................................................................................................................................... 287 © 2017 SQL Maestro Group ..................................................................................................................................................................................... 289 Check boxes...................................................................................................................................................................................................................................................................................................................................................................................................................... 291 Page controls........................................................................................... 293 Splitters ....................................................................................................................................................................................... 288 Edit controls................................ 292 Group boxes...................................................................................................................................................... 294 Index 296 © 2017 SQL Maestro Group VI .................................................................... 290 Buttons ............................................. Contents VI Bars and menus ........... 287 Trees and lists .................................................................. 1 PHP Generator for MySQL Help 1 Welcome to PHP Generator for MySQL PHP Generator for MySQL is a tool for creating database-driven web applications visually. Security Demo. Key features: · 100% responsive design based on professional-quality page templates · Support for updatable SQL queries 25 · Master-detail presentations 89 · Out-of-the-box Charts 158 · 25 color themes · Event-driven content management 95 · Client-side data validation · Custom pagination (display partitioning) 176 · Data export to PDF. You needn't have any programming background to use it. Excel and Word · Support for hard-coded. and other demo applications. CVS. © 2017 SQL Maestro Group . Almost all features provided by PHP Generator for MySQL can be seen in action in our Feature Demo. We would highly recommend you to take a look at them as this can save you hours of work when developing your own websites. database server and custom user authentication 205 · Record-level security 224 · Flexible appearance customization 195 · Multi-language support 226 · and much more. table-based. It allows you to generate professional quality PHP-based frontends for your MySQL databases in a few minutes. XML. · PHP 5. © 2017 SQL Maestro Group .0 is supported too.NET Framework 4.23 to 6. · Internet Explorer 9 or higher (to display the Preview page correctly).0 or higher (to compile styles).1 System Requirements Client environment · Pentium PC or higher.0. PHP 7. · SVGA-compatible video adapter. · 25 MB of free hard disk space.1 or higher. · Linux/Unix or Windows Web Server. Server environment · MySQL from 3. Welcome to PHP Generator for MySQL 2 1. · Windows NT4/2000/XP/Vista/Windows 7/Windows 8/Windows 10. · 512 MB RAM (1 GB recommended). · Microsoft . · run setup.2 Installation To install PHP Generator for MySQL on your PC: · download the PHP Generator for MySQL distribution package from the download page at our site. 3 PHP Generator for MySQL Help 1. · find the PHP Generator for MySQL shortcut in the corresponding program group of the Windows Start menu after the installation is completed. © 2017 SQL Maestro Group .exe from the local folder and follow the instructions of the installation wizard. We send the software activation key by email within 24 hours after completion of the order process. Welcome to PHP Generator for MySQL 4 1.com. If you have not received the activation key within this period.3 How can I purchase PHP Generator for MySQL? Thank you for your interest in purchasing PHP Generator for MySQL Professional! You can select licensing options and register PHP Generator for MySQL at its on-line order page. toll-free phone call. After this period you may renew your license for the next 12(36) months with a 50% discount. please visit the appropriate section on our website or contact us by email to support@sqlmaestro. Upon purchasing the product you confirm that you have tested it and you are completely satisfied with its current version. It is possible to purchase on-line. To obtain technical support. All our products and bundles are shipped with 12 months of free upgrades (minor and major ones) or with 36 months of free upgrades for a quite small additional fee. PHP Generator for MySQL has a free 30-day trial. please contact our sales department. or place a purchase order. © 2017 SQL Maestro Group . by fax. mail. 5 PHP Generator for MySQL Help 1. translate. otherwise reverse engineer. entity or individual. · Reverse engineering. You further acknowledge that title and full ownership rights to the SOFTWARE will remain the exclusive property of SQL Maestro Group and you will not acquire any rights to the SOFTWARE except as expressly set forth in this license. lease. rent. An unregistered copy of the SOFTWARE ("UNREGISTERED SOFTWARE") may be used for evaluation purposes. Your license confers no title or ownership of the SOFTWARE and should not be construed as a sale of any rights for the SOFTWARE. executing or displaying the SOFTWARE. sell. You are allowed to make one copy of the REGISTERED SOFTWARE for back-up purposes. You may not use. You may not modify the SOFTWARE or disable any licensing or control features of the SOFTWARE except as an intended part of the SOFTWARE's programming features. do not install and/or use this software. This license is not transferable to any other company. or transfer the SOFTWARE except as provided in this agreement. A registered copy of the SOFTWARE ("REGISTERED SOFTWARE") allows you to use the SOFTWARE only on a single computer and only by a single user at a time. You acknowledge that no title to the intellectual property in the SOFTWARE is transferred to you. "Use" means storing. If you wish to use the SOFTWARE for more than one user. entity or individual. The UNREGISTERED SOFTWARE may be freely copied and distributed to other users for their evaluation. The use of the software provided with this agreement (the "SOFTWARE") constitutes your acceptance of these terms. You affirm that you will not attempt to reverse compile. an entity or an individual. then you agree to: · replace existing version of the UNREGISTERED SOFTWARE installation package with the new package immediately after a new version of the SOFTWARE is released by SQL Maestro Group. disassemble. The SOFTWARE is owned and copyrighted by SQL Maestro Group. loading. If you offer this UNREGISTERED SOFTWARE installation package for download. · Unauthorized use. You agree that any copies of the SOFTWARE will contain the same proprietary notices which appear on and in the SOFTWARE. · License grant. You may not publish any registration information (serial numbers. If you do not agree to the terms of this agreement. Any such unauthorized use shall result in immediate and © 2017 SQL Maestro Group . copy. · Copyright. modify. etc. · Ownership. The use of this software is conditioned upon the user's compliance with the terms of this agreement. · License and distribution.4 License Agreement Notice to users: carefully read the following legal agreement. or disassemble the SOFTWARE in whole or in part. modify. you will need a separate license for each individual user. or · delete an obsolete version of the UNREGISTERED SOFTWARE installation package immediately upon written email notice by SQL Maestro Group. "You" means a company. The SOFTWARE is protected by the United States copyright law and international treaty provisions. registration keys.) or pass it to any other company. SQL Maestro Group grants you a license to use one copy of the version of this SOFTWARE on any single hardware product for as many licenses as you purchase. decompile. installing. relating to the subject matter of this license. special. consequential. incidental or indirect damages of any kind arising out of the delivery. · No liability for consequential damages. tort or any other theory of liability. exceed the license fee paid by you. whether written or oral. whether in contract. SQL Maestro Group disclaims all other warranties with respect to the SOFTWARE. Some jurisdictions do not allow the exclusion of implied warranties or limitations on how long an implied warranty may last. the parties agree that such invalidity shall not affect the validity of the remaining portions of this license. fitness for a particular purpose and noninfringement of third party rights. · Entire agreement. This is the entire agreement between you and SQL Maestro Group which supersedes any prior agreement or understanding. Neither SQL Maestro Group nor anyone else who has been involved in the creation. Welcome to PHP Generator for MySQL 6 automatic termination of this license. In no event will SQL Maestro Group's liability for any claim. or incidental damages arising out of the use or inability to use such SOFTWARE. © 2017 SQL Maestro Group . All rights not expressly granted here are reserved to SQL Maestro Group. or delivery of this SOFTWARE shall be liable for any indirect. even if SQL Maestro Group has been advised of the possibility of such damages or claims. The person using the SOFTWARE bears all risk as to the quality and performance of the SOFTWARE. Some jurisdictions do not allow limitation or exclusion of incidental or consequential damages. SQL Maestro Group does not warrant that the SOFTWARE is error-free. production. including but not limited to any implied warranties of merchantability or fitness for a particular purpose. including but not limited to implied warranties of merchantability. · Severability. or the exclusion or limitation of incidental or consequential damages. so the above given limitations or exclusion may not apply to you to the extent that liability is by law incapable of exclusion or restriction. so the above given limitations or exclusions may not apply to you. This warranty gives you specific legal rights and you may also have other rights which vary from jurisdiction to jurisdiction. SQL Maestro Group disclaims all warranties relating to this SOFTWARE. either express or implied. if any. In no event shall SQL Maestro Group or its suppliers be liable to you for any consequential. · Limited warranty. This SOFTWARE is provided on an "AS IS" basis. whether expressed or implied. · Reserved rights. performance or use of the SOFTWARE. even if SQL Maestro Group has been advised of the possibility of such damages. In the event of invalidity of any provision of this license. · No other warranties. you can build queries visually. Firebird. It provides you with the ability to perform all the necessary database operations such as creating. SQL Anywhere. DB2. extracting and dropping database objects. The united team of eminently qualified developers is pleased to create new software products for commercial. SQL Maestro Group employs an international team concentrating their efforts on cutting-edge DBA tools development. PostgreSQL. control and development of the following servers: MySQL. · We aim at being of considerable assistance to our clients. and increase database performance and availability. SQL Maestro is the premier Windows GUI admin tool for database development. export and import data to/from most popular file formats. © 2017 SQL Maestro Group . our company offers a series of Windows GUI admin tools for SQL management. At present. editing. view and edit data including BLOBs. Oracle.5 About SQL Maestro Group SQL Maestro Group is a privately-held company producing high-quality software for database administrators and developers. represent data as diagrams. and use a lot of other tools designed for making your work with your server comfortable and efficient. It is aimed to denote that we set to create easy-to-use products meant for those who appreciate comfort. and MaxDB. The slogan of our company is The Shortest Path to SQL. The company was founded in 2002 as an essential partner for every business that is trying to harness the explosive growth in corporate data. · We feel contented doing our beloved work. and control. copying. compress time frames. moreover. We do our best to design and develop products that remove complexity. manage users and their privileges (if possible). 7 PHP Generator for MySQL Help 1. We are glad to realize that our products take usual chores upon themselves. SQLite. We also produce universal tools to be used for administering any database engine accessible via ODBC driver or OLE DB provider. management. so that our customers could have more time left for their creative work. execute queries and SQL scripts. Such products may be the clear-cut decision for those who constantly work with several database servers. academic and government customers worldwide. Microsoft SQL Server. friendly program interface and support when working with SQL servers. improve productivity. · We are pleased to facilitate your job. import data into the tables. developers and testers that need a quick. Data Sync is a powerful and easy-to-use tool for database contents comparison and synchronization. easy and reliable way to compare and synchronize their data. Such tools transfer database schema and data and are equipped with native support for the most popular database servers. RTF and HTML. views and queries through the web. Welcome to PHP Generator for MySQL 8 SQL PHP Generator is a powerful tool for creating database-driven web applications visually. view and edit BLOBs in various way. © 2017 SQL Maestro Group . You needn't have any programming background to use it. sorting and grouping abilities. export data to as many as 14 file formats including Excel. build query visually. import data from Excel. It provides you with a number of easy-to-use wizards for performing the required data manipulation easily and quickly. It allows you to manage SQL queries and scripts using such useful features as code folding. Database Converter is a user friendly tool to migrate any local or remote ADO-compatible database to MySQL. execute several queries at a time. It allows you to generate high-quality PHP scripts for working with tables. Such tools can be useful for database administrators. and export/ import BLOB fields from/to files. CSV. view and edit result data with filtering. code completion and syntax highlighting. execute scripts from files. build diagrams based on Oracle data. The tool allows you to export data from MySQL tables and queries to most popular formats. and much more. generate SQL dump of selected tables. XML and text files. SQL Code Factory is a premier GUI tool aimed at the SQL queries and scripts development. SQL Data Wizard is a high-capacity Windows GUI utility for managing your data. New York 10005 United States Thank you for your interest to our company! © 2017 SQL Maestro Group .com Postal address: SQL Maestro Group 140 Broadway.9 PHP Generator for MySQL Help The software products are constantly optimized for the latest server versions support. You can use the following contact information if necessary: Our web-site www.sqlmaestro. Suite 706 New York City. 6 What's new Please find out the latest PHP Generator for MySQL news at http://www. com/products/mysql/phpgenerator/news/ © 2017 SQL Maestro Group .sqlmaestro. Welcome to PHP Generator for MySQL 10 1. PHP Generator for MySQL allows you to save and restore all the options set during a session. Find out more about © 2017 SQL Maestro Group . follow More. 11 PHP Generator for MySQL Help 2 Getting started In general. · Specify security settings 205 to protect your data from an unauthorized access. recently used projects are also available from this popup menu. · Specify datasources 22 for web pages. · Set additional generation options 228 such as webpages appearance 195 and interface language 226 . only first two steps are mandatory): · Connect to the database 13 you want to work with through the web. To run a wizard with a project. Loaded settings may be edited if necessary. all you need to create your own feature rich data-driven web application is to complete the following simple steps (in fact. · Customize web pages 27 to be created. > Load Project on the first wizard step and enter the name of the project file. All the session parameters may be saved and loaded to/from a project file... © 2017 SQL Maestro Group . Getting started 12 working with Projects 17 . · HTTP tunnel connection HTTP tunneling is a technique used in conditions of restricted network connectivity including firewalled networks. or via Secure SHell (SSH) tunnel or HTTP tunnel. Irrespectively of a connection mode you should specify common credentials as follows: Host The host name of the MySQL server. you need to: 1. and NATs. networks behind proxy servers. It is the slowest way and is recommended to use if the others are impossible.list of IP addresses allowed accessing from outside. However in most cases you have to go to your control panel and add your home/office computer IP address or domain name to the Access List . Most of hosting companies allow direct connections to databases. 13 PHP Generator for MySQL Help 2. PHP Generator for MySQL allows you to connect to MySQL databases directly. Script connection properties These parameters will be used by the generated web application. Use it each time it is possible.1 How to connect to MySQL Connection properties Specify the connection parameters for a database you want PHP Generator for MySQL to work with. you have to specify the value of the Host parameter as localhost. · Direct connection It is the most natural and the most preferable connection mode. Password The password for the user account on server. More about SSH tunnel connection To establish connection to intermediate SSH server and forward all MySQL commands through the secure tunnel. By default they are the same as parameters used by PHP Generator for MySQL but you can change them if necessary. More information. if you are working with a remote database located at your web hosting and your database server and web server are installed on the same computer. © 2017 SQL Maestro Group . · SSH tunnel connection If your MySQL server does not allow direct connections from your remote workstations. For example. you can establish connection to an allowed intermediate SSH server and forward all MySQL commands through the Secure SHell (SSH) tunnel. User name The username used to connect to MySQL. Check I can connect to the server directly or via SSH tunneling. Port number The TCP/IP port to use (default MySQL port is 3306). 3. com or OpenSSH formats. if both of MySQL and SSH servers are located on the same computer. Port number Enter the port number for the SSH server. Enter valid User name for the remote server and select the Authentication method and set corresponding credentials. Getting started 14 2. Password-based Set the password corresponding to the specified user. use the PuTTYgen utility that © 2017 SQL Maestro Group . Key-based Specify the path to the Private key file with the corresponding Passphrase to log in to the remote server. Check Connect through the Secure Shell (SSH) tunnel and complete the following fields: Host name Specify the host name or IP of your site. Follow the Configure SSH options link to open the SSH Options window. you should specify localhost as Host name instead of server's external host name or IP address. Note. PHP Generator for MySQL accepts keys in ssh. To convert a private key from PuTTY's format to one of the formats supported by our software. that MySQL host name always should be set relatively to the SSH server. 4. For example. During keyboard authentication zero or more prompts (questions) is presented to the user. The number and contents of the questions are virtually not limited. Keyboard interactive Keyboard authentication is the advanced form of password authentication. contains two scripts: mysqli_tunnel. www. Enter the connection PHP script URL. Just use Test script using default browser to open connection script in your browser.com/files/mysqli_tunnel.yoursite.php.g. 3. © 2017 SQL Maestro Group . The installation folder.15 PHP Generator for MySQL Help can be freely downloaded from the PuTTY website.php uses the original MySQL PHP API that is deprecated as of PHP 5.php and mysql_tunnel. usually C: \Program Files\SQL Maestro Group\PHP Generator for MySQL. you need to: 1. More about connection via HTTP tunnel To connect to a remote server using an HTTP tunnel. 4. The user should give the answer to each prompt (question). enter all the required connection parameters and click the Test connection button. In case using of a proxy server use Configure tunnelling options to open the HTTP tunnelling options window and specify your proxy server connection parameters and HTTP authentication. You can test the connection before the profile is created.php script always if possible as it operates through the MySQLi PHP extension (available since PHP 5) while mysql_tunnel.5. so certain types of automated logins are also possible. aimed specifically at the human operator as a client. We would recommend you to use the mysqli_tunnel. Select the I have to use HTTP tunneling radio button. Upload the connection PHP script to your website. e. 2.php. so in most cases the host/server name is "localhost" unless the target database server is not installed on the same computer as the Web server. © 2017 SQL Maestro Group . Getting started 16 Note: You are actually connecting to your database through the PHP script on the server. To restore previously saved settings from a project. If you will close the application without saving a project. © 2017 SQL Maestro Group . configure datasources and click More > Save Project at any next step (Ctrl+S) or More > Save Project as. You need not to specify all options each time you work with the application anew. (Ctrl+Shift+S). To set the same options next time. instead you can load all settings from a project and change them if necessary. Projects are very useful when working with PHP Generator. To create a project. you'll need to repeat the process step by step again while with a project all the session parameters can be restored in a few mouse clicks. All the settings you have made will be saved to a file. Recently used projects are available from the More > Recent Projects popup menu.2 Projects PHP Generator for MySQL allows you to save and restore all the options set during a session. 17 PHP Generator for MySQL Help 2.. all carefully adjusted settings will be lost. click More > Load Project at the first wizard step.. To open the NBA_db.exe] [<project_file_name>] [-o|output <output_directory>] [- g|generate] [-h|help] MyPHPGenerator[. Examples The examples below assume that you are entering the command lines in the PHP Generator for MySQL program directory.3 Command line options PHP Generator for MySQL supports a number of command line options that make it possible to fully automate PHP scripts creation. -h|help Show help information. To generate the command line automatically.pgtm project in PHP Generator GUI: myphpgenerator C:\PHPGen\MySQL\NBA_db. <output_directory> A directory where file are generated to. Don't forget to enclose all paths and filenames containing spaces in quotes. The Command Line Builder allows you to save the prepared line to clipboard or to a batch file. -g|generate Generate without running the GUI application.pgtf -g -o C:\xampp\htdocs\myapp © 2017 SQL Maestro Group . The PHP Generator for MySQL command line syntax is as follows: MyPHPGenerator[.exe] The PHP Generator for MySQL program file. <project_file_name> The project 17 with all the task's settings.pgtm To generate files without opening PHP Generator GUI: fbphpgenerator C:\PHPGen\Firebird\online_store. load the project to be used or specify the generation options manually and click More > Generate command line. Getting started 18 2. © 2017 SQL Maestro Group .com as email attachment. add the problem description and click Send record to get the prepared report in your default email client.4 Report sending To send a report to SQL Maestro support team. 19 PHP Generator for MySQL Help 2. click More > Send report. In case you have no browser installed save the prepared report to a file with the corresponding option and send it manually to support@sqlmaestro. Check the corresponding options to include project file.. . use the corresponding PHP Generator for MySQL feature.. and specified number of the table records. schema. To invoke the window. Add new record Alt+Ctrl+I.js © 2017 SQL Maestro Group . Alt+Insert Save (in input forms) Ctrl+Return Save and add another record Ctrl+Shift+Return Previous page Ctrl+Left Next page Ctrl+Right Open all details Ctrl+Shift+/ Open Filter Builder Ctrl+Shift+F Add a new condition in Filter Alt+Ctrl+I. Getting started 20 2.5 Shortcut keys The following table describes the default shortcut keys in applications created with PHP Generator for MySQL. Alt+Insert Builder All or any shortcuts may be customized in components/js/pgui.shortcuts. We recommend you to use a file synchronization software.php files from the root directory of the generated application and the custom_templates folder (if you customized one or more templates 133 in this project). facilitating the separation of presentation (HTML/CSS) from application logic. · If the new and the live web applications were created by different versions of PHP Generator for MySQL. Any such tool compares and synchronizes the output directory and the corresponding folder on your web hosting quickly and can significantly simplify the deployment process. Only an administrator can execute this operation so if you can't do that then ask your hosting provider to do it for you. Deploy generated files You can upload generated files to your web server manually or using a file synchronization software. Allow write access to templates_c The web server user must have write access to the templates_c directory. If you can do this. then it is possible (and recommended) to disallow "other" users read/write access for optimum security. The change of ownership is the easiest way to accomplish this. The most secure method is to make this directory owned by this user. just copy to the remote server all . copy all files from the output directory to the corresponding folder of the remote server and then empty the templates_c directory. Smarty compiles copies of the templates as PHP scripts. One thing you have to do is to exclude the template_c directory from the synchronization process. Compilation happens once when each template is first invoked.6 Deployment Applications created by PHP Generator use the Smarty library. 21 PHP Generator for MySQL Help 2. To upload a ready web application to your web hosting. The compiled templates are stored under the templates_c directory which must be accessible for writing by Smarty. and then the compiled versions are used from that point forward. © 2017 SQL Maestro Group . 1. In case of manual deployment there are two possible scenarios: · If the new and the live web applications were created by the same version of PHP Generator for MySQL. Smarty is a template engine for PHP. 2. you need to have the following conditions. open the Select object 24 window with the corresponding button. Adding queries To add a query.sql file with More > Load query from file. edit. type the query text in the Query editor 25 or load it from . Primary keys The wizard automatically inspects all data objects for unique identifiers that are necessary for add. filter. views. Moreover you can use queries stored a single . Configuring datasources 22 3 Configuring datasources PHP Generator for MySQL creates webpages aimed at interaction with MySQL tables. © 2017 SQL Maestro Group . It marks objects without primary key constraints with No key columns label and asks a confirmation 277 on moving to the next step. sort. and queries throw the web. It's recommended to specify a single column or a set of columns that uniquely identifies each record in the view/query to expedite the work of the generated application. To save/load queries to/from a single file. The basic rules of queries usage in PHP Generator projects are covered in the corresponding topic 25 . use More > Save all queries as repository / Load query repository items from the More button menu accordingly. Adding tables and views To add a table or a view. delete. Each webpage contains a grid with data of according datasource supplied with abilities to view.qrp file (query repository). This feature may be extremely useful if you need to share a set of the same queries between several different projects.. It's optional but preferable. and delete operations. and others.. Invalid queries The wizard automatically validates objects and displays names of invalid queries in red. edit. you can change them later. © 2017 SQL Maestro Group . but it's useful to setup the generation rules in accordance with settings of the most webpages to reduce further adjustments.23 PHP Generator for MySQL Help By default. Of course. each script has settings defined by the application options 266 . To choose several objects at a time.1 Tables and views To specify source database objects for working through the web. then click Mark selected. © 2017 SQL Maestro Group . Configuring datasources 24 3. select them using Ctrl and Shift keys. pick the objects in the Select objects tab. select * from ( QUERY_TEXT_YOU_ENTERED ) an_alias This happens because the software uses similar queries for internal needs. table2. specify the query name and text. 25 PHP Generator for MySQL Help 3. To meet this requirement. use the Create Query button or select the corresponding popup menu item. Creating updatable datasets (For Professional Edition Only) To get an updatable dataset based on an SQL query. table2. Rules for creating queries used by PHP Generator All queries must satisfy the simple requirement: the following query must be correct. last_name FROM customer WHERE last_name LIKE 'A%' © 2017 SQL Maestro Group .id.id as table1_id. the wizard marks the query as invalid and displays its name in red. For example. table2 WHERE table1. make sure that all the columns in the result dataset have unique aliases.id. first_name. the following query works fine itself. Each of these queries can contain several parameterized statements that use parameters like : field_name. table2 WHERE table1.id = table2. provide these columns with unique aliases: SELECT table1.*. and the third one provides a DELETE statement to remove the records.id = table2. but returns a dataset with two columns named id: SELECT table1. and DELETE to be able to modify. the second query provides an INSERT statement to add a new record to the tables.2 Custom SQL queries To add a query within the editor. and click OK.id as table2_id FROM table1. you have to provide up to three SQL queries: UPDATE. To solve the problem. This is the reason the wizard marks this query as invalid. Example Assume that we have the following SELECT statement: SELECT id.* FROM table1. The first query provides an UPDATE statement for modifying existing records. INSERT. add and remove records accordingly. In case such SQL expression is not valid. last_name = :last_name WHERE id = :OLD_id. INSERT. first_name = :first_name. :last_name). Configuring datasources 26 To create an updatable dataset based on this query. UPDATE and DELETE statements can be specified as follows: INSERT INTO customer VALUES (:id. :first_name. DELETE FROM customer WHERE id = :id. UPDATE customer SET id = :id. © 2017 SQL Maestro Group . 27 PHP Generator for MySQL Help 4 Page Management This step of the wizard displays the list of the webpages to be created. The working area of the step is divided into two main sections: root level pages 28 (i. The Setup project options to configure default page settings link at the bottom of the step working area opens the Project Options 181 dialog where you can setup application- level settings as well as specify default options for generated pages. It allows you to customize the pages as well as manage master/detail views and define the structure of the application menu.e. © 2017 SQL Maestro Group . pages that can be included into the site menu) and detail pages 31 that are covered in the appropriate topics. Properties Provides quick access to the Page Properties 162 dialog which is also can be invoked in Page Editor 33 . Groups Invokes a modal dialog that allows you to manage top-level site menu groups.e. pages that can be included into site menu. © 2017 SQL Maestro Group . PHP Generator for MySQL asks you whether you want to include that column into the page. All these values can be also set in the Page Properties 162 dialog. If a new column detected in a page data source. You can manage and customize these pages using the buttons on the right of the page list as described below. Page Management 28 4.1 Root level pages This list contains root-level pages i. The behavior can be changed in the Application Options 275 dialog. To include a page into a group. All cells in the list are editable i. just select the cell and click the left mouse button or the F2 key. To do so. click a cell in the Group column and select the desired group in the drop-down list. it is possible to edit the value of any cell directly in the list. Reorder Allows you to reorder the pages in the site menu. Refresh Refreshes the database schema. Edit Opens Page Editor 33 for the selected page.e. Also using commands from this button's drop down list allows you to add two or more pages based on the same data source. Copy Clones the selected page. Assign settings Copies all or certain page settings from the current page to selected pages based on the same data source. More This button provides access to additional page management commands as described below.29 PHP Generator for MySQL Help Add Allows you quickly add a page without necessity to return to the previous step. Settings you want to copy can be customized in the dialog window. Remove Removes the selected page from the list and website. © 2017 SQL Maestro Group . © 2017 SQL Maestro Group . Page Management 30 Reset. Reset All Resets all the settings for selected page or for all pages to their default values specified in the Project Options 181 dialog. e. Link Editor Opens a dialog window that allows you to edit link conditions between master and detail pages. Add Adds a new detail page located at the same level as the selected page. Edit Opens Page Editor 33 for the selected page. Copy © 2017 SQL Maestro Group . This dialog is also invoked when you add a new detail page with Add or Add Child commands. You can manage and customize these pages using the buttons on the right of the page list as described below. child views for root level pages 28 .2 Detail pages This list contains detail pages 89 i. If the Setup details by foreign key 275 option is turned ON. 31 PHP Generator for MySQL Help 4. Properties Provides quick access to the Page Properties 162 dialog which is also can be invoked in Page Editor 33 . such pages are created automatically according to foreign key constraints detected in the database schema. Add Child Adds a child page for the selected detail page. This command allows you to create a detail page at any level of nesting. Reset All Resets all the settings for selected page or for all pages to their default values specified in the Project Options 181 dialog. Remove Removes the selected page from the list and website. Settings you want to copy can be customized in the dialog window. © 2017 SQL Maestro Group . Reorder Allows you to change the order of detail pages. More This button provides access to additional page management commands as described below. Page Management 32 Clones the selected page. Reset. Charts 158 Use this tab to equip the web page with interactive charts.e. The Data Partitioning 176 wizard allows you to create a custom pagination i. 33 PHP Generator for MySQL Help 5 Page Editor Columns 35 Use this tab to specify which columns will be displayed on the result web page and corresponding forms. Details 89 Use this tab to adjust the page detail presentations and setup detail pages properties. etc. their captions. Check the corresponding boxes to apply this order to necessary presentations. Filter 157 Use this tab to reduce the number of records available at the generated page. Use the Page Properties 162 window to setup common page properties such as view/edit/ delete/filter/export abilities. and more.. button and set the new order in the opened window. To reorder columns. which controls will be used for certain columns on Insert and Edit forms. © 2017 SQL Maestro Group . edited. Events 95 Set here the fragments of PHP code to be executed before or after a record was added. deleted. click the Reorder columns. page header. lookup options and more.. split the records on the generated page by a specified criteria. The order of columns within Page Editor is changed accordingly if the new order is applied to all presentations and remains unchanged if a different column order is specified for two or more presentations. pagination options. Page Editor 34 © 2017 SQL Maestro Group . 35 PHP Generator for MySQL Help 5. click the ellipsis button and specify the appropriate values. Edit. Insert. View. Print. Common Properties specified in this section are applied to all presentations. if a column stores country IDs. Export. Caption Allows you to specify the caption for the column. By default. and Compare pages. etc). List © 2017 SQL Maestro Group . View 41 Use this section to specify the way column values are displayed on List. To provide different captions for different presentations. Use lookup Turn this checkbox ON and set the appropriate options to enable displaying of lookup values 37 instead of the "real" values stored in this column.1 Columns The Columns tab of Page Editor allows you to customize the way column data is displayed for all the available presentations (like List. For example. you can use this option to display country names instead of their IDs (assuming that there is a table that stores the ID/name combination for each country). Details are covered below. PHP Generator for MySQL enables lookups for columns linked by a foreign key with a single column from another table (if the Setup lookups by foreign key option 275 option is enabled). specify the Width and select the Units. Average. Count. Live Demo. Show column filter Turn ON the checkbox to enable the column filtering for the appropriate column. Filter Builder Here you can specify operators that will be allowed for the selected column in the Filter Builder dialog. Page Editor 36 Here you can specify some options that are applied only for the List view. rem. Fixed column width To set a fixed width for a column. etc) units. You can use both relative-length (like px or mm) and absolute-length (em. Use Sorting and Number of values to display controls to specify the sort order and number of values to be displayed in the column filter dropdown accordingly. Edit/Insert 54 Allows you to select a control to be used for the selected column in Edit and Insert forms and customize the control's properties. More about CSS units. Live Demo. Live Demo. etc) for the selected column. Available values correspond to the device widths as follows: Phone The column is displayed on all devices. Minimal visibility PHP Generator for MySQL provides you with an ability to generate responsive pages that look beautiful on any device from a mobile phone up to an extra-large desktop. © 2017 SQL Maestro Group . Tablet The column is displayed on all devices with width greater than 768px. Live Demo. This option allows you to select the minimum resolution of devices the column will be visible at. Totals This option allows you to enable a grid footer to display summaries (Sum. check the Fixed width. Desktop The column is displayed on all devices with width greater than 992px. Large The column is displayed only on devices with width greater than desktop 1200px. 1. IN. all editors can be used. This condition corresponds to the WHERE clause applied to the data source (you must not add the WHERE keyword to beginning of the condition). To get around such a situation. <=. · for lookup data sources containing 20+ values. in the database the customers' names are stored in a different table to avoid duplicating the customer data for each order by the same customer. · select the foreign table/view/query as Data Source. · specify the field with the same data as Link field. The following operators can be used in this clause: =. BETWEEN. PHP Generator for MySQL enables an Autocomplete 62 editor for a column linked by a foreign key with a single column from another table (if Setup lookups by foreign key option 275 is enabled). · set the field with data to appear in the lookup editor as Display field. To set a lookup editor with the list of values owned by the current user. you can enable a lookup editor: · check the Use lookup box. query) If you create a PHP script for taking orders. It is also possible to use predefined variables like %CURRENT_USER_NAME%. Radio Group 60 . Example 1 To enable a lookup editor with a list of USA cities (the corresponding value of "country_id" is 103) named like Da*. and Combobox 58 . LIKE. most users will prefer to work with customer names. 37 PHP Generator for MySQL Help 5. specify the following condition: country_id = 103 AND city LIKE 'Da%' Example 2 Suppose we have a table that contains a column 'owner' with owner information. · for lookup data sources containing no more than 15-20 values. the Autocomplete 62 editor is recommended. On Insert and Edit presentations lookup editors are used to simplify input by selecting a value storing in another dataset and corresponding to a pre-defined value from the base one.1 Lookup settings Lookups are used in grids and on Insert and Edit forms as well. both Autocomplete 62 and Combobox 58 editors can be used. Working directly with the customer number is not the most natural way. >. view. Here are some recommendations: · for lookup data sources containing a few (usually no more than 5-7) values. Using Filter condition Filter condition allows you to reduce the list of values represented in the lookup editor with a specified criterion. On List and View presentations lookups are used to display records of another dataset corresponding to and instead of values stored in the webpage base data source. >=. the 'Orders' table will generally have a field hosting a number indicating the customer who made the order. Setting a lookup editor bound to a data source (table. specify the filter © 2017 SQL Maestro Group . <.<> (!=). However. In data input forms the following editors can be used for lookup controls: Autocomplete 62 (default option). By default. '. CREATE TABLE department ( DEPT_NO integer NOT NULL PRIMARY KEY. and job title of the employee. CREATE TABLE job ( JOB_CODE integer NOT NULL PRIMARY KEY. j. LAST_NAME varchar(20) NOT NULL. '. JOB_TITLE varchar(25) NOT NULL. e.JOB_TITLE) as FULL_NAME FROM employee e. See definitions here CREATE TABLE employee ( EMP_NO integer NOT NULL PRIMARY KEY. The Filter Condition property cannot be used to implement dependent lookups or another similar logic. Example Suppose we have three tables: 'employee' with a list of office employees. job j WHERE e. LOCATION integer. To enable a lookup editor for the 'HEAD_DEPT' field of the 'department' table representing first name. Page Editor 38 condition as follows: owner = %CURRENT_USER_NAME% NB. 'job' with employees' job titles and salaries. MNGR_NO integer. follow the steps above with the following query text: SELECT e. last name.LAST_NAME.JOB_CODE = j. HEAD_DEPT integer.JOB_CODE © 2017 SQL Maestro Group . Setting a lookup editor represented data of multiple columns To create such lookup editor. SALARY real NOT NULL ). DEPT_NO integer NOT NULL ). DEPARTMENT varchar(20) NOT NULL. ' '. BUDGET real. PHONE_NO char(20) ).FIRST_NAME. and 'department' with a list of office departments. FIRST_NAME varchar(15) NOT NULL. Only pre-defined variables and constant expressions are allowed. A complete example can be found below. JOB_CODE integer NOT NULL. create a query with all the necessary data concatenated into a single column and specify the query as Data Source.EMP_NO as ID. CONCAT(e. 39 PHP Generator for MySQL Help Setting a lookup editor bound to a custom value list To create a lookup editor bound to a custom value list i. · Enter the list of the allowed values in pairs an_allowed_value=value_to_be_represented separated by a comma (Example: 1=One.2=Two). to a list of values that are not stored in a database table and cannot be retrieved by a query. process as follows: · Click the ellipsis button next to the "Edit properties". © 2017 SQL Maestro Group .e. Page Editor 40 © 2017 SQL Maestro Group . View. Display properties Select the control to be used to represent column data from the drop-down list. Available controls are as follows: · Text 42 · DateTime 44 · Checkbox 45 · File download 46 · Image 47 · External File 48 · External Image 49 · External Audio 50 © 2017 SQL Maestro Group . 5.2 View controls The View options define the way the column data is displayed on List. PHP Generator for MySQL creates lookup editors described above for columns based on enumeration data types. Print and Export pages.1. 41 PHP Generator for MySQL Help By default. . that is. A link in one of the inner frameset documents which uses "_parent" will load the new document where the inner frameset file had been. _parent is used in the situation where a frameset file is nested inside another frameset file.1. _top loads the linked document in the topmost frame. the format is the same as it is set at the Project options 276 . _self puts the new document in the same window and frame as the current document. _blank opens the new document in a new window. The full text will be © 2017 SQL Maestro Group . and so on.. By default. All fields represented on the picture below are displayed as text. Header hint Use this field to specify the the column caption's hint. the new page fills the entire window. Along with available formatting options you can specify any property you want using the Custom attributes option. 5.1 Text The most popular type of data representation when data is represented "as is" with minimum modifications. it is a comment to the table/view column. This option allows you to specify the content of standard HTML style tag applied to the column data. Target controls where the new document is displayed when a user follows the link. image size. To implement a conditional data formatting. In case the length of stored text is longer. Page Editor 42 · External Video 51 · Embedded video 53 To set the format to be applied to the column data such as text alignment. By default. use the OnCustomDrawRow 141 or OnExtendedCustomDrawRow 129 events. Display as hyperlink To represent the column's data as hyperlink. The Null Label property allows you to customize the representation of NULL values at the column level. this text will be cropped and the more link will be added after the allowed number of symbols. "_self" works the same as if you had not used TARGET at all.2. check the Display as hyperlink option and specify the HREF Template 88 . Max length Use this option to specify the maximum number of symbols to be displayed on the generated webpage. use the dialog opened by the ellipsis button. to set the font color and the background color for a control. For example.43 PHP Generator for MySQL Help displayed in a popup window on putting mouse over the more link or in a separate window on clicking this link. For example. Right. Custom attributes This property allows you to add simple metadata to individual elements. Left. Such attributes can be later handled in client-side events. Use the Allow HTML and Word wrapping checkboxes to set whether HTML tags will be applied to the stored data and whether word wrapping will be allowed. largely for the purpose of providing information to make JavaScript functions easier. Align Allows you to specify the alignment of the control. place the following string to Inline styles: color: red. Possible values are Default. Replace CR+LF by <BR> This option is useful for correct representation of line feeds in the text in which line breaks are marked with the Carriage Return (CR) and Line Feed (LF). background-color: yellow. to add several custom attributes to an editor. Use application options 275 to specify the default max length of text fields. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" © 2017 SQL Maestro Group . and Center. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. Page Editor 44 It is recommended to prefix all custom attributes with data. Such attributes can be later handled in client-side events.1. Set the Format options to be applied to the column data depending of data type (Number.2014 12:30:00 d M Y H:i:s 18 Nov 2014 12:30:00 Align Allows you to specify the alignment of the control.Y H:i:s 18. "Not available" "Not supported". enter the following string into the Custom attributes edit box: © 2017 SQL Maestro Group . For example. Possible values are Default. and Center. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. place the following string to Inline styles: color: red. You can specify a custom value for a certain column (for example. etc. "Not selected". 5. Find out more information about supported date and time formats at PHP manual. By default the value of this property corresponds to the one defined at the project level.to keep the result document compatible with the HTML5 requirements.) if necessary. largely for the purpose of providing information to make JavaScript functions easier. Null label This property allows you to define how NULL values are represented for this column. Currency). Percent. For example. String.m. to add several custom attributes to an editor.2 DateTime Use this type of representation to display date and time in convenient format. Format Example Y-m-d 2014-11-18 d.Y 18.11.m. to set the font color and the background color for a control. background-color: yellow.2014 dM Y 18 Nov 2014 Y-m-d H:i: 2014-11-18 12:30:00 s d. Date time format Use the drop-down list to select a format to be applied to the column data or specify your own format manually.11. Custom attributes This property allows you to add simple metadata to individual elements. Right.2. Left. or INTEGER data.1. and Center. By default the value of this property corresponds to the one defined at the project level. Left. You can specify a custom value for a certain column (for example. BIT(1). PHP Generator for MySQL provides you with the following types of the control appearance. "Not selected". etc. Null label This property allows you to define how NULL values are represented for this column. · Standard check box control · Images · Text values Align Allows you to specify the alignment of the control.) if necessary. This type of representation is used for columns storing BOOLEAN. Right.to keep the result document compatible with the HTML5 requirements. "Not available" "Not supported". 45 PHP Generator for MySQL Help data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. Possible values are Default. © 2017 SQL Maestro Group . 5.3 Checkbox Use this control to display column values as checkboxes. TINYINT(1).2. to set the font color and the background color for a control. Left. and Center. For example. largely for the purpose of providing information to make JavaScript functions easier. to set the font color and the background color for a control. the Image 47 control will be automatically selected for all the BLOB columns. "Not selected". instead of open them in the browser. Page Editor 46 Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. Right. largely for the purpose of providing information to make JavaScript functions easier. background-color: yellow. "Not available" "Not supported". to add several custom attributes to an editor. For example. Such attributes © 2017 SQL Maestro Group . Null label This property allows you to define how NULL values are represented for this column. By default the value of this property corresponds to the one defined at the project level. background-color: yellow. You can specify a custom value for a certain column (for example. Use the Additional options to specify templates 88 of file names and content type (optional) to be used for binary files on download and enable the Force downloading option to force browser to download files. If the Setup binary fields as image 275 option is turned ON. etc. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. Custom attributes This property allows you to add simple metadata to individual elements. Possible values are Default.4 File download This control allows you to represent BLOB data stored in the database as download links. 5. Such attributes can be later handled in client-side events. place the following string to Inline styles: color: red. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. place the following string to Inline styles: color: red. Custom attributes This property allows you to add simple metadata to individual elements.1. Align Allows you to specify the alignment of the control.2. For example.to keep the result document compatible with the HTML5 requirements. For files stored outside of the database the External File 48 control should be used.) if necessary. 5 Image This control allows you to represent BLOB data stored in the database as images. etc.to keep the result document compatible with the HTML5 requirements. For images stored outside of the database the External Image 49 control should be used. Possible values are Default. "Not available" "Not supported". To change image sizes. The Additional attributes allows you to manipulate the size of represented images: to resize them to a specified height or width.) if necessary. the appropriate PHP extension is required. "Not selected". For example. this control will be automatically selected for all the BLOB columns. 47 PHP Generator for MySQL Help can be later handled in client-side events. You can also specify a template 88 to be used for image hints to be shown when the mouse passes on an image. Left. Align Allows you to specify the alignment of the control.1. © 2017 SQL Maestro Group . enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. By default the value of this property corresponds to the one defined at the project level. Image upload 82 5.2. Null label This property allows you to define how NULL values are represented for this column. If the Setup binary fields as image 275 option is turned ON. You can specify a custom value for a certain column (for example. See also: File upload 81 . to add several custom attributes to an editor. You can use column names enclosed in percents (like %column_name%) to include the value(s) of the corresponding fields into the hint. © 2017 SQL Maestro Group . Custom attributes This property allows you to add simple metadata to individual elements. Right. the only thing you will need to change is the value of this property. you can specify the value of the Prefix property as 'media/' and store in the database only short file names. Hint template The value of this property is displayed as the value of the title attribute of the corresponding web element at the generated page. File upload 81 5. By default the value of this property corresponds to the one defined at the project level. You can specify a custom value for a certain column (for example. and Center. largely for the purpose of providing information to make JavaScript functions easier. Left. "Not available" "Not supported". If one day you decide to rename the directory. For example.to keep the result document compatible with the HTML5 requirements. "Not selected". if files are stored in the media directory. to add several custom attributes to an editor. For example. Possible values are Default. the actual filename is calculated as follows: Source prefix + value_stored_in_the_database + Source suffix. For example. Such attributes can be later handled in client-side events. Page Editor 48 Right. Source prefix and Source suffix These properties allow you to improve the flexibility of the application. and Center.2. For files stored in the database the File download 46 control should be used. See also: Image upload 82 . place the following string to Inline styles: color: red. Null label This property allows you to define how NULL values are represented for this column. In short.1. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. etc.6 External File This control is intended for representing links to external files.) if necessary. to set the font color and the background color for a control. background-color: yellow. Align Allows you to specify the alignment of the control. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. largely for the purpose of providing information to make JavaScript functions easier. © 2017 SQL Maestro Group . Other examples are available at Arenas and Roster pages in the NBA demo (the last page also learns how to display images stored at an external website). 49 PHP Generator for MySQL Help Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. For example. etc. "Not selected". By default the value of this property corresponds to the one defined at the project level. to set the font color and the background color for a control. 5. For images stored in the database the Image 47 control should be used. Source prefix and Source suffix These properties allow you to improve the flexibility of the application. place the following string to Inline styles: color: red. the actual filename is calculated as follows: Source prefix + value_stored_in_the_database + Source suffix. Live examples You can see this control in action at Column Types and Image Galleries pages in the Feature Showcase demo. In short.1.2. the only thing you will need to change is the value of this property. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. you can specify the value of the Prefix property as 'media/' and store in the database only short file names. to add several custom attributes to an editor. Null label This property allows you to define how NULL values are represented for this column. If one day you decide to rename the directory. if files are stored in the media directory. Such attributes can be later handled in client-side events. For example. For example.) if necessary. You can specify a custom value for a certain column (for example. background-color: yellow.to keep the result document compatible with the HTML5 requirements.7 External Image This control is intended for displaying images stored in external files. Custom attributes This property allows you to add simple metadata to individual elements. "Not available" "Not supported". You can specify a custom value for a certain column (for example.to keep the result document compatible with the HTML5 requirements. without these attributes. optionally.) if necessary. © 2017 SQL Maestro Group .8 External Audio This control is intended for displaying and playing audio files with the standard html5 audio player. Null label This property allows you to define how NULL values are represented for this column. and cannot reserve the appropriate space to it. etc.2. "Not selected". and Center. Right. For example. If this property is checked. "Not available" "Not supported". the browser does not know the size of the image. Align Allows you to specify the alignment of the control. to set the font color and the background color for a control. To avoid this. Page Editor 50 Hint template The value of this property is displayed as the value of the title attribute of the corresponding web element at the generated page. Please note that downsizing a large image with these properties forces a user to download the large image (even if it looks small on the page). 5. Is thumbnail Defines whether this image is a thumbnail for another image. The effect will be that the page layout will change during loading (while the images load). Possible values are Default.1. its prefix and suffix that are handled exactly as Source prefix and Source suffix properties described above. For example. Custom attributes This property allows you to add simple metadata to individual elements. You can use column names enclosed in percents (like %column_name%) to include the value(s) of the corresponding fields into the hint. Height and Width Specifies the height and width for the image in pixels. place the following string to Inline styles: color: red. By default the value of this property corresponds to the one defined at the project level. You can specify any of these dimensions as well as both dimensions. the space required for the image is reserved when the page is loaded. Such attributes can be later handled in client-side events. If both height and width are set. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. background-color: yellow. to add several custom attributes to an editor. use thumbnails (see below). Left. However. you should specify the original image field name and. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. largely for the purpose of providing information to make JavaScript functions easier. "Not available" "Not supported". Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. You can specify a custom value for a certain column (for example. and Center. For example. Left.) if necessary. largely for the purpose of providing information to make JavaScript functions easier. By default the value of this property corresponds to the one defined at the project level. you can specify the value of the Prefix property as 'media/' and store in the database only short file names. Align Allows you to specify the alignment of the control. place the following string to Inline styles: color: red. Such attributes can be later handled in client-side events. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. For example. background-color: yellow. Hint template The value of this property is displayed as the value of the title attribute of the corresponding web element at the generated page.1. If one day you decide to rename the directory. to add several custom attributes to an editor. if files are stored in the media directory. locally stored) video files. Null label This property allows you to define how NULL values are represented for this column. 51 PHP Generator for MySQL Help Source prefix and Source suffix These properties allow you to improve the flexibility of the application. Right. Possible values are Default. 5.9 External Video This control is intended for displaying and playing raw (for example. You can use column names enclosed in percents (like %column_name%) to include the value(s) of the corresponding fields into the hint.to keep the result document compatible with the HTML5 requirements. For videos stored on a video hosting service like YouTube or Vimeo the Embedded Video 53 control should be used. to set the font color and the background color for a control. In short. © 2017 SQL Maestro Group . etc.2. the actual filename is calculated as follows: Source prefix + value_stored_in_the_database + Source suffix. "Not selected". the only thing you will need to change is the value of this property. For example. Custom attributes This property allows you to add simple metadata to individual elements. Left. In short.to keep the result document compatible with the HTML5 requirements. © 2017 SQL Maestro Group . Possible values are Default. If one day you decide to rename the directory. Page Editor 52 Source prefix and Source suffix These properties allow you to improve the flexibility of the application. Right. background-color: yellow. the only thing you will need to change is the value of this property. to set the font color and the background color for a control. You can use column names enclosed in percents (like %column_name%) to include the value(s) of the corresponding fields into the hint. Hint template The value of this property is displayed as the value of the title attribute of the corresponding web element at the generated page. largely for the purpose of providing information to make JavaScript functions easier. you can specify the value of the Prefix property as 'media/' and store in the database only short file names. place the following string to Inline styles: color: red. and Center. Such attributes can be later handled in client-side events. the actual filename is calculated as follows: Source prefix + value_stored_in_the_database + Source suffix. For example. if files are stored in the media directory. For example. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. Custom attributes This property allows you to add simple metadata to individual elements. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. For example. Align Allows you to specify the alignment of the control. to add several custom attributes to an editor. Video player width and Video player height Width and height of the HTML5 video player control used to display and play the video. place the following string to Inline styles: color: red. Possible values are Default.1.to keep the result document compatible with the HTML5 requirements. You can specify a custom value for a certain column (for example. For example. Right. background-color: yellow. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. Null label This property allows you to define how NULL values are represented for this column. Such attributes can be later handled in client-side events.2. Left.) if necessary. Custom attributes This property allows you to add simple metadata to individual elements. 5. For example. By default the value of this property corresponds to the one defined at the project level. to set the font color and the background color for a control. "Not selected".10 Embedded Video This control allows you to embed a video stored on a video hosting service like YouTube or Vimeo into the page (for videos stored in external files the External Video 51 control should be used). etc. By default the value of this property corresponds to the one defined at the project level. largely for the purpose of providing information to make JavaScript functions easier. Clicking the thumbnail or the button opens a modal window and starts playing the video. "Not available" "Not supported".) if necessary. It is represented as a thumbnail of the video or as a play button (for low screen resolutions). 53 PHP Generator for MySQL Help Null label This property allows you to define how NULL values are represented for this column. You can specify a custom value for a certain column (for example. "Not selected". etc. to add several custom attributes to an editor. "Not available" "Not supported". enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. and Center. © 2017 SQL Maestro Group . Align Allows you to specify the alignment of the control. Available controls are: · Text 56 · Combo box 58 · Radio group 60 · Autocomplete editor 62 · Multi-level autocomplete editor 63 · Check box 70 · Check box group 71 · Multiple Select 72 · DateTime 73 · Time 74 · Spin edit 74 © 2017 SQL Maestro Group .1. Edit properties Use this drop-down list to select a control to be used for this column on Edit and Insert pages. Page Editor 54 5.3 Edit controls The Edit options define the way the column data is represented on Edit and Insert pages. Upload Image to Folder 85 To set additional control properties such as captions. Visible This option defines whether the control will be visible on the generated page. Required columns are marked by red asterisk. Required Check the Required box if the field is mandatory. Disabled input elements in a form will not be submitted. Read only Use this option to make the control readonly. An invisible element stays in its original position and size. PHP Generator for MySQL allows you to check for correctness of input data on the client side on two scopes: © 2017 SQL Maestro Group . data will not be submitted and an error message will be shown. Enabled Use this option to specify whether the control will be enabled on the generated page. use the dialog opened by the ellipsis button. and so on. Upload File to Folder 84 . and copy the text from it). Turn it OFF to disable the control. element attributes. A readonly input field cannot be modified (however. Image Upload 82 . highlight it. formatting options. a user can tab to it. When a user tries to submit a form with an empty required field. Readonly form elements will get passed to the form processor.55 PHP Generator for MySQL Help · Range edit 75 · Color edit 76 · Mask edit 77 · Text area 78 · Html Wysiwyg 79 · Password 81 · File Upload 81 . · The input values are validated when a user clicks the Save button. use the OnInsertFormValidate 115 and OnEditFormValidate 115 client side events.1. Default value This option allows you to set the expected value of an input field with string templates 88 . specify the suitable Client validator. Number The script makes the element require a decimal number. %CURRENT_TIME%. Length The script validates if the length of text is between the min length and the max length.3. Such expression is a pattern and every character entered in a form field is matched against that pattern – the form can only be submitted if the pattern and the user-input matches. Regular You can also specify your regular expression for data expression validation. Credit card The script makes the element require a credit card number. These events occur before submitting of an insert and edit forms and allow you to detect errors on the client side before the form is submitted to the server to avoid the round trip of information necessary for server-side validation. This may be useful to check the compatibility of input data.1 Text Select this control to create a single-line input field for entering text. Digits The script makes the element require digits only. For this purpose. Page Editor 56 · The input value is validated when a user leaves the control. %CURRENT_USER_ID%. Range The generated script validates if number is between the largest and smallest values. You can use such environment variables as %CURRENT_DATETIME%. % CURRENT_DATE%. URL The script makes the element require a valid URL. Max width © 2017 SQL Maestro Group . range Email The script makes the element require a valid email. For this purpose. and % CURRENT_USER_NAME%. 5. Other examples include @ with a username (a la Twitter.g. Max length Use this field to restrict the number of symbols of the value that can be entered. For example. 50%. etc.g. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. Use Prefix and Suffix to create prepended and appended inputs allowing for simple punctuation or units to be paired with an input. to add several custom attributes to an editor. © 2017 SQL Maestro Group . For example. place the following string to Inline styles: color: red. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. 300px. to set the font color and the background color for a control. Can be specified in any units supported by web browsers e. so you have to define allowed items explicitly. use the prepend with a $ sign.57 PHP Generator for MySQL Help Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). Custom attributes This property allows you to add simple metadata to individual elements. Such attributes can be later handled in client-side events. if you need to indicate a field is asking for money.to keep the result document compatible with the HTML5 requirements. For example. a sample value or a short description of the expected format). 25em. The placeholder is displayed in the input field before the user enters a value. By default all tags and attributes are stripped out.com's settings pages) and "+1" for phone number inputs. largely for the purpose of providing information to make JavaScript functions easier. HTML filter Use it to strip unwanted HTML tags and attributes from user input. Placeholder Use this field to set a short hint that describes the expected value of an input field (e. background-color: yellow. 5.g. 50%. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). 25em. etc. Value © 2017 SQL Maestro Group . a combination of a drop-down list and a single-line editable textbox. All other tags and attributes will be removed from the user input.3. allowing the user to either type a value directly or select a value from the list.1. By default. 300px.2 Combo box Select this control to create a combobox. Page Editor 58 Settings on the screenshot above are to allow the <a> tag (optionally with the href attribute as well as the <strong> and <h1> tags. PHP Generator for MySQL enables a combo box lookup editor for a column linked by a foreign key with a single column from another table (if Setup lookups by foreign key option 275 is enabled). Can be specified in any units supported by web browsers e. 59 PHP Generator for MySQL Help Use this field to fill the combobox with more convenient values instead of stored ones. For this purpose use the Value list window or enter them manually as pairs allowed_value=value_to_be_represented separated by commas (Example: 1=One, 2=Two). Most frequently used values Use the ellipsis button next to this field to specify combobox values to be always displayed at the top of the drop-down list. Item caption template This option allows you to populate the combobox with values of several columns. For this purpose, specify a template 88 to be used for each item in the list. © 2017 SQL Maestro Group Page Editor 60 Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. For example, to set the font color and the background color for a control, place the following string to Inline styles: color: red; background-color: yellow; Custom attributes This property allows you to add simple metadata to individual elements, largely for the purpose of providing information to make JavaScript functions easier. Such attributes can be later handled in client-side events. For example, to add several custom attributes to an editor, enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data- to keep the result document compatible with the HTML5 requirements. 5.1.3.3 Radio group Select this control to let the visitor select one option from a set of alternatives. If more options are to be allowed at the same time you should use check boxes 71 instead. © 2017 SQL Maestro Group 61 PHP Generator for MySQL Help Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). Can be specified in any units supported by web browsers e.g. 300px, 25em, 50%, etc. Values You can specify values to be represented as radio group values instead of stored ones. For this purpose use the dialog opened by the ellipsis button, or add them manually as pairs allowed_value=value_to_be_represented separated by commas (Example: 1=One, 2=Two). Display mode Use the drop-down list to select whether the radio group will be represented on the same column (Stacked) or on the same line (Inline). Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. For example, to set the font color and the background color for a control, place the following string to Inline styles: color: red; background-color: yellow; Custom attributes This property allows you to add simple metadata to individual elements, largely for the purpose of providing information to make JavaScript functions easier. Such attributes can be later handled in client-side events. For example, to add several custom attributes to an editor, enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data- to keep the result document compatible with the HTML5 requirements. © 2017 SQL Maestro Group Page Editor 62 5.1.3.4 Autocomplete editor Select this control to create a combination of a single-line editable textbox and a drop- down list filtered according to values entered in the textbox. It is recommended to use this editor type as lookup editor to work with a big number of records. Live Demo. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). Can be specified in any units supported by web browsers e.g. 300px, 25em, 50%, etc. Allow clear Turn it ON to allow end users to clear the selected value using special button. Minimum input length Use this option to specify minimal amount of symbols to start the search (useful for large lookup datasets where short search terms are not very useful). Number of values to display Defines the number of lookup values to be displayed in the drop-down list. Item caption template This option allows you to populate the combobox with values of several columns. For this purpose, specify a template 88 to be used for each item in the list. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. For example, to set the font color and the background color for a control, place the following string to Inline styles: color: red; background-color: yellow; Custom attributes This property allows you to add simple metadata to individual elements, largely for the purpose of providing information to make JavaScript functions easier. Such attributes can be later handled in client-side events. For example, to add several custom attributes to an editor, enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data- to keep the result document compatible with the HTML5 requirements. © 2017 SQL Maestro Group 63 PHP Generator for MySQL Help Formatting functions Use these functions to format search results and the selection. For example, it is possible to use fonts, colors, images, and so on. All you need is to specify two functions in JavaScript each of which accepts the current item as a parameter and returns the HTML code to represent search results and the selected item accordingly. In the example below search results are displayed in italic and the selected item is displayed in bold. formatResult function: return '<i>' + item.text + '</i>'; formatSelection function: return '<b>' + item.text + '</b>'; The editor now looks as follows: 5.1.3.5 Multi-level autocomplete editor Select this control to create cascading combo boxes to get greater control over data input, and to make things easier for the user. Multi-level autocomplete editor is a series of 2 or more combo boxes in which each combo box is filtered according to the previous combo box. The number of levels is not limited. Live Demo. Note: regardless of the number of levels the result of the multi-level editor is only a single value. The picture below demonstrates two-level and three-level autocomplete editors. On the first figure, the City combo box is populated on the fly with city names that correspond to the currently selected country from the Country combo box. On the second figure, to specify an address a user needs to select a country, then select a city from a combo box populated with names of cities located in the selected country, and after that he can select an address from the list of addresses related to the currently selected city. © 2017 SQL Maestro Group Page Editor 64 To create cascading combo boxes with any number of levels, use the same technique as described below. Database schema requirements To create an N-level autocomplete editor you need to have N+1 tables: the source table for the generated webpage and N tables each of them refers to the primary key in the previous table. The foreign key constraints are not required but highly recommended to enforce the referential integrity at the database level. The picture above demonstrates a two-level editor represented on an Address webpage and allowing to specify a city using a list of countries. To create this control we used three tables: Country, City, and Address. Address is the source table for the webpage. The Address table refers to the primary key of the City table and City refers to the primary key of Country. Levels Use this tab to select tables to be used for additional combo boxes, specify captions for these combo boxes, and columns which data will be displayed in the drop-down lists. Place tables in the reverse order of logical priority. In the example of three-levels editor we used Country, City, Address, and Customer tables. Customer is the source table for the generated webpage. Pay attention that the data entry order would be Country, City and then Address; which by data hierarchy standards is backwards. So we need to add Address first, then specify City and after that Country. The Filter Condition property allows you to restrict number of displayed values. Variables like %CURRENT_USER_ID% are allowed. Example Let's consider how to implement a three-level editor. Suppose we have the following tables: © 2017 SQL Maestro Group 1. these properties are set automatically. If you have a foreign key relationship and the Setup lookup by foreign key 275 option is enabled. and specify its lookup properties 37 . select the Address_id column. Open the editor of the page based on the Customer table. © 2017 SQL Maestro Group .65 PHP Generator for MySQL Help Our goal is to create a three-level editor like this. Select Multi-level autocomplete editor as edit control and click the ellipsis button to open the Edit properties dialog © 2017 SQL Maestro Group . Page Editor 66 2. As we've written above. so we need to add Address first. To add a new level for the control. click Add level and specify options of the Add filter dialog as follows: © 2017 SQL Maestro Group . the tables for additional combo boxes are placed in the reverse order of logical priority. City and then Address.67 PHP Generator for MySQL Help 3. The data entry order would be Country. then specify City and after that Country. Page Editor 68 4. Add the next level in the same way: © 2017 SQL Maestro Group . to set the font color and the background color for a control. For example. 50%. Number of values to display Defines the number of lookup values to be displayed in the drop-down list for each level. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). place the following string to Inline styles: © 2017 SQL Maestro Group . etc.g. 25em. Allow clear Turn it ON to allow end users to clear the selected value using special button. Can be specified in any units supported by web browsers e. Minimum input length Use this option to specify minimal amount of symbols to start the search (useful for large lookup datasets where short search terms are not very useful). Inline styles Use this field to set formatting options to be used inside the <style> tag of the element.69 PHP Generator for MySQL Help Click OK in the Edit properties window to save all settings and return to the Page Editor. 300px. Formatting functions can be specified at the level basis. 25em. For example.g. to add several custom attributes to an editor. and so on. place the following string to Inline styles: color: red. colors. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). Can be specified in any units supported by web browsers e. The screenshot below is from our demo application: 5.6 Check box Select this control to let the user to make a binary choice. Page Editor 70 color: red. background-color: yellow. © 2017 SQL Maestro Group . For example. 300px. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. Formatting functions Use these functions to format search results and the selection. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. background-color: yellow. Custom attributes This property allows you to add simple metadata to individual elements. 50%. For example. etc. Such attributes can be later handled in client-side events. to set the font color and the background color for a control.3.1. All you need is to specify two functions in JavaScript each of which accepts the current item as a parameter and returns the HTML code to represent search results and the selected item accordingly.to keep the result document compatible with the HTML5 requirements. This type of editor is automatically selected for boolean and bit(1) columns. largely for the purpose of providing information to make JavaScript functions easier. it is possible to use fonts. images. 1. largely for the purpose of providing information to make JavaScript functions easier. to set the font color and the background color for a control. 25em. Such attributes can be later handled in client-side events. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data.to keep the result document compatible with the HTML5 requirements. You can also use the Multiple select 72 control for this purpose. Such attributes can be later handled in client-side events. For example. Live Demo. Values You can separate values to be represented in the control and values stored in the database. largely for the purpose of providing information to make JavaScript functions easier. background-color: yellow. For example. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. 5. to add several custom attributes to an editor. 50%.g. 300px. For example. place the following string to Inline styles: color: red. For this purpose use the dialog opened by the ellipsis button and enter the values you need. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" © 2017 SQL Maestro Group . 71 PHP Generator for MySQL Help Custom attributes This property allows you to add simple metadata to individual elements. Can be specified in any units supported by web browsers e. Custom attributes This property allows you to add simple metadata to individual elements. etc. or add them manually as pairs stored_value=value_to_be_represented separated by commas (Example: 1=One. Display mode Use the drop-down list to select whether the check box group will be represented on the same column (Stacked) or on the same line (Inline).3.7 Check box group Select this control to provide the user with the ability to select multiple items. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). 2=Two). to add several custom attributes to an editor. g. 2=Two). In this case hard-coded values described above are ignored and NOT included into the list of available choices. Values You can separate values to be represented in the control and values stored in the database. 50%. For example. allows you to select multiple options for a single field) but looks much different and requires less space in the forms. 25em. place the following string to Inline styles: color: red. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. For this purpose use the dialog opened by the ellipsis button and enter the values you need. to set the font color and the background color for a control. or add them manually as pairs stored_value=value_to_be_represented separated by commas (Example: 1=One. It provides the same functionality as Checkbox Group 72 (i. Custom attributes This property allows you to add simple metadata to individual elements. Live Demo. 5. Maximum selection size This property allows you to restrict number of items that can be selected simultaneously. 300px. largely for the purpose of providing information to make JavaScript functions easier. stored and displayed values are retrieved from the specified data source. Can be specified in any units supported by web browsers e. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. Such attributes can be later handled in client-side events.to keep the result document © 2017 SQL Maestro Group .8 Multiple select Select this control to provide the user with the ability to select multiple items.3. For example. to add several custom attributes to an editor. etc. Retrieve values from database If this option is checked.1. background-color: yellow. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value).e.to keep the result document compatible with the HTML5 requirements. Page Editor 72 It is recommended to prefix all custom attributes with data. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). 25em. 300px.3. uncheck the Default format option and select it from the corresponding field to setup a format to be applied to the input value.g. For example. a combination of an interactive calendar and a single-line editable textbox. © 2017 SQL Maestro Group . For example. 5. Can be specified in any units supported by web browsers e. the format of the column's data is the same as it is set at the Project options 276 . place the following string to Inline styles: color: red. etc. Custom attributes This property allows you to add simple metadata to individual elements. 73 PHP Generator for MySQL Help compatible with the HTML5 requirements.1. to add several custom attributes to an editor. background-color: yellow. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data.9 DateTime Select this control to let the user to enter date time values with datepicker.to keep the result document compatible with the HTML5 requirements. To use another Date time format. Such attributes can be later handled in client-side events. to set the font color and the background color for a control. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. By default. largely for the purpose of providing information to make JavaScript functions easier. 50%. Can be specified in any units supported by web browsers e.1. background-color: yellow. Such attributes can be later handled in client-side events. 50%. 25em.to keep the result document compatible with the HTML5 requirements. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. For example. For example. Page Editor 74 5. 5. largely for the purpose of providing information to make JavaScript functions easier.10 Time Select this control to let the user to enter time values in a single-line editable textbox provided by a spinner helping to quickly change the editor's value as well as to reset its value to the current time.g. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). to add several custom attributes to an editor.11 Spin edit Select this control to create a single-line input field allowing users to edit numeric values with ease.1.3.3. Custom attributes This property allows you to add simple metadata to individual elements. place the following string to Inline styles: color: red. The editor consists of an edit region and one pairs of spin buttons which can © 2017 SQL Maestro Group . to set the font color and the background color for a control. 300px. etc. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. place the following string to Inline styles: color: red. 50%.g. to set the font color and the background color for a control. 75 PHP Generator for MySQL Help be used to adjust the numerical value. the value is incremented or decremented by this amount. 300px. When an end-user presses a spin button. etc. background-color: yellow. To limit end-user input to a specified range. Step specifies the legal number intervals for the input field. © 2017 SQL Maestro Group . The default value is 1. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data.1.3. For example. Can be specified in any units supported by web browsers e. to add several custom attributes to an editor. Custom attributes This property allows you to add simple metadata to individual elements. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. turn ON the Use constraints option and define the editor's minimum and maximum allowed values. etc. When an end-user presses a spin button. It is possible to indicate the allowed range of values in the appropriate dialog window (default values are 0 and 100 for bottom and top limits accordingly).12 Range edit The range input (so-called slider) is useful for imprecise number input. 25em. Can be specified in any units supported by web browsers e. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). 25em. Step specifies the legal number intervals for the input field.g. Such attributes can be later handled in client-side events. For example. 5. largely for the purpose of providing information to make JavaScript functions easier.to keep the result document compatible with the HTML5 requirements. The default value is 1. the value is incremented or decremented by this amount. 300px. 50%. For example. Page Editor 76 To limit end-user input to a specified range. Custom attributes This property allows you to add simple metadata to individual elements. to add several custom attributes to an editor.13 Color edit Use this control to edit values of columns storing HTML color codes with a native- browser Color Picker (it is assumed that a string data type is used for storing such values in the database). enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. 5. background-color: yellow. largely for the purpose of providing information to make JavaScript functions easier.to keep the result document compatible with the HTML5 requirements.1. turn ON the Use constraints option and define the editor's minimum and maximum allowed values.3. © 2017 SQL Maestro Group . Such attributes can be later handled in client-side events. For example. place the following string to Inline styles: color: red. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. to set the font color and the background color for a control. For example. For example.a-z.to keep the result document compatible with the HTML5 requirements. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). The following mask definitions are predefined: a . Any character not in the definitions list below is considered a mask literal.Represents an alphanumeric character (A-Z.Represents a numeric character (0-9) * .Represents an alpha character (A-Z. 50%.g.1.0-9) Example To define an edit box for telephone numbers. etc.14 Mask edit Use this control to define an edit box that limits the user to a specific format (dates. Mask A mask is defined by a format made up of mask literals and mask definitions. Can be specified in any units supported by web browsers e. 25em. Custom attributes This property allows you to add simple metadata to individual elements. 5. 50%. phone numbers. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. 77 PHP Generator for MySQL Help Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). 999-999-9999 © 2017 SQL Maestro Group . Mask literals will be automatically entered for the user as they type and will not be able to be removed by the user. Such attributes can be later handled in client-side events. 300px.a-z) 9 . background-color: yellow. to set the font color and the background color for a control. 300px. Can be specified in any units supported by web browsers e. place the following string to Inline styles: color: red. specify the following string as the mask of the editor. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. largely for the purpose of providing information to make JavaScript functions easier. etc. 25em. to add several custom attributes to an editor. etc) and accepts only valid characters.3.g. Such attributes can be later handled in client-side events. The placeholder is displayed in the input field before the user enters a value.to keep the result document compatible with the HTML5 requirements. The size of a text area can be specified by the Column count and Row count values. the application will not accept it. For example. 50%. and the text renders in a fixed-width font (usually Courier).15 Text area Use this control to provide the Edit form with a multi-line text input control.g. largely for the purpose of providing information to make JavaScript functions easier. Placeholder Use this field to set a short hint that describes the expected value of an input field (e. place the following string to Inline styles: color: red.1. Inline styles © 2017 SQL Maestro Group . Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. a sample value or a short description of the expected format). 300px. Custom attributes This property allows you to add simple metadata to individual elements. Can be specified in any units supported by web browsers e. to add several custom attributes to an editor. Page Editor 78 In this case the created data entry field accepts only numeric input and if a user then tries to enter a letter in this edit box. etc. background-color: yellow. A text area can hold an unlimited number of characters.g. 25em.3. For example. 5. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. to set the font color and the background color for a control. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). 79 PHP Generator for MySQL Help Use this field to set formatting options to be used inside the <style> tag of the element. without having to type or remember names of layout commands. to set the font color and the background color for a control. place the following string to Inline styles: color: red. so you have to define allowed items explicitly. Custom attributes This property allows you to add simple metadata to individual elements. By default all tags and attributes are stripped out. 5. Such attributes can be later handled in client-side events. For example. For example. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. largely for the purpose of providing information to make JavaScript functions easier. background-color: yellow.3.1.to keep the result document compatible with the HTML5 requirements. © 2017 SQL Maestro Group .16 Html Wysiwyg Select WYSIWYG (What You See Is What You Get) editor to provide users with an ability to directly manipulate the layout of a HTML data stored in the column. HTML filter Use it to strip unwanted HTML tags and attributes from user input. Settings on the screenshot above are to allow the <a> tag (optionally with the href attribute as well as the <strong> and <h1> tags. All other tags and attributes will be removed from the user input. to add several custom attributes to an editor. place the following string to Inline styles: color: red. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. 25em.g. By default all tags and attributes are stripped out. HTML filter Use it to strip unwanted HTML tags and attributes from user input. 50%. Such attributes can be later handled in client-side events. 300px. background-color: yellow. © 2017 SQL Maestro Group . Page Editor 80 Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). etc. Custom attributes This property allows you to add simple metadata to individual elements. For example. largely for the purpose of providing information to make JavaScript functions easier. to set the font color and the background color for a control. For example. so you have to define allowed items explicitly.to keep the result document compatible with the HTML5 requirements. Can be specified in any units supported by web browsers e. to add several custom attributes to an editor. Such attributes can be later handled in client-side events. 5.1.3.1. For example. use the Upload File to Folder 84 control. largely for the purpose of providing information to make JavaScript functions easier. To store files externally. 5. place the following string to Inline styles: color: red.to keep the result document compatible with the HTML5 requirements. to add several custom attributes to an editor.g.17 Password Select this control to add a masked textbox.18 File upload Use this control to allow users to upload binary files to the database. 25em. All other tags and attributes will be removed from the user input. 300px. Can be specified in any units supported by web browsers e. Custom attributes This property allows you to add simple metadata to individual elements. background-color: yellow. © 2017 SQL Maestro Group . Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. etc. to set the font color and the background color for a control.3. 50%. For example. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. 81 PHP Generator for MySQL Help Settings on the screenshot above are to allow the <a> tag (optionally with the href attribute as well as the <strong> and <h1> tags. Can be specified in any units supported by web browsers e. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. Page Editor 82 Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). 50%. to set the font color and the background color for a control. The drop down list contains pre-defined values for some common cases. to add several custom attributes to an editor. background-color: yellow. largely for the purpose of providing information to make JavaScript functions easier. To store images externally. See also: Upload file to folder 84 . check this option and specify the maximum allowed file size in kilobytes. For example. etc. 300px. File download 46 5.1. place the following string to Inline styles: color: red. name and size of uploaded files to table columns (optional). You can save the type. Custom attributes This property allows you to add simple metadata to individual elements. 25em. Use file size limitation To restrict the size of uploaded files. use the Upload Image to Folder 85 control.g. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. For example.19 Image upload Use this control to allow users to upload images to the database. Such attributes can be later handled in client-side events.to keep the result document compatible with the HTML5 requirements. Acceptable file types The value of this property defines which file types are displayed in the dialog invoked by pressing the Choose File button.3. © 2017 SQL Maestro Group . width is not greater than 600px and height is not greater than 400px and to save the original file names to the file_name column. 25em.83 PHP Generator for MySQL Help Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). 50%. etc. Use image size limitation To restrict the size of uploaded images. check this option and specify the maximum allowed image width and height. Fit by height) and specify the height or width correspondingly. name and size of uploaded files to table columns (optional). The drop down list contains pre-defined values for some common cases.g. Example To allow uploading images which size is not greater than 200Kb. 300px. Can be specified in any units supported by web browsers e. Acceptable file types The value of this property defines which file types are displayed in the dialog invoked by pressing the Choose File button. check this option and specify the maximum allowed file size in kilobytes. check the Resize image option. You can save the type. specify the Edit properties as follows: © 2017 SQL Maestro Group . Use file size limitation To restrict the size of uploaded files. select Resize type (Fit by width. Uploaded images resizing To upload resized images. to set the font color and the background color for a control. Can be specified in any units supported by web browsers e. 300px. For example. For example. use the File Upload 81 control. See also: Upload Image to Folder 85 . largely for the purpose of providing information to make JavaScript functions easier.20 Upload file to folder Use this control to allow users to upload external files. to add several custom attributes to an editor. background-color: yellow. 50%. Such attributes can be later handled in client-side events.g. Image (view column) 47 5. To files stored in the database. Page Editor 84 Inline styles Use this field to set formatting options to be used inside the <style> tag of the element.1.to keep the result document compatible with the HTML5 requirements. etc. place the following string to Inline styles: color: red. Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. 25em. Acceptable file types © 2017 SQL Maestro Group . Custom attributes This property allows you to add simple metadata to individual elements.3. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element.to keep the result document compatible with the HTML5 requirements. To images stored in the database.3. 85 PHP Generator for MySQL Help The value of this property defines which file types are displayed in the dialog invoked by pressing the Choose File button. to set the font color and the background color for a control.g. Folder to upload Use this field to specify the folder to be used to store the uploaded files. use the Image Upload 82 control. For example. external_data/uploaded_files/filename. Store file name only Defines whether the full file path (e.21 Upload image to folder Use this control to allow users to upload external images 48 . Custom attributes This property allows you to add simple metadata to individual elements. Such attributes can be later handled in client-side events. place the following string to Inline styles: color: red.ext) is stored in the database after the uploading. background-color: yellow.ext) or only file name (e. File download 46 5. The drop down list contains pre-defined values for some common cases. © 2017 SQL Maestro Group .g.1. Replace file if exists This option allows you to set whether the uploaded file will be saved or ignored in case a file with the same name already exists in the folder to upload. filename. to add several custom attributes to an editor. For example. Check the Generate random file name option to save uploaded files with random names or specify the File name template 88 to be used for file name generation. largely for the purpose of providing information to make JavaScript functions easier. See also: File Upload 81 . enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. By default thumbnails are saved in the same folder where full size images are saved.g. Check the Generate random file name option to save uploaded files with random names or specify the File name template 88 to be used for file name generation. Fit by height) and specify the height or width correspondingly. 25em.g. etc. Can be specified in any units supported by web browsers e. Store file name only Defines whether the full file path (e. Inline styles Use this field to set formatting options to be used inside the <style> tag of the element. Folder to upload Use this field to specify the folder to be used to store the uploaded files. 300px. Acceptable file types The value of this property defines which file types are displayed in the dialog invoked by pressing the Choose File button.g.ext) is stored in the database after the uploading. Replace file if exists This option allows you to set whether the uploaded file will be saved or ignored in case a file with the same name already exists in the folder to upload. The drop down list contains pre-defined values for some common cases. The names of thumbnails are 'field name'_'uploaded_file_name'. Enable the Generate thumbnail option to save reduced-size versions of the uploaded files along with these files. Page Editor 86 Max width Use this property to restrict the maximum width of the editor (this means that in any screen resolution editor's width will be less or equal then the property value). filename. external_data/uploaded_files/filename. 50%.ext) or only file name (e. You can also specify another Folder to upload and File name template. To set the size of thumbnails. © 2017 SQL Maestro Group . select Resize type (Fit by width. background-color: yellow. Such attributes can be later handled in client-side events. enter the following string into the Custom attributes edit box: data-city="Boston" data-lang="js" data-food="Bacon" It is recommended to prefix all custom attributes with data. See also: Image Upload 82 . Image (view column) 47 © 2017 SQL Maestro Group .87 PHP Generator for MySQL Help For example. place the following string to Inline styles: color: red. For example. Custom attributes This property allows you to add simple metadata to individual elements. largely for the purpose of providing information to make JavaScript functions easier. to add several custom attributes to an editor. to set the font color and the background color for a control.to keep the result document compatible with the HTML5 requirements. nba.nba.com/maverics/ http://www. etc.nba.com/cavaliers/ set the HREF template http://www. Suppose a table 'team' stores various info about NBA teams. The table has 'caption' column with such data: maverics cavaliers To create links to the team home pages: http://www.2 String templates String templates are used by PHP Generator for MySQL on setting HREF templates. Suppose there is a table 'employee' storing employee info. hints. Examples: 1. Page Editor 88 5.com/%caption%/ 2. The strings may contain column names enclosed by %. The table has 'first_name' and 'last_name' columns with such data: Forest Gump Sara Connor To add such hints to their photos on the generated webpage: Forest Gump Photo Sara Connor Photo Specify the hint template: %first_name% %last_name% Photo © 2017 SQL Maestro Group . For any continent all the corresponding countries may be browsed with a single click and at the same time it is possible to see cities of a certain country. add new orders. and so on. On the picture below the webpage with a list of continents is represented. working with list of continents . browsing the page representing product information. © 2017 SQL Maestro Group . edit/delete existing orders. So. for example.3 Master-Detail Presentations Master-detail presentations allow you to view and edit records from master and detail data sources (like country/city) on a single page. You can also create nested master-detail presentations when you can see the "details of details".to inspect countries of the specific continent as on the picture below. 89 PHP Generator for MySQL Help 5. see all the orders related to a certain product. you can. Alternatively you can access a detail page using the drop-down list on the right of the plus button. To see all the detail records. click the Full view link above the detail data grid. © 2017 SQL Maestro Group . Page Editor 90 First 20 detail records can be previewed without opening a separate page. Creating master-detail views There are two ways to provide the result webpage with a master-detail presentation: Automatic creation If tables are linked with a foreign key and the Setup details by foreign key 275 option is enabled. the first-level detail pages are created automatically.91 PHP Generator for MySQL Help Database schema requirements To create a two-level master-detail presentation. The foreign key constraints are not required but highly recommended to enforce the referential integrity at the database level. you need two tables with a parent- child relationship. © 2017 SQL Maestro Group . Page Editor 92 Manual creation If tables are NOT linked with a foreign key or the Setup details by foreign key 275 option is disabled. 1. 2. button on the right of the detail page list to open Link Editor.. The same technique is applied for creating nested detail pages.. you can create detail pages manually as described below. © 2017 SQL Maestro Group . Click the Add. At the Page Management step of the wizard select a root-level page 28 you want to create a detail page for or (for creating a nested detail page) select a detail page 31 in the corresponding list. Select a detail data source (table. © 2017 SQL Maestro Group .93 PHP Generator for MySQL Help 3. Click Add to add a link condition (you can specify multiple columns from each list for a single link). view. or query) and columns from the Master field and Detail field lists. Click Remove to delete a field pair. © 2017 SQL Maestro Group . Page Editor 94 4. Click OK to save changes and close Link Editor. supply the application with the power of third-part libraries. · Server-side application-level (global) events 95 · Server-side page-level events 122 · Client-side page-level events 113 To add or modify an event handler: · open Page Editor 33 of a webpage the event to be fired on (for page-level events) or the Project Options 181 dialog (for global events).e. The complete list of currently available application-level events is as follows. This feature provides you with wide opportunities: for example.4. 95 PHP Generator for MySQL Help 5. It is possible to use Server Side API 257 and environment variables 155 within these event handlers. · enter/modify your PHP/Javascript code in the text area. and by the side the event handlers are executed on: the webserver (written on PHP) or browsers (written on Javascript). use the corresponding checkbox at the Events tab of the according Page Editor 33 (for Page events) or the Project Options 181 (for Global events). · go to the Events tab. etc. 5.1 Application-level (global) Events Handlers of global events are pieces of PHP code that are not specific for any page i. completely redesign any of generated pages.4 Events PHP Generator for MySQL allows you to supply the generated applications with an additional functionality with the help of event handlers. you can equip webpages with tracking of user activity. Event handlers are fragments of PHP/Javascript code executed at the appointed time. these events are fired for all the generated webpages. · select an event from the list and double-click the appropriate line in the grid (it is also possible to use popup menu or Ctrl+Enter). To temporarily disable an event. · OnBeforePageExecute 97 · OnAfterLogin 97 · OnBeforeLogout 97 · OnPreparePage 98 · OnGetCustomTemplate 99 · OnCustomHTMLHeader 98 · OnBeforeUpdateRecord 107 © 2017 SQL Maestro Group . All events supported by PHP Generator for MySQL may be divided by the scope the events are fired on (possible options are all generated webpages (global events) or a certain webpage (page-specific events)). switch to the Events tab of the Project options 181 dialog and double click the appropriate line in the grid. Page Editor 96 · OnBeforeInsertRecord 107 · OnBeforeDeleteRecord 108 · OnAfterUpdateRecord 109 · OnAfterInsertRecord 108 · OnAfterDeleteRecord 110 · OnGetFieldValue 111 · OnGetCustomExportOptions 111 · OnCustomizePageList 112 · OnGetCustomPagePermissions 113 To specify a handler for a global event. © 2017 SQL Maestro Group . $connection. The code snippet below inserts a new record containing user name and the login time into the 'log' table. The following code is used to include it to into all application web pages. 5.1 OnBeforePageExecute This event occurs before other events are declared and allow to create global objects.php file. This helps you to define a snapshot of PHP code that will be included into all the pages. © 2017 SQL Maestro Group . $connection) Parameters: $userName The name of the logged user. formatting and highlighting SQL code we entered in the schema_browser_utlis. log_date) VALUES ('$userName'. $connection->ExecSQL("INSERT INTO log(user_name. $errorMessage) Parameters: $userName The name of the logged user. but $canLogin == false. $canLogin.2 OnAfterLogin This event occurs after a user is successfully logged in into the application. $connection An instance of the EngConnection class 259 . 5.1. $canLogin Specifies whether a user can login (true by default).4. CURRENT_TIMESTAMP)"). Signature: function OnBeforeLogout ($userName. See also: OnBeforeLogout event 97 . 97 PHP Generator for MySQL Help 5. include_once 'schema_browser_utils. and include third-party libraries.1. $errorMessage A message to be displayed when valid credentials are provided.3 OnBeforeLogout This event occurs just before a user logged out from the application by pressing the Logout button or when the inactivity timeout 225 is reached. Signature: function OnBeforePageExecute() Example: In our Schema Browser demo project all the code implementing database filter.php'. Example Among other things this event can be used for tracking the user activity.4. Signature: function OnAfterLogin ($userName.4.1. declare functions. You can set the value of this parameter to false to disable login even for a user who provided valid credentials. Page Editor 98 $connection An instance of the EngConnection class 259 . Example Among other things this event can be used for tracking the user activity. The code snippet below inserts a new record containing user name and the action into the 'activity_log' table. $connection->ExecSQL( "INSERT INTO activity_log (user_name, action) values ('{$userName}', 'logout')" ); See also: OnAfterLogin event 97 . 5.4.1.4 OnPreparePage This piece of code is a method of the Page class that is called at the end of the constructor. It allows you to customize all members of the class. Signature: function OnPreparePage() Parameters: This method has no parameters. Example The following code hides the update_date_time column from the data grid and Single Record View form as well as the status column from Edit and Insert forms from all users except ones who have the Admin privilege for the current page. if (!GetApplication()->IsLoggedInAsAdmin()) { $updateDateTimeColumnName = 'update_date_time'; $column = $this->GetGrid()->getSingleRecordViewColumn($updateDateTimeColumnName); if ($column) { $column->setVisible(false); } $column = $this->GetGrid()->getViewColumn($updateDateTimeColumnName); if ($column) { $column->setVisible(false); } $statusColumnName = 'status'; $column = $this->GetGrid()->getEditColumn($statusColumnName); if ($column) { $column->setVisible(false); } $column = $this->GetGrid()->getInsertColumn($statusColumnName); if ($column) { $column->setVisible(false); } } 5.4.1.5 OnCustomHTMLHeader This event occurs when generating the HEAD section of the page. It allows you to define the contents of the HEAD section (like meta tags or favicon) for all pages of the generated website. © 2017 SQL Maestro Group 99 PHP Generator for MySQL Help Signature: function OnCustomHTMLHeader ($page, &$customHTMLHeaderText) Parameters: $page An instance of the Page class 257 declared in components/page.php. $customHtmlHeaderText The text block to be added to the head section of all created pages. Example: To add a new title and a favicon to all webpages of the generated application, place the following code to the event body. $customHtmlHeaderText = '<meta name="author" content="SQL Maestro Group">'; $customHtmlHeaderText .= "\n"; $customHtmlHeaderText .= '<meta name="copyright" content="SQL Maestro Group" />'; $customHtmlHeaderText .= "\n"; $customHtmlHeaderText .= '<meta name="keywords" content="nba,basketball,game">'; $customHtmlHeaderText .= "\n"; $customHtmlHeaderText .= '<link rel="icon" href="favicon.ico" type="image/x-icon" />'; The screenshot demonstrates the result of the fired event. 5.4.1.6 OnGetCustomTemplate This event allows you to customize almost any part of the generated application using an own template instead of the default one. Signature: function OnGetCustomTemplate ($part, $mode, &$result, &$params) Parameters: $part The part of the page to be affected by the template. $mode The current state of the webpage the template to be used. $result The path to the file to be used as template according to the components/templates/custom_templates folder. $params An associative array of additional parameters you want to assign to the template. © 2017 SQL Maestro Group Page Editor 100 PHP Generator uses Smarty 2.0 as template language. If you are not familiar with web template engines, you might want to start here. Our Feature Demo provides a number of live examples of customized templates. We would recommend you to study them carefully before trying to customize your application. To customize a webpage, you need to: · create a new template to be used for this webpage; · instruct PHP Generator to use this template for the selected webpage. The simplest way to create a new template is to modify an existing one (it is much easier than create a new template "from scratch"). Use the table below to select the template corresponding to the necessary state of page and page part. Custom template files should be uploaded to the 'components/templates/custom_templates' directory. This folder should be created by the user of PHP Generator and its content is not changing during the further PHP Generator sessions. The following table shows how to customize common pages used in the generated applications. State of Page Part Default template Parameters the webpage webpage common/layout.tpl PagePart::Layout layout Any PageMode All Pages page_list_menu.tpl PagePart::PageList (for top-side menu) Any PageMode page list page_list_sidebar.tpl (for sidebar menu) list/grid_table.tpl PagePart::Grid (for grid view mode) PageMode::ViewAll table grid list/grid_card.tpl (for card view mode) List page list/single_row.tpl PagePart::GridRow (for grid view mode) PageMode::ViewAll single row list/sinlge_row_card.tpl (for card view mode) view/grid.tpl PagePart::RecordCard View (separate page) PageMode::View forms/form.tpl PagePart::VerticalGrid Edit form (editors area) PageMode::EditForm © 2017 SQL Maestro Group 101 PHP Generator for MySQL Help forms/form.tpl PagePart::VerticalGrid Insert form (editors area) PageMode::InsertForm compare/grid.tpl PagePart::Grid Record comparison page PageMode::Compare forms/page_form.tpl PagePart::VerticalGrid Edit (separate page) PageMode::Edit forms/page_form.tpl PagePart::VerticalGrid Insert (separate page) PageMode::Insert forms/modal_form.tpl PagePart::VerticalGrid Edit (modal dialog) PageMode::ModalEdit forms/modal_form.tpl PagePart::VerticalGrid Insert (modal dialog) PageMode::ModalInsert view/record_card_view.tpl PagePart::VerticalGrid View (modal dialog) PageMode::ModalView forms/inline_form.tpl PagePart::VerticalGrid Edit (inline form) PageMode::InlineEdit forms/inline_form.tpl PagePart::VerticalGrid Insert (inline form) PageMode::InlineInsert print/page.tpl PagePart::PrintLayout webpage PageMode::PrintAll layout print/grid.tpl PagePart::Grid Print table grid PageMode::PrintAll print/detail_page.tpl PagePart::PrintLayout detail page PageMode::PrintDetailPage export/pdf_grid.tpl, export/ PagePart::Grid excel_grid.tpl, export/ PageMode::ExportPdf, data grid csv_grid.tpl, etc PageMode::ExportExcel, PageMode::ExportCsv, Export etc export/pdf_record.tpl PagePart::RecordCard single record PageMode::ExportPdf (PDF only) © 2017 SQL Maestro Group Page Editor 102 print/page.tpl PagePart::PrintLayout webpage PageMode::PrintOneRecord Print layout Single Record view/print_grid.tpl PagePart::Grid table grid PageMode::PrintOneRecord login_page.tpl PagePart::LoginPage Login page login_control.tpl PagePart::LoginControl Login control home_page.tpl PagePart::HomePage Home page navigation.tpl PagePart::Navigation Navigation The following table shows how to customize user registration and password recovering pages. These parameters can be used only for the project-level version of this event. registration_page.tpl PagePart::RegistrationPage Registration Page registration_form.tpl PagePart::RegistrationForm Registration Form recovering_password_page. PagePart:: Password Recovery tpl PasswordRecovery Page reset_password_page.tpl PagePart::ResetPassword Reset Password Page resend_verification_page.tpl PagePart:: Resend Verification ResendVerification Email Page The following table shows how to customize emails sent to users 213 on registration and password recovering. These parameters can be used only for the project-level version of this event. © 2017 SQL Maestro Group 103 PHP Generator for MySQL Help user_verification_subject PagePart::Mail Verification email .tpl PageMode:: subject MailVerificationSubject user_verification_body. PagePart::Mail Verification email tpl PageMode::MailVerificationBody body recovering_password_sub PagePart::Mail Password reset email ject.tpl PageMode:: subject MailRecoveringPasswordSubject recovering_password_bo PagePart::Mail Password reset email dy.tpl PageMode:: body MailRecoveringPasswordBody To instruct PHP Generator to use a customized template file for a certain webpage, specify the following code in the page's OnGetCustomTemplate event handler (of course you should replace YourPart and YourMode to the appropriate values from the table above). if ($part == YourPart && $mode == YourMode) { $result = 'your_template_file.tpl'; } Example 1: Suppose we need to use components/templates/custom_templates/staff_edit.tpl file as a template for the edit form of a webpage. if ($part == PagePart::VerticalGrid && $mode == PageMode::Edit) { $result = 'staff_edit.tpl'; } Now we can compare the result webpages without using this event and with the enabled one: © 2017 SQL Maestro Group if ($part == PagePart::RecordCard && $mode == PageMode::View) $result = 'games_view. Specify the OnGetCustomTemplate event handler as follows: // set the template file if ($part == PagePart::Grid && $mode == PageMode::ViewAll) { $result = 'custom_grid.tpl'.tpl'.tpl'. // get the list of available databases © 2017 SQL Maestro Group . Page Editor 104 Example 2: A single event handler can be used to customize multiple templates: if ($part == PagePart::Grid && $mode == PageMode::ViewAll) $result = 'games_grid. if ($part == PagePart::VerticalGrid && $mode == PageMode::Edit) $result = 'games_edit.tpl'. 1. Example 3 This example shows how to fill a SELECT input with names of all MySQL databases available at the server. else // not found. } 2. // check if the parameter custom_var available if (GetApplication()->IsGETValueSet('custom_var')) // found $params['custom_var'] = GetApplication()->GetGETValue('custom_var').tpl'. Add the following code to the template file: <div> <h4>I am a custom template with a custom variable $custom_var. Its value © 2017 SQL Maestro Group . // fill a one-dimensional array with database names $databaseNames = array(). Assign a default value. Example 4 This example shows the use of the superglobal $_GET array values in a custom template. Add the following code to the template file: <select name="database"> {foreach from=$databaseNames item=database} <option value="{$database}">{$database}</option> {/foreach} </select> The screen below demonstrates the result output. Specify the OnGetCustomTemplate event handler as follows: if ($part == PagePart::Grid && $mode == PageMode::ViewAll) { $result = 'custom_grid. $this->GetConnection()->ExecQueryToArray('SHOW DATABASES'. foreach($queryResult as $row) $databaseNames[] = $row[0]. } 2. $params['custom_var'] = '5 (default)'. // assign the parameter in the template $params['databaseNames'] = $databaseNames. 1.105 PHP Generator for MySQL Help $queryResult = array(). $queryResult). home games and players for LA Lakers. } 2. if ($part == PagePart::RecordCard && $mode == PageMode::ExportPdf) { $result = 'game_pdf.</td> </tr> <tr> <td>boston</td> <td>boston</td> <td>The same for the Boston Celtics team.tpl'. } © 2017 SQL Maestro Group .</td> </tr> <tr> <td>game_manager</td> <td>game</td> <td>Can access only game list.tpl'.</td> </tr> <tr> <td>lakers</td> <td>lakers</td> <td>Can modify team info. </h4> </div> Example 4 Let's see the login form customization used in our NBA online demo. 1. Specify the OnGetCustomTemplate event handler as follows: if ($part == PagePart::LoginPage) { $result = 'login_page.</td> </tr> </tbody> </table> Example 5 The example below is used in our NBA demo application to customize the template used to export a single record to PDF. Can modify any game. Add the following code to the template file: <h2>Logins</h2> <table class="table table-bordered"> <thead> <tr> <th>Username</th> <th>Password</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>admin</td> <td>admin</td> <td>Can modify any record at any page and manage other users. Page Editor 106 {if !isset($custom_var)} still undefined {else} = {$custom_var} {/if}. $cancel The value indicating whether the operation should be canceled. $message = 'The application is running in read-only mode. $messageDisplayTime A time interval (in seconds) after which the message will disappear automatically. $rowData The associative array of values that corresponds to the currently processed row. Default value is 0 (the message will not disappear). &$rowData. &$messageDisplayTime.4.1. &$messageDisplayTime. 5.8 OnBeforeUpdateRecord This event occurs when the Update command is executed. $cancel The value indicating whether the operation should be © 2017 SQL Maestro Group . &$cancel.php.4.7 OnBeforeInsertRecord This event occurs when the Insert command is executed. &$message. Signature: function OnBeforeInsertRecord ($page.1. 5. $oldRowData. OnAfterInsertRecord 142 . $message The message string that is displayed after the operation is completed (or canceled). $tableName) Parameters: $page An instance of the Page 257 class declared in components/ page. and before the actual insertion. and before the actual update. &$message. Signature: function OnBeforeUpdateRecord ($page. $tableName The name of processed table.'. Example: if (!(allowDataEditing())) { $cancel = true. $oldRowData The associative array of old (previous) values of the currently processed row. $tableName) Parameters: $page An instance of the Page 257 class declared in components/ page. &$rowData. 107 PHP Generator for MySQL Help Live example can be found here. OnBeforeDeleteRecord 145 .php. } See also: OnBeforeUpdateRecord 145 . &$cancel. $rowData The associative array of values that corresponds to the currently processed row. $tableName The name of processed table. © 2017 SQL Maestro Group . Default value is 0 (the message will not disappear). OnAfterUpdateRecord 142 .9 OnBeforeDeleteRecord This event occurs when the Delete command is executed. &$cancel.10 OnAfterInsertRecord This event occurs when the Insert command is executed. 5.'. OnBeforeInsertRecord 144 . $message The message string that is displayed after the operation is completed (or canceled). $tableName) Parameters: $page An instance of the Page 257 class declared in components/ page. &$messageDisplayTime. &$rowData. and after the actual insertion.php. Signature: function OnBeforeDeleteRecord ($page. $message = 'The application is running in read-only mode. $message = 'The application is running in read-only mode.1. Default value is 0 (the message will not disappear). $tableName The name of processed table. $messageDisplayTime A time interval (in seconds) after which the message will disappear automatically. &$message. } See also: OnBeforeUpdateRecord 145 . $message The message string that is displayed after the operation is completed (or canceled). Example: if (!(allowDataEditing())) { $cancel = true.1. $messageDisplayTime A time interval (in seconds) after which the message will disappear automatically. 5. OnBeforeInsertRecord 144 .4. Example: if (!(allowDataEditing())) { $cancel = true. and before the actual deletion.4. $cancel The value indicating whether the operation should be canceled. Page Editor 108 canceled.'. OnAfterDeleteRecord 143 . $rowData The associative array of values that corresponds to the currently processed row. } See also: OnBeforeDeleteRecord 145 . $message A message to be displayed to a user. &$success. &$messageDisplayTime) Parameters: $page An instance of the Page 257 class. $messageDisplayTi A time interval (in seconds) after which the message will me disappear automatically. &$success. and after the actual update. Default value is 0 (the message will not disappear). Example if ($success) { $message = 'Record processed successfully. If the statement completed successfully.</p>'. ' . $oldRowData The associative array of old (previous) values of the currently processed row. $rowData. $rowData The associative array of values that corresponds to the currently processed row. the value of this parameter is equal to empty string. $oldRowData. } else { $message = '<p>Something wrong happened.1. $rowData The associative array of values that corresponds to the currently processed row.'. $success Indicates whether the last data manipulation statement was successful or not. &$message.com">' . OnAfterDeleteRecord 143 .11 OnAfterUpdateRecord This event occurs when the Update command is executed. the value of this parameter contains the error message that came from the database server. $rowData. Signature: function OnAfterUpdateRecord ($page. $tableName The name of processed table. Success messages are displayed in green while error messages are displayed in red. &$message. © 2017 SQL Maestro Group . $tableName. OnBeforeInsertRecord 144 . $tableName The name of processed table. If the statement failed.4. $success Indicates whether the last data manipulation statement was successful or not. &$messageDisplayTime) Parameters: $page An instance of the Page 257 class. 109 PHP Generator for MySQL Help Signature: function OnAfterInsertRecord ($page. 5. '<a class="alert-link" href="mailto:admin@example. } See also: OnAfterUpdateRecord 142 . 'Contact developers</a> for more info. $tableName. Signature: function OnAfterDeleteRecord ($page. '<a class="alert-link" href="mailto:admin@example. © 2017 SQL Maestro Group . $rowData. $message A message to be displayed to a user. $tableName.</p>'. $tableName The name of processed table. $messageDisplayTi A time interval (in seconds) after which the message will me disappear automatically. OnBeforeUpdateRecord 145 . the value of this parameter contains the error message that came from the database server.12 OnAfterDeleteRecord This event occurs when the Delete command is executed. the value of this parameter contains the error message that came from the database server. } See also: OnAfterDeleteRecord 143 .1. Default value is 0 (the message will not disappear).com">' . &$messageDisplayTime) Parameters: $page An instance of the Page 257 class. &$success. } else { $message = '<p>Something wrong happened. ' . Default value is 0 (the message will not disappear). $rowData The associative array of values that corresponds to the currently processed row. the value of this parameter is equal to empty string. OnAfterInsertRecord 142 . Page Editor 110 $message A message to be displayed to a user. $messageDisplayTim A time interval (in seconds) after which the message will e disappear automatically. Success messages are displayed in green while error messages are displayed in red. If the statement failed. $success Indicates whether the last data manipulation statement was successful or not.'. If the statement completed successfully. If the statement failed. the value of this parameter is equal to empty string. 5. If the statement completed successfully.'. Success messages are displayed in green while error messages are displayed in red. Example if ($success) { $message = 'Record processed successfully.4. &$message. Example if ($success) { $message = 'Record processed successfully. and after the actual deletion. 'Contact developers</a> for more info. 'Contact developers</a> for more info.</p>'. It allows you to replace the actual value of a field to your own. 111 PHP Generator for MySQL Help } else { $message = '<p>Something wrong happened. &$value. It allows you to customize some advanced export settings.13 OnGetFieldValue This event occurs on displaying a value of a field. $value The actual value of the field. 5.4. ' . "xls". } Since the call of this function for an encrypted expression returns the original string. Signature: function OnGetFieldValue ($fieldName. 5. "pdf". $rowData An associative array of values that corresponds to the currently processed row (for exporting a single row). $rowData.14 OnGetCustomExportOptions This event fires on exporting data from a database to a file. $exportType The type of the result file. if ($fieldName == 'private_data') { $value = str_rot13($value). } See also: OnAfterUpdateRecord 142 . OnAfterInsertRecord 142 . $tableName The name of currently processed table. OnBeforeDeleteRecord 145 . '<a class="alert-link" href="mailto:admin@example. we can define OnBeforeInsertRecord 144 and OnBeforeUpdateRecord 145 event handlers as follows: $rowData['private_data'] = str_rot13($rowData['private_data']). NULL if a record list is © 2017 SQL Maestro Group . "doc". This is just an example. "xml". Signature: function OnGetCustomExportOptions ($Page page.4. $tableName) Parameters: $fieldName The name of currently processed field. &$options) Parameters: $page An instance of the Page 257 class. Possible values are "csv". Example This example shows how this event can be used for implementing a very simple transparent encryption based on the str_rot13 PHP function.1. $exportType. Can be changed to another value.1. We would recommend that you use more cryptographically strong algorithms to encrypt your important data.com">' . 5. $options['filename'] = ($rowData ? $rowData['id'] : 'list') .mysite. SRA0 . 'External links')). If a record list is exported. $pageList An instance of the PageList class.1. $options An associative array of options passed to the export engine (see below). Royal. Possible values are "P" (portrait orientation) or "L" (landscape orientation). false. The list of supported options is as follows: All export types filename The name of the output file. © 2017 SQL Maestro Group .A10. C0 - C10. list. etc). the file name is set to list. false.com/support/'. Legal. false.xls files). 'Vist my site'. A (type A paperback 111x178mm). Default value is "P". 'Get support for this application'. 2A0. 'http://www. Folio. Default value is "template".RA4. B0 . Executive. Possible values are "template" (template-based export) and "phpexcel" (to create native .' . 'http://www. '.B10. Example This example shows how to customize the result file name according to row values. $pageList->addGroup('External links').4. Signature: function OnCustomizePageList($page. size Size of the page. $pageList->addPage(new PageLink('Home Site'.com'.xml. B (type B paperback 128x198mm). RA0 . $exportType.pdf (list. $pageList) Parameters: $page An instance of the CommonPage class that corresponds currently processed page. Letter. 4A0.xls.mysite. 'External links')). Page Editor 112 exported.SRA4. Export to PDF orientation Page orientation.15 OnCustomizePageList This event allows you to add new groups and items to the application menu (both top- side and sidebar). false. Export to Excel engine The engine to be used on data export. Default value is A4. Possible values are A0 . Example This example shows how to add a new group with a couple of links. $pageList->addPage(new PageLink('Get Support'. Demy. &$handled) Parameters: $page An instance of the Page 257 class. true. } See also: OnGetCustomRecordPermissions 153 . $permissions Permissions to be applied to the page. Our goal is to ensure that only site admins and members of the Sales role can add. true).4. "INNER JOIN phpgen_roles r ON r. } } }.role_name " . Example This example shows how to implement a simple role-based permission model. Signature: function OnGetCustomPagePermissions($page.4. $handled A parameter to indicate whether the new permissions should be applied. true. // retrieving all user roles $sql = "SELECT r. // iterating through retrieved roles if (!empty($result)) { foreach ($result as $row) { // is current user a member of the Sales role? if ($row['role_name'] === 'Sales') { // if yes.16 OnGetCustomPagePermissions This event allows you to customize page-level permissions. 5. // otherwise default permissions for this page will be applied $permissions->setGrants(true. $userId)). using jQuery. // apply the new permissions $handled = true. "FROM phpgen_user_roles ur " . They allow you to manipulate with DOM elements directly. break.1. Set $handled to true to apply the changes.role_id " .2 Client Side Page Events Client-side events are fragments of JavaScript code executed at the appointed time.id = ur. "WHERE ur. allow all actions. // do not apply these rules for site admins if (!GetApplication()->HasAdminGrantForCurrentUser()) { // retrieving the ID of the current user $userId = GetApplication()->GetCurrentUserId(). 113 PHP Generator for MySQL Help 5. An instance of the PermissionSet 260 class. and/or via the © 2017 SQL Maestro Group . $result = $page->GetConnection()->fetchAll(sprintf($sql. &$permissions. remove and edit records displayed on this page.user_id = %d". pg-row'). · OnBeforePageLoad 114 · OnAfterPageLoad 114 · OnInsertFormValidate 115 · OnEditFormValidate 115 · OnInsertFormEditorValueChanged 116 · OnEditFormEditorValueChanged 118 · OnInsertFormLoaded 120 · OnEditFormLoaded 121 See also: Server Side Events 122 5.pgui-grid').pgui-grid tr. © 2017 SQL Maestro Group . function() { setTimeout(highlightWinLossRows. define the expandFirstDetail function within the OnBeforePageLoad event handler as follows: function expandFirstDetail() { if ($('table. It does not get triggered until all assets such as images have been completely received and DOM hierarchy has been fully constructed. 3000). 5. The complete list of currently available client-side events is as follows. }).4. specify Javascript code as follows: $('a.2.4. Example: To get details of the first record expanded on the webpage opening.on("click".1 OnBeforePageLoad This event occurs before page loading. Use the event to include one or several files of a third-party library into the generated pages.expandDetails($row). grid.2. Example: To get the details of the first master record expanded on opening of a certain page of the generated application. Page Editor 114 Client Side API 231 provided by PHP Generator for MySQL.2 OnAfterPageLoad This event occurs after page has been fully rendered.expand-details').data('grid-class'). return true. var $row = $('table. It allows you to declare functions and global variables. 100).first(). } } This function then should be called within the OnAfterPageLoad 114 event handler. } else { setTimeout(expandFirstDetail.data('grid-class')){ var grid = $('table.pgui-grid'). In this case the OnAfterPageload event handler should contain only the function call: expandFirstDetail().4 OnEditFormValidate This event occurs before submitting an edit form.SetMessage('"Home" and "Away" must be different'). errorInfo) Parameters: fieldValues An associative array of values containing the user input. errorInfo The object that provides interface (the SetMessage method) to set a validation error message.4. if (fieldValues['percents'] < 0 || fieldValues['percents'] > 100) { errorInfo. return false. } Example 2: The following code is used in the NBA demo project to ensure that home and away teams are different for an inserted game: if (fieldValues['home_team_id'] == fieldValues['away_team_id']) { errorInfo. 115 PHP Generator for MySQL Help It is also possible to specify the function above within the OnBeforePageLoad 114 event handler.2. Signature: function OnInsertFormValidate (fieldValues. It allows you to detect errors on the client side before the form is submitted to the server to avoid the round trip of information necessary for server-side validation.').4. return false.2. errorInfo) Parameters: fieldValues An associative array of values containing user input. Signature: function OnEditFormValidate (fieldValues. Example 1: The code below demonstrates the verification of the percent number on the record inserting. © 2017 SQL Maestro Group . It allows you to detect errors on the client before the form is submitted to the server to avoid the round trip of information necessary for server-side validation.SetMessage('Percent value should be between 0 and 100.3 OnInsertFormValidate This event occurs before submitting of an insert form. 5. } See also: OnEditFormValidate 115 5. enabled(sender.next().S. } See also: OnInsertFormValidate 115 5. if (sender. editors) Parameters: sender A control whose value has been changed. Signature: function OnInsertFormEditorValueChanged (sender. $('#college_id_edit').').getValue()).show().SetMessage('Percent value should be between 0 and 100.5 OnInsertFormEditorValueChanged This event occurs on changing a value in the Insert form.next().2.setValue(null). console.getValue() == 1). Page Editor 116 errorInfo An object that provides interface (the SetMessage method) to set a validation error message. © 2017 SQL Maestro Group .hide().log(sender).getFieldName() == 'country_id') { console.4. editors['college_id']. return false. editors An associative array of form controls. use the following code: if (fieldValues['percents'] < 0 || fieldValues['percents'] > 100) { errorInfo. Example 1: To validate the 'percents' value and show a warning message in case of erroneous input. if (sender.log(sender. } else $('#college_id_edit'). See how it looks on the webpage at the screen below. } Example 2: The following code is used in the NBA demo project to ensure that home and away teams are different for an edited game: if (fieldValues['home_team_id'] == fieldValues['away_team_id']) { errorInfo.getValue() != 1) { editors['college_id'].SetMessage('"Home" and "Away" must be different'). (see this in action). The examples below show how this method can be used in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 event handlers. Example 1: The code below allows you to select a college only for players from U. return false. getValue() == '') { editors['current_number']. } } © 2017 SQL Maestro Group .enabled(false).hide(). editors['current_number']. This piece of code allows you to select player number only if a player's team is already selected (in other words.enabled(true).setValue(''). $('#current_number_edit'). } else { editors['current_number'].next(). players who do not belong to a team cannot have numbers).getFieldName() == 'current_team_id') { if (sender.show().117 PHP Generator for MySQL Help Example 2: Another example from the insert and edit forms of the Players page (see this in action).next(). if (sender. $('#current_number_edit'). 2. console.6 OnEditFormEditorValueChanged This event occurs on changing a value in the Edit form. if (sender. Example 1: The code below allows you to select a college only for players from U.getValue() == 1).getValue()).next(). if (sender. (see this in action).log(sender.S. © 2017 SQL Maestro Group . The examples below show how this method can be used in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 event handlers.4.enabled(sender. $('#college_id_edit'). editors['college_id']. editors An associative array of form controls.log(sender). } else $('#college_id_edit'). See how it looks on the webpage at the screen below.show(). editor) Parameters: sender A control whose value has been changed. Signature: function OnEditFormEditorValueChanged(sender.hide().setValue(null).getValue() != 1) { editors['college_id']. Page Editor 118 See also: OnEditFormEditorValueChanged 118 5.next().getFieldName() == 'country_id') { console. 119 PHP Generator for MySQL Help Example 2: Another example from the insert and edit forms of the Players page (see this in action).next().next().enabled(false). $('#current_number_edit'). if (sender. players who do not belong to a team cannot have numbers). editors['current_number'].enabled(true). $('#current_number_edit'). } } © 2017 SQL Maestro Group .hide().setValue(''). } else { editors['current_number'].show().getFieldName() == 'current_team_id') { if (sender.getValue() == '') { editors['current_number']. This piece of code allows you to select player number only if a player's team is already selected (in other words. enabled(false). } else editors['current_number'].enabled(editors['country_id'].getValue() != 1) editors['college_id']. 2) Player's college is cleared and the appropriate control becomes disabled if player's country is not USA (country code == 1).7 OnInsertFormLoaded This event occurs after an Insert form is loaded.getValue() == 1). addInlineHint('college_id'. Signature: function OnInsertFormLoaded(editor) Parameters: editors An associative array of form controls.setValue('').2. editors['college_id'].4. 'College can be selected only for players from USA. Page Editor 120 See also: OnInsertFormEditorValueChanged 116 5.') if (editors['country_id']. Example: This piece of code targets two things: 1) Player number is cleared and the appropriate control becomes disabled for players that do not belong to a team. if (editors['current_team_id'].setValue(null).getValue() == '') { editors['current_number']. The inline hint describes the reason of the disabling. © 2017 SQL Maestro Group . editors['current_number'].enabled(true). getValue() == 1). Signature: function OnEditFormLoaded(editor) Parameters: editors An associative array of form controls.setValue(''). if (editors['current_team_id']. 121 PHP Generator for MySQL Help See also: OnEditFormLoaded 121 5.4. } else { editors['current_number']. } 2) Player's college is cleared and the appropriate control becomes disabled if player's country is not USA (country code == 1).setEnabled(true). editors['current_number'].setEnabled(editors['country_id']. © 2017 SQL Maestro Group . Example: This piece of code targets two things: 1) Player number is cleared and the appropriate control becomes disabled for players that do not belong to a team.2.getValue() == '') { editors['current_number'].8 OnEditFormLoaded This event occurs after the Edit form is loaded. editors['college_id'].setEnabled(false). It is possible to use Server Side API 257 and environment variables 155 within these event handlers.setValue(null).4. Page Editor 122 if (editors['country_id']. · OnBeforePageExecute 123 · OnPreparePage 123 · OnCustomRenderColumn 125 · OnCustomRenderPrintColumn 128 · OnCustomRenderExportColumn 128 · OnCustomHTMLHeader 128 · OnExtendedCustomDrawRow 129 · OnCustomRenderTotals 132 · OnGetCustomTemplate 133 · OnCustomDrawRow 141 · OnAfterUpdateRecord 142 · OnAfterDeleteRecord 143 · OnAfterInsertRecord 142 · OnBeforeUpdateRecord 145 © 2017 SQL Maestro Group . The complete list of currently available client-side events is as follows.3 Server Side Page Events Server-side events are fragments of PHP code executed at the appointed time.getValue() != 1) editors['college_id']. See also: OnInsertFormLoaded 120 5. 123 PHP Generator for MySQL Help · OnBeforeDeleteRecord 145 · OnBeforeInsertRecord 144 · OnGetFieldValue 146 · OnGetCustomExportOptions 146 · OnPrepareFilterBuilder 147 · OnPrepareColumnFilter 148 · OnGetCustomFormLayout 149 · OnGetCustomColumnGroup 150 · OnCustomCompareValues 151 · OnGetCustomUploadFileName 152 · OnGetCustomPagePermissions 153 · OnGetCustomRecordPermissions 153 See also: Client Side Events 113 5. Example Suppose we decided to implement a syntax highlighting using the GeSHi library somewhere in the generated application.4. declare functions.3. if (!GetApplication()->IsLoggedInAsAdmin()) { $updateDateTimeColumnName = 'update_date_time'.3.. It allows you to customize all members of the class.php'. and so on./geshi/geshi. $column = $this->GetGrid()->getSingleRecordViewColumn($updateDateTimeColumnName). 5.2 OnPreparePage This piece of code is a method of the Page class that is called at the end of the constructor. To implement such a feature. so the event handler should be specified as follows: include_once '. Example The following code hides the update_date_time column from the data grid and Single Record View form as well as the status column from Edit and Insert forms from all users except ones who have the Admin privilege for the current page.1 OnBeforePageExecute This event handler contains PHP code to be included into the page.4. This code is executed only once and intended to create global objects. Signature: function OnPreparePage() Parameters: This method has no parameters. if ($column) { © 2017 SQL Maestro Group . we need (among other things) to include the main library file into the generated scripts. include third-party libraries. if (StringUtils::IsNullOrEmpty($value)) { $globalConnectionOptions = GetGlobalConnectionOptions(). It allows you. 'database'). if ($column) { $column->setVisible(false). new FieldFilter($value. '=')). } } 5. } $statusColumnName = 'status'. $value).3. $column = $this->GetGrid()->getEditColumn($statusColumnName).4. Signature: function OnPageLoaded() Parameters: This method has no parameters. } $column = $this->GetGrid()->getInsertColumn($statusColumnName). Example 1 The following code is used in our Schema Browser Demo to filter database objects belonging to the selected database: applyDatasetFilter($this->dataset).3 OnPageLoaded This event occurs after the page is completely loaded from the server. } if (!StringUtils::IsNullOrEmpty($value)) { $dataset->AddFieldFilter('Database_name'. Page Editor 124 $column->setVisible(false). to add additional filters to the dataset.php file as follows: function applyDatasetFilter(Dataset $dataset) { if (GetApplication()->IsGETValueSet('database')) $value = GetApplication()->GetGETValue('database'). if ($column) { $column->setVisible(false). Here applyDatasetFilter() is a function defined in the schema_browser_utils. else $value = ArrayUtils::GetArrayValueDef($_COOKIE. $value = $globalConnectionOptions['database']. for example. setcookie('database'. } } Example 2 The following code is used in our Feature Demo to filter countries according to the values selected in the form: © 2017 SQL Maestro Group . } $column = $this->GetGrid()->getViewColumn($updateDateTimeColumnName). if ($column) { $column->setVisible(false). Signature: function OnCustomRenderColumn ($fieldName. // checking values in the browser address line if (GetApplication()->isGetValueSet('minLifeExpectancy') && GetApplication()->isGetValueSet('maxLifeExpectancy')) { $minLifeExpectancy = GetApplication()->GetGETValue('minLifeExpectancy').4 OnCustomRenderColumn This event occurs before column rendering and allows you to completely replace the cell content. To do so. $rowData. © 2017 SQL Maestro Group . } // saving calculated values to the session $_SESSION['minLifeExpectancy'] = $minLifeExpectancy. Set $handled to true to apply the new content. $rowData The associative array of values that corresponds to the currently processed row. $fieldData The data of currently processed cell. $handled A parameter to indicate whether the event handler takes effect. Example 1: Suppose a table 'employee' has a column storing data about the employee's sex in that way that '1' corresponds to male and '2' to female.3. It is an extremely useful event for conditional rendering or embedding third- party components to extend standard functionality. &$handled) Parameters: $fieldName The field name for the currently processed cell. // applying filter to the dataset $this->dataset->AddCustomCondition( "life_expectancy >= {$minLifeExpectancy} ". $_SESSION['maxLifeExpectancy'] = $maxLifeExpectancy. 125 PHP Generator for MySQL Help // default values $minLifeExpectancy = 40. $handled = true. $maxLifeExpectancy = $_SESSION['maxLifeExpectancy']. $fieldData. // or (if not found) in the session } else if (isset($_SESSION['minLifeExpectancy']) && isset($_SESSION['maxLifeExpectancy'])) { $minLifeExpectancy = $_SESSION['minLifeExpectancy']. $customText A string to replace the original cell content. "AND life_expectancy <= {$maxLifeExpectancy}"). 5.4. &$customText. Our goal is to represent the employees sex as 'M' and 'F' for men and women accordingly. $maxLifeExpectancy = 90. $maxLifeExpectancy = GetApplication()->GetGETValue('maxLifeExpectancy'). you could specify the OnCustomRenderColumn event handler as follows: if ($fieldName == 'sex') { $customText = $rowData['sex'] == 1 ? 'M' : 'F'. $countriesPics[$rowData['country_id']]. Example 3: The code below is used in our demo project to add flag images to the "Country" column. '&nbsp.">' . } © 2017 SQL Maestro Group . if ($fieldName == 'current_team_id') { if (!isset($fieldData)) { $customText = 'Free agent'. 6 => 'sp'. '<img src="countries/'. 8 => 'ar'. } The screenshot demonstrates the result of this event fired on the Games webpage. 3 => 'br'. 15 => 'ru'. } } elseif ($fieldName == 'country_id') { $countriesPics = array ( 1 => 'us'. 18 => 'gr'. $handled = true. 4 => 'it'. 11 => 'li'. $handled = true. $handled = true. 2 => 'fr'. 20 => 'ge' ). text-align: left. Page Editor 126 } Example 2: The code below is used in our demo project to show the number of overtime periods played in the game. ' OT'. if ($fieldName == 'overtime_count') { if ($fieldData > 0) $customText = $fieldData . '</div>'.'.' . $customText = '<div style="width: 80px. else $customText = '-'. $fieldData .png">' . '</div>'. $language). false).127 PHP Generator for MySQL Help Example 4 This example demonstrates the applying of the syntax highlighting provided by the Geshi library. $handled = true. $formatted_sql = SqlFormatter::format($source. $language = 'sql'. We use this library to highlight SQL syntax in strings stored in the 'Body' column. } © 2017 SQL Maestro Group . $customText = '<div align="left">'.$geshi->parse_code(). if ($fieldName == 'Body') { $source = $rowData['Body']. $geshi = new GeSHi($formatted_sql. $fieldData. It is an extremely useful for conditional rendering or embedding third-party components to extend standard functionality. author. $handled A parameter to indicate whether the event handler executed. See also: OnCustomRenderColumn 125 . Page Editor 128 See also: OnCustomRenderPrintColumn 128 . etc. Excel. $customText A string to replace the original cell content.4. $rowData The associative array of values that corresponds to the currently processed row. Signature: function OnCustomRenderExportColumn ($fieldName.4. Use it to provide additional information for the HEAD section of the page (such as keywords. $fieldData The data of currently processed cell. OnCustomRenderExportColumn 128 5. Signature: function OnCustomRenderPrintColumn ($fieldName. $rowData. Set $handled to true in the event handler to apply new content. Set $handled to true in the event handler to apply new content.7 OnCustomHTMLHeader This event occurs when the head section of the page is generating. OnCustomRenderExportColumn 128 5. &$customText. $rowData. OnCustomRenderPrintColumn 128 5.3. &$handled) Parameters: $fieldName The field name of currently processed cell.3. $fieldData The data of currently processed cell. &$handled) Parameters: $fieldName The field name of currently processed cell. &$customText. $rowData The associative array of values that corresponds to the currently processed row.5 OnCustomRenderPrintColumn This event occurs before column rendering on the print page and allows you to replace cell content. &$customHtmlHeaderText) © 2017 SQL Maestro Group . It is an extremely useful event for conditional rendering. and allows you to replace cell content.4. or description). $handled A parameter to indicate whether the event handler executed. $fieldData. $customText A string to replace the original cell content. See also: OnCustomRenderColumn 125 .3.6 OnCustomRenderExportColumn This event occurs before column rendering into Word. Signature: function OnCustomHTMLHeader ($page. The specified styles and classes are applied to <tr> and <td> tags accordingly. Example 1: The code below is used in our online demo to display the winning team and the losing team scores according to the current theme. $rowStyles Use this string to modify styles of a whole row. etc. } else { $cellClasses['home_team_score'] = 'loss-score'. It is an extremely useful event for conditional formatting such as changing font color. &$rowCellStyles. &$rowClasses. 5. $rowClasses Use this string to add a class to a whole row. if ($rowData['home_team_score'] > $rowData['away_team_score']) { $cellClasses['home_team_score'] = 'win-score'. The only difference between these two events is that OnCustomDrawRow has a more understandable parameter list while OnExtendedCustomDrawRow provides more flexible abilities. &$rowStyles. } The 'win-score' and 'loss-score' classes are defined in User-defined styles as follows: © 2017 SQL Maestro Group . row background color.8 OnExtendedCustomDrawRow This event occurs when rendering a grid row and allows you to change the row and/or cell styles directly.php $customHtmlHeaderText A string to place into the head section Example: The following code demonstrates how to use this event to add metadata to the generated webpage.3. This event (as well as the OnCustomDrawRow 141 one) is used for conditional formatting. Each field name is associated with its style string. 129 PHP Generator for MySQL Help Parameters: $page An instance of the Page class declared in components/ page. $rowCellStyles The associative array of styles. $cellClasses['away_team_score'] = 'loss-score'. font styles. &$cellClasses) Parameters: $rowData The associative array of values that corresponds to the currently processed row. Signature: function OnExtendedCustomDrawRow ($rowData. $cellClasses['away_team_score'] = 'win-score'. $cellClasses The associative array of cell classes.4. cell background color. $customHtmlHeaderText = '<meta name="copyright" content="SQL Maestro Group"/>'. font-weight: bold. } .4em. } .base-score). Example 2 The code below is used in our online demo to highlight fields representing player's height depending on the value.base-score). $height = $rowData['height']. color: @brand-danger. elseif ($height > 185) © 2017 SQL Maestro Group . } The screenshot below demonstrates the result of the event fired on the Game list webpage in Cyborg Bootswatch theme for Bootstrap.loss-score { &:extend(. Page Editor 130 . The next one shows the result of the event fired on this webpage in Facebook Bootswatch theme.base-score { font-size: 1. if ($height > 200) $cellClass = 'tall'.win-score { &:extend(. and 'tall' classes are defined in User Defined Styles as follows: @height-color: @state-warning-bg. . $cellClasses ['height'] = $cellClass.tall { background-color: darken(@height-color. } The screenshot below demonstrates the result of the event fired on the Game list webpage in Journal Bootswatch theme for Bootstrap. The 'undersized'. 10%). else $cellClass = 'undersized'.131 PHP Generator for MySQL Help $cellClass = 'medium-height'. 'medium-height'. 10%). } .undersized { background-color: lighten(@height-color. The next one shows the result of the event fired on this webpage in Superhero Bootswatch theme.medium-height { background-color: @height-color. } . © 2017 SQL Maestro Group . enable the grid footer in the View properties 41 of the corresponding column. $columnName. 'MIN'. $customText A string to replace the total cell content. 'MAX'. To use it. '</strong>'.9 OnCustomRenderTotals This event occurs before total values rendering and allows you to replace the default total footer content. if ($columnName == 'amount') { $customText = '<strong>Total: $' . $aggregate. $columnName The column name of currently processed total. &$customText. } This picture demonstrates the difference between a webpage generated with default footer and a webpage with the OnCuStomRenderTotals event specified in this way: © 2017 SQL Maestro Group . Set $handled to true in the event handler to apply new content.3. $handled A parameter to indicate whether the event handler executed. $aggregate The string representation of total aggregate ('AVG'. $totalValue . $handled = true. 'COUNT'). 'SUM'. &$handled) Parameters: $totalValue The value of currently processed total. Page Editor 132 5.4. Signature: function OnCustomRenderTotals ($totalValue. Example 1: The code below changes the caption of the 'amount' column footer and gives it strong importance. Signature: function OnGetCustomTemplate ($part. } 5. $mode The current state of the webpage the template to be used. We would recommend you to study them carefully before trying to customize your © 2017 SQL Maestro Group .'. 133 PHP Generator for MySQL Help Example 2: The code below is used in our online demo on the 'Teams' page to display the year of foundation of the oldest team on the page in more convenient form. $handled = true. $result The path to the file to be used as template according to the components/templates/custom_templates folder.3. $mode. intval(str_replace('. &$params) Parameters: $part The part of the page to be affected by the template. ''. If you are not familiar with web template engines. if ($columnName == 'year_founded') { $customText = 'MIN: ' .0 as template language. &$result. $params An associative array of additional parameters you want to assign to the template. Our Feature Demo provides a number of live examples of customized templates.4.10 OnGetCustomTemplate This event allows you to customize almost any part of the generated application using an own template instead of the default one. $totalValue)). you might want to start here. PHP Generator uses Smarty 2. tpl (for card view mode) List page list/single_row. Use the table below to select the template corresponding to the necessary state of page and page part.tpl PagePart::PageList (for top-side menu) Any PageMode page list page_list_sidebar. Custom template files should be uploaded to the 'components/templates/custom_templates' directory.tpl PagePart::Layout layout Any PageMode All Pages page_list_menu.tpl PagePart::RecordCard View (separate page) PageMode::View forms/form.tpl PagePart::VerticalGrid Insert form (editors area) PageMode::InsertForm © 2017 SQL Maestro Group .tpl (for card view mode) view/grid. you need to: · create a new template to be used for this webpage. Page Editor 134 application. The following table shows how to customize common pages used in the generated applications. The simplest way to create a new template is to modify an existing one (it is much easier than create a new template "from scratch"). State of Page Part Default template Parameters the webpage webpage common/layout.tpl PagePart::VerticalGrid Edit form (editors area) PageMode::EditForm forms/form.tpl PagePart::Grid (for grid view mode) PageMode::ViewAll table grid list/grid_card. To customize a webpage. This folder should be created by the user of PHP Generator and its content is not changing during the further PHP Generator sessions.tpl (for sidebar menu) list/grid_table. · instruct PHP Generator to use this template for the selected webpage.tpl PagePart::GridRow (for grid view mode) PageMode::ViewAll single row list/sinlge_row_card. etc PageMode::ExportExcel.tpl PagePart::VerticalGrid Edit (inline form) PageMode::InlineEdit forms/inline_form.tpl PagePart::VerticalGrid Edit (modal dialog) PageMode::ModalEdit forms/modal_form.tpl PagePart::RecordCard single record PageMode::ExportPdf (PDF only) Print print/page.tpl PagePart::VerticalGrid Edit (separate page) PageMode::Edit forms/page_form. Export etc export/pdf_record.tpl PagePart::Grid Print table grid PageMode::PrintAll print/detail_page. export/ PagePart::Grid excel_grid.tpl PagePart::Grid Record comparison page PageMode::Compare forms/page_form.tpl PagePart::VerticalGrid View (modal dialog) PageMode::ModalView forms/inline_form.tpl PagePart::PrintLayout webpage PageMode::PrintAll layout print/grid.tpl PagePart::PrintLayout detail page PageMode::PrintDetailPage export/pdf_grid.tpl.135 PHP Generator for MySQL Help compare/grid.tpl PagePart::VerticalGrid Insert (inline form) PageMode::InlineInsert print/page.tpl PagePart::VerticalGrid Insert (modal dialog) PageMode::ModalInsert view/record_card_view.tpl.tpl PagePart::PrintLayout webpage Single PageMode::PrintOneRecord layout Record © 2017 SQL Maestro Group .tpl PagePart::VerticalGrid Insert (separate page) PageMode::Insert forms/modal_form. data grid csv_grid. export/ PageMode::ExportPdf. PageMode::ExportCsv.tpl. PagePart:: Password Recovery tpl PasswordRecovery Page reset_password_page.tpl PagePart::RegistrationForm Registration Form recovering_password_page. These parameters can be used only for the project-level version of this event.tpl PagePart::LoginControl Login control home_page.tpl PagePart::Grid table grid PageMode::PrintOneRecord login_page.tpl PagePart::RegistrationPage Registration Page registration_form.tpl PagePart::HomePage Home page navigation. registration_page. These parameters can be used only for the project-level version of this event.tpl PagePart::LoginPage Login page login_control. Page Editor 136 view/print_grid.tpl PageMode:: subject MailVerificationSubject user_verification_body. user_verification_subject PagePart::Mail Verification email . PagePart::Mail Verification email tpl PageMode::MailVerificationBody body © 2017 SQL Maestro Group .tpl PagePart::Navigation Navigation The following table shows how to customize user registration and password recovering pages.tpl PagePart:: Resend Verification ResendVerification Email Page The following table shows how to customize emails sent to users 213 on registration and password recovering.tpl PagePart::ResetPassword Reset Password Page resend_verification_page. specify the following code in the page's OnGetCustomTemplate event handler (of course you should replace YourPart and YourMode to the appropriate values from the table above).tpl'.tpl PageMode:: body MailRecoveringPasswordBody To instruct PHP Generator to use a customized template file for a certain webpage.tpl file as a template for the edit form of a webpage. if ($part == YourPart && $mode == YourMode) { $result = 'your_template_file.137 PHP Generator for MySQL Help recovering_password_sub PagePart::Mail Password reset email ject. } Example 1: Suppose we need to use components/templates/custom_templates/staff_edit.tpl'. if ($part == PagePart::VerticalGrid && $mode == PageMode::Edit) { $result = 'staff_edit.tpl PageMode:: subject MailRecoveringPasswordSubject recovering_password_bo PagePart::Mail Password reset email dy. } Now we can compare the result webpages without using this event and with the enabled one: © 2017 SQL Maestro Group . tpl'. Specify the OnGetCustomTemplate event handler as follows: // set the template file if ($part == PagePart::Grid && $mode == PageMode::ViewAll) { $result = 'custom_grid. // get the list of available databases © 2017 SQL Maestro Group . Page Editor 138 Example 2: A single event handler can be used to customize multiple templates: if ($part == PagePart::Grid && $mode == PageMode::ViewAll) $result = 'games_grid.tpl'. 1. Example 3 This example shows how to fill a SELECT input with names of all MySQL databases available at the server. if ($part == PagePart::RecordCard && $mode == PageMode::View) $result = 'games_view.tpl'. if ($part == PagePart::VerticalGrid && $mode == PageMode::Edit) $result = 'games_edit.tpl'. $queryResult).tpl'. Add the following code to the template file: <div> <h4>I am a custom template with a custom variable $custom_var.139 PHP Generator for MySQL Help $queryResult = array(). $params['custom_var'] = '5 (default)'. else // not found. Specify the OnGetCustomTemplate event handler as follows: if ($part == PagePart::Grid && $mode == PageMode::ViewAll) { $result = 'custom_grid. $this->GetConnection()->ExecQueryToArray('SHOW DATABASES'. foreach($queryResult as $row) $databaseNames[] = $row[0]. } 2. Example 4 This example shows the use of the superglobal $_GET array values in a custom template. Assign a default value. // check if the parameter custom_var available if (GetApplication()->IsGETValueSet('custom_var')) // found $params['custom_var'] = GetApplication()->GetGETValue('custom_var'). // assign the parameter in the template $params['databaseNames'] = $databaseNames. 1. // fill a one-dimensional array with database names $databaseNames = array(). Add the following code to the template file: <select name="database"> {foreach from=$databaseNames item=database} <option value="{$database}">{$database}</option> {/foreach} </select> The screen below demonstrates the result output. Its value © 2017 SQL Maestro Group . } 2. Page Editor 140 {if !isset($custom_var)} still undefined {else} = {$custom_var} {/if}. Specify the OnGetCustomTemplate event handler as follows: if ($part == PagePart::LoginPage) { $result = 'login_page.</td> </tr> <tr> <td>game_manager</td> <td>game</td> <td>Can access only game list.tpl'. </h4> </div> Example 4 Let's see the login form customization used in our NBA online demo. Add the following code to the template file: <h2>Logins</h2> <table class="table table-bordered"> <thead> <tr> <th>Username</th> <th>Password</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>admin</td> <td>admin</td> <td>Can modify any record at any page and manage other users. } 2. if ($part == PagePart::RecordCard && $mode == PageMode::ExportPdf) { $result = 'game_pdf.</td> </tr> <tr> <td>lakers</td> <td>lakers</td> <td>Can modify team info.tpl'.</td> </tr> </tbody> </table> Example 5 The example below is used in our NBA demo application to customize the template used to export a single record to PDF.</td> </tr> <tr> <td>boston</td> <td>boston</td> <td>The same for the Boston Celtics team. Can modify any game. 1. } © 2017 SQL Maestro Group . home games and players for LA Lakers. 4. $cellBoldAttr Set the parameter to true to use bold font. NB. cell background color. moreover. Example 2: In the example below we need to display winning team score in red and losing team score in black. © 2017 SQL Maestro Group . Don't use column captions instead! Example 1: Suppose we need to create a webpage with list of customers with addresses represented in cursive. This column in the data source is named 'address_id' and the column's caption is "Address". font styles. both scores should be in bold and displayed by a 16pt font. etc. 141 PHP Generator for MySQL Help Live example can be found here. &$cellBoldAttr) Parameters: $rowData The associative array of values that corresponds to the currently processed row. To define the font attribute. &$cellFontColor. $cellFontColor The parameter allows to set a font color for selected fields. use the following code: $cellItalicAttr['address_id'] = true. view. $cellItalicAttr Set the parameter to true to represent text in cursive font. &$cellFontSize. This event (as well as the OnExtendedCustomDrawRow 129 one) is used for conditional formatting. $cellFontSize The parameter defines a font size of selected data. &$cellItalicAttr. It is an extremely useful event for conditional formatting such as changing font color. or query). $rowData array keys should contain the real column names in the data source (table. &$cellBgColor. The only difference between these two events is that OnCustomDrawRow has a more understandable parameter list while OnExtendedCustomDrawRow provides more flexible abilities. $cellBgColor The parameter allows to set a background color of fields.3.11 OnCustomDrawRow This event occurs on rendering a grid row. 5. row background color. Signature: function OnCustomDrawRow ($rowData. OnBeforeInsertRecord 144 . the value of this parameter is equal to empty string. $rowData The associative array of values that corresponds to the currently processed row.4. Signature: function OnAfterInsertRecord ($page. &$messageDisplayTime) Parameters: $page An instance of the Page 257 class.12 OnAfterInsertRecord This event occurs when the Insert command is executed. &$success. Example if ($success) { $message = 'Record processed successfully.3. } See also: OnAfterUpdateRecord 142 . 5. © 2017 SQL Maestro Group . if ($rowData['home_team_score'] > $rowData['away_team_score']) $cellFontColor['home_team_score'] = '#F65317'. 5. $tableName. $tableName The name of processed table. $message A message to be displayed to a user. OnAfterDeleteRecord 143 . $cellFontSize['away_team_score'] = '16pt'. Page Editor 142 $cellFontSize['home_team_score'] = '16pt'. If the statement completed successfully. } else { $message = '<p>Something wrong happened. $cellBoldAttr['away_team_score'] = true. Success messages are displayed in green while error messages are displayed in red. 'Contact developers</a> for more info. $rowData.</p>'. ' .com">' . $cellBoldAttr['home_team_score'] = true. and after the actual insertion.4. Default value is 0 (the message will not disappear). $success Indicates whether the last data manipulation statement was successful or not. '<a class="alert-link" href="mailto:admin@example.'. &$message. $messageDisplayTi A time interval (in seconds) after which the message will me disappear automatically.3.13 OnAfterUpdateRecord This event occurs when the Update command is executed. else $cellFontColor['away_team_score'] = '#000000'. If the statement failed. and after the actual update. the value of this parameter contains the error message that came from the database server. 'Contact developers</a> for more info. $tableName. OnBeforeUpdateRecord 145 . &$message. $message A message to be displayed to a user.4. &$success.14 OnAfterDeleteRecord This event occurs when the Delete command is executed. $messageDisplayTim A time interval (in seconds) after which the message will e disappear automatically.</p>'. $rowData The associative array of values that corresponds to the currently processed row. the value of this parameter contains the error message that came from the database server. Signature: function OnAfterDeleteRecord ($page. } else { $message = '<p>Something wrong happened. } See also: OnAfterDeleteRecord 143 . Default value is 0 (the message will not disappear). $tableName The name of processed table. $tableName The name of processed table. OnAfterInsertRecord 142 . $rowData. and after the actual deletion. the value of this parameter is equal to empty string. If the statement failed. $oldRowData The associative array of old (previous) values of the currently processed row. &$message.'. &$messageDisplayTime) Parameters: $page An instance of the Page 257 class. Example if ($success) { $message = 'Record processed successfully.3. &$messageDisplayTime) Parameters: $page An instance of the Page 257 class.com">' . $success Indicates whether the last data manipulation statement was successful or not. '<a class="alert-link" href="mailto:admin@example. 143 PHP Generator for MySQL Help Signature: function OnAfterUpdateRecord ($page. Success messages are displayed in green while error messages are displayed in red. $oldRowData. $rowData. $success Indicates whether the last data manipulation statement was © 2017 SQL Maestro Group . &$success. If the statement completed successfully. ' . $rowData The associative array of values that corresponds to the currently processed row. 5. $tableName. Default value is 0 (the message will not disappear). } See also: OnAfterUpdateRecord 142 . Signature: function OnBeforeInsertRecord ($page. Page Editor 144 successful or not.'.</p>'. Success messages are displayed in green while error messages are displayed in red. and before the actual insertion. $messageDisplayTi A time interval (in seconds) after which the message will me disappear automatically. If the statement completed successfully. $rowData The associative array of values that corresponds to the currently processed row. &$rowData. OnAfterInsertRecord 142 . Default value is 0 (the message will not disappear). the value of this parameter contains the error message that came from the database server.15 OnBeforeInsertRecord This event occurs when the Insert command is executed. } © 2017 SQL Maestro Group . $cancel The value indicating whether the operation should be canceled. If the statement failed.com">' . $message A message to be displayed to a user.4. 'Contact developers</a> for more info. $tableName) Parameters: $page An instance of the Page 257 class declared in components/ page. Example if ($success) { $message = 'Record processed successfully. $messageDisplayTime A time interval (in seconds) after which the message will disappear automatically. &$message. &$messageDisplayTime. } else { $message = '<p>Something wrong happened. Example: if (!(allowDataEditing())) { $cancel = true.'. the value of this parameter is equal to empty string. '<a class="alert-link" href="mailto:[email protected]. ' . 5.php. $tableName The name of processed table. OnBeforeDeleteRecord 145 . $message The message string that is displayed after the operation is completed (or canceled). &$cancel. $message = 'The application is running in read-only mode. OnAfterUpdateRecord 142 . $oldRowData. &$rowData.'. OnBeforeInsertRecord 144 . $message = 'The application is running in read-only mode.17 OnBeforeDeleteRecord This event occurs when the Delete command is executed. $messageDisplayTime A time interval (in seconds) after which the message will disappear automatically. &$message. &$cancel. $rowData The associative array of values that corresponds to the currently processed row. Signature: function OnBeforeDeleteRecord ($page.4. OnBeforeDeleteRecord 145 . &$messageDisplayTime. &$rowData. $tableName The name of processed table. and before the actual update. } See also: OnBeforeDeleteRecord 145 . $oldRowData The associative array of old (previous) values of the currently processed row.php. $tableName) Parameters: $page An instance of the Page 257 class declared in components/ page. $message The message string that is displayed after the operation is completed (or canceled). &$cancel. $cancel The value indicating whether the operation should be © 2017 SQL Maestro Group . &$messageDisplayTime. OnAfterInsertRecord 142 .3. 5. and before the actual deletion. Example: if (!(allowDataEditing())) { $cancel = true.16 OnBeforeUpdateRecord This event occurs when the Update command is executed. Signature: function OnBeforeUpdateRecord ($page. 145 PHP Generator for MySQL Help See also: OnBeforeUpdateRecord 145 .3. $tableName) Parameters: $page An instance of the Page 257 class declared in components/ page.4. &$message. 5. $rowData The associative array of values that corresponds to the currently processed row. Default value is 0 (the message will not disappear).php. $cancel The value indicating whether the operation should be canceled. $rowData.19 OnGetCustomExportOptions This event fires on exporting data from a database to a file. OnAfterDeleteRecord 143 . } Since the call of this function for an encrypted expression returns the original string.18 OnGetFieldValue This event occurs on displaying a value of a field. OnBeforeInsertRecord 144 . } See also: OnBeforeUpdateRecord 145 . $tableName The name of currently processed table. Can be changed to another value. $tableName) Parameters: $fieldName The name of currently processed field. It allows you to customize some advanced export settings. We would recommend that you use more cryptographically strong algorithms to encrypt your important data. Signature: function OnGetCustomExportOptions ($Page page. Page Editor 146 canceled. Example This example shows how this event can be used for implementing a very simple transparent encryption based on the str_rot13 PHP function. $tableName The name of processed table. 5. $exportType. if ($fieldName == 'private_data') { $value = str_rot13($value).4. It allows you to replace the actual value of a field to your own. $message The message string that is displayed after the operation is completed (or canceled). $value The actual value of the field. we can define OnBeforeInsertRecord 144 and OnBeforeUpdateRecord 145 event handlers as follows: $rowData['private_data'] = str_rot13($rowData['private_data']). $messageDisplayTime A time interval (in seconds) after which the message will disappear automatically. Example: if (!(allowDataEditing())) { $cancel = true. Default value is 0 (the message will not disappear).3. $message = 'The application is running in read-only mode.4. Signature: function OnGetFieldValue ($fieldName.'.3. 5. This is just an example. &$value. &$options) © 2017 SQL Maestro Group . Default value is "template". NULL if a record list is exported. Example This example shows how to customize the result file name according to row values. RA0 . Possible values are "template" (template-based export) and "phpexcel" (to create native .3. B0 .A10. Possible values are "csv". size Size of the page. Export to Excel engine The engine to be used on data export. A (type A paperback 111x178mm).SRA4. $exportType The type of the result file. "xls". 5. If a record list is exported. 147 PHP Generator for MySQL Help Parameters: $page An instance of the Page 257 class. the file name is set to list. Example This example shows how to setup initial value for Filter Builder (available live in the © 2017 SQL Maestro Group . SRA0 . "pdf". Possible values are "P" (portrait orientation) or "L" (landscape orientation). Possible values are A0 .xls. Folio. C0 - C10. $options An associative array of options passed to the export engine (see below). '. list. Royal. Executive.RA4. Default value is A4.B10. 2A0.4. B (type B paperback 128x198mm). "doc". Legal. etc). $columns An associative array of columns available in the tool. Default value is "P". 4A0.xml. Export to PDF orientation Page orientation. $rowData An associative array of values that corresponds to the currently processed row (for exporting a single row). Demy. Letter. FixedKeysArray $columns) Parameters: $filterBuilder An instance of the FilterBuilder class.' . "xml". Signature: function OnPrepareFilterBuilder(FilterBuilder $filterBuilder.xls files).20 OnPrepareFilterBuilder This event allows you to setup initial condition for the Filter Builder tool. $exportType.pdf (list. The list of supported options is as follows: All export types filename The name of the output file. $options['filename'] = ($rowData ? $rowData['id'] : 'list') . array('Fantasy')) ) ). FilterConditionOperator::EQUALS. 5. "6-7" => FilterCondition::between(6. array( 'Shorter than 90 min' => FilterCondition::lessThan(90). "4-5" => FilterCondition::between(4. new FilterCondition($columns['genre_id']. "7-8" => FilterCondition::between(7.180 min' => FilterGroup::orX( array( '90-120 min' => FilterCondition::between(90. 'Longer than 180 min' => FilterCondition::greaterThan(180) ). $filterBuilder->setFilterComponent($rootGroup).4. 120). Signature: function OnPrepareColumnFilter ($columnFilter) Parameters: $columnFilter An instance of the ColumnFilter class. © 2017 SQL Maestro Group . FilterConditionOperator::IS_BETWEEN. 7). Example 1 This example shows how to setup a column filter as a list of custom values. 180) ) ). $columnFilter->setOptionsFor( 'runtime'. array(14).3. $rootGroup = new FilterGroup(FilterGroupOperator::OPERATOR_AND. array(5. All examples below can be seen in action in the Feature Demo. '150-180 min' => FilterCondition::between(150. Example 2 This example shows how to group custom values.21 OnPrepareColumnFilter This event allows you to customize column-specific filters. 150). array( "Less than 3" => FilterCondition::lessThan(3). 7)). 5). false // no default values ). $columnFilter->setOptionsFor( 'rating'. "Higher than 8" => FilterCondition::greaterThan(8) ). array( new FilterCondition($columns['rating']. '90 . Page Editor 148 Feature Demo). false // no default values ). 8). '120-150 min' => FilterCondition::between(120. 4. Adding a group To add a new group to the layout.22 OnGetCustomFormLayout This event allows you to customize the layout for View. FixedKeysArray $columns. Live Demo. "inline_edit". '2009-12-31') ). FormLayout $layout) Parameters $mode The form mode. Adding rows to a group To add a new row to a group. This means you can add groups to the layout. and Insert forms. Edit. 5. and "view". use the addGroup method of the FormLayout class: function addGroup($name = null. true // add default values (this parameter can be omitted) ). the control label is placed on the left of the editor (for vertical forms the label is placed on the top of the editor). $layout An instance of the FormLayout class. Layout structure The layout has the following hierarchical structure: layout -> groups -> rows -> columns. '2000s' => FilterCondition::between('2000-01-01'. $width = 12). Layout mode By default all forms are horizontal i. $columnFilter->setOptionsFor('release_date'. and columns to rows. To create a vertical form. possible values are integers from 1 to 12. '2019-12-31'). use the following call: $layout->setMode(FormLayoutMode::VERTICAL). rows to groups. Possible values are "edit".e. Video Tutorial. Width is provided in relative units. "insert". "inline_insert". array( '2010s' => FilterCondition::between('2010-01-01'. 149 PHP Generator for MySQL Help Example 3 This example shows how to add custom values to default ones. This function returns an instance of the FormLayoutGroup class that can be later used to add rows to the new group (see below).3. Signature: function OnGetCustomFormLayout($mode. $columns The associative array of columns displayed in the form. use the addRow method of the FormLayoutGroup class (see above): © 2017 SQL Maestro Group . 12). Adding controls to a row To add a new control to a row. 12). This function has no parameters and returns an instance of the FormLayoutRow class that can be later used to add controls to the new row (see below). 6).4. Here $column is an element of the $columns array and $inputWidth and $labelWidth are relative widths of the editor and its label accordingly ($labelWidth can be used only for horizontal forms). 4) ->addCol($columns['storage_external']. This function also returns an instance of the FormLayoutRow class to allow method chaining. Example 2 This example shows how to create a group and place 3 editors in the same row: $storageGroup = $layout->addGroup('Storage'. $softwareGroup = $layout->addGroup('Software'. 12). 12). $softwareGroup->addRow()->addCol($columns['os_basic']. 6). use the addCol method of the FormLayoutRow class (see above): function addCol($column. Examples All the examples below can be seen live in our Feature Demo. 6). $labelWidth = null). $storageGroup->addRow() ->addCol($columns['storage_min']. $hardwareGroup->addRow()->addCol($columns['gpu'].3. Example 1 This example shows how to create a simple group with 2 rows and 2 controls in each row (all controls have equal width): $displayGroup = $layout->addGroup('Display'). 4). $softwareGroup->addRow()->addCol($columns['os_upgradable']. $hardwareGroup->addRow()->addCol($columns['cpu']. Page Editor 150 function addRow(). $inputWidth = null. $displayGroup->addRow() ->addCol($columns['display_resolution_x']. 5. 12). 6) ->addCol($columns['display_size']. Example 3 This example shows how it is possible to place 2 groups in a row: $hardwareGroup = $layout->addGroup('Hardware'. $hardwareGroup->addRow()->addCol($columns['chipset']. 12). 12).23 OnGetCustomColumnGroup This event allows you to setup multi-row grid header. 4) ->addCol($columns['storage_max']. 6) ->addCol($columns['display_resolution_y']. $displayGroup->addRow() ->addCol($columns['display_type']. $softwareGroup->addRow()->addCol($columns['web_browser']. © 2017 SQL Maestro Group . 6). $columnGroup The default (root) group. Signature: © 2017 SQL Maestro Group . $columns['release_date'] ) )).3. By default all column headers are placed in this group.24 OnCustomCompareValues This event allows you to define your own function for value comparison.4. array( $columns['id']. array( $columns['runtime']. Description You can organize columns in logical groups and display them using multi-row header representation. A column group is visually represented by a header displayed above the headers of the columns it combines. $columns['title']. Each group can contain data columns as well as other groups. $columns['original_language_id'] ) ). $columns['rating'] ) ) ) )). Example 1 This example shows how to define an additional header for 3 columns: $columnGroup->add(new ViewColumnGroup('Common info'. ViewColumnGroup $columnGroup) Parameters: $columns The associative array of column headers. array( new ViewColumnGroup('Texts'. array( $columns['genre_id']. Examples All the examples below can be seen live in our Feature Demo. 151 PHP Generator for MySQL Help Signature: function OnGetCustomColumnGroup(FixedKeysArray $columns. new ViewColumnGroup('Numbers'. 5. $columns['original_title']. Example 2 This example shows how to define nested column groups: $columnGroup->add(new ViewColumnGroup('Addtional info'. 5.4. $handled = true. $valueA. &$handled. $handled Indicate whether the event handler executed. } © 2017 SQL Maestro Group . if (in_array($columnName. if ($fieldName === 'filename') { $newFileName = date('Y-m-d_H-i-s') . $valueB. &$result. array('height'. $valueB The second value to compare. $result The result of the comparison. Signature: function OnGetCustomUploadFilename($fieldName. $result).25 OnGetCustomUploadFileName This event allows you to customize the file name for files uploaded with Upload file to folder 84 and Upload image to folder 85 editors. } The example can be seen in action in our Feature Demo. $originalFileName. Set $handled to true in the event handler code to apply the changes. Change the value of this parameter to customize the filename. $newFileName. $originalFileExtension. $result The actual file name. Should be set to 0 if values are equal and to a non-zero value otherwise. $result = str_replace($originalFileName. $rowData The associative array of values that corresponds to the currently processed row. 'length'.5. $valueA The first value to compare. 'width'))) { $result = abs($valueA . Page Editor 152 function OnCustomCompareValues($columnName. Example This example shows how to define an algorithm that considers two values to be equal if their difference is less than or equal to 0.5.$valueB) <= 0. $originalFileName The original file name $originalFileExtension The original file extension $fileSize The file size Example This example shows how to add current date and time to the uploaded filename. &$result) Parameters: $columnName The name of currently processed column.3. "_" . $fileSize) Parameters: $fieldName The name of currently processed column. $originalFileName. // do not apply these rules for site admins if (!GetApplication()->HasAdminGrantForCurrentUser()) { // retrieving the ID of the current user $userId = GetApplication()->GetCurrentUserId(). Signature: function OnGetCustomPagePermissions($page. break.4. $handled A parameter to indicate whether the new permissions should be applied. true). Signature: © 2017 SQL Maestro Group . 5. // iterating through retrieved roles if (!empty($result)) { foreach ($result as $row) { // is current user a member of the Sales role? if ($row['role_name'] === 'Sales') { // if yes. // otherwise default permissions for this page will be applied $permissions->setGrants(true.role_name " .user_id = %d". 153 PHP Generator for MySQL Help 5. // retrieving all user roles $sql = "SELECT r. true.27 OnGetCustomRecordPermissions This event allows you to customize record-level permissions 224 . $permissions Permissions to be applied to the page. true.id = ur.role_id " . // apply the new permissions $handled = true.4.26 OnGetCustomPagePermissions This event allows you to customize page-level permissions.3. $userId)). "INNER JOIN phpgen_roles r ON r. } See also: OnGetCustomRecordPermissions 153 . Set $handled to true to apply the changes.3. Our goal is to ensure that only site admins and members of the Sales role can add. "FROM phpgen_user_roles ur " . Example This example shows how to implement a simple role-based permission model. &$permissions. "WHERE ur. remove and edit records displayed on this page. &$handled) Parameters: $page An instance of the Page 257 class. $result = $page->GetConnection()->fetchAll(sprintf($sql. allow all actions. } } }. An instance of the PermissionSet 260 class. $handled A parameter to indicate whether the new permissions should be applied. . $rowData. // retrieving the ID of sales department and the status of the current user $sql = "SELECT sales_department_id.Ordinary managers must have full access to their own sales records except completed ones. $usingCondition Any logical SQL expression. Default value is true. "FROM phpgen_users WHERE user_id = $userId". // Granting permissions according to the scenario $allowEdit = $isHeadManager || !$rowData['completed']. the user can delete the currently processed row. if (empty($result)) return. which work in one of these departments. $allowDelete = $isHeadManager || !$rowData['completed']. $mergeWithDefault Indicates whether custom permissions should be merged with default ones 224 (if any). © 2017 SQL Maestro Group . $salesDepartmentId = $result[0]['sales_department_id']. is_head_manager " . Example Assume we have a small company with several sales departments. Page Editor 154 function OnGetCustomRecordPermissions($page. They should have no access to sales of other departments. the following code can be used: // do not apply these rules for site admins if (GetApplication()->IsLoggedInAsAdmin()) { return. All users of our application are sales managers. $allowDelete If true.Head managers must have full access to all sales records of the department. Each such user can work as an ordinary manager or as a head manager of the department. They should have no access to the sales made by other managers. To implement the scenario above. Set $handled to true to apply the changes. &$usingCondition. $result = $page->GetConnection()->fetchAll($sql). Our challenge is to grant privileges in the following way: . Rows for which the expression returns true will be visible $rowData The associative array of values that corresponds currently processed row $allowEdit If true. the user can edit values of the currently processed row. } // retrieving the ID of the current user $userId = $page->GetCurrentUserId(). &$mergeWithDefault. $isHeadManager = (boolean) $result[0]['is_head_manager']. &$allowDelete. &$allowEdit. &$handled) Parameters: $page An instance of the Page 257 class. © 2017 SQL Maestro Group . use the GetEnvVar 257 method of the Page 257 class.4 Using Variables PHP Generator for MySQL supports some environment variables (such as CURRENT_USER_ID. } else { $usingCondition = sprintf('manager_id = %d'. 5. } // apply granted permissions $handled = true. // We have to add this line. $userId). // Do not merge the new record permissions with default ones (true by default).4. $salesDepartmentId). 155 PHP Generator for MySQL Help // Specifying the condition to show only necessary records if ($isHeadManager) { $sql = 'manager_id IN '. otherwise head managers will not be able to see // sales made by other managers of the department. $usingCondition = sprintf($sql. See also: OnGetCustomPagePermissions 153 . turn ON the "Show environment variables" option in the Project Options 181 dialog. CURRENT_USER_NAME. $mergeWithDefault = false. '(SELECT user_id FROM phpgen_users WHERE sales_department_id = %d)'. re-generate the code and then open any of produced web pages in the browser. Retrieving the list of available variables To obtain a complete list of supported variables. Accessing variable value To access the value of a variable. UNIQUE_ID) in both page 122 and application 95 level server-side events. Page Editor 156 Example The following example demonstrates how to use variables within the OnBeforeInsertRecord 144 event handler. Within server-side page-level events it is also possible to use $this instead of $page. © 2017 SQL Maestro Group . if ($userName != 'admin') $rowData['changed_by'] = $userName. $rowData['ip_address'] = $page->GetEnvVar('REMOTE_ADDR'). $userName = $page->GetEnvVar('CURRENT_USER_NAME'). Example 1 There is a table with test questions of a Web programming course.5 Filter To reduce the number of records available at the page.channel_id FROM game ) © 2017 SQL Maestro Group .id > 0) AND channel. set the filter condition as follows: Example 2 You can use subqueries in the filter expression. to display the list of channels that hosted even if a single game. specify the Filter condition as follows: (channel. For example. 157 PHP Generator for MySQL Help 5.id IN ( SELECT game. This condition corresponds to the WHERE clause of the query returned page data (you must not add the WHERE keyword to beginning of the condition). specify the Filter condition. To display only questions of the 'Beginner' level (level_id = 2) concerning to PHP (statement_language_id = 1). and interactive charts. 4. Column. Players. Each row can contain any number of charts. if you apply a filter to the grid. 3. Creating and editing charts To add a new chart to a webpage or edit an existing one: · open the webpage editor 33 . 5. · define an SQL query 158 to retrieve chart data. Charts can be placed in rows above the data grid or below the grid. Pie. The retrieved data must contain exactly one column to specify labels along the major axis of the chart (domain column) and one or more columns to specify series data to render in the chart (data columns).. Page Editor 158 5. Key facts 1. · setup common 160 and advanced 160 options of the chart. Bar. to create a new chart or modify an existing chart accordingly. 7. 2. All other properties provided by the library can be customized with the OnPrepareChart 160 event. Some more examples can be found at the Games.4).. exchange_date date.6 Charts PHP Generator for MySQL allows you to visualize data on your website with feature-rich. · Click Add. Area. Live examples You can find a number of examples in the Charts group of the Feature Demo.6. eur_rate decimal(10. refer to the chart's parent page query using the %source% placeholder. and Teams page of the NBA Demo. Line.. · go to the Charts tab. or Edit. 5. © 2017 SQL Maestro Group .1 Data Query This query returns data to be used by the chart. Common properties for each chart can be set up directly in the software UI 160 . Charts are sensitive to the data grid i.e. 6. responsive.. and Geo charts are currently supported. charts will change accordingly. To allow a chart to be sensitive to grid data. Charts are based on the Google chart library. Example 1 Assume we have the following table: CREATE TABLE usd_exchange_rate ( id int NOT NULL. customizable. /* Foreign keys */ CONSTRAINT fk_emp_department FOREIGN KEY (department_id) REFERENCES department(id) ). /* Keys */ PRIMARY KEY (id) ).159 PHP Generator for MySQL Help gbp_rate decimal(10. CREATE TABLE employee ( id int NOT NULL. © 2017 SQL Maestro Group . chf_rate decimal(10. As data are already grouped.name order by 2 desc Then we should specify dep_name as the domain column and total_salary as a data column. our query is very simple: %source% Then we should specify the exchange_rate column as domain column and all *_rate columns as data columns. Our goal is to create a chart representing the total salary by departments on the Department webpage. /* Keys */ PRIMARY KEY (id) ). full_name varchar(100) NOT NULL.salary) AS total_salary FROM (%source%) d INNER JOIN employee e ON (e. salary int NOT NULL.4). cad_rate decimal(10.department_id = d.4).4). aud_rate decimal(10. SUM(e. name varchar(100) NOT NULL. /* Keys */ PRIMARY KEY (id).id) GROUP BY d. Our goal is to create a chart that displays the USD course. department_id int NOT NULL.4).name as dep_name. The following query returns the appropriate data: SELECT d. Example 2 Suppose we have two tables department and employee defined as follows: CREATE TABLE department ( id int NOT NULL. Height The height of the chart in pixels.3 Advanced options The previous topic 160 learns how to setup common options of a chart. numbers. © 2017 SQL Maestro Group . Line. The function that is invoked for each chart on the page is defined as follows: Signature: function OnPrepareChart(Chart $chart) Parameters: $chart An instance of the Chart class getId() Returns the identifier of the chart (unique among all charts on a page). Position Select whether the chart is placed above or below the data grid. Data columns One or more columns to specify series data to render in the chart. The Format property is suitable for date and number columns and should be specified as a pattern (for example.6.###. Visible Allows to (temporarily) hide/show the chart.### or MMM d. Other settings can be specified in the OnPrepareChart 160 event handler. Pie. underscore. Allowed values are Column. Title The chart title (to be displayed above the chart).6. and hyphens. Type The type for your chart. Domain column The column that specifies labels along the major axis of the chart. yyyy). Corresponds to the value of the id attribute of the web element. #. All you need is to study the reference from Google and write a few lines of PHP code to set property values. Can contain letters. The key idea is that you can setup absolutely all the options that are available in the Google chart library. Area. Page Editor 160 5. and Geo.2 Common options The second step of the chart editor allows you to specify common options of the chart. Width The width of the chart in columns (from 1 to 12). Id The unique identifier of the chart. Bar. This topic explains how to customize the chart according to your needs. 5. 'height' => '70%'. 'theme' => 'maximized'. 'top' => '18%'). ))). use the following syntax: $chart->setOptions(array( 'objectName' => array('propName' => 'value').161 PHP Generator for MySQL Help setOptions($array) Sets chart options. 'legend' => array('position' => 'bottom'). )). 'titleTextStyle' => array('fontSize' => 14). array( 'vAxis' => array('format' => '0'). Operating in the same way you can set any property provided by the library. Example 2: The following code is used in our demo application to customize the chart on the Players page: if ($chart->getId() === 'height-by-avg-age') { $chart->setOptions(array( 'height' => 400. Here $array is an associative array that stores all the options you want to apply to the chart. if ($chart->getId() === 'overall-win-loss') { $chart->setOptions(array_merge($options. } else if ($chart->getId() === 'win-loss-by-month') { $chart->setOptions(array_merge($options. )). } © 2017 SQL Maestro Group . Example 1: To set the value of the property propName. '#CC3C3C'). 'hAxis' => array('format' => '0'). use the following syntax: $chart->setOptions(array( 'propName' => 'Value'. 'legend' => 'none'. ))). To set the value of the property objectName. ).propName. } Example 3: The following code is used in our demo application to customize charts on the Teams- >Home games and Teams->Away games pages: $options = array( 'colors' => array('#9ECC3C'. )). array( 'chartArea' => array('width' => '70%'. e. Delete. To change this. All properties are grouped in several tabs. · Common 163 tab represents page-specific properties i. and Options 172 tabs are set in accordance with the corresponding values of project options 181 . properties that are unique for each page. Edit. etc) to be © 2017 SQL Maestro Group . By default. all property values defined at the Abilities 167 . · RSS 167 allows you to create an RSS feed based on the table. Export and Print 170 . uncheck the Use default options box at the top of the tab and change the values. Page Editor 162 5.7 Page Properties The Page Properties window allows you to define general properties of the generated page. To invoke this window. use the corresponding button of Page Editor 33 or select the necessary page in the list of pages 27 to be generated and click the Properties button on the right side. · Abilities 167 tab allows you to specify operations (like View. settings that are not inherited from the Project settings). HTML tags are allowed. so you can easily change default "Players" to a more user-friendly "Edit Tim Duncan profile". the generated webpage is equipped with a button with a question mark on the right side of the title bar of the page. Menu label The text to be displayed in menus View form title template.1 Common properties Here you can setup page-specific settings (i. Edit form title template. · Options 172 tab is to specify page appearance and behavior settings for this page. Detailed description If specified. · Export and Print 170 tab allows you to specify exporting and printing options to be available for this page. Inline description A text to be displayed at the top of the page. 163 PHP Generator for MySQL Help available for this page. Insert form title The titles of View. Titles and descriptions Title The title of the page. © 2017 SQL Maestro Group . Edit. 5. HTML tags are allowed.7. For View and Edit forms it is possible to use field name tags in the title template. This button opens a modal window with the specified description. and Insert forms accordingly.e. Page Editor 164 Home page description A text to be displayed at the home page (live example). © 2017 SQL Maestro Group . Behavior Allow new records on Insert form Defines whether the "Add another record" link is displayed on the Insert form. Default ordering To set the default sort order of page data.If the file name extension is not specified. A page with this option applied looks as shown below. Ask for filter condition before display data If checked.php file. use the Sort dialog opened by the ellipsis button next to the Default ordering option.165 PHP Generator for MySQL Help Add multiple records at a time (set of values) Defines additional items (if any) for the "Add new" button's drop-down menu (live example). Specify the columns to sort by moving them from the Available columns list to the Columns to sort list and specify which order for each column you prefer. no data is displayed in the grid until a user specifies a filter condition (can be useful for pages containing a lot of data). © 2017 SQL Maestro Group . Options File name The name of generated . it will be defined according to application output options 276 . Page Editor 166 Header columns for record comparison Columns which values will be displayed in the header row of the data comparison grid ( live example). You can use both relative-length (like px or mm) and absolute-length ( em. Live Demo. Grid fixed width To set a fixed width of the grid. etc) units. specify the Width. rem. and select the Units. © 2017 SQL Maestro Group . check the Grid fixed width. More about CSS units. 7. Defines the last publication date for the content of the feed. © 2017 SQL Maestro Group .3 Abilities This tab allows you to specify operations available for a certain page. Item link template 88 Defines the hyperlink to the item. To retrieve a generated RSS feed. By default values of these options are set according to the corresponding values specified in the Project Options 181 dialog. Channel title Defines the title of the channel.2 RSS options PHP Generator for MySQL provides support for full-fledged RSS feeds based on a page data source 22 . Channel description Describes the channel. Click Reset to defaults to reset these options to their default values defined at the project level. 167 PHP Generator for MySQL Help 5. Channel link Defines the hyperlink to the channel.com/mypage.php file is as follows: http://www. 5.mysite. click the appropriate button as shown below. open the Page Properties dialog. For more details see the RSS specification. turn ON the Use RSS checkbox and provide values for the edit fields as described below. To change the abilities for a certain page.7. Item publication date field This field is optional.php?operation=rss Live example is available in the NBA demo. Item description template 88 Describes the item. uncheck the Use default options checkbox first. Adding an RSS feed to a page To add an RSS feed to a page. Item title template 88 Defines the title of the item. The URL that provides the RSS feed for a page stored in the mypage. switch to the Common - > RSS tab. ossible values are Disabled. List only. Separated Page (default value). Page Editor 168 Actions View Defines whether browsing a single record is available. Edit Defines whether data editing is available. View only. and None. Separated Page (default value). and Modal window. and Modal window. Possible values are List and view (quick editing is available in both data grid and single record view window). Possible values are Disabled. Quick Edit Defines whether the quick edit mode is available. Separated Page (default value). © 2017 SQL Maestro Group . Possible values are Disabled. and Modal window. Inline mode. Multi-edit Defines whether mass data editing is available. Refresh © 2017 SQL Maestro Group . Multi-delete Defines whether multi deletion is available (user can delete multiple records at a time). Possible values are Enabled (default) and Disabled. Possible values are Enabled (default) and Disabled. Separated Page (default value). Column Filter Defines whether the Column Filter tool is available. Inline mode. Copying Defines whether data copying is available. Filter Builder Defines whether the Filter Builder tool is available. Records comparison Defines whether the record comparison tool is available.169 PHP Generator for MySQL Help Insert Defines whether data insertion is available. and Modal window. Possible values are Enabled (default) and Disabled. Possible values are Enabled (default) and Disabled. and Modal window. Possible values are Enabled (default) and Disabled. Separated Page (default value). Possible values are Enabled (default) and Disabled. Delete Defines whether data deletion is available. Sorting by dialog Defines whether the data sort dialog is available. Possible values are Enabled (default) and Disabled. Possible values are Disabled. Filtering Quick search Defines whether the Quick Search box is displayed. Possible values are Enabled (default) and Disabled. Possible values are Disabled. It is also possible to enable/disable this feature at the column level. Inline mode. Sorting Sorting by click Defines whether data can be sorted by click on a column header. Possible values are Enabled (default) and Disabled. Additional Runtime Customization Defines whether end user is able to customize such page properties as number of records displayed on a page and a number of cards for each screen resolution. All records from grid Defines exporting and printing options to be available for the data grid. 5. © 2017 SQL Maestro Group .4 Export and Print This tab allows you to specify exporting and printing options available for a certain page.7. Possible values are Enabled (default) and Disabled. uncheck the Use default options checkbox first. By default values of these options are set according to the corresponding values specified in the Project Options 181 dialog. Click Reset to defaults to reset these options to their default values defined at the project level. To change settings for a certain page. Page Editor 170 Defines whether the Refresh button is diaplyed. © 2017 SQL Maestro Group .171 PHP Generator for MySQL Help Selected records from grid Defines exporting and printing options to be available for the selected records in the data grid. Single record from grid Defines exporting and printing options to be available for a single record in the data grid. By default values of these options are set according to the corresponding values specified in the Project Options 181 dialog. To change settings for a certain page.5 Options This tab allows you to specify page options.7. © 2017 SQL Maestro Group . Click Reset to defaults to reset these options to their default values defined at the project level. uncheck the Use default options checkbox first. 5. Page Editor 172 Record from view form Defines exporting and printing options to be available for a single record view form. and Insert modal windows. Modal form size A preferred size (default. Content encoding The default option value is UTF-8 and you must have really good reasons to change it. List These options are applied for List views (both grid and card).173 PHP Generator for MySQL Help Common These options are applied for all generated pages. small. the sidebar menu will be closed until a user opens it manually. © 2017 SQL Maestro Group . or large) for View. Page direction Allows you to select between Left-to-right and Right-to-left page directions. Edit. Hide sidebar menu by default If checked. use Data Partitioning 176 . To create a custom pagination. The end-user can easily switch from the grid mode to the card one and vice versa using the Page Settings dialog (if the Runtime Customization option is enabled). View mode Select whether page data are displayed in a grid or as info cards. Page Editor 174 Page navigator Allows you to specify the position of the navigational control(s) and the default number of records displayed on the page. Number of cards in a row © 2017 SQL Maestro Group . This value may be changed by application users in runtime if the Runtime Customization option is enabled. These values also can be changed by end-users if the Runtime Customization option is enabled. Live Example. Control buttons position Select whether the Edit. Use fixed grid header Allows you to make the grid header are non-scrollable. Display "Set NULL" checkboxes Defines whether "Set NULL" checkboxes are displayed for each control in Edit and Insert forms. Condensed table Turn this option 'ON' to make tables more compact by cutting cell padding in half. Edit/Insert These options are applied to data input forms. Live Example. View.175 PHP Generator for MySQL Help Allows you to specify maximum number of cards displayed in a row for each screen resolution. Bordered table Check this option to add borders on all sides of the table and cells. Live Example. Live Example. Live Example. Live Example. © 2017 SQL Maestro Group . and Copy buttons to be displayed on the left side of the generated page or on the right side. Use images for actions Defines whether images or text captions are used for control buttons (like Edit. Display "Set Default" checkboxes Defines whether "Set Default" checkboxes are displayed for each control in Edit and Insert forms. or Delete). Delete. Highlight row at mouse over Allows you to enable/disable the highlighting of rows at mouse over. Show line numbers Check this option to add row numbering to the grid. Show key columns images Turn is 'ON' to mark key columns with the 'key' images. View. Sweden. length integer UNSIGNED. and length. Select the type of data partitioning on the first wizard step: · Range partitioning Selects a partition by determining if the partitioning expression value is inside a certain range. choose 'length' as partition expression and set the partitioning ranges as follows: © 2017 SQL Maestro Group . If the partitioning expression value has one of these values. · List partitioning A partition is assigned a list of values.8 Data Partitioning The Data Partitioning wizard allows you to create a custom pagination i. select Range partitioning at the first wizard step. split the records on the generated page by a specified criteria. Example 1 (Range partitioning) There is a table storing information about films such as title. Norway. Finland or Denmark could build a partition for the 'Nordic countries'. · Custom partitioning Create your own partitioning with fill partitions and build conditions functions. title varchar(255) NOT NULL. · To disable data partitioning. release year. release_year integer. See definition here CREATE TABLE film ( film_id integer NOT NULL.e. all rows where the column 'Country' is either Iceland. select None. Page Editor 176 5. /* Keys */ PRIMARY KEY (film_id) ). the partition is chosen. For example. To create a pagination by the film length. Our goal is to group customers by the first letter of their last name as displayed below. © 2017 SQL Maestro Group .177 PHP Generator for MySQL Help Here you can see the result PHP script: Example 2 (Custom partitioning) Assume that a table 'customer' contains the 'last_name' column. &$condition) { $condition = "left(last_name. $tmp ). $this->GetConnection()->ExecQueryToArray(" SELECT DISTINCT left(c. } } function GetPartitionCondition($partitionKey. Page Editor 178 To get around such a situation. 1) as first_letter FROM customer c ORDER BY first_letter". 1) = '$partitionKey'". foreach($tmp as $letter) { $partitions[$letter['first_letter']] = $letter['first_letter'].last_name. select Custom partitioning and define functions as follows: function GetPartitions($partitions) { $tmp = array(). } © 2017 SQL Maestro Group . Credit card The script makes the element require a credit card number. To implement data validation on submitting a form. URL The script makes the element require a valid URL. This type of validation checks the input information before it gets to the server. When a user clicks the Save button. it's performed on the client's. The user doesn't have to wait for the data to travel to the server to be checked and a response to be sent. expression Such expression is a pattern and every character entered in a form field is matched against that pattern – the form can only be submitted if the pattern and the user-input matches. use the OnInsertFormValidate 115 and OnEditFormValidate 115 client side events. · Giving immediate feedback to your users since the processing is performed in their browsers. who then corrects the problem and resubmits the data. That is. Javascript ensures that the data conforms to specifications before moving on the server. the error must travel back to the user. Number The script makes the element require a decimal number. · Saving processing time on the server by ensuring that data is clean and clear before it gets to your database. This back-and-forth traveling can eat up precious bandwidth. To enable validation of data entered in a control. Server-side data validation This type of data validation consists of validating user input on the server. computer. PHP Generator for MySQL allows you to implement the client-side data validation on two levels: when a user leaves a certain control and when a user submits a form. If an error is found in the data in the server-side validation. Client-side data validation This type of data validation refers to validation performed on the client side. It may be helpful to check the compatibility of input data. 179 PHP Generator for MySQL Help 5. Regular You can also specify your regular expression for data validation.9 Data Validation Data validation is intended to provide certain guarantees for accuracy and consistency for any of various kinds of user input. specify the appropriate Client validator 54 . Digits The script makes the element require digits only. also known as the user's. They know immediately whether they need to tweak the information they have entered. Length range The script validates if the length of text is between the min length and the max length. © 2017 SQL Maestro Group . PHP Generator for MySQL allows you to check for correctness of input data on the client side and on the server side as well. Email The script makes the element require a valid email. It has following advantages: · Reducing the amount of traffic to and from your web server since the data doesn't have to travel to the server before it gets checked (server-side data validation). Range The generated script validates if number is between the largest and smallest values. Page Editor 180 This type of data validation means using PHP to verify that good values have been sent to the script. OnBeforeUpdateRecord 145 OnBeforeInsertRecord 144 © 2017 SQL Maestro Group . works seamlessly with all browsers. but it does so at the cost of slightly higher server load and slower feedback for users. and allows to use session variables. Using server-side validation has pretty much the exact opposite pros and cons of client-side development: it is more secure. Shared options 192 This tab allows you to specify options that are applied for a whole website (i. follow the Setup project options to configure default page settings link at the Page Managememt 27 wizard step All settings are grouped into several tabs: Page This tab group allows you to define default settings for all pages of the website including page appearance. Display formats These tab fields allow to adjust the display data formats in the way you need. most of these options have the same values as the application options 266 . By default these settings are set in accordance with the Application options 266 . and so on. exporting and printing options. 181 PHP Generator for MySQL Help 6 Project Options PHP Generator for MySQL allows you to specify default settings to be applied to each generated webpage. © 2017 SQL Maestro Group . By default these settings are set in accordance with the Application options 266 . By default.e. shared between all pages). operations to be available. To open this dialog window. Events This tab allows you to specify application-level events 95 . Project Options 182 © 2017 SQL Maestro Group . the sidebar menu will be closed until a user opens it manually. Common These options are applied for all generated pages. Page direction Allows you to select between Left-to-right and Right-to-left page directions. Content encoding The default option value is UTF-8 and you must have really good reasons to change it. Modal form size A preferred size (default. and Insert modal windows. 183 PHP Generator for MySQL Help 6. or large) for View. Edit. small. Hide sidebar menu by default If checked.1 Page This tab allows you to specify default page options those can be later changed for a certain page 172 . © 2017 SQL Maestro Group . The end-user can easily switch from the grid mode to the card one and vice versa using the Page Settings dialog (if the Runtime Customization option is enabled). use Data Partitioning 176 . This value may be changed by application users in runtime if the Runtime Customization option is enabled. View mode Select whether page data are displayed in a grid or as info cards. Page navigator Allows you to specify the position of the navigational control(s) and the default number of records displayed on the page. To create a custom pagination. © 2017 SQL Maestro Group . Project Options 184 List These options are applied for List views (both grid and card). View. Control buttons position Select whether the Edit. © 2017 SQL Maestro Group . Live Example. These values also can be changed by end-users if the Runtime Customization option is enabled.185 PHP Generator for MySQL Help Number of cards in a row Allows you to specify maximum number of cards displayed in a row for each screen resolution. or Delete). Bordered table Check this option to add borders on all sides of the table and cells. Use images for actions Defines whether images or text captions are used for control buttons (like Edit. Live Example. Live Example. Delete. Condensed table Turn this option 'ON' to make tables more compact by cutting cell padding in half. Live Example. Show key columns images Turn is 'ON' to mark key columns with the 'key' images. Live Example. Highlight row at mouse over Allows you to enable/disable the highlighting of rows at mouse over. View. Use fixed grid header Allows you to make the grid header are non-scrollable. and Copy buttons to be displayed on the left side of the generated page or on the right side. © 2017 SQL Maestro Group .1. They can be later changed for a certain page 167 . Edit/Insert These options are applied to data input forms. Live Example. Display "Set NULL" checkboxes Defines whether "Set NULL" checkboxes are displayed for each control in Edit and Insert forms. Display "Set Default" checkboxes Defines whether "Set Default" checkboxes are displayed for each control in Edit and Insert forms. 6. Project Options 186 Show line numbers Check this option to add row numbering to the grid.1 Abilities This tab allows you to specify default operation to be available for all pages. Separated Page (default value). and Modal window. ossible values are Disabled. View only. Separated Page (default value). Possible values are Disabled. Possible values are Disabled. List only. and Modal window. Multi-edit Defines whether mass data editing is available. and None. Possible values are List and view (quick editing is available in both data grid and single record view window). Edit Defines whether data editing is available. © 2017 SQL Maestro Group .187 PHP Generator for MySQL Help Actions View Defines whether browsing a single record is available. Separated Page (default value). and Modal window. Inline mode. Quick Edit Defines whether the quick edit mode is available. and Modal window. Possible values are Disabled. Additional Runtime Customization Defines whether end user is able to customize such page properties as number of records displayed on a page and a number of cards for each screen resolution. Column Filter Defines whether the Column Filter tool is available. Records comparison Defines whether the record comparison tool is available. and Modal window. Possible values are Enabled (default) and Disabled. Multi-delete Defines whether multi deletion is available (user can delete multiple records at a time). Sorting Sorting by click Defines whether data can be sorted by click on a column header. Possible values are Enabled (default) and Disabled. Inline mode. Project Options 188 Insert Defines whether data insertion is available. Refresh © 2017 SQL Maestro Group . Inline mode. Possible values are Enabled (default) and Disabled. Possible values are Enabled (default) and Disabled. Possible values are Enabled (default) and Disabled. Copying Defines whether data copying is available. Separated Page (default value). Sorting by dialog Defines whether the data sort dialog is available. Filtering Quick search Defines whether the Quick Search box is displayed. Delete Defines whether data deletion is available. Separated Page (default value). It is also possible to enable/disable this feature at the column level. Filter Builder Defines whether the Filter Builder tool is available. Possible values are Enabled (default) and Disabled. Possible values are Enabled (default) and Disabled. Possible values are Enabled (default) and Disabled. Possible values are Disabled. Possible values are Enabled (default) and Disabled. 2 Export and Print This tab allows you to specify default exporting and printing options to be available for all pages. 189 PHP Generator for MySQL Help Defines whether the Refresh button is diaplyed. Possible values are Enabled (default) and Disabled. All records from grid Defines exporting and printing options to be available for the data grid. © 2017 SQL Maestro Group .1. 6. They can be later changed for a certain page 170 . Single record from grid Defines exporting and printing options to be available for a single record in the data grid. © 2017 SQL Maestro Group . Project Options 190 Selected records from grid Defines exporting and printing options to be available for the selected records in the data grid. © 2017 SQL Maestro Group .191 PHP Generator for MySQL Help Record from view form Defines exporting and printing options to be available for a single record view form. Menu mode Defines the location of the application menu. Home page banner A piece of the HTML code to be displayed at the top of the application home page. © 2017 SQL Maestro Group . and None (no menu will be displayed at all). If checked. You can use this property for calling extra attention to some special content or information. Possible values are as Top-side drop- down menu (the menu will be displayed on the top of each page). Generate home page Defines whether a home page for the application is generated (live example). Project Options 192 6. Sidebar menu (the menu will be displayed on the left of each page).e.php). you can customize a filename for this page (default value is index.2 Shared options This tab allows you to specify options that are applied for a whole website (i. shared between all pages). These settings are used in all email-based features 213 and when an email is sent with the sendMailMessage 261 function. Outgoing mail settings A set of settings to be used to send emails from the generated website. By default the SendMail mail transfer agent is used. © 2017 SQL Maestro Group .193 PHP Generator for MySQL Help Show breadcrumb navigation Defines whether a breadcrumb navigation is available in the application. Please note that this options was removed as of PHP 5. Disable magic quotes_runtime option Defines whether the magic quotes_runtime PHP option will be enabled or disabled. php file. ini_set('display_errors'. © 2017 SQL Maestro Group .4. Minification reduces the amount of data that needs to be transferred on loading a page. PHP options (ini_set) This allows you to customizing PHP configuration options during the application runtime. Offline mode Turn this option ON for websites running on web servers without an Internet connection. the list of the available environment variables 155 will be displayed below the data grid. Project Options 194 Force show PHP errors and warnings If checked. We would recommend you to turn this option ON in the development environment and turn it OFF in the production environment. Minify JavaScript code Defines whether the generated JavaScript code should be minified (compressed). so we would recommend you to keep this option checked. These variables can be accessible in server-side event handlers via the GetEnvVar 257 method of the Page 257 class. These options are represented as calls of the ini_set function in the phpgen_settings. 'On'). Show environment variables If checked. the following PHP directives will be added to all pages: error_reporting(E_ALL ^ E_NOTICE). you will not be able to use charts 158 and embedded videos 53 in your application. Note that when this option is checked. A sample webpage generated using different color schemes. 195 PHP Generator for MySQL Help 7 More customization options Besides settings available in the Page Editor 33 tool. PHP Generator for MySQL allows you to customize created webpages in the following ways: Built-in color schemes 198 The simplest way to adjust the look and feel of the result application is to select one of color schemes the software comes with. Custom color scheme 198 This allows you to provide the application with a specific look and feel defining your own style sheet (or changing an existing one). © 2017 SQL Maestro Group . A sample webpage with specified header. background images. They can be customized within the appropriate window at the last step of the wizard 228 . © 2017 SQL Maestro Group . Header and Footer 199 These are fragments of HTML code that will be included into all the generated pages. Custom Style Sheets 200 It is also possible to define custom styles to be applied after all pre-defined CSS rules. More about user-defined styles 264 . This can be useful to define such things as size of controls. text alignments. and more. More customization options 196 A sample webpage generated with custom color scheme. OnCustomRenderColumn 125 . © 2017 SQL Maestro Group . fonts. Such events as OnBeforePageExecute 123 .e. and what they display. Please find some examples of using these and other events in our demo application and in the Resources section at the product home page. this one helps you to redesign the webpages entirely i. where they are displayed. Open the User Javascript 202 window to define functions to be called from event handlers and other client-side code for your website. define what controls are displayed on a specific form. Live examples. Custom templates 203 While all the previously described methods allow you to define colors. and other display attributes of generated webpages.197 PHP Generator for MySQL Help Events 95 Events are pieces of code that are run when an action is taken by the user. and OnCustomDrawRow 141 can be used to change the webpage appearance. text alignments. click the Customize color scheme button and modify the necessary variables within the opened window.1 Color schemes The color scheme of created application contains the information on basic style definitions for all key HTML components: fonts. More customization options 198 7. borders. select the appropriate item from the "Color scheme" drop-down list. colors. backgrounds. and others. To learn more about the LESS syntax used in this window. To use one of them. To change default scheme settings according to your needs. © 2017 SQL Maestro Group . The Preview window displays current appearance settings applied to a sample webpage. PHP Generator for MySQL comes with a number of built-in color schemes. please refer to the LESS manual. margin-top: -14px. paste the following text in the Header edit box: <span class="navbar-brand"> <span> <img src="mysql_logo. enter the appropriate code in the Header and Footer text boxes accordingly."> </span> </span> <span class="navbar-brand"> <span class="hidden-xs"><strong>MySQL Schema Browser</strong></span> </span> © 2017 SQL Maestro Group .2 Header and Footer To add an HTML markup to be displayed at the top and at the bottom of each page of the generated web application. 199 PHP Generator for MySQL Help 7. Example: To add the header like one on the screen above.png" style="height: 44px. font-weight: bold. Less syntax is allowed. and more.base-score). Firebug. and so on. text alignment. Chrome developer tools. Among other things these tools allows you to view the current element's attributes and applied styles and experiment with new ones.win-score { &:extend(. } . } else { $cellClasses['home_team_score'] = 'loss-score'.base-score).loss-score { &:extend(.4em.3 User-defined styles The ability to use custom styles allows you to set up such parameters of web pages as size of controls. } . use any available inspect HTML tools such as default Firefox developer tools. To define a custom style sheet that will be applied after all the pre-defined rules. } The conditional formatting is specified in the OnExtendedCustomDrawRow event as follows: if ($rowData['home_team_score'] > $rowData['away_team_score']) { $cellClasses['home_team_score'] = 'win-score'. More customization options 200 7. Example 1 The code below is used in our online demo to display the winning team and the losing team scores according to the current theme. $cellClasses['away_team_score'] = 'win-score'. color: @brand-danger. click the "Edit user styles" button and enter the rules you need manually or load them from a file.base-score { font-size: 1. The 'win-score' and 'loss-score' classes are defined as follows: . $cellClasses['away_team_score'] = 'loss-score'. To determine a selector to apply the styles for. Internet Explorer developer tools. } The screenshot below displays the Game list page in the Cyborg theme: © 2017 SQL Maestro Group . } © 2017 SQL Maestro Group .pgui-date-time-edit { max-width: 300px. use the following rule: div.201 PHP Generator for MySQL Help The next one shows the same page in the Facebook theme: Example 2 To limit maximum width of Date and DateTime pickers in all Edit and Insert forms by 300 pixels. Of course we can define the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 with the same code.removeItem('Mr'). but it's easier to define a function in the User Javascript window and call it in these event handlers. editors['title']. editors['title']. User Javascript: function fillRelatedTitles(sender.removeItem('Ms'.addItem('Mrs'. editors['title']. Example Suppose we want to fill the content of 'title' control depending of the value selected as 'sex' on Insert and Edit forms. } © 2017 SQL Maestro Group .'Ms').addItem('Mr'. editors) { if (sender.removeItem('Mrs'. JavaScript functions that are called from several event handlers (in order to avoid duplicate code). This is the optimal place to define.'Ms'). editors).'Mr').'Mrs'). for example.4 User JavaScript The ability to use custom JS allows you to specify JavaScript code that will be included into all the generated pages. More customization options 202 7.addItem('Ms'. editors['title']. } } OnInsertFormEditorValueChanged/OnEditFormEditorValueChanged event handlers: if (sender.'Mrs'). } else { editors['title'].getFieldName() == 'sex') { fillRelatedTitles(sender.getValue() == 'Male') { editors['title']. follow these steps: · Create a new template. inserting. · Instruct PHP Generator to use this template for the selected webpage with the OnGetCustomTemplate event. a typical representative of the web template engines family. · Customize the template according to your needs and preferences. Using custom templates To change the webpage appearance with custom templates.5 Custom templates Applications created by PHP Generator for MySQL use Smarty. Another article learns how to add a chart component to a webpage using the way described above. The demo application also shows some additional examples of using custom templates. The detailed description of such customization is given in the appropriate article. Custom templates must be stored under the components/ templates/custom_templates folder which contents is not changing on re-generation of the scripts. you need to change the appropriate template. Each folder in this catalog contains template files to be used by the application in different cases: on editing. © 2017 SQL Maestro Group . etc. All templates used by the software are stored in the components/templates subfolder of the output directory. 203 PHP Generator for MySQL Help 7. So in order to redesign a webpage. You must create this folder manually. printing. The example of supplying of generated pages with look and feel of an existing website illustrates this method in the appropriate article. Since all the templates are rewritten each time you generate an application. you have to add modified templates to the Excluded files 228 list to prevent them from overwriting. © 2017 SQL Maestro Group . More customization options 204 Changing existing templates You can modify generated template files directly. Record-level security 224 © 2017 SQL Maestro Group . See also: User permissions 220 . PHP Generator for MySQL provides you with the following authorization types: · Hard-coded authorization 207 Select this option to incorporate the authorization procedure directly into the PHP code of the generated application. 205 PHP Generator for MySQL Help 8 Security settings Check the Enable security option to supply the generated application with a login page to request user name and password when someone attempts to access your website. This kind of authorization also provides support for user self-registration and other email-based features 213 . · Table-based authorization 209 Select this option to authorize a user of the web application by a login/password combination stored in a database table. · User-defined authorization 218 Select this option to use a custom function to check user identity. · Database server authorization 217 Select this option to accomplish the authorization by MySQL server. Security settings 206 © 2017 SQL Maestro Group . Check the Enable guest access option to allow an anonymous user to access the generated app without completing the authentication procedure. click the Edit additional users button. As any operation related to the user management requires re-generation and re- uploading of the application.php files. © 2017 SQL Maestro Group . To manage additional users. then use Add/Edit/ Remove buttons or the user grid's popup menu. 207 PHP Generator for MySQL Help 8.1 Hard-coded authorization On using this kind of authorization all user accounts are stored in generated . fill in the Administrator login and Administrator password fields. Turn ON the Enable MD5 password encryption checkbox to store user passwords encrypted with the MD5 algorithm (recommended). it is not recommended to use this kind of authorization for real websites except the simplest ones. To create the administrator user. © 2017 SQL Maestro Group . see the User permissions 220 section. Security settings 208 When creating/editing a user. To learn how to specify page-level permissions. provide its user name and password and check the necessary options to grant application-level permissions to this user. Using a new table Click the Create new table. then select columns where user names. © 2017 SQL Maestro Group .. and IDs are stored. It is also possible to provide custom functions 211 for encrypting and verifying the passwords. then click OK. user_name character varying(255) The login of the user user_passw character varying(255) The password of the user ord Using an existing table Specify the table name in the Users table fields.. enter desired table and column names. The table may be prepared earlier or created directly within PHP Generator. Some additional columns should be added for support email-based features 213 . Table structure The basic table structure is as follows.2 Table-based authorization This kind of authorization means that user accounts are stored a database table. 209 PHP Generator for MySQL Help 8. If passwords are encrypted. passwords. button. Default Data type Description name user_id integer ID of the user. A new table will be created in the database. select the corresponding algorithm from the Password Encryption drop down list or enter the algorithm manually (if passwords are encrypted with a hash algorithm missing in the list like SHA512). This column must be defined as autoincrement for support user self- registration 213 . Security settings 210 To be able to log in to your website. you should create the first user (i. Open the Permission Manager 220 window to setup permission storage and/ or customize the permissions. Allow users to change their passwords Turn this option ON to allow your end-users change their passwords themselves (the appropriate button is located in the top right corner of the window). you can do it with our MySQL Maestro). Other users can be created online via the Administration Panel that is generated automatically. Enable guest access Turn this options ON to allow unauthorized users to access all or certain pages of your website. Please note that this functionality required storing user permissions in a database table as described here 220 . Don't forget that the password should be encrypted with the algorithm you selected.e. the first record in this table) with the Admin privilege manually (for example. Customizing permissions By default all users have the SELECT privilege granted at the application level via the PUBLIC group. © 2017 SQL Maestro Group . 211 PHP Generator for MySQL Help 8.2.1 Custom Password Encryption PHP Generator for MySQL comes with built-in support of a number of reliable and strong algorithms for password encryption; however, you can define your own functions for encrypting and verifying the passwords. This allows you to use any encryption algorithm API or library you like. To define a custom password encryption algorithm, select "Custom" in the Password Encryption field, then press the ellipsis button and provide two PHP functions for encrypting and verifying the password accordingly. function OnEncryptPassword($password, &$result) This function accepts an unencrypted password in the $password parameter and returns the encrypted password in the $result parameter that is passed by reference. function OnVerifyPassword($enteredPassword, $encryptedPassword, &$result) This function accepts an unencrypted password entered by the user and an encrypted password stored in the database. The $result parameter must be set to true if the entered password has been verified successfully and to false otherwise. By default this function encrypts the entered password with the OnEncryptPassword function call (see above) and compares the result with the encrypted password, so you should define the OnVerifyPassword function explicitly only if the default behavior is not suitable for your needs. © 2017 SQL Maestro Group Security settings 212 Example The example below shows how it is possible to use the PHP Native password hashing API for encrypting and verifying the password. The OnEncryptPassword function should be defined as follows: $result = password_hash($password, PASSWORD_DEFAULT); As we need to call a separate function for the password verification, the OnVerifyPassword function should be provided as well: $result = password_verify($enteredPassword, $encryptedPassword); © 2017 SQL Maestro Group 213 PHP Generator for MySQL Help 8.2.2 Email-based features Some security-related features provided by PHP Generator for MySQL like self- registration and password recovering are based on sending email messages to users of generated sites. This chapter explains how these features work and what is required from the site developer for their support. Users table extension To support email-based features, user table must contain the following columns (besides columns for storing user names, passwords, and IDs that are required to support table- based authentication basically): Default Data type Description name user_email character varying(255) Email address of the user user_token character varying(255) Internal data for verification and password recovering user_statu integer Status of the user. Possible values are as s follows: 0 - registered user 1 - user awaiting verification 2 - user requested password reset Enable self-registration If this option is turned ON, users can register in the generated application. Enable password recovering If this option is turned ON, users are allowed to reset their passwords. Customizing email messages Email messages to be sent to the user on the registration and password recovering can be customized with the OnGetCustomTemplate 133 event. Outgoing mail settings A set of settings to be used to send emails from the generated website. These settings can be also specified in the Project Options 192 dialog. © 2017 SQL Maestro Group Security settings 214 Events A number of events help you to control user registration and password recovering processes in the most flexible way possible. The following events are currently available: · OnBeforeUserRegistration 214 · OnAfterUserRegistration 214 · OnPasswordResetRequest 215 · OnPasswordResetComplete 215 8.2.2.1 OnBeforeUserRegistration event This event occurs before a user is registered. Signature: function OnBeforeUserRegistration($username, $email, $password, &$allowRegistration, &$errorMessage) Parameters: $username The name of the user. $email The email of the user. $password The password of the user. $allowRegistration A parameter to indicate whether user registration is allowed. Set $allowRegistration to false to reject the new user. Default value is true. $errorMessage A message to be displayed if $allowRegistration == false. Example The code snippet below demonstrates how to deny registrations for users with a mailinator.com email address. $emailDomainName = substr($email, strrpos($email, '@') + 1); if ($emailDomainName == 'mailinator.com') { $allowRegistration = false; $errorMessage = "It is forbidden to register with mailinator's emails"; } 8.2.2.2 OnAfterUserRegistration event This event occurs after a user is registered. Signature: function OnAfterUserRegistration ($userName, $email) Parameters: $userName The name of the user. $email The email of the user. © 2017 SQL Maestro Group 215 PHP Generator for MySQL Help Example The code snippet below sends an email 261 to the site administrator when a new user is registered. $messageBody = "A new user $username ($email) is registered"; sendMailMessage('[email protected]', 'A new user just registered', $messageBody); 8.2.2.3 OnPasswordResetRequest event This event occurs after a user requested to reset his password. Signature: function OnPasswordResetRequest ($userName, $email) Parameters: $userName The name of the user. $email The email of the user. Example The code snippet below shows how to add a record to a log table when a user requested to reset his password. $connection = createConnection 262 (); $sqlTemplate = "INSERT INTO user_log (username, action_type, action_time) " . "VALUES ('%s', '%s', '%s')"; $sql = sprintf($sqlTemplate, $username, 'password_reset_request', date('Y-m-d H:i:s')); $connection->Connect(); $connection->ExecSQL($sql); 8.2.2.4 OnPasswordResetComplete event This event occurs after a user resets his password. Signature: function OnPasswordResetComplete ($userName, $email) Parameters: $userName The name of the user. $email The email of the user. Example The code snippet below shows how to add a record to a log table when a user resets his password. $connection = createConnection 262 (); $sqlTemplate = "INSERT INTO user_log (username, action_type, action_time) " . "VALUES ('%s', '%s', '%s')"; © 2017 SQL Maestro Group Security settings 216 $sql = sprintf($sqlTemplate, $username, 'password_reset_complete', date('Y-m-d H:i:s')); $connection->Connect(); $connection->ExecSQL($sql); © 2017 SQL Maestro Group © 2017 SQL Maestro Group . 217 PHP Generator for MySQL Help 8. To allow access without entering a password. You can align user interface to real permissions granted at the server side with the OnGetCustomPagePermissions 153 event.3 Database server authorization This kind of authorization means that each user in your application should correspond to a user at the database server. User permissions should also be managed with the server facilities (GRANT and REVOKE statements). you need to create an additional user account at the database server and specify its username/ password in the corresponding fields. This feature requires you to define a function that takes entered username and password and returns true or false depending on their validity.4 User-defined authorization This kind of authorization allows you to define your own custom authentication. This means you can use any possible storage for user credentials and any encryption algorithm you like. © 2017 SQL Maestro Group . Security settings 218 8. 219 PHP Generator for MySQL Help Example: To check that the password is equal to the user name and password contains 5 or more symbols. See also: OnGetCustomPagePermissions 153 . place the following code to the body of the CheckUserIdentity function. © 2017 SQL Maestro Group . This condition means that the 'John/John' or 'John/Michael' pair will be declined while the 'Michael/Michael' or 'Gloria/Gloria' login/password combination will be accepted. if ($username == $password) $result = strlen($password) >= 5. else $result = false. OnGetCustomRecordPermissions 153 . Permissions can be granted at the application and page levels. Permissions granted at the application level are automatically applied to all pages in the application. Page-level permissions are granted for each page individually..e. Any user in the application will have the sum of privileges granted directly to him and PUBLIC privileges. press the Manage permissions. The privileges can be granted to guest just like any user in © 2017 SQL Maestro Group . 4. permissions are cumulative. including those that might be created later. 2. PUBLIC permissions are permissions to be granted to all authorized users of your application. 3. How permissions are granted and applied 1.5 Permission manager Permission manager allows you to restrict user access to the pages of the generated application. button. Security settings 220 8. To open this window. This is not applicable for the database server authorization. in that case the permissions should be set with the server facilities (GRANT and REVOKE statements). Effective user permissions for a page are calculated as sum of permissions granted to the user at the application and page levels i. PUBLIC privileges also can be granted at the application and page levels. You can enable the guest account in your application to allow any unauthorized user access to your website. 5.. and Admin. Use the checkboxes at the Permissions tab to grant/revoke the corresponding application-level permissions to users specified at the Hard-coded authorization window 207 ... he/she can read. use the Customize page level permission. Update. Hard-coded authorization On using this kind of authorization. To grant or revoke page-level permissions. and delete all the records of the page as well as add the new records and manage the page access permissions via Admin Panel (if the table-based authorization 209 is used and permissions are stored in a database table). button. The following permissions can be granted: Select.php files. 8. all users and their permissions are stored in generated .221 PHP Generator for MySQL Help the application. Live examples can be found in the Security Demo. The Copy operation is available for everyone who has the Insert privilege. Printing. Note that PUBLIC privileges do not affect the guest privileges and vice versa. Exporting. If a user has the Admin permission for a page. change. so it is necessary to re-generate the application to modify this data. 7. Delete. 6. Insert. and Comparison operations are available for everyone who has the Select privilege. Table-based authorization © 2017 SQL Maestro Group . switch to the Storage tab and click the appropriate radio button. you can use an existing table or create a new one. user accounts are always stored in a database table while permissions can be stored either in the generated files (as on using the hard-coded authorization) or in a database table like user accounts (recommended). On using this storage option. © 2017 SQL Maestro Group . you can manage users and their permissions (both application and page levels) without necessity of re-building your site via PHP Generator for MySQL GUI as well as via the web-based Administration Panel. To choose between these options. Security settings 222 On using this kind of authorization. To store permissions in the database. 223 PHP Generator for MySQL Help © 2017 SQL Maestro Group . 6 Record-level security Record-level security allows you to specify records to be accessible to a certain user. so they can access (and change) all the records. © 2017 SQL Maestro Group . You can customize record-level security for a certain page with the OnGetCustomRecordPermissions 153 event. define a column that identifies the record owner selecting the appropriate value from the drop down list in the Owner field name column. Use the Reset settings button to clear all the settings made in this window. Click the Set options for all button to specify owner field name and/or permissions for all pages at once. To enable record-level security for a page. Now all users are divided into two groups: the record owners. Live examples of using this feature can be found in the Security Demo. Security settings 224 8. This feature is available for table-based 209 and hard-coded 207 authorization types. Note the application and page admins bypass record-level security. and the others. Then grant privileges for each of these groups separately. The appropriate message will be displayed to the user and he/she will have to log in again to continue his/her work with the website. 225 PHP Generator for MySQL Help 8. When the timeout is reached.7 Inactivity Timeout You can specify the maximum amount of time (in seconds) after that a user will be automatically logged out from the application if he/she does not perform any action during this period. the OnBeforeLogout 97 event fires. Inactivity timeout is supported for all kinds of authorization. © 2017 SQL Maestro Group . dk.pl. you can create the © 2017 SQL Maestro Group .php French lang.es. select the corresponding file on the last wizard step.php Slovak lang.php Brazilian lang.php Spanish lang.tr.fr. Using prepared localization files PHP Generator for MySQL comes with a number of localization files that can be found under the installation folder.en.br.php German lang. If none of these files is right for you.php Danish lang.php Serbian lang.php Arabic lang. it is possible to customize the localization as described below.se. it is recommended to specify it in the application output options 276 to enable it by default. translated) to any language. Interface language 226 9 Interface language By default a web application created with PHP Generator for MySQL has English interface but it can be localized (i. In case you use the same file on a regular basis.sl.php Turkish These files were sent to us by our customers and we are not responsible for their quality.ru.cs. The table below contains currently available files and the corresponding interface languages: lang.it.php Czech lang. Using a custom localization file If none of supplied files is appropriate for your application.sr.php English lang.ar.php Dutch lang.php Russian lang.sk.php Hungarian lang.php Swedish lang. We will be very appreciated if you send us your custom file to be enjoyed by all the PHP Generator for MySQL users. To use a specific language.de.php Slovenian lang. The text strings to be used in the application's interface are stored in a localization file.hu.e.php Polish lang. usually C:\Program Files\SQL Maestro Group\PHP Generator for MySQL or C:\Program Files (x86)\SQL Maestro Group\PHP Generator for MySQL if you have a 64-bit operation system installed on your computer.php Italian lang.nl. The result is shown below.227 PHP Generator for MySQL Help localization yourself. Example Suppose we need to create a web application in Esperanto. enter/ correct necessary captions with any text editor.php (eo is the two-char language code for Esperanto). Let's open the file with a text editor (we prefer Notepad++). All we need to do is select this file at the last wizard step and generate the application. For this purpose get a localization file the clearest for you. In our case it is lang.en. translate all captions to Esperanto. First we need to define the localization file that is the clearest for us. © 2017 SQL Maestro Group . select the UTF-8 encoding and save it as lang. and save it in the UTF-8 encoding (this is very important for the correct displaying of captions in a web browser).eo.php. Note. images. To see the result of the process. © 2017 SQL Maestro Group . open any prepared . database_engine. These files must be rewritten only in case they were generated by the former version of PHP Generator for MySQL.php file with any browser. Note that the corresponding set of PHP functions should be available on your web server. and define security settings 205 of the created application. it's recommended to avoid repeated copying of non-changeable system files stored in components. set a localization file 226 . Common generation options 228 10 Common generation options At the last wizard step you can specify header and footer 199 . To deploy ready web application to the Internet. Generation options To make the repeated generating process more fast. By default the driver is set in accordance with the application output options 276 . Access driver There are several PHP drivers to communicate with database servers and PHP Generator for MySQL allows you to select a driver to be used by the generated web application. libs folders. that to run PHP code you need to have PHP and Apache installed or to run any portable web server. Output directory Generated files will be created in the output directory stored on your computer. copy the created directory to your hosting 21 . 229 PHP Generator for MySQL Help © 2017 SQL Maestro Group . Client Side API 231 Extends the functionality of Insert and Edit forms of generated web applications. Developer Reference 230 11 Developer Reference The following features and technologies allow you to develop applications with PHP Generator for MySQL. Style files compilation 264 Allows to create websites in several color schemas. © 2017 SQL Maestro Group . Server Side API 257 Extends the functionality of the generated application by the possibility to execute additional queries and use environment variables. Find out the description of available operations appropriate to each editor type: · All editors 231 · Text editor 241 · Text area 242 · Combobox 243 · Radio group 248 · Checkbox group 252 11. Signature: function getValue() © 2017 SQL Maestro Group .1 getValue Returns a value of a certain control (input. To set a control value. select.1 All editors The following operations may be applied to all editors: · getValue 231 · setValue 233 · getEnabled 235 · setEnabled 235 · getReadonly 237 · setReadonly 237 · getVisible 237 · setVisible 238 · getRequired 238 · setRequired 238 · getState 238 · setState 239 · setHint 239 · getFieldName 239 11. 231 PHP Generator for MySQL Help 11.1. These functions may be used in client side events 113 . use the appropriate function 233 .1. radio button.1 Client Side API The programming interface allows you to extend the functionality of Insert and Edit forms of generated web applications by the manipulating of their controls programmatically. PHP Generator for MySQL provides you with a number of operations executed on the client side. Use these functions to operate with editors' attributes and values on the air.1. textarea. etc). Example 1: The code below allows you to select a college only for players from U.setValue(null). See how it looks on the webpage at the screen below.getValue() != 1) { editors['college_id'].hide().next().log(sender). if (sender.next(). Example 2: © 2017 SQL Maestro Group . } else $('#college_id_edit').show(). Developer Reference 232 The examples below show how this method can be used in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 event handlers.getValue() == 1). if (sender. console.enabled(sender.getValue()). editors['college_id'].S.log(sender. $('#college_id_edit').getFieldName() == 'country_id') { console. (see this in action). if (sender. (see this in action).getFieldName() == 'current_team_id') { if (sender.enabled(sender.1.show(). See how it looks on the webpage at the screen below. This piece of code allows you to select player number only if a player's team is already selected (in other words. Signature: function setValue(value).next().2 setValue Sets the value of a certain control.hide().enabled(true).getValue() != 1) { editors['college_id']. Example 1: The code below allows you to select a college only for players from U.1. 233 PHP Generator for MySQL Help Another example from the insert and edit forms of the Players page (see this in action). } } See also: setValue 233 11.enabled(false). $('#college_id_edit').log(sender. editors['current_number']. $('#current_number_edit'). console.next().hide().getValue() == '') { editors['current_number'].getValue() == 1).setValue(null).setValue('').next(). The examples below show how this method can be used in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 event handlers. if (sender. } else $('#college_id_edit').show().getFieldName() == 'country_id') { console.S. } else { editors['current_number']. editors['college_id'].getValue()). if (sender.next().log(sender). players who do not belong to a team cannot have numbers). To get a control value. © 2017 SQL Maestro Group . use the appropriate function 231 . $('#current_number_edit'). next(). $('#current_number_edit'). editors['current_number']. } } © 2017 SQL Maestro Group .show(). if (sender. Developer Reference 234 Example 2: Another example from the insert and edit forms of the Players page (see this in action).getValue() == '') { editors['current_number'].enabled(true). This piece of code allows you to select player number only if a player's team is already selected (in other words.getFieldName() == 'current_team_id') { if (sender. } else { editors['current_number'].next().hide(). players who do not belong to a team cannot have numbers).enabled(false).setValue(''). $('#current_number_edit'). getValue() == 1).hide().getValue() != 1) { editors['college_id']. Disabled input elements in a form will not be submitted.enabled(sender. (see this in action).1.log(sender). Example 1: The code below allows you to select a college only for players from U.1. } else $('#college_id_edit'). Example: var editorState = editors['current_number'].3 getEnabled Returns the value specifying whether the control is enabled.S. false to disable it.next(). Signature: function getEnabled(). $('#college_id_edit'). editors['college_id']. 235 PHP Generator for MySQL Help See also: getValue 231 11. if (sender.setValue(null).getFieldName() == 'country_id') { console. True to enable the control. See how it looks on the webpage at the screen below. See also: setEnabled 235 11.4 setEnabled Sets a value specifying whether the control is enabled. if (sender.next().log(sender.show(). © 2017 SQL Maestro Group . Signature: function setEnabled([true|false]) The examples below show how this method can be used in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 event handlers.1.getEnabled().getValue()).1. console. hide().getValue() == '') { editors['current_number'].enabled(false). } } © 2017 SQL Maestro Group .show().enabled(true).getFieldName() == 'current_team_id') { if (sender. $('#current_number_edit'). } else { editors['current_number'].next(). players who do not belong to a team cannot have numbers).setValue(''). $('#current_number_edit'). if (sender. Developer Reference 236 Example 2: Another example from the insert and edit forms of the Players page (see this in action).next(). This piece of code allows you to select player number only if a player's team is already selected (in other words. editors['current_number']. 1.5 getReadonly Returns the value specifying whether the control is readonly. Signature: function setReadonly([true|false]) Example: editors['team'].1. A read-only input field cannot be modified (however. 237 PHP Generator for MySQL Help See also: getEnabled 235 11.setReadonly(true). © 2017 SQL Maestro Group .1.getReadonly().1. and copy the text from it).6 setReadonly Sets a value specifying whether the control is readonly. See also: setReadonly 237 11.7 getVisible Returns the value specifying whether the control is visible. Signature: function getReadonly() Example: var editorState = editors['team']. highlight it. Form elements with the readonly attribute set will get passed to the form processor. a user can tab to it.1. See also: getReadonly 237 11.1. 11 getState Returns the current state of a control.1.credit_card. Developer Reference 238 Signature: function getVisible() Example: var editorState = editors['team'].getValue() === 'Credit Card'.1.8 setVisible Sets a value specifying whether the control is visible.1. Signature: function getRequired() © 2017 SQL Maestro Group .1. editors. See also: getVisible 237 11.getVisible(). Signature: function setRequired([true|false]) Example: if (sender.1. See also: getRequired 238 11.payment_method. Signature: function setVisible([true|false]) Example: editors['team']. Signature: function getRequired() Example: var editorState = editors['team'].setRequired(isCreditCard).setVisible(true). An invisible element stays in its original position and size.1.10 setRequired Sets or clears the required attribute for a control.getRequired().9 getRequired Returns the value specifying whether the control is required.setVisible(isCreditCard). See also: setVisible 238 11. See also: setRequired 238 11. } The example can be seen live in our Feature Demo.getFieldName() === 'payment_method') { var isCreditCard = editors.1.1. Example: var editorState = editors['team'].1.12 setState Sets the state for a control.getState().1.setHint('Hint text'). } See also: getState 238 11. 'warning'.setState('warning'). } else { editors['percentage']. To clear a hint: editors['field_name'].1. See also: setState 239 11. © 2017 SQL Maestro Group .setState('normal').1.setHint(null).getValue() < 10) { editors['percentage'].1. 239 PHP Generator for MySQL Help Returning value: One of the following strings: 'normal'. Signature: function getFieldName() The examples below show how this method can be used in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 event handlers. 11. or 'success'. Signature: function setState(['normal'|'warning'|'error'|'success']) Example: if (sender. 'error'.14 getFieldName Returns the name of the field in the database the editor corresponds to.1.13 setHint Sets or clears an inline hint for a control. Signature: function setHint(['Hint text'|null]) Example: To set a hint for a control: editors['field_name']. next().next().log(sender. Developer Reference 240 Example 1: The code below allows you to select a college only for players from U. (see this in action).getValue() != 1) { editors['college_id']. This piece of code allows you to select player number only if a player's team is already selected (in other words. if (sender.setValue(null). editors['college_id'].getFieldName() == 'country_id') { console. © 2017 SQL Maestro Group .enabled(sender.getValue()). See how it looks on the webpage at the screen below.show(). Example 2: Another example from the insert and edit forms of the Players page (see this in action). players who do not belong to a team cannot have numbers). if (sender.getValue() == 1). console.log(sender).S. } else $('#college_id_edit').hide(). $('#college_id_edit'). Signature: function getPlaceholder() Example: var placeholder = editors['user_name'].next(). } else { editors['current_number'].enabled(true). $('#current_number_edit'). if (editors['first_name']. a sample value or a short description of the expected format). Signature: function setPlaceholder(value) Example: To add a placeholder to an Insert form depending of the entered first name.enabled(false). $('#current_number_edit'). 241 PHP Generator for MySQL Help if (sender.getFieldName() == 'current_team_id') { if (sender.').g. The short hint is displayed in the input field before the user enters a value.2 Text editor The following operations may be applied to one-line input fields: · getPlaceholder 241 · setPlaceholder 241 11. place the following strings to the OnInsertFormValueChanged.getPlaceholder().setPlaceholder('Hi.getValue() == '') { editors['current_number'].1 getPlaceholder Returns the value specifying whether the control has a placeholder.show().1. editors['current_number'].hide().getValue() == 'John') { editors['last_name'].1. } } 11.2. } © 2017 SQL Maestro Group .1.2 setPlaceholder Specifies a short hint that describes the expected value of an input field (e.2.setValue('').next(). John! Enter here your surname :). See also: setPlaceholder 241 11. 3. See also: setPlaceholder 241 11. if (editors['first_name'].g. } © 2017 SQL Maestro Group .2 setPlaceholder Specifies a short hint that describes the expected value of an input field (e. Signature: function getPlaceholder() Example: var placeholder = editors['user_name'].1.3. Signature: function setPlaceholder(value) Example: To add a placeholder to an Insert form depending of the entered first name.').1 getPlaceholder Returns the value specifying whether the control has a placeholder.getValue() == 'John') { editors['last_name'].1.setPlaceholder('Hi. The short hint is displayed in the input field before the user enters a value.3 Text area The following operations may be applied to multi-line text input controls: · getPlaceholder 242 · setPlaceholder 242 11. place the following strings to the OnInsertFormValueChanged.getPlaceholder().1. Developer Reference 242 See also: getPlaceholder 241 11. a sample value or a short description of the expected format). John! Enter here your surname :). 'Ms').removeItem('Mrs'.1. function fillRelatedTitles(sender.'Mr'). editors['title']. editors['title']. Place the code in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 event handlers to change the 'Title' content depending of the selected 'Sex' value.addItem('Mrs'.addItem('Mr'. editors['title']. editors) { if (sender. © 2017 SQL Maestro Group .4. editors['title'].addItem('Ms'. } else { editors['title'].'Ms'). caption). } } The screenshot demonstrates the result of the fired event.'Mrs'). Example: This example shows how we can manipulate combobox and radio group items depending on the 'sex' value.removeItem('Ms'.4 Combobox The following operations may be used to manipulate comboboxes on a form: · addItem 243 · removeItem 245 · getItemCount 247 · getCaption 247 · clear 247 11. Signature: function addItem(value.1.'Mrs').1 addItem Adds items to a combobox dynamically. 243 PHP Generator for MySQL Help See also: getPlaceholder 241 11.removeItem('Mr').getValue() == 'Male') { editors['title']. Developer Reference 244 © 2017 SQL Maestro Group . clear 247 11. Place the code in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 event handlers to change the 'Title' content depending of the selected 'Sex' value.addItem('Mr'.removeItem('Mr'). } else { editors['title'].addItem('Mrs'. editors['title'].2 removeItem Removes an item from a combobox.1.removeItem('Mrs'. 245 PHP Generator for MySQL Help See also: removeItem 245 .4. function fillRelatedTitles(sender. © 2017 SQL Maestro Group . editors['title'].'Mrs'). editors) { if (sender. getItemCount 247 .'Mrs'). } } The screenshot demonstrates the result of the fired event.'Mr').addItem('Ms'. editors['title'].getValue() == 'Male') { editors['title'].removeItem('Ms'.'Ms').'Ms'). Signature: function removeItem(value) Example: This example shows how we can manipulate combobox and radio group items depending on the 'sex' value. editors['title']. Developer Reference 246 © 2017 SQL Maestro Group . 247 PHP Generator for MySQL Help See also: addItem 243 , getItemCount 247 , clear 247 11.1.4.3 getItemCount Returns the number of combobox elements. Signature: function getItemCount() Example: The following code populates the item_count variable with the number of combobox elements. var item_count = editors['title'].getItemCount(); See also: addItem 243 , removeItem 245 , clear 247 11.1.4.4 getCaption Returns the caption of a certain control. Signature: function getCaption() Let's see the difference between getValue() and getCaption() functions. Assume we we have a Combobox editor with the following properties: ... and the second item is selected: The following code shows the difference between these functions: var value = editors['color'].getValue(); // value == 2 var caption = editors['color'].getCaption(); // caption == 'yellow' See also: addItem 243 , removeItem 245 , getItemCount 247 , clear 247 11.1.4.5 clear Deletes all elements in a combobox. Signature: function clear() © 2017 SQL Maestro Group Developer Reference 248 Example: The following code empties the 'title' control. editors['title'].clear(); See also: addItem 243 , removeItem 245 , getItemCount 247 11.1.5 Radio group The following operations may be applied to groups of radio buttons: · addItem 248 · removeItem 249 · getItemCount 251 · getCaption 251 · clear 251 11.1.5.1 addItem Adds items to a radio group dynamically. Signature: function addItem(value, caption); Example: This example shows how we can manipulate combobox and radio group items depending on the 'sex' value. Place the code in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 event handlers to change the 'Title' content depending of the selected 'Sex' value. function fillRelatedTitles(sender, editors) { if (sender.getValue() == 'Male') { editors['title'].removeItem('Ms','Ms'); editors['title'].removeItem('Mrs','Mrs'); editors['title'].addItem('Mr','Mr'); } else { editors['title'].removeItem('Mr'); editors['title'].addItem('Ms','Ms'); editors['title'].addItem('Mrs','Mrs'); } } The screenshot demonstrates the result of the fired event. © 2017 SQL Maestro Group 249 PHP Generator for MySQL Help See also: removeItem 249 , getItemCount 251 , clear 251 11.1.5.2 removeItem Removes an item from a radio group. Signature: function removeItem(value) Example: This example shows how we can manipulate combobox and radio group items depending on the 'sex' value. Place the code in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 event handlers to change the 'Title' content depending of the selected 'Sex' value. © 2017 SQL Maestro Group Developer Reference 250 function fillRelatedTitles(sender, editors) { if (sender.getValue() == 'Male') { editors['title'].removeItem('Ms','Ms'); editors['title'].removeItem('Mrs','Mrs'); editors['title'].addItem('Mr','Mr'); } else { editors['title'].removeItem('Mr'); editors['title'].addItem('Ms','Ms'); editors['title'].addItem('Mrs','Mrs'); } } The screenshot demonstrates the result of the fired event. © 2017 SQL Maestro Group 251 PHP Generator for MySQL Help See also: addItem 248 , getItemCount 251 , clear 251 11.1.5.3 getItemCount Returns the number of radio group elements. Signature: function getItemCount() Example: The following code populates the item_count variable with the number of combobox elements. var item_count = editors['title'].getItemCount(); See also: addItem 248 , removeItem 249 , clear 251 11.1.5.4 getCaption Returns the caption of a certain control. Signature: function getCaption() Let's see the difference between getValue() and getCaption() functions. Assume we we have a Radio group editor with the following properties: ... and the second item is selected: The following code shows the difference between these functions: var value = editors['color'].getValue(); // value == 2 var caption = editors['color'].getCaption(); // caption == 'yellow' See also: addItem 248 , removeItem 249 , getItemCount 251 , clear 251 11.1.5.5 clear Deletes all elements in a radio group. Signature: function clear() Example: The following code empties the 'title' control. editors['title'].clear(); © 2017 SQL Maestro Group Developer Reference 252 See also: addItem 248 , removeItem 249 , getItemCount 251 11.1.6 Checkbox group and Multiple select These function are helpful to define the behaviour of a checkbox group or a multiple select: · addItem 252 · removeItem 253 · getItemCount 254 · clear 255 11.1.6.1 addItem Adds items to a checkbox group or a multiple select dynamically. Signature: function addItem(value, caption); Example: The code below placed in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 changes the content of the 'Clothes' checkbox group depending of the selected season. if (sender.getFieldName() == 'season') { var $item_count = editors['clothes'].getItemCount(); if ($item_count == 6) { if (sender.getValue() == 'Winter') { editors['clothes'].removeItem('Shorts'); editors['clothes'].removeItem('Sandals'); editors['clothes'].removeItem('Swimsuit'); } else { editors['clothes'].removeItem('Coat'); editors['clothes'].removeItem('Boots'); editors['clothes'].removeItem('Cap'); } } else { editors['clothes'].clear(); if (sender.getValue() == 'Winter') { editors['clothes'].addItem('Coat','Coat'); editors['clothes'].addItem('Boots','Boots'); editors['clothes'].addItem('Cap','Cap'); } else { editors['clothes'].addItem('Shorts','Shorts'); editors['clothes'].addItem('Sandals','Sandals'); editors['clothes'].addItem('Swimsuit','Swimsuit'); } © 2017 SQL Maestro Group 'Coat'). editors['clothes']. editors['clothes'].getFieldName() == 'season') { var $item_count = editors['clothes']. editors['clothes'].1. if ($item_count == 6) { if (sender. } else { editors['clothes'].getItemCount(). getItemCount 254 . © 2017 SQL Maestro Group .clear().removeItem('Sandals').6. Signature: function removeItem(value) Example: The code below placed in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 changes the content of the 'Clothes' checkbox group depending of the selected season.addItem('Coat'.addItem('Boots'. clear 255 11.removeItem('Coat').removeItem('Shorts'). editors['clothes'].2 removeItem Removes an item from a checkbox group or a multiple select.removeItem('Swimsuit').removeItem('Cap'). if (sender.removeItem('Boots').getValue() == 'Winter') { editors['clothes']. 253 PHP Generator for MySQL Help } } The screenshot demonstrates the result of the fired event. See also: removeItem 253 . editors['clothes']. if (sender.getValue() == 'Winter') { editors['clothes']. } } else { editors['clothes'].'Boots'). removeItem('Swimsuit'). clear 255 11.addItem('Sandals'. } else { editors['clothes'].addItem('Shorts'. getItemCount 254 .getFieldName() == 'season') { var $item_count = editors['clothes'].removeItem('Cap').getValue() == 'Winter') { editors['clothes'].'Sandals').'Shorts').3 getItemCount Returns the number of checkbox group or a multiple select elements.6. editors['clothes']. editors['clothes']. editors['clothes']. if ($item_count == 6) { if (sender.getItemCount(). editors['clothes']. Signature: function getItemCount() Example: The code below placed in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 changes the content of the 'Clothes' checkbox group depending of the selected season.removeItem('Sandals').addItem('Cap'. Developer Reference 254 editors['clothes']. } else { editors['clothes'].1. if (sender. See also: addItem 252 . editors['clothes'].removeItem('Shorts').removeItem('Boots'). } } } The screenshot demonstrates the result of the fired event.removeItem('Coat').'Cap'). editors['clothes'].addItem('Swimsuit'.'Swimsuit'). } © 2017 SQL Maestro Group . addItem('Cap'.1.'Shorts'). editors['clothes'].'Coat').clear(). editors['clothes']. clear 255 11.4 clear Deletes all elements in a checkbox group or a multiple select. editors['clothes'].addItem('Sandals'.'Boots').6. } else { editors['clothes'].'Swimsuit').addItem('Swimsuit'. if ($item_count == 6) { if (sender.getFieldName() == 'season') { var $item_count = editors['clothes']. } } } The screenshot demonstrates the result of the fired event.'Sandals'). © 2017 SQL Maestro Group . editors['clothes'].removeItem('Shorts'). See also: removeItem 253 . addItem 252 . Signature: function clear() Example: The code below placed in the OnInsertFormEditorValueChanged 116 and OnEditFormEditorValueChanged 118 changes the content of the 'Clothes' checkbox group depending of the selected season. editors['clothes'].getItemCount().getValue() == 'Winter') { editors['clothes']. 255 PHP Generator for MySQL Help } else { editors['clothes'].addItem('Shorts'. if (sender.'Cap').getValue() == 'Winter') { editors['clothes'].addItem('Coat'.addItem('Boots'. if (sender.removeItem('Sandals'). 'Cap'). } else { editors['clothes'].getValue() == 'Winter') { editors['clothes']. editors['clothes'].'Shorts').clear().'Swimsuit'). editors['clothes']. removeItem 253 . } } } The screenshot demonstrates the result of the fired event.'Boots').addItem('Cap'. } } else { editors['clothes'].addItem('Coat'.removeItem('Swimsuit'). See also: addItem 252 . if (sender.addItem('Shorts'. } else { editors['clothes'].removeItem('Boots').addItem('Sandals'.'Coat'). editors['clothes'].addItem('Swimsuit'. Developer Reference 256 editors['clothes']. getItemCount 254 © 2017 SQL Maestro Group . editors['clothes'].removeItem('Coat'). editors['clothes'].removeItem('Cap').'Sandals'). editors['clothes'].addItem('Boots'. 2. 257 PHP Generator for MySQL Help 11. $userName = $this->GetEnvVar('CURRENT_USER_NAME').2 Server Side API The programmatic interface allows you to extend the functionality of the generated application executing additional queries and using environment variables.1.2. Use them in the sever side events 122 . Signature: function GetEnvVar($name) Example: The following example demonstrates how to use variables within the OnBeforeInsertRecord 144 event handler. · Page 257 · Application 258 · EngConnection 259 · Global functions 261 11. © 2017 SQL Maestro Group . $queryResult). Signature: function GetConnection() Example: To get the list of available databases.2.1 class Page The following methods of class Page might be useful for application developers: · GetEnvVar 257 · GetConnection 257 11. $rowData['ip_address'] = $this->GetEnvVar('REMOTE_ADDR').1 GetEnvVar Returns the value of a specified environment variable.2 GetConnection Returns the connection object (an instance of the EngConnection 259 class).1. 11. Current page may be called as $this. Available methods are grouped by classes they belong to. if ($userName != 'admin') $rowData['changed_by'] = $userName. $this->GetConnection()->ExecQueryToArray('SHOW DATABASES'. use the following code: $queryResult = array(). 2. $params['custom_var'] = '5 (default)'.2.2. else // not found. Assign a default value. See also: IsGETValueSet 258 © 2017 SQL Maestro Group . Assign a default value. if so. $params['custom_var'] = '5 (default)'.1 IsGETValueSet Checks if $_GET contains a parameter named paramName. else // not found. Signature: function GetGETValue($name) Example: The code below checks if a $_GET parameter does exist and. Returns true if such parameter does exist and false otherwise.2.2. assigns its value to a variable. // check if the parameter custom_var available if (GetApplication()->IsGETValueSet('custom_var')) // found $params['custom_var'] = GetApplication()->GetGETValue('custom_var'). Developer Reference 258 11. Signature: function IsGETValueSet($paramName) Example: The code below checks if a $_GET parameter does exist and.2 GetGETValue Returns the value of a parameter named paramName from the superglobal $_GET array. if so. assigns its value to a variable.2 class Application The following methods of class Application are available: · IsGETValueSet 258 · GetGETValue 258 · IsPOSTValueSet 259 · GetPOSTValue 259 · IsLoggedInAsAdmin 259 11. // check if the parameter custom_var available if (GetApplication()->IsGETValueSet('custom_var')) // found $params['custom_var'] = GetApplication()->GetGETValue('custom_var'). See also: GetGETValue 258 11. Signature: function IsPOSTValueSet($paramName) The code below checks if a $_POST parameter does exist and. $params['custom_var'] = '5 (default)'.3 class EngConnection The following methods of class EngConnection are available: © 2017 SQL Maestro Group . Assign a default value. 259 PHP Generator for MySQL Help 11. else // not found. if so. else // not found. Returns true if such parameter does exist and false otherwise.3 IsPOSTValueSet Checks if $_POST contains a parameter named paramName.4 GetPOSTValue Returns the value of a parameter named paramName from the superglobal $_POST array.2. // check if the parameter custom_var available if (GetApplication()->IsPOSTValueSet('custom_var')) // found $params['custom_var'] = GetApplication()->GetPOSTValue('custom_var').2. assigns its value to a variable.2. Signature: function GetPOSTValue($name) The code below checks if a $_POST parameter does exist and.5 IsLoggedInAsAdmin Checks whether currently logged in user has admin permissions at the application level.2.2. $params['custom_var'] = '5 (default)'.2.2. assigns its value to a variable. Signature: function IsLoggedInAsAdmin() Example if (!GetApplication()->IsLoggedInAsAdmin()) { // perform some actions for ordinal users } 11. if so. See also: GetPOSTValue 259 11. Assign a default value. See also: IsPOSTValueSet 259 11. // check if the parameter custom_var available if (GetApplication()->IsPOSTValueSet('custom_var')) // found $params['custom_var'] = GetApplication()->GetPOSTValue('custom_var'). 2.3.2. 11. Developer Reference 260 · ExecScalarSQL 260 · ExecSQL 260 · ExecQueryToArray 260 11.3 ExecQueryToArray Еxecute a query that returns a result set. An instance of this class is passed to the OnGetCustomPagePermissions 153 event to customize page-level permissions.4 class PermissionSet PermissionSet is a simple class that encapsulates object permissions and provide methods to query/change all or certain permissions. All functions return Boolean.. $this->GetConnection()->ExecQueryToArray( 'SELECT 1 as a UNION SELECT 2 as a'. Signature: function ExecScalarSQL($sql) Example: $one = $this->GetConnection()->ExecScalarSQL('SELECT 1').1 ExecScalarSQL Executes a query returning a single value.2.2. hasDeleteGrant() Returns whether the current user can delete records. hasEditGrant() Returns whether the current user can edit records.'). &$array) Example: $values = array(). Querying permissions The following methods can be used to query the current state of a class instance. $values ). © 2017 SQL Maestro Group . Signature Description hasViewGrant() Returns whether the current user can view records. hasAddGrant() Returns whether the current user can add records. Signature: function ExecQueryToArray($sql..3.3. 11.2 ExecSQL Executes a query that does not return results. Signature: function ExecSQL($sql) Example: $this->GetConnection()->ExecSQL('INSERT INTO . 11. $attachments = ''. Changing permissions The following methods can be used to change the current state of a class instance. Signature: function sendMailMessage($recipients.1 GetApplication Returns an instance of the Application 258 class. $delete) Sets all page permissions at once. setAddGrant($value) Allows the current user to add records. All parameters are Boolean. setGrants($view. Assign a default value. $messageSubject. $messageBody. 261 PHP Generator for MySQL Help hasAdminGrant() Returns whether the current user has admin privileges for the current page. 11. $bcc = '') Parameters: Name Data type Description Mandat © 2017 SQL Maestro Group . Signature Description setViewGrant($value) Allows the current user to view records.5.5 Global functions Global functions: · GetApplication 261 11. 11.2.5. else // not found. $add. Signature: function GetApplication() Example: To check if the parameter custom_var is available.2. setDeleteGrant($value) Allows the current user to delete records.2. $cc = ''. setEditGrant($value) Allows the current user to edit records. Actually it is implemented via the Singleton pattern. use the following code: if (GetApplication()->IsGETValueSet('custom_var')) // found $params['custom_var'] = GetApplication()->GetGETValue('custom_var'). so the same instance always will be returned.2 sendMailMessage Sends an email message to specified recipients using project-level outgoing mail settings 192 . $params['custom_var'] = '5 (default)'. setAdminGrant($value) Grants the current user admin privileges for the current page. $edit. $messageBody. 'david_frost@example. 'Message body').edu' => 'Dougie Jones'. 11. $cc. 'bob_cooper@example. $bcc). $messageSubject.com' => 'Bob Cooper'. sendMailMessage('admin@example. 'Message subject'. Signature: function createConnection() Example The code snippet below shows how to add a record to a log table when a user resets his password 215 . 'external_data/images/example.com'.html"). $cc = array('mark_lynch@example. © 2017 SQL Maestro Group .en' => 'Laura Horne' ). $connection = createConnection(). $messageBody = file_get_contents("external_data/mail_message_body.gov'). HTML is yes y allowed. $bcc = array( 'dougie_jones@example. $attachments string or An attachment or a list of attachments for no array the email message $cc string or A recipient or a list of recipients specified in no array the CC field $bcc string or A recipient or a list of recipients specified in no array the BCC field Example 1 This example demonstrates the simplest use of the function. $attachments = array( 'external_data/files/example.5. $messageSubject = 'Welcome!!!'. Example 2 This example demonstrates an advanced use of the function.2. Returns an instance of the EngConnection 259 class. 'laura_horne@example. sendMailMessage('[email protected]'.3 createConnection Creates a new connection to the database. Developer Reference 262 ory $recipients string or A recipient or a list of recipients for the yes array email message $messageSubj string A subject of the email message yes ect $messageBod string A body of the email message.com'.png' ). $attachments.com'. "VALUES ('%s'. $connection->Connect(). $sql = sprintf($sqlTemplate. '%s')". action_type. 'password_reset_complete'. $username. '%s'. $connection->ExecSQL 260 ($sql). action_time) " .263 PHP Generator for MySQL Help $sqlTemplate = "INSERT INTO user_log (username. © 2017 SQL Maestro Group . date('Y-m-d H:i:s')). Manual compilation of LESS files You might want to compile . a dynamic style sheet language that can be compiled into Cascading Style Sheets (CSS).less files are stored in the components/assets/less folder of the output directory. To do so. Developer Reference 264 11. For example. functions and many other techniques that simplify the development of large style sheets.less and saves the results to components/assets/css/main.3 Style sheets internals Style sheets structure PHP Generator's style sheets are made with LESS. you will need to compile main. The choice of Less is motivated by such advantages of this language as variables. you can use dotless. css.Compiler (a command-line compiler that comes with PHP Generator and can be found in SQL Maestro Group\DotLess inside the Common Files directory) using the following command: dotless. the software automatically compiles main. When you click "Generate" in PHP Generator for MySQL.exe -r -m full/path/to/main.less file references (directly or indirectly) all styles defined in other files and subdirectories of this folder as well as user-defined styles.less files manually.less.compiler. which are stored in components/assets/less/user.less compiler you like.less Visit dotless.Compiler wiki to find more info on using this tool. less using any . mixins. All . The main. © 2017 SQL Maestro Group . Current color theme is defined in components/assets/ less/theme.less. menus. The window allows you to customize the options grouped by the following sections: · Application 266 General PHP Generator for MySQL options: generation rules. trees. use the More button and select Options at the drop-down list. default page options. and display data formats. You may be surprised at all the things you can adjust and configure! © 2017 SQL Maestro Group . 265 PHP Generator for MySQL Help 12 Options PHP Generator for MySQL allows you to customize the way it works within the Options dialog. It is a good idea to check through these settings before you start working with PHP Generator for MySQL.bars. To open the dialog. etc. · Editors & Viewers 279 Customizing of all the SQL editors. · Appearance 287 Customizing program interface . The section consists of several tab. follow the links to find out more about each of them. © 2017 SQL Maestro Group .1 Application The Application section allows you to customize common rules of PHP Generator for MySQL behavior. · Page 266 · Generation defaults 275 · Display formats 276 · Output 276 12. Options 266 12.1.1 Page This tab allows you to specify default page options to be applied to all the generated pages in all applications. These settings can be overwritten for a project as well as for a certain page. List These options are applied for List views (both grid and card). Content encoding The default option value is UTF-8 and you must have really good reasons to change it. and Insert modal windows. Hide sidebar menu by default If checked. Page direction Allows you to select between Left-to-right and Right-to-left page directions. small. Modal form size A preferred size (default. or large) for View. Page navigator © 2017 SQL Maestro Group .267 PHP Generator for MySQL Help Common These options are applied for all generated pages. Edit. the sidebar menu will be closed until a user opens it manually. Number of cards in a row Allows you to specify maximum number of cards displayed in a row for each screen resolution. To create a custom pagination. This value may be changed by application users in runtime if the Runtime Customization 272 option is enabled. The end-user can easily switch from the grid mode to the card one and vice versa using the Page Settings dialog (if the Runtime Customization 272 option is enabled). These values also can be changed by end-users if the Runtime Customization © 2017 SQL Maestro Group . View mode Select whether page data are displayed in a grid or as info cards. use Data Partitioning 176 . Options 268 Allows you to specify the position of the navigational control(s) and the default number of records displayed on the page. Show line numbers Check this option to add row numbering to the grid. Live Example. Condensed table Turn this option 'ON' to make tables more compact by cutting cell padding in half. Live Example. Control buttons position Select whether the Edit. Live Example. Bordered table Check this option to add borders on all sides of the table and cells. Edit/Insert These options are applied to data input forms. View. Live Example. Highlight row at mouse over Allows you to enable/disable the highlighting of rows at mouse over. Display "Set Default" checkboxes Defines whether "Set Default" checkboxes are displayed for each control in Edit and Insert forms. and Copy buttons to be displayed on the left side of the generated page or on the right side. Delete. Use images for actions Defines whether images or text captions are used for control buttons (like Edit. View. © 2017 SQL Maestro Group .269 PHP Generator for MySQL Help 272 option is enabled. or Delete). Live Example. Show key columns images Turn is 'ON' to mark key columns with the 'key' images. Display "Set NULL" checkboxes Defines whether "Set NULL" checkboxes are displayed for each control in Edit and Insert forms. Live Example. Use fixed grid header Allows you to make the grid header are non-scrollable. All records from grid Defines exporting and printing options to be available for the data grid. Options 270 12.1.1. These settings can be overwritten for a project as well as for a certain page. © 2017 SQL Maestro Group .1 Export and Print This tab allows you to specify default exporting and printing options to be available for all the generated pages in all applications. Record from view form Defines exporting and printing options to be available for a single record view form. Single record from grid Defines exporting and printing options to be available for a single record in the data grid.271 PHP Generator for MySQL Help Selected records from grid Defines exporting and printing options to be available for the selected records in the data grid. © 2017 SQL Maestro Group . Options 272 12.2 Abilities This tab allows you to specify default operations to be available for all the generated pages in all applications. © 2017 SQL Maestro Group .1.1. These settings can be overwritten for a project as well as for a certain page. List only. and Modal window.273 PHP Generator for MySQL Help Actions View Defines whether browsing a single record is available. Inline mode. Possible values are Disabled. Separated Page (default value). Separated Page (default value). Edit Defines whether data editing is available. Quick Edit Defines whether the quick edit mode is available. Separated Page (default value). Possible values are List and view (quick editing is available in both data grid and single record view window). © 2017 SQL Maestro Group . ossible values are Disabled. and Modal window. Multi-edit Defines whether mass data editing is available. and Modal window. Possible values are Disabled. and None. View only. Possible values are Enabled (default) and Disabled. Filtering Quick search Defines whether the Quick Search box is displayed. Delete Defines whether data deletion is available. Possible values are Enabled (default) and Disabled. Inline mode. Possible values are Enabled (default) and Disabled. Possible values are Enabled (default) and Disabled. Sorting by dialog Defines whether the data sort dialog is available. Possible values are Disabled. It is also possible to enable/disable this feature at the column level. Multi-delete Defines whether multi deletion is available (user can delete multiple records at a time). Column Filter Defines whether the Column Filter tool is available. Inline mode. Options 274 Insert Defines whether data insertion is available. Possible values are Enabled (default) and Disabled. Refresh © 2017 SQL Maestro Group . Sorting Sorting by click Defines whether data can be sorted by click on a column header. and Modal window. and Modal window. Filter Builder Defines whether the Filter Builder tool is available. Possible values are Enabled (default) and Disabled. Separated Page (default value). Possible values are Disabled. Possible values are Enabled (default) and Disabled. Possible values are Enabled (default) and Disabled. Possible values are Enabled (default) and Disabled. Additional Runtime Customization Defines whether end user is able to customize such page properties as number of records displayed on a page and a number of cards for each screen resolution. Records comparison Defines whether the record comparison tool is available. Copying Defines whether data copying is available. Separated Page (default value). If the text length is greater than this value. Specify here the Max visible length of text fields value. 275 PHP Generator for MySQL Help Defines whether the Refresh button is diaplyed. Possible values are Enabled (default) and Disabled.2 Generation rules Use this tab to define rules to be used for the page generation. automatic enabling of text area editors for columns storing varchar data with length greater than a specified value and automatic setting Image view control and Image upload edit control for binary fields. the residual text will be hidden under the More.. These options allow you to enable/disable the automatic implementation of lookup editors and details by foreign keys..1. link on the generated page. Full text can be displayed in the special window in this case. © 2017 SQL Maestro Group . 12. the editing of autoincrement fields and inserting data into them. 12. Options 276 12.3 Display formats Use this tab's fields to adjust the display data formats in the way you need. Find out more on applications localization at the corresponding page 226 . Note that the corresponding set of PHP functions should be available on your web server. PHP Driver There are several PHP drivers to communicate with database servers and PHP Generator for MySQL allows you to select a driver to be used by the generated web application. You can also set here the output file extension and the default color scheme for the © 2017 SQL Maestro Group .1.1. Localization file Use this field to define the interface language to be used for the generated application by default.4 Output Use this tab to specify default values for project output options 228 . 12. Most of these options can be also set directly from the corresponding confirmation dialogs. © 2017 SQL Maestro Group .1.5 Confirmations This tab allows you to disable/enable application confirmations. 277 PHP Generator for MySQL Help generated pages. Options 278 © 2017 SQL Maestro Group . 279 PHP Generator for MySQL Help 12. Convert tabs to spaces If this option is checked. To open a link click it with the Ctrl button pressed. line numbers are displayed in the editor window. Show line numbers If this option is checked. · General 279 · Display 280 · SQL highlight 281 · PHP highlight 283 · XML highlight 282 · Code Insight 284 · Code Folding 285 12. Tab Stops Defines the tab length. Show special chars If this option is checked. insert symbols mode is default on. Use syntax highlight Enables syntax highlight in the object editor window.1 General If the Auto indent option is checked. each new indention is the same as the previous when editing SQL text. used when editing text.2 Editors & Viewers The Editors & Viewers section allows you to set the parameters of viewing and editing the SQL statements within PHP Generator for MySQL. the appropriate number of spaces will be added to the edited text. Always show links If this option is checked. depending on the previous line tab. special chars (like line breaks) are displayed in the editor window. hyperlinks are displayed in the editor window. each time you press the Tab key. Undo Limit © 2017 SQL Maestro Group . Insert mode If this option is checked. Use smart tabs With this option on the number of tab stops is calculated automatically.2. © 2017 SQL Maestro Group .2 Display You can disable/enable the right text margin and the gutter of the editor area.2. Options 280 Defines the maximum number of changes possible to be undone. The panel below displays the sample of the selected font. 12. and the Gutter width. Use the Editor font and Font size to define the font used in all program editors and viewers. set the position of the right text margin as Right margin. © 2017 SQL Maestro Group . e.3 SQL highlight Use the SQL highlight item to customize syntax highlight in all SQL editors and viewers. Select the text element from the list. 281 PHP Generator for MySQL Help 12. background color and text attributes according to your preferences.2.g. comment or SQL keyword and adjust its foreground color. 4 XML highlight Use the XML highlight item to customize XML syntax highlight for the text representation of BLOBs. Options 282 12. e. © 2017 SQL Maestro Group .2.g. attribute or attribute value and adjust its foreground color. background color and text attributes according to your wishes. Select the text element from the list. 5 PHP highlight Select the text element from the list (e. © 2017 SQL Maestro Group . Identifier). 283 PHP Generator for MySQL Help 12. Keyword. background color and text attributes according to your wishes.g. and adjust its foreground color. Comment.2. 2. and case of words inserted automatically. Options 284 12.6 Code Insight You can disable/enable the code completion with the corresponding option and also set the time is appears as Delay. © 2017 SQL Maestro Group . 2. In extended mode the whole text is displayed (set by default). © 2017 SQL Maestro Group . in collapsed mode the text is hidden behind one text line denoting the first line of the collapsed region. Each part can be collapsed and extended.7 Code Folding The Code Folding item group makes it possible both to view the whole text and to divide it into logical parts (regions). 285 PHP Generator for MySQL Help 12. © 2017 SQL Maestro Group . Options 286 You can enable/disable code folding in SQL editors and viewers and customize the colors of its items. Check boxes. Use the Scheme name box to select the interface scheme you prefer: Office XP style. 287 PHP Generator for MySQL Help 12.) and clicking the Save As button. etc. The item allows you to select Bar style and menu animation from the corresponding drop-down lists and to enable or disable such options as sunken border. You can create your own interface schemes by customizing any visual options (Bars and menus. · Bars and menus 287 · Trees and lists 288 · Edit controls 289 · Check boxes 290 · Buttons 291 · Page controls 292 · Group boxes 293 · Splitters 294 12. Edit controls. F10 key for opening menu. flat close buttons. gray-scale images.3.3 Appearance The Appearance section allows you to customize the application interface style to your preferences. viewing full menus after delay. Windows XP native style. etc.1 Bars and menus Use the Bars and menus item to customize PHP Generator for MySQL toolbars style and menus animation. All the customized options are displayed on the sample panel. Trees and lists. © 2017 SQL Maestro Group . Buttons. Use the item to select standard. check or uncheck the hide selection. Options 288 12. flat or ultraflat styles.3. © 2017 SQL Maestro Group . hide focus rectangle and native style options.2 Trees and lists Use the Trees and lists item to select various tree view options. 3 Edit controls Use the Edit controls item to customize the appearance of different PHP Generator for MySQL edit controls. © 2017 SQL Maestro Group . button edit and combo box controls. shadows. button style and transparency.3. enable/disable hot tracks. The tab allows you to select the edit controls border style. It is also possible to define samples for the text edit. 289 PHP Generator for MySQL Help 12. native style and customize edges. The tab allows you to customize the appearance of check boxes: set border style. © 2017 SQL Maestro Group . It is also possible to define samples for check boxes and radio buttons. native style. shadows. enable/disable hot tracks.4 Check boxes The Check boxes item allows you to customize the appearance of check boxes and radio buttons.3. Options 290 12. 291 PHP Generator for MySQL Help 12. © 2017 SQL Maestro Group . The tab allows you to adjust the appearance of buttons and define sample buttons as well.5 Buttons Use the Buttons item to customize PHP Generator for MySQL buttons.3. enable/disable hot track.3.6 Page controls The Page controls item allows you to customize the style of all PHP Generator for MySQL page controls. © 2017 SQL Maestro Group . multi- line pages and native style. The tab allows you to select tab styles. Options 292 12. 7 Group boxes Use the Group boxes item to customize all PHP Generator for MySQL group boxes according to your preferences. © 2017 SQL Maestro Group . 293 PHP Generator for MySQL Help 12.3. enable/disable native style and define samples. Use tab to apply styles for group boxes. Simple or none) and specify the Hot zone drags a splitter option.8 Splitters Use the Splitters item to customize all PHP Generator for MySQL splitters according to your preferences. Media Player 9. © 2017 SQL Maestro Group .3. Options 294 12. Use the tab to select hot zone style (Windows XP task bar. Media Player 8. 295 PHP Generator for MySQL Help © 2017 SQL Maestro Group . 242 OnBeforeLogout 97 setReadonly 237 OnBeforeUpdateRecord 107 setRequired 238 OnCustomHTMLHeader 98 setState 239 OnCustomizePageList 112 Text editors 241 OnGetCustomExportOptions 111 Command line options 18 OnGetCustomPagePermissions 113 Connect to database 13 OnGetFieldValue 111 © 2017 SQL Maestro Group . 238 OnAfterUpdateRecord 109 setEnabled 235 OnBeforeDeleteRecord 108 setHint 239 OnBeforeInsertRecord 107 setPlaceholder 241. Developer reference 230 Client Side API 231 Appearance Options Server Side API 257 Bar and menus 287 Style sheets internals 264 Buttons 291 Check boxes Edit controls 290 289 -E- Group boxes 293 Editor & Viewer Options Page controls 292 Code Folding 285 Splitters 294 Code Insight 284 Trees and lists 288 Display 280 General 279 -C. 122 All editors API 231 getEnabled 235 getFieldName 239 -G- getPlaceholder 241. 113 Client Side API Page Events executed at Server Side 95. PHP highlight 283 SQL highlight 281 Charts XML highlight 282 General options 160 Email-based features OnPrepareChart 160 OnAfterUserRegistration 214 Query 158 OnBeforeUserRegistration 214 class Application OnPasswordResetComplete 215 GetGETValue 258 OnPasswordResetRequest 215 GetPOSTValue 259 EULA 5 IsGETValueSet 258 Events 95 IsLoggedInAsAdmin 259 Global Events 95 IsPOSTValueSet 259 Page Events executed at Client Side 95. 242 Getting started 11 getReadonly 237 Global Events getRequired 238 OnAfterDeleteRecord 110 getState 238 OnAfterInsertRecord 108 getValue 231. Index 296 Connection options 13 Index -D- -A. 233 OnAfterLogin 97 getVisible 237. 146 Page properties -O.Detail Presentations 89 -S- Multi-level autocomplete editor 63 Security options Page properties 162 Custom Password Encryption 211 Templates 88 Database server authorization 217 View properties 41 Email-based features 213 Page Events executed at Client Side 113 Hard-coded authorization 207 OnAfterPageLoad 114 Inactivity Timeout 225 OnBeforePageLoad 114 Permission manager 220 OnEditFormEditorValueChanged 118 Record-level security 224 OnEditFormLoaded 121 Table-based authorization 209 OnEditFormValidate 115 User-defined authorization 218 OnInsertFormEditorValueChanged 116 Server Side API OnInsertFormLoaded 120 class Page 257 OnInsertFormValidate 115 Server Side Page Events Page Events executed at Server Side 122 OnCustomCompareValues 151 OnAfterDeleteRecord 107. Abilities 167 Common options 163 Options 265 RSS options 167 Appearance 287 PHP Generator for MySQL Application 266 Installation 3 Editor & Viewers 279 License agreement 5 Page 266 Overview 1 Registration 4 System requirements 2 -P. Projects 17 Purchase PHP Generator for MySQL 4 Page Editor Charts 158 Columns 35 Data Partitioning 176 -R- Edit properties 54 Registration 4 Events 95 Report sending 19 Filter 157 Lookup options 37 Master. 142. 142 © 2017 SQL Maestro Group . OnCustomRenderExportColumn 128 OnCustomRenderPrintColumn 128 Installation instructions 3 OnCustomRenderTotals 132 OnExtendedCustomDrawRow 129 -L. 146 License Agreement 5 OnGetFieldValue 111. 108. OnGetCustomExportOptions OnGetCustomTemplate 99. 143. 133 111. 145 OnGetCustomFormLayout 149 OnAfterUpdateRecord 109. 297 PHP Generator for MySQL Help Global Events OnBeforePageExecute 123 OnPreparePage 98 OnCustomDrawRow 141 OnCustomHTMLHeader 128 OnCustomRenderColumn 125 -I. 110. OnGetCustomColumnGroup 150 144. 153 OnGetCustomRecordPermissions 153 OnGetCustomUploadFileName 152 OnPageLoaded 124 OnPrepareColumnFilter 148 OnPrepareFilterBuilder 147 System requirements 2 -V- View Controls External Audio 50 External File 48 External Image 49 External Video 51 -W- Webpage appearance 195 Color Scheme 198 Color Scheme Customization 198 Custom CSS 200 Custom templates 203 Header and Footer 199 Using templates 203 Working with PHP Generator for MySQL Adding queries 25 Advanced generation options 228 Configuring datasources 22 Deployment to the Internet 21 Localization 226 Output folder 228 Page Editor 33 Project Options 181 Security options 205 Selecting tables and views 24 Shared Options 192 Webpage appearance 195 © 2017 SQL Maestro Group . Index 298 Server Side Page Events OnGetCustomPagePermissions 113.
Copyright © 2024 DOKUMEN.SITE Inc.