Phprunner 10.0 Manual: © 2018 Xlinesoft
Phprunner 10.0 Manual: © 2018 Xlinesoft
Phprunner 10.0 Manual: © 2018 Xlinesoft
0 Manual
© 2018 Xlinesoft
I PHPRunner 10.0 Manual
Table of Contents
Part I Introduction 1
1 Welcome
................................................................................................................................... 1
2 System
...................................................................................................................................
requirements 14
3 Editions
...................................................................................................................................
comparison 15
4 Licensing
...................................................................................................................................
details 15
5 What is
...................................................................................................................................
the registration 16
6 Quick ...................................................................................................................................
start guide 17
© 2018 Xlinesoft
Contents II
Pie/Doughnut
.........................................................................................................................................................
charts 107
Chart param eters
.......................................................................................................................................................... 109
Chart appearance
.......................................................................................................................................................... 111
Using SQL to..........................................................................................................................................................
shape chart data 114
9 Reports
................................................................................................................................... 118
Creating report
..........................................................................................................................................................
and setting param eters 118
Report totals..........................................................................................................................................................
and layout 123
10 Dashboards
................................................................................................................................... 125
Creating dashboards
.......................................................................................................................................................... 125
Master-details
..........................................................................................................................................................
dashboard 140
Dashboard search
.......................................................................................................................................................... 146
11 Choose
...................................................................................................................................
pages 152
List page settings
..........................................................................................................................................................
/ Click actions 152
Add/Edit page
..........................................................................................................................................................
settings 162
Update selected
..........................................................................................................................................................
page 163
CAPTCHA on..........................................................................................................................................................
Add/Edit page 164
Key colum ns.......................................................................................................................................................... 167
Export/Im port
..........................................................................................................................................................
pages 169
Printer page/PDF
..........................................................................................................................................................
view settings 173
Geocoding .......................................................................................................................................................... 174
12 Choose
...................................................................................................................................
fields 175
13 Miscellaneous
...................................................................................................................................
settings 184
14 Adding
...................................................................................................................................
CAPTCHA 198
15 Security
................................................................................................................................... 202
Login page .......................................................................................................................................................... 202
Login form appearance
.......................................................................................................................................................... 204
Registration ..........................................................................................................................................................
and passw ords 209
Advanced security
..........................................................................................................................................................
settings 216
User group perm
..........................................................................................................................................................
issions 219
Dynam ic Perm..........................................................................................................................................................
issions 221
Audit and record
..........................................................................................................................................................
locking 225
Active Directory
.......................................................................................................................................................... 229
Encryption .......................................................................................................................................................... 233
Facebook connect
.......................................................................................................................................................... 236
Tw o-factor authentication
.......................................................................................................................................................... 239
16 Page...................................................................................................................................
Designer 240
About Page Designer
.......................................................................................................................................................... 240
Working w ith..........................................................................................................................................................
Com m on pages 247
Working w ith..........................................................................................................................................................
Table pages 250
Working w ith..........................................................................................................................................................
cells 257
Working w ith..........................................................................................................................................................
page elem ents 260
Page layout and
..........................................................................................................................................................
grid type 269
Tabs and sections
.......................................................................................................................................................... 273
Adding PHP code
..........................................................................................................................................................
snippet 277
Insert button.......................................................................................................................................................... 281
Insert Map .......................................................................................................................................................... 289
"View as" settings
.......................................................................................................................................................... 297
"View as".........................................................................................................................................................
settings 297
Audio ......................................................................................................................................................... 304
File ......................................................................................................................................................... 304
Image ......................................................................................................................................................... 305
© 2018 Xlinesoft
II
III PHPRunner 10.0 Manual
© 2018 Xlinesoft
Contents IV
© 2018 Xlinesoft
IV
V PHPRunner 10.0 Manual
Register page
......................................................................................................................................................... 457
Before process......................................................................................................................................... 457
Before registration ......................................................................................................................................... 458
After successful .........................................................................................................................................
registration 459
After unsuccessful .........................................................................................................................................
registration 460
Before display ......................................................................................................................................... 460
JavaScript OnLoad ......................................................................................................................................... 461
Change passw
.........................................................................................................................................................
ord page 463
Before process......................................................................................................................................... 463
Before change passw .........................................................................................................................................
ord 463
After passw ord.........................................................................................................................................
changed 464
Before display ......................................................................................................................................... 465
JavaScript OnLoad ......................................................................................................................................... 466
Remind passw
.........................................................................................................................................................
ord page 467
Before process......................................................................................................................................... 467
Before passw ord .........................................................................................................................................
reminder sent 468
After passw ord.........................................................................................................................................
reminder sent 468
Before display ......................................................................................................................................... 469
JavaScript OnLoad ......................................................................................................................................... 470
After application
.........................................................................................................................................................
initialized 471
Menu item:.........................................................................................................................................................
Modify 473
Before audit
.........................................................................................................................................................
log 475
Table events.......................................................................................................................................................... 476
Add page......................................................................................................................................................... 476
Before process......................................................................................................................................... 476
Copy page: OnLoad ......................................................................................................................................... 477
Before record added ......................................................................................................................................... 477
Custom add ......................................................................................................................................... 479
After record added ......................................................................................................................................... 480
Process record.........................................................................................................................................
values 481
Before display ......................................................................................................................................... 482
JavaScript OnLoad ......................................................................................................................................... 483
Edit page ......................................................................................................................................................... 485
Before process......................................................................................................................................... 485
Before record updated ......................................................................................................................................... 485
Custom record update ......................................................................................................................................... 487
Process record.........................................................................................................................................
values 488
After record updated ......................................................................................................................................... 489
Before display ......................................................................................................................................... 491
JavaScript OnLoad ......................................................................................................................................... 491
List page ......................................................................................................................................................... 493
Before process......................................................................................................................................... 493
Before record deleted ......................................................................................................................................... 493
After record deleted ......................................................................................................................................... 494
After group of records.........................................................................................................................................
deleted 495
Before record processed
......................................................................................................................................... 496
After record processed......................................................................................................................................... 496
Before SQL query ......................................................................................................................................... 497
Before display ......................................................................................................................................... 498
JavaScript OnLoad ......................................................................................................................................... 499
Get Row Count ......................................................................................................................................... 500
Custom Query ......................................................................................................................................... 501
Custom record fetch ......................................................................................................................................... 502
Report page......................................................................................................................................................... 503
© 2018 Xlinesoft
Contents VI
© 2018 Xlinesoft
VI
VII PHPRunner 10.0 Manual
© 2018 Xlinesoft
Contents VIII
makeReadWrite................................................................................................................................... 586
on ................................................................................................................................... 587
removeClass ................................................................................................................................... 588
removeValidation ................................................................................................................................... 588
reset ................................................................................................................................... 590
setDisabled ................................................................................................................................... 590
setEnabled ................................................................................................................................... 591
setFocus ................................................................................................................................... 591
setValue ................................................................................................................................... 592
show ................................................................................................................................... 593
validate ................................................................................................................................... 593
validateAs ................................................................................................................................... 594
InlineRow .........................................................................................................................................................
object 596
About InlineRow.........................................................................................................................................
object 596
RunnerPage .........................................................................................................................................................
object 596
About RunnerPage .........................................................................................................................................
object 596
Methods ......................................................................................................................................... 597
getSearchController ................................................................................................................................... 597
hideField ................................................................................................................................... 597
show Field ................................................................................................................................... 598
getTabs ................................................................................................................................... 599
SearchController
.........................................................................................................................................................
object 600
About SearchController.........................................................................................................................................
object 600
Methods ......................................................................................................................................... 601
addField ................................................................................................................................... 601
clear ................................................................................................................................... 602
deleteField ................................................................................................................................... 603
display ................................................................................................................................... 603
getSearchFields................................................................................................................................... 604
toggleCriteria ................................................................................................................................... 604
toggleOptions ................................................................................................................................... 605
SearchField.........................................................................................................................................................
object 606
About SearchField .........................................................................................................................................
object 606
Methods ......................................................................................................................................... 607
addOption ................................................................................................................................... 607
getControl ................................................................................................................................... 608
getName ................................................................................................................................... 609
getOption ................................................................................................................................... 609
getOptions ................................................................................................................................... 610
getSecondControl ................................................................................................................................... 610
remove ................................................................................................................................... 611
removeOption ................................................................................................................................... 612
setOption ................................................................................................................................... 612
Examples ......................................................................................................................................................... 613
How to ask for confirmation
.........................................................................................................................................
before saving record 613
How to calculate .........................................................................................................................................
values on the fly 613
How to change .........................................................................................................................................
font size in text box 614
How to change .........................................................................................................................................
font in "edit" controls 614
How to change .........................................................................................................................................
w idth of edit box w ith AJAX popup 616
How to change .........................................................................................................................................
w idth of text field on Quick Search panel 616
How to control Inline .........................................................................................................................................
Add/Edit functionality from script 617
How to convert.........................................................................................................................................
input into upper case 620
How to display all .........................................................................................................................................
Options on Search panel 620
How to display any .........................................................................................................................................
page in Bootstrap popup w indow . 620
© 2018 Xlinesoft
VIII
IX PHPRunner 10.0 Manual
© 2018 Xlinesoft
Contents X
© 2018 Xlinesoft
X
XI PHPRunner 10.0 Manual
How to create..........................................................................................................................................................
your ow n Edit control plugin 699
How to display
..........................................................................................................................................................
m essage or tooltip 705
How to m ark..........................................................................................................................................................
field invalid 705
How to display
..........................................................................................................................................................
data returned by stored procedure 706
How to execute
..........................................................................................................................................................
SQL Server/MySQL/ORACLE stored procedures 707
Master-details
..........................................................................................................................................................
relationships 707
PHPRunner session
..........................................................................................................................................................
variables 708
PHPRunner tem..........................................................................................................................................................
plates 709
runner_m ail ..........................................................................................................................................................
function 711
runner_sm s..........................................................................................................................................................
function 714
Tem plate files
..........................................................................................................................................................
processing rules (Files.txt) 715
Tem plate language
.......................................................................................................................................................... 716
Useful links .......................................................................................................................................................... 722
Using JOIN SQL
..........................................................................................................................................................
queries 723
3 Publishing
...................................................................................................................................
PHP application to the remote Web server 724
Using FTP client
..........................................................................................................................................................
to publish PHP pages to the rem ote Web server 724
Using FrontPage
..........................................................................................................................................................
to publish PHP pages to the rem ote Web server 725
4 Demo...................................................................................................................................
Account 726
What is the Dem
..........................................................................................................................................................
o Account? 726
Term s and Conditions
.......................................................................................................................................................... 727
5 Web ...................................................................................................................................
reports 728
Online report/chart
..........................................................................................................................................................
builder 728
Creating w eb
..........................................................................................................................................................
report 733
Creating w eb
..........................................................................................................................................................
chart 746
Custom SQL.......................................................................................................................................................... 758
6 Domain
...................................................................................................................................
host instructions 762
Yahoo! .......................................................................................................................................................... 762
Connecting.........................................................................................................................................................
to MySQL 762
Configuring
.........................................................................................................................................................
FTP 767
Publishing.........................................................................................................................................................
project via FTP 769
1&1 .......................................................................................................................................................... 771
Connecting.........................................................................................................................................................
to MySQL 771
Configuring
.........................................................................................................................................................
FTP 776
Publishing.........................................................................................................................................................
project via FTP 777
GoDaddy.com .......................................................................................................................................................... 779
Connecting.........................................................................................................................................................
to MySQL 779
Configuring
.........................................................................................................................................................
FTP 782
Publishing.........................................................................................................................................................
project via FTP 784
WebHost4Life.com
.......................................................................................................................................................... 786
Connecting.........................................................................................................................................................
to MySQL 786
Configuring
.........................................................................................................................................................
FTP 789
Publishing.........................................................................................................................................................
project via FTP 790
MyHosting.com.......................................................................................................................................................... 792
Connecting.........................................................................................................................................................
to MySQL 792
Configuring
.........................................................................................................................................................
FTP 796
Publishing.........................................................................................................................................................
project via FTP 798
InspiRunner.com
.......................................................................................................................................................... 800
Connecting.........................................................................................................................................................
to MySQL 800
Configuring
.........................................................................................................................................................
FTP 802
Publishing.........................................................................................................................................................
project via FTP 803
7 How ...................................................................................................................................
to install local web server (XAMPP) 807
8 How ...................................................................................................................................
to add external css/php/js files 811
© 2018 Xlinesoft
Contents XII
9 Working
...................................................................................................................................
with MS Access databases 813
10 Working
...................................................................................................................................
with Oracle databases 813
11 Connect
...................................................................................................................................
to remote MySQL database via PHP 814
12 AJAX-based
...................................................................................................................................
Functionality 817
13 Localizing
...................................................................................................................................
PHPRunner applications 823
14 Rich ...................................................................................................................................
Text Editor plugins 829
15 PDF view
...................................................................................................................................
settings 832
16 Web ...................................................................................................................................
interface guide 833
17 Mobile
...................................................................................................................................
Template 835
18 Testing
...................................................................................................................................
web apps in mobile mode 837
19 Error...................................................................................................................................
reporting 842
© 2018 Xlinesoft
XII
1 PHPRunner 10.0 Manual
1 Introduction
1.1 Welcome
Templates
More info
© 2018 Xlinesoft
Introduction 2
More info
More info
Page Designer
© 2018 Xlinesoft
3 PHPRunner 10.0 Manual
More info
More info
© 2018 Xlinesoft
Introduction 4
Dashboards
More info
Application Preview
More info
SQL Editor
© 2018 Xlinesoft
5 PHPRunner 10.0 Manual
More info
Security
More info
© 2018 Xlinesoft
Introduction 6
More info
Dynamic Permissions
More info
Multilanguage support
© 2018 Xlinesoft
7 PHPRunner 10.0 Manual
More info
Events
© 2018 Xlinesoft
Introduction 8
More info
Master-Details Relationships
More info
© 2018 Xlinesoft
9 PHPRunner 10.0 Manual
More info
More info
© 2018 Xlinesoft
Introduction 10
More info
Edit Controls
More info
© 2018 Xlinesoft
11 PHPRunner 10.0 Manual
Ajax-based functionality
More info
FTP Upload
© 2018 Xlinesoft
Introduction 12
More info
More info
Additional Templates
© 2018 Xlinesoft
13 PHPRunner 10.0 Manual
More info
Import
© 2018 Xlinesoft
Introduction 14
More info
· PHPRunner comes with built-in web server as well which is perfect for local testing.
Supported databases
· MySQL
· Maria DB
· PostgreSQL
· Oracle
· Microsoft Access
© 2018 Xlinesoft
15 PHPRunner 10.0 Manual
· DB2
· Informix
· SQLite
Table shows the difference between PHPRunner Trial, Standard and Enterprise Editions.
Data encryption
License
By receiving and/or using PHPRunner, you accept the following Evaluation and Registered User
Agreement. This agreement is a binding legal agreement between XLineSoft and the
purchasers, users or evaluators of XlineSoft's software and products. If you do not intend to
honor this agreement, remove all installed XLineSoft products from your computer now.
© 2018 Xlinesoft
Introduction 16
You may allow other users to evaluate copies of the unregistered software. All evaluation
users are subject to the terms of this agreement.
XLineSoft name and any logo or graphics file that represent our software may not be used in
any way to promote products developed with our software. All parts of XLineSoft products are
copyright protected. No program, code, part, image, video clip, audio sample, text or computer
generated sequence of images may be copied or used in any way by the user except as
intended within the bounds of the single user program.
XLineSoft is not responsible for any damages whatsoever, including loss of information,
interruption of business, personal injury and/or any damage or consequential damage without
limitation, incurred before, during or after the use of our products. Our entire liability, without
exception, is limited to the customers' reimbursement of the purchase price of the software
(maximum being the suggested retail price as listed by XLineSoft) in exchange for the return of
the product, all copies, registration papers and manuals, and all materials that constitute a
transfer of ownership from the customer back to XLineSoft.
Each registered copy of the PHPRunner may be used in only one single location by one user.
Use of the software means that you have loaded the program and run it or have installed the
program onto a computer. If you install the software onto a multi-user platform or network,
each and every individual user of the software must be registered separately.
You may make one copy of the registered software for backup purposes, providing you only
have one copy installed on one computer being used by one person. If any person other than
yourself uses XLineSoft software registered in your name, regardless of whether it is at the
same time or different times, then this agreement is being violated!
The sale of and/or distribution of registered copies of this software is strictly forbidden. It is a
violation of this agreement to loan, rent, lease, borrow, or transfer the use of registered copies
of XLineSoft products.
PHPRunner is "Try before you buy" software. This means that we have made the software
available to you for free evaluation. You are entitled to evaluate the software for up to 21
days without obligation to pay. After 21 days, if you decide to keep the software, you must
register your copy with us.
Demo version (non-registered) of PHPRunner is a "full-featured" release. This means that the
same capabilities available in the registered software are present in the non-registered
software. This allows you to try out all the features in PHPRunner to confirm that they work to
your satisfaction.
Registration entitles you free technical support for 90 days and one year of free upgrades.
Registration may also entitle you to discounts on new software releases from XLineSoft. We
© 2018 Xlinesoft
17 PHPRunner 10.0 Manual
will also send you information bulletins by email to let you know about what’s happening with
other XLineSoft products.
Finally, by registering the software, you provide us with the resources and incentive to support
the software with updates and to develop additional quality software products in the future.
This is step-by-step tutorial that will help you build your first PHP pages quickly. Hit Help button if
you need more information during the process.
Note: To get more familiar with PHPRunner, you can also watch flash tutorials that are available
at http://www.xlinesoft.com/phprunner/php-database.htm.
Run PHPRunner application after you installed it on your computer. It can be found at Start ->
Programs -> PHPRunner -> PHPRunner.
On the first screen enter a project name and a project location. If you already have a database,
select Blank application to build the project from scratch. Otherwise, you can select one of the
predefined templates and get a themed web site and database created for you. Click Next>>.
© 2018 Xlinesoft
Introduction 18
On the next screen choose database type and click Next>>. In our example, we will connect to
MySQL. If you do not have MySQL server, see How to install local server.
Then select a database or create new one. When finished click Next>>.
© 2018 Xlinesoft
19 PHPRunner 10.0 Manual
Select datasource tables from the list of available tables. Click Next>>. On the next screen you can
modify SQL query.
© 2018 Xlinesoft
Introduction 20
On the next screen choose pages you would like to create and select key fields.
Note: Key column is the datasource column which lets you query each table row individually and
modify each row without altering other rows in the same table. The values that compose a key
column are always unique. When finished click Next>>.
© 2018 Xlinesoft
21 PHPRunner 10.0 Manual
On the next several screens you can choose the fields to appear on each page, customize your
data appearance and set the fields order on each page. You can also modify the miscellaneous
settings.
Security screen allows you to protect an access to your database. Refer to security settings for
more information. Click Next>>.
© 2018 Xlinesoft
Introduction 22
Page Designer allows you to customize the look and feel of your web pages in a more user-friendly
way.
© 2018 Xlinesoft
23 PHPRunner 10.0 Manual
On the next screen you can choose and modify style and color scheme for displaying the pages.
On the next screen you can enhance your web site functionality by adding events.
You are almost finished! On the next screen select output directory where you like to put generated
PHP pages and image files. Press Build to generate files. You are done! Now you are ready to test
the generated application.
To preview your application locally, you need the Internet Information Server or Apache up and
running on your computer. If you do not have a web server, see How to install a local Web server.
You can also upload the files to the remote Web server using built-in FTP client. You can publish
your application to our Demo Server or simply sign up for our hosting specifically dedicated to
PHPRunner customers.
© 2018 Xlinesoft
Introduction 24
2 Using PHPRunner
Quick jump
Creating new project Saving your project as a
Template
Project structure Add template to project
Opening an existing project Project settings
Saving a project
Click Project button and select one of the option from the drop down list to create new
project, open or save an existing one, define project settings.
© 2018 Xlinesoft
25 PHPRunner 10.0 Manual
For more information about templates that are shipped with PHPRunner, see What are
templates.
Project structure
With PHPRunner, you can save all your settings in a single project file and do not have to go
through individual files if you simply need to change a single label or field format.
Each project in PHPRunner saves to its own directory, which contains the following
subdirectories:
2. tmp - Temporary storage of visual templates and other files. tmp\backup directory
stores backup copies of your project. Project backup name (i.e. Project4.2011-11-09
10_08_00.w.zip) contains date and time of when backup was created.
3. output - Directory with output files. You can point output directory to another folder on
Output directory screen.
© 2018 Xlinesoft
Using PHPRunner 26
When you open a project created with PHPRunner 4.x or older, you are prompted to choose a
project directory. After you select a directory, your project file is copied to it. Then the next
time you open your project it will be from the folder you selected, not from the original
location.
If you upload files to the Web server using third party FTP client software, you must upload
the entire contents of the output directory.
When you make a backup of your project, you should include all files in the project directory
together with all subdirectories. At a minimum, you should backup the project file itself along
with all files in the visual directory.
Saving a project
If you want to save the current project under a different name - for example, development
purposes or to create a backup - select Save Project As option. A new project directory will
be created and all necessary project files will be copied to it.
In this case, your database along with your project file and all files you have edited with the
visual editor will be saved.
While saving Project As Template you need to type in the template name you wish your
project to be saved under. The template will be saved in the Business Templates Directory (by
default in C:\Users\<username>\Documents\PHPRunnerTemplats\project_name).
Note: After your template is saved, you can add files that are not generated by PHPRunner
to the template directory.
© 2018 Xlinesoft
27 PHPRunner 10.0 Manual
After that saved Template will be available on the list of templates when you create a new
project.
You can also add a thumbnail image to the template that will be displayed on templates list.
Place an image named preview.gif (JPG and PNG formats are supported also) to template
folder. Image size should be 130x97.
If you have added several templates to the project you can choose one to inherit security
settings from in Security template dropdown box.
© 2018 Xlinesoft
Using PHPRunner 28
If you add more than one template to the project you can get some errors trying to run your
project right after that. This what you need to do in order to add two or more templates to
the same project.
2. Proceed to AfterAppInit event and copy all code there. Close temporary project without
saving.
3. Go to your original project and paste this code to the end of AfterAppInit event.
Project settings
Use Create human-readable labels for the database fields option to convert field names
into the more human readable format. For example, if this option is enabled, the field name id
will be displayed as Id, last_name as Last Name, FirstName as First Name etc.
Use Synchronize the database on each project load option to enable/disable automatic
database synchronization. We recommend to use this option for small or local databases. For
more information about database synchronization, see Datasource tables: Synchronize
database.
To increase or decrease the files upload speed, change the number of FTP upload
connections.
Enable Autocomplete option enables Intellisense that provides autocomplete popups and
function calltips in Event Editor.
Exclude system tables option excludes system tables from the list of tables for Users table,
Lookup tables etc.
© 2018 Xlinesoft
29 PHPRunner 10.0 Manual
Use Always add database wrappers option to add wrappers to all names of fields and tables.
When this option is disabled, database wrappers will be added only to the field names
containing spaces and service field names.
After you enabled Lock pages modified in Visual Editor automatically option, all pages that
you manually modify will be locked from further automatic modifications. You can still modify
locked pages manually.
Revision history limit defines the number of page revisions to be saved in Visual Editor.
Use Format HTML code option to auto-format HTML code of pages in Visual Editor.
Navigation bar provides an easy way to navigate between PHPRunner pages and manage your
projects. Navigation bar is located at the bottom of PHPRunner main window and available all the
time you work with the project.
Button Description
© 2018 Xlinesoft
Using PHPRunner 30
Exit PHPRunner.
:
2.3 Templates
Upgrading templates.
Template helps you to create a themed web site easily and quickly.
It consists of PHPRunner project file, pre-built pages, and a script for creating tables in MySQL
database.
Template is comfortable to work with, since a user doesn't need to take care about tables and
database structure or about placing content on the web site pages. All you have to do is to choose
template you need and generate the project.
To create a project from the template, on the first welcome page in PHPRunner select the template
you want to use and click Next. On database connection point PHPRunner to the database where
template tables to be created. PHPRunner can create a new database named after template name
or use any existing database to create database tables.
© 2018 Xlinesoft
31 PHPRunner 10.0 Manual
· Cars · News
· Classified · Paypal
· Jobs · Sporting
DocManager Calendar
EmailReader Members
Survey Invoice
© 2018 Xlinesoft
Using PHPRunner 32
Quiz Forum
You can create new project using two templates or add a template to existing project. For more
information, see Working with projects.
Upgrading templates
To upgrade template, remove template tables from the project ('Datasource tables' screen) and
then add template to the project again.
To avoid replacing template tables with existing all PHPRunner business templates (tables and files)
have the unique prefix. For example, all tables of the project 'Cars' have prefix 'cars'.
© 2018 Xlinesoft
33 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 34
2.3.2 Cars
Guest users can search/view cars listings and send a quote request to a
dealer/car owner.
Guest users can search/view ads, contact ad author, and tell a friend
about this ad.
© 2018 Xlinesoft
35 PHPRunner 10.0 Manual
2.3.4 Events
Guest users can search/view events and tell friends about this event.
2.3.5 Jobs
Guest users can search/view jobs and contact the company in regards
to a specific open position.
© 2018 Xlinesoft
Using PHPRunner 36
Registered user can add comments to knowledge base articles and edit
his own comments.
2.3.7 News
© 2018 Xlinesoft
37 PHPRunner 10.0 Manual
2.3.8 Paypal
Guest users can search/view items, add items to shopping cart, and pay
for items using Paypal.
· ppmain - main table that holds items description, price, images etc
· retblresults - main table that holds property description, price, images etc
© 2018 Xlinesoft
Using PHPRunner 38
2.3.10 Sporting
© 2018 Xlinesoft
39 PHPRunner 10.0 Manual
Quick jump
Connecting to MySQL Connecting to ODBC Data Source
PHPRunner supports the following databases: MySQL, Oracle, Microsoft SQL Server, MS Access,
PostgreSQL, spreadsheet file, Informix, DB2, SQLite, any other ODBC-enabled database.
© 2018 Xlinesoft
Using PHPRunner 40
Select your database type and press Next>>. Depending on the selected database type you will
see one of the database-specific dialog boxes shown below.
Connecting to MySQL
Type the Host/Server Name (usually localhost), user name, password and click Connect. More info
about how to install local web server and MySQL server.
If your MySQL server doesn't allow remote connection, you can connect via PHP.
Connecting to PostgreSQL
Type the Host/Server Name (usually localhost), user name, password, set additional parameters if
required (e.g. port=5439) and click Connect.
© 2018 Xlinesoft
41 PHPRunner 10.0 Manual
If your PostgreSQL server doesn't allow remote connection, you can connect via PHP.
Define the file path to your database/spreadsheet file, enter login name and password if required.
Click Next >>.
© 2018 Xlinesoft
Using PHPRunner 42
PHPRunner will try to find what ODBC driver to use to connect to selected database file. Select the
Select ODBC driver manually check box if you'd like to select ODBC driver manually.
You can read more about working with MS Access connection in this topic: Connecting to MS
Access database
To create new DSN, press the ODBC Admin button. In the window opened add new DSN. Then
click Refresh list.
© 2018 Xlinesoft
43 PHPRunner 10.0 Manual
Select ODBC driver from the list of available ODBC drivers and click Next>>.
© 2018 Xlinesoft
Using PHPRunner 44
Using Create new table window you can create new tables in your database.
© 2018 Xlinesoft
45 PHPRunner 10.0 Manual
For each field type name, type, size, scale (applies to DECIMAL datatype in SQL Server, Oracle and
MySQL only). Set the Primary key field. Databases created with PHPRunner will be saved to the
project directory (database.mdb, database1.mdb etc.).
Note: Don't change table settings after you've built your project and added data records. All data
will be lost after table modification.
Downloading drivers
If you use 32-bit version of PHPRunner, you need to download 32-bit drivers. If you use 64-bit
version of PHPRunner, download 64-bit drivers.
32-bit drivers:
© 2018 Xlinesoft
Using PHPRunner 46
64-bit drivers:
· DB2:
Quick jump
Create custom view Synchronize database
Create report Renamed/deleted tables
Create chart Multiple database connections
Create dashboard Setting master-details
relationship between tables
After you successfully connected to database, select all datasource tables you'd like to build PHP
code for. After that highlight one of selected tables and step through other screens in PHPRunner
adjusting settings for selected table. You can always see name of currently selected table in the
middle of blue info pane. To switch between selected tables use Table list pane on the left.
© 2018 Xlinesoft
47 PHPRunner 10.0 Manual
Click Create new Table to add new table to the existing database. Then for each field type name,
type, size, scale (applies to DECIMAL datatype in SQL Server, Oracle and MySQL only). Set the
Primary key field. Click Create table. Also you can add new custom view, report, chart or
dashboard to your project.
© 2018 Xlinesoft
Using PHPRunner 48
© 2018 Xlinesoft
49 PHPRunner 10.0 Manual
Toolbar description:
Button Description
Synchronizes database.
© 2018 Xlinesoft
Using PHPRunner 50
Change caption option allows to edit caption and field labels. Click Advanced option to change a
base table (is available only for view/chart/report) or filename prefix.
© 2018 Xlinesoft
51 PHPRunner 10.0 Manual
Since view, chart and report may include fields from several tables, a base table for them is the
table where data is added, edited and deleted. Key columns are also selected from the base table
on Choose pages screen.
By default, prefix for each generated file name is the table name. E.g. if the table name is
OrderDetails, the file name of List page will be OrderDetails_list.php. If you change the prefix to
details, the file name will be details_list.php.
When you create new custom view, all current settings of the table, on the basis of which view is
created, are copied into it except for visual templates and events. You can create a copy of
existing custom view (right-click the custom view and select Copy). Note that custom views are
not created in the database and only exist in the project.
Example:
Table Cars shows all cars in the database. SQL query: Select * from Cars.
View Active listings displays active listings only. SQL Query: Select * from Cars where
status='active'
© 2018 Xlinesoft
Using PHPRunner 52
View Closed listings displays closed listings only. SQL Query: Select * from Cars where
status='closed'
Note: when you create a custom view all table settings are copied to Custom view settings.
Synchronize database
Every time you make changes to the database in PHPRunner (e.g. you create new table or view,
you add or edit table fields etc.), these changes should be implemented in the database. In other
words, the structures of the database and PHPRunner project should be synchronized.
To synchronize database manually, use Sync database button or right-click tables tree or blank
area near tables tree and select Sync database.
Also you can use the option to synchronize the database automatically on each project load (select
Project -> Settings). Use this option for small or local databases. In the case of remote or large
databases the automatic synchronization will take some time when opening the project.
Renamed/deleted tables
Tables that were renamed in the database (outside PHPRunner) or deleted in PHPRunner are moved
to the Deleted tables folder. You can restore table, rename and then restore table, remove table
from the project permanently.
© 2018 Xlinesoft
53 PHPRunner 10.0 Manual
Right-click the Deleted tables to get two more options: Remove all tables and Restore all tables.
Note: Multiple database connections feature is available only in the Enterprise Edition of
PHPRunner. See Editions Comparison.
© 2018 Xlinesoft
Using PHPRunner 54
The first database connection is considered as "primary" one. But you can make any other
connection primary by right-clicking the database name and selecting the corresponding option.
© 2018 Xlinesoft
55 PHPRunner 10.0 Manual
The following features work only for the primary database connection:
· Add template to project - template will be added only to the primary database;
· Upload to demo account - tables from the primary database will be downloaded to the demo
account.
All other features work for all database connections, including Save project as template option.
We do not advise to add tables with the same names that belong to different databases to avoid
conflicts.
Quick jump
Changing order of child tables
Print master table data with details
© 2018 Xlinesoft
Using PHPRunner 56
Note that one master table can have multiple details tables. And you can display data from multiple
details tables (nested or one master - many details) on the same page. I.e. you can display
customers, orders by customer, order details per order and edit all three tables at the same time
without leaving the page.
1. Go to the Datasource tables page and select both master and details tables in the list of
datasource tables..
2. Drag field from one table to another. Table link properties dialog opens.
© 2018 Xlinesoft
57 PHPRunner 10.0 Manual
3. Choose what table is Master and select link fields in both tables. If you'd like to display master
table data on the details page select the corresponding check box. Click OK.
Link for details is displayed as icon. Click it to view details tables. Use this option if master
table has multiple details tables.
© 2018 Xlinesoft
Using PHPRunner 58
© 2018 Xlinesoft
59 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 60
Note: If you select to display details records in popup, you can define the popup page
appearance in Visual Editor -> Details preview page for details table.
If you select to display details records inline, you will be able to add/edit/delete details in inline
mode on master table.
© 2018 Xlinesoft
61 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 62
© 2018 Xlinesoft
63 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 64
© 2018 Xlinesoft
65 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 66
© 2018 Xlinesoft
67 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 68
© 2018 Xlinesoft
69 PHPRunner 10.0 Manual
On the Edit SQL query page you can modify SQL query that PHPRunner has built for you
automatically. In most cases you can proceed with default SQL query.
This page includes graphical panes that display your SQL statement (Query Designer tab), a text
pane that displays the text of your SQL statement (SQL tab) and result of edited query as table
with values (Results tab). You can work in either the graphical or text panes and then check result
of executed query. Query Designer synchronizes the views so they are always current.
Features:
4. the grid pane to specify criteria (Order By, Group By, Where etc.)
5. SQL parsing - enter the SQL statement, and the diagram and grid will be populated
© 2018 Xlinesoft
Using PHPRunner 70
Query Designer gives you the ability to use the simple graphical interface to construct SQL
statements.
Note: if you modify default SQL query, make sure that key column(s) are included into fields list.
This is required to provide edit/delete functionality.
© 2018 Xlinesoft
71 PHPRunner 10.0 Manual
To switch between tables use Tables list panel on the left. Note that all fields marked with a tick in
the Output column are added to the SELECT clause.
It can be useful when you need to speed up the load of the webpage or your chart has too many
items on it and you only need to show the most significant ones. It also works with list pages added
to dashboard.
Search and filters will be applied first and then results will be limited to first "N" rows.
This option will work with all PHPRunner project items except reports with that have group fields
selected.
What is supported
Inner joins, outer joins
© 2018 Xlinesoft
Using PHPRunner 72
To add join click the Add Table button, select table and then drag and drop any field from first
table to the joined table. To setup join type click the line between tables, select foreign keys on
the Table link properties dialog in both tables and choose join type.
© 2018 Xlinesoft
73 PHPRunner 10.0 Manual
SQL query:
SELECT
carsmodels.id,
carsmodels.model,
carsmodels.make
FROM carsmodels
INNER JOIN carsmake ON carsmodels.make = carsmake.make
Note: it's recommended to use aliases for fields from joined tables to avoid confusion when two
fields from different tables have the same name.
Calculated fields
To add calculated fields use empty grid below all field names:
SQL query:
© 2018 Xlinesoft
Using PHPRunner 74
SELECT
category,
color,
Date Listed,
descr,
EPACity,
EPAHighway,
features,
UserID,
YearOfMake,
zipcode,
Price*0.1 AS Discount
FROM carscars
In the example above the alias Discount is assigned to the calculated field Price*0.1. Note that if
the field was assigned an alias in the SQL query, then the $values array will get the alias instead of
field name from the database. So you should use $values["Discount"] instead of
$values["Price*0.1"] in your events. For more information about events, see Events.
We do not recommend using aliases to give a field another name. If you have very long or complex
field names, you can assign a label to the field on Choose fields page or in the Label editor instead
of using aliases.
WHERE clause
You can add where clause in the Filter column. If you need to add two or more conditions use Or
columns.
SQL query:
SELECT *
FROM carscars
WHERE YearOfMake =2004
SELECT *
FROM carscars
WHERE ( YearOfMake =2004 OR YearOfMake =2005 )
ORDER BY clause
© 2018 Xlinesoft
75 PHPRunner 10.0 Manual
If you'd like to specify default sorting order on the list page (ascending or descending) select Sort
Type in the corresponding column for necessary fields.
GROUP BY clause
To add GROUP BY clause click the Group By button and select one of grouping function in Group
By column.
SQL query:
SELECT
Make,
Model,
AVG (YearOfMake)
FROM carscars
GROUP BY Make, Model
ORDER BY Make
· Update/Delete/Insert/Create queries
· Unions
· DISTINCT keyword
2.7.3 SQL
On the SQL tab you can modify SQL query manually. All changes on this tab automatically transfer
to the Query Designer.
Note: if you modify default SQL query, make sure that key column(s) are included. This is
required to provide edit/delete functionality. If table participates in Master-Details relationship make
sure link fields (primary/foreign key) stay on the list of fields.
© 2018 Xlinesoft
Using PHPRunner 76
To switch between tables use Tables list panel on the left. Find and Replace buttons let you
quickly search within your SQL code and modify it.
What is supported
Inner joins, outer joins
SQL query:
SELECT
carsmodels.id,
carsmodels.model,
carsmodels.make
FROM carsmodels
INNER JOIN carsmake ON carsmodels.make = carsmake.make
Note: it's recommended to use aliases for fields from joined tables to avoid confusion when two
fields from different tables have the same name.
Calculated fields
© 2018 Xlinesoft
77 PHPRunner 10.0 Manual
SQL query:
SELECT
category,
color,
Date Listed,
descr,
EPACity,
EPAHighway,
features,
UserID,
YearOfMake,
zipcode,
Price*0.1 AS Discount
FROM carscars
In the example above the alias Discount is assigned to the calculated field Price*0.1. Note that if
the field was assigned an alias in the SQL query, then the $values array will get the alias instead of
field name from the database. So you should use $values["Discount"] instead of
$values["Price*0.1"] in your events. For more information about events, see Events.
Do not use aliases as field labels in your app. If you have very long or complex field names, you can
assign a label to the field on Choose fields page or in the Label editor instead of using aliases.
WHERE clause
SQL query:
SELECT *
FROM carscars
WHERE YearOfMake =2004
SELECT *
FROM carscars
WHERE ( YearOfMake =2004 OR YearOfMake =2005 )
SQL query:
SELECT
Make,
Model,
AVG (YearOfMake)
FROM carscars
GROUP BY Make, Model
© 2018 Xlinesoft
Using PHPRunner 78
ORDER BY Make
Aliases
When you connect to databases like DB2, Oracle or Postgre and your SQL query contains aliases,
we recommend to enclose them in double quotes. Here is an example:
· Update/Delete/Insert/Create queries
· Unions
· DISTINCT keyword
2.7.4 Results
The Results tab lets you see the results of an SQL query. Up to 200 records will be displayed.
© 2018 Xlinesoft
79 PHPRunner 10.0 Manual
You may use the Tables list panel on the left to switch between tables.
© 2018 Xlinesoft
Using PHPRunner 80
© 2018 Xlinesoft
81 PHPRunner 10.0 Manual
You can also create and manage WHERE tabs from your code to:
- create a tab dynamically use addTab() function.
- delete tab title use deleteTab() function.
- change tab title use setTabTitle() function.
- change tab where clause use setTabWhere() function.
2.8 Charts
To create a chart:
© 2018 Xlinesoft
Using PHPRunner 82
Note that you can create a copy of existing chart (right-click the chart and select Copy).
On the next several pages (use Next button to navigate) you can:
· make necessary changes to SQL query. More info about editing SQL queries;
· select the type of chart to build. More info about chart types;
© 2018 Xlinesoft
83 PHPRunner 10.0 Manual
· choose Data Series fields (more info about setting chart parameters);
Note that you can use charts as both master and details tables. For more information, see Master-
details relationship between tables.
© 2018 Xlinesoft
Using PHPRunner 84
© 2018 Xlinesoft
85 PHPRunner 10.0 Manual
To further customize chart appearance like setting colors, fonts or changing chart title use
ChartModify event.
© 2018 Xlinesoft
Using PHPRunner 86
Gauge Yes No - - No
Accumulation charts are typically single series charts representing the data in percentages and do
not utilize axes. The height of a chart segment is proportional to the y-coordinate value of the
corresponding point.
Chart settings:
· Accumulation appearance - this option defines the chart form (cone, flat, pyramid).
Make Sales2005
BMW 15000
Audi 14000
Volvo 9000
In this example we choose Sales2005 as Data Series field, Make as Label field.
© 2018 Xlinesoft
87 PHPRunner 10.0 Manual
Chart settings:
· Chart Scrolling - this option allows you display a scrollable chart. Don't forget to define the
number of points to show on the chart screen.
© 2018 Xlinesoft
Using PHPRunner 88
· Chart stacked - this option allows building stacked chart where a single bar on the chart
shows data for more than one category of data. Stacked chart requires two or more Data
series.
In this example we choose Sales2005 as Data Series field, Month as Label field.
© 2018 Xlinesoft
89 PHPRunner 10.0 Manual
In this example we choose Sales2004 and Sales2005 as Data Series fields, Month as Label field.
In this example we choose Sales2004 and Sales2005 as Data Series fields, Month as Label field.
© 2018 Xlinesoft
Using PHPRunner 90
A Bubble chart is a variation of a Scatter chart in which the data points are replaced with bubbles.
Bubble charts are often used to present financial data. Use a Bubble chart when you want specific
values to be more visually represented in your chart by different bubble sizes.
Bubble chart need 3 values (x, y and size) to show bubbles. Depending on data model and the
visualization purpose the bubble chart may contain single series or multi series.
© 2018 Xlinesoft
91 PHPRunner 10.0 Manual
Chart settings:
· Chart 3D - this option allows building 3D (three-dimensional) chart. If this option is disabled,
2D (two-dimensional) chart will be built.
In this example we choose Horsepower as Y-coordination field, Sales2005 as bubble size field, Price
as Label field (X-coordination field).
© 2018 Xlinesoft
Using PHPRunner 92
In this example we choose Sales2005 and Sales2006 as Y-coordination fields, Horsepower as bubble
size field, Price as Label field (X-coordination field).
© 2018 Xlinesoft
93 PHPRunner 10.0 Manual
A column/bar chart is a chart with rectangular bars of lengths usually proportional to the
magnitudes or frequencies of what they represent.
The column chart is vertically oriented bars. In column charts, categories are typically organized
along the horizontal axis and values along the vertical axis.
The bar chart is horizontally oriented bars. In bar charts, categories are typically organized along
the vertical axis and values along the horizontal axis. Consider using a bar chart when:
© 2018 Xlinesoft
Using PHPRunner 94
The column/bar chart may contain single series (one Data series field and label field selected - one
for Y-Axis and another one for X-Axis) or multi series (two or more Data series fields selected).
Chart settings:
· Chart 3D - this option allows building 3D (three-dimensional) chart. If this option is disabled,
2D (two-dimensional) chart will be built.
· Chart stacked - this option allows building stacked chart where a single bar on the chart
shows data for more than one category of data. Stacked chart requires two or more Data
series.
In this example we choose Sales2005 as Data Series field, Make as Label field.
© 2018 Xlinesoft
95 PHPRunner 10.0 Manual
In this example we choose Sales2004 and Sales2005 as Data Series fields, Make as Label field.
© 2018 Xlinesoft
Using PHPRunner 96
If you select one Data series field, you will get a Line chart. If you select two Data series fields,
you will get Line-Area chart. If three or more Data series fields - Line-Area-Column chart.
© 2018 Xlinesoft
97 PHPRunner 10.0 Manual
In this example we choose Average sales and Planned sales as Data Series fields, Month as Label
field.
© 2018 Xlinesoft
Using PHPRunner 98
In this example we choose Average sales, Planned sales, Sales2004 and Sales2005 as Data Series
fields, Month as Label field.
© 2018 Xlinesoft
99 PHPRunner 10.0 Manual
An open-high-low-close chart (also known as OHLC chart) is a type of chart typically used to
illustrate movements in the price of a financial instrument over time. Each vertical line on the chart
shows the price range (the highest and lowest prices) over one unit of time, e.g. one day or one
hour. Tick marks project from each side of the line indicating the opening price (e.g. for a daily
OHLC chart this would be the starting price for that day) on the left, and the closing price for that
time period on the right.
The Japanese Candlestick chart is another way of displaying market price data, with the opening
and closing prices defining a rectangle within the range for each time unit. The rectangles have
different colors depending on whether prices rose or fell in that period.
Both charts show the exact same data, i.e. the opening, high, low, and closing prices during a
particular time frame. Some traders find the candlestick chart easier to read.
OHLC/Candlestick chart may contain single series or multi series. These charts use four values, so
you need to pass opening, high, low and closing price values. Also you need to select Label field.
© 2018 Xlinesoft
Using PHPRunner 100
In this example we choose Open, High, Low, Close as Data Series 1 fields, Day as Label field.
© 2018 Xlinesoft
101 PHPRunner 10.0 Manual
A Gauge chart represents a value on a graduated scale or dial. The Gauge chart can be of two
types: Circular Gauge and Linear Gauge.
The circular Gauge looks like gauges on a car dashboard. It consists of radial scale, holding your
data range, pointer, and might support different color ranges for classifying your data.
The linear Gauge is a wide line, that can hold much information and possess a variety features. It
can be either vertical or horizontal.
You can display one or several Gauges on a chart by choosing one or several Data series. Also you
can define minimum and maximum values.
© 2018 Xlinesoft
Using PHPRunner 102
Color zones are used to decide whether your data is in preset limits. You can set the desired
number of different colors depending on the number of your conditions.
Chart settings:
· Gauge style - this option defines the gauge appearance (circle, horizontal linear, vertical
linear).
© 2018 Xlinesoft
103 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 104
A line chart displays information as a series of data points connected by line segments. A line chart
is often used to visualize a trend in data over intervals of time. In a line chart, category data is
distributed evenly along the horizontal axis, and all value data is distributed evenly along the
vertical axis.
Chart settings:
· Line style - this option defines the line segments style (normal, spline, step).
© 2018 Xlinesoft
105 PHPRunner 10.0 Manual
In this example we choose Sales2004 as Data Series field, Month as Label field.
© 2018 Xlinesoft
Using PHPRunner 106
In this example we choose Sales2004 and Sales2005 as Data Series fields, Month as Label field.
In this example we choose Sales2004 as Data Series field, Month as Label field.
© 2018 Xlinesoft
107 PHPRunner 10.0 Manual
A pie chart is a circular chart divided into sectors, illustrating percents. A doughnut chart is
functionally identical to a pie chart, with the exception of a blank center.
You can create single-series and multi-series pie and doughnut charts by choosing one or
several Data series fields.
Make Sales2005
© 2018 Xlinesoft
Using PHPRunner 108
Audi 14000
BMW 15000
Volvo 9000
In this example we choose Sales2005 as Data Series field, Make as Label field.
In this example we choose Sales2005 as Data Series field, Make as Label field.
© 2018 Xlinesoft
109 PHPRunner 10.0 Manual
On the Chart parameters page you can choose Data series fields (fields with data) and Label field
(field with data labels).
You can add unlimited number of data series. Additional Data series dropdown list boxes are added
automatically once you used available ones.
For more information about choosing data series for certain chart type, see Chart types.
© 2018 Xlinesoft
Using PHPRunner 110
Note: only numeric fields can be chosen as a Data series. Therefore only numeric fields are
available for selection in Data series dropdown list box.
Make Sales2005
Audi 14000
BMW 15000
Volvo 9000
In this example we choose Sales2005 as Data Series field, Make as Label field.
© 2018 Xlinesoft
111 PHPRunner 10.0 Manual
Sometimes the data in your database needs to be processed before it is used in the chart. For more
information, see Using SQL to shape chart data.
To further customize chart appearance like setting colors, fonts or changing chart title use
ChartModify event.
On the Chart Appearance page you can control how your chart is displayed on the web page.
© 2018 Xlinesoft
Using PHPRunner 112
Use the Autoupdate check box to enable chart auto-refresh by specified time interval.
The Use animation check box enables the chart animation while opening a chart.
If you select one of the 2D charts (e.g. 2D Column chart), additional options will be available. Use
Chart 3D option to display data columns as the 3D images. Use Chart stacked option to display
stacking chart where chart elements are stacked on top of each other. The Chart scrolling option
allows you display a scrollable chart. Don't forget to define the number of bars to show on the chart
screen.
Use the Logarithmic Y-Axis option to convert a linear value axis to a logarithmic value axis. If you
have several data series on the chart, you can use the Multiple Y-Axes option to position each
data series relative to its own Y axis.
For more information about settings for certain chart type, see Chart types.
Y-axis label input box will only appear if you have multiple data series.
Notes:
© 2018 Xlinesoft
113 PHPRunner 10.0 Manual
2. In Visual Editor you can copy and paste chart to any other page (report/list/view/another chart).
It can be useful to build a dashboard with several charts on it.
To further customize chart appearance like setting colors, fonts or changing chart title use
ChartModify event.
© 2018 Xlinesoft
Using PHPRunner 114
Charts are all about visualizing your data. Charts need data fields that store numeric values
however using aggregate functions you can build charts on any data.
SQL query:
Results:
Country Stotal
USA $560
Germany $280
GB $270
Australia $85
France $40
© 2018 Xlinesoft
115 PHPRunner 10.0 Manual
Chart:
SQL query:
Results:
Country CTotal
USA 4
© 2018 Xlinesoft
Using PHPRunner 116
Germany 2
GB 2
Australia 1
France 1
Chart:
This example shows how to use GROUP BY in conjunction with INNER JOIN. For example we have the
following data and like to display a diagram that illustrates how many flags each client has.
© 2018 Xlinesoft
117 PHPRunner 10.0 Manual
clientid flag
1001 Green
1001 Green
1001 Green
1001 Green
1001 Amber
1001 Amber
1001 Red
1002 Green
1002 Amber
1002 Amber
1002 Amber
1002 Red
1003 Green
1003 Amber
1003 Red
1001 4 1 2
1002 2 1 3
© 2018 Xlinesoft
Using PHPRunner 118
1003 1 1 1
Related info:
2.9 Reports
Quick jump
To create a report:
© 2018 Xlinesoft
119 PHPRunner 10.0 Manual
Note that you can create a copy of existing report (right-click the report and select Copy).
On the next several pages (use Next button to navigate) you can:
· make necessary changes to SQL query. More info about editing SQL queries;
Note that you can use reports as both master and details tables. For more information, see Master-
details relationship between tables.
© 2018 Xlinesoft
Using PHPRunner 120
Standard reports
© 2018 Xlinesoft
121 PHPRunner 10.0 Manual
If you clear the Show details and summary check box, only summary will be shown on report
page.
Besides standard intervals (new group starts when group field value changes) you can use other
interval types. Available interval types are different for each data type.
Here is the example of text group field using first letter as an interval.
© 2018 Xlinesoft
Using PHPRunner 122
Cross-tab reports
PHPRunner supports cross-tab reports (often called pivot tables). On the Group fields screen you
can choose two or more variables (columns) and assigned them to either X axis or to Y axis. You
can assign more than one variable to the axis and switch between them in runtime.
© 2018 Xlinesoft
123 PHPRunner 10.0 Manual
On Report: Totals screen you can choose totals options like Min, Max, Sum and Average.
Here is how cross-tab reports looks in generated application. You can select variables, totals types
and data fields to display.
Quick jump
On the Report Totals page you can choose what fields to display on the report/search pages.
© 2018 Xlinesoft
Using PHPRunner 124
Also you can apply aggregate functions like MIN, MAX, SUM and AVERAGE. The results of these
calculations will be displayed after each group and at the end of page/report.
The Report: Miscellaneous page allows you to choose report layout. If you use grouping you can
choose between Stepped, Block, Outline and Align layouts. If you don't use grouping you can only
use Tabular layout which is very similar to the basic List page.
© 2018 Xlinesoft
125 PHPRunner 10.0 Manual
You can also change the way your data is sorted. Note that you can only control data sort order
inside the group, as groups are sorted by Group fields.
Number of lines per page option determines where to insert the page break, when you print the
whole report.
2. Enable report search page, proceed to Visual Editor, open Search page, double-click the field
and make it Lookup Wizard.
Either option allows you to display a value from another table on the Report page (i.e. Customer
Name instead of Customer ID).
2.10 Dashboards
Quick jump
Create new dashboard
Customize dashboard layout
Master-details dashboard
Dashboard with data grid and single record view
Dashboard with map and single record view
Dashboard with data grid and map
Dashboards allow you to display multiple related or unrelated objects on the same page such as
grids, single record views, master and details together, charts, reports, search pages, maps, etc.
Here is an example of a dashboard with an Orders table, along with details (Order Details and
Customers) and a single Orders table record view:
© 2018 Xlinesoft
Using PHPRunner 126
© 2018 Xlinesoft
127 PHPRunner 10.0 Manual
Note: It is possible to create a copy of an existing dashboard (right-click the dashboard and
select Copy).
On the next several pages (use Next button to navigate) you can:
Clicking add allows you select a data grid, single record view, chart, report, search page or map to
use as a dashboard element.
Click settings on the added dashboard element to customize its appearance. Click remove to
delete it.
© 2018 Xlinesoft
Using PHPRunner 128
You can insert any sort of code snippet as a dashboard element. This code could be used to display
current weather, calculate order totals, show the number of active users, or even embed a Youtube
video.
See this live demo for inspiration.
Master-details dashboard
You can select grid features to be displayed in a browser: Add/Edit/View/Delete record buttons may
be used for a data grid, View/Add/Edit tabs for a single record. Use the Filter by master table
option to make dashboard elements display data depending on other dashboard elements. You can
use this option for cascading master-details (for example, customers-orders-order details) or when
a map is used as details.
© 2018 Xlinesoft
129 PHPRunner 10.0 Manual
If a dashboard element has a strongly differing width or height, you may use the Taller/Shorter
and Wider/Narrower buttons to change the cells' dimensions. In the example below, we make the
orders-record element shorter.
© 2018 Xlinesoft
Using PHPRunner 130
© 2018 Xlinesoft
131 PHPRunner 10.0 Manual
1. Add two tables to a dashboard: one to use as a data grid and one as a single record.
© 2018 Xlinesoft
Using PHPRunner 132
2. Click settings on the grid element and select grid features to be displayed in a browser
(Add/Edit/View/Delete record buttons).
3. Click settings on the record element and select tabs to be displayed on the single record view
(View/Add/Edit tabs).
© 2018 Xlinesoft
133 PHPRunner 10.0 Manual
To create a dashboard, where clicking on a map marker updates the single record view:
1. Add two tables to a dashboard: one to use as a map and one as a single record.
© 2018 Xlinesoft
Using PHPRunner 134
2. Click settings on the map element and select Latitude and Longitude fields.
© 2018 Xlinesoft
135 PHPRunner 10.0 Manual
3. Click settings on the record element and select tabs to be displayed on the single record view
(View/Add/Edit tabs).
© 2018 Xlinesoft
Using PHPRunner 136
To create a dashboard where grid data is updated when you change the zoom level of the map:
© 2018 Xlinesoft
137 PHPRunner 10.0 Manual
1. Add two tables to a dashboard: one to use as a map and one as a data grid. Note that you need
to use Latitude and Longitude fields to make the map function properly.
2. Click settings on the grid element and select grid features to be displayed in a browser
(Add/Edit/View/Delete record buttons).
3. Click settings on the map element and select Latitude and Longitude fields. Select Use map to
filter grid data option.
© 2018 Xlinesoft
Using PHPRunner 138
Click Global map settings to select a map provider. Enter API Key (if required).
You can obtain API keys for development purposes for free at https://developers.google.com (for
Google maps) or at bingmapsportal.com (for Bing maps).
You may use the Geocoding option to update latitude/longitude information each time a record is
added or updated. You may either select existing fields for storing latitude and longitude data or
create new ones. Then select address field(s) to be used during geocoding.
© 2018 Xlinesoft
139 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 140
In master-details dashboard selection in a master table filters records in details table. Make sure
you set master-details relationship between two or more tables before creating a dashboard. You
have two ways to organize your master-details dashboard:
· Add master table to a dashboard twice: as data grid and then as details. In such dashboard if
master table has several details tables, you can display all details (each on separate tab) or
select which of them to display.
© 2018 Xlinesoft
141 PHPRunner 10.0 Manual
· Add master table and details table as data grids and enable the Filter by master table
option for details table. Use this option to display nested master-details, such as customers-
orders-order details. Also you can display master-details relationship not only between tables
but other elements such as table and map.
2. Click settings on the grid element and select grid features to be displayed in a browser
(Add/Edit/View/Delete record buttons).
3. If master table has several details tables, click settings on the details element and select details
tables to display and set the initial one. Select grid features to be displayed for details table
(Add/Edit/View/Delete record buttons).
© 2018 Xlinesoft
Using PHPRunner 142
When open the master-details dashboard in a browser, we will see the list of orders and
order/customer details:
Dashboard where master table and details tables added as data grids
© 2018 Xlinesoft
143 PHPRunner 10.0 Manual
Let's create dashboard which displays data from nested master-details relationships Orders -> Order
details -> Products, where selected order updates order details and selected record in order details
grid updates products grid.
1. Add Order (master) table, Order details and Products (details) tables as data grids.
2. Click settings on the Order details grid element and enable the Filter by master table option.
Select Orders as master table.
© 2018 Xlinesoft
Using PHPRunner 144
3. Click settings on the Products grid element and enable the Filter by master table option.
Select Order details as master table.
© 2018 Xlinesoft
145 PHPRunner 10.0 Manual
1. Create chart as a master and add details table to it as described in this article Charts and
reports as master and details tables.
3. Add the same chart to the dashboard but now choose details in the Choose element to add
dialogue.
Dashboard page in a browser should look like this. Now when you click on the chart bar the details
grid should be filtered.
© 2018 Xlinesoft
Using PHPRunner 146
Quick jump
Search across all dashboard items
© 2018 Xlinesoft
147 PHPRunner 10.0 Manual
1. Search across all dashboard items. You can setup this on Dashboard search page choosing
fields that will be searchable. This type of search will be available as a separate page in generated
application and also as Search all fields search box on dashboard page.
2. Add a search page of any dashboard table as a dashboard item. When you add a new dashboard
item select any table, view, chart or report and choose Search as an option. This option only
makes sense if you also add this table/view/chart/report to the dashboard.
You can drag fields from different tables/elements into a single cell. In this case search will be
carried out through all the elements that belong to the selected fields. For example, you can search
Orders table and Orders Chart at the same time.
© 2018 Xlinesoft
Using PHPRunner 148
Include into all fields search option allows to add fields to the 'All fields' quick search.
To make some dashboard elements do not display the data initially, apply the Hide data until
search option to them in Search and Filter settings on the Choose fields screen.
© 2018 Xlinesoft
149 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 150
To add a search page to a dashboard, click add, select any table/view/chart/report and choose
Search as an option.
Make sure you've also added selected table/view/chart/report to the dashboard as data grid, single
record, chart or report.
© 2018 Xlinesoft
151 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 152
To create new pages select the corresponding check boxes under Pages to build. If check boxes
near View record, Edit record, Delete record, Copy record options are disabled, you need to
start by selecting key columns.
Inline add/Inline edit options allow you to add/edit multiple records without leaving the List page.
Inline Add/Edit functions use the same Edit as types as the regular Add/Edit pages.
Click Settings next to the List page, Edit record, Add new, View record, Printer-friendly or
PDF view check box to adjust page settings.
© 2018 Xlinesoft
153 PHPRunner 10.0 Manual
You can select the table to store application settings like order of columns, show/hide state,
columns size and also saved searches. These settings are user specific.
· Use icons for Edit, View, Copy labels - if this option is enabled, icons are displayed for Edit,
View, Copy actions instead of text labels.
© 2018 Xlinesoft
Using PHPRunner 154
· Show basic search options - if this option is enabled, basic search options (Contains, Any
field) are displayed instead of just one Search field.
© 2018 Xlinesoft
155 PHPRunner 10.0 Manual
· Show search panel - if this option is enabled, search panel is displayed. Search panel allows
you to manage the search criteria. For more information, see Web interface guide.
© 2018 Xlinesoft
Using PHPRunner 156
· AJAX search, pagination and sorting - this option enables AJAX search, pagination and
sorting that allows updating data without loading the whole page again.
You can also choose if users still can sort data by clicking on column headers.
© 2018 Xlinesoft
157 PHPRunner 10.0 Manual
· Scroll table data - if enabled, data records are displayed as scrollable table with fixed table
header.
· Show in popup - this option allows to show Add/Edit/View pages in popup window.
© 2018 Xlinesoft
Using PHPRunner 158
Drag-n-drop columns on the List page according to your needs. Your settings will be saved in
the database and next time you open this page you will see the same layout. This feature will
only work with Bootstrap layout.
© 2018 Xlinesoft
159 PHPRunner 10.0 Manual
Choose what columns to show on each page in run time. Settings are also saved in the
database and preserved between sessions. Each user has its own set of settings. This feature
will only work with Bootstrap layout.
© 2018 Xlinesoft
Using PHPRunner 160
© 2018 Xlinesoft
161 PHPRunner 10.0 Manual
This one is pretty cool, you can assign actions like open a certain page, make record selected,
expand/collapse details or run a custom code to row/cell click.
Click OrderID field to retrieve current order total and display it in OrderID field.
© 2018 Xlinesoft
Using PHPRunner 162
You can choose one of the action to be performed after the record is added or updated.
© 2018 Xlinesoft
163 PHPRunner 10.0 Manual
Enable the Display CAPTCHA option and change its default settings if you want to use
CAPTCHA on Add and Edit pages.
© 2018 Xlinesoft
Using PHPRunner 164
Adding CAPTCHA
You can add CAPTCHA to Add and Edit pages (select the Display CAPTCHA checkbox).
CAPTCHA is a simple test to determine if a user is a computer or a human. It is used to
prevent spam abuse on the websites. Click CAPTCHA settings and choose what CAPTCHA to
use: Flash-based CAPTCHA (it is simple but doesn't work on most mobile devices) or Google
reCAPTCHA.
© 2018 Xlinesoft
165 PHPRunner 10.0 Manual
Flash-based CAPTCHA:
© 2018 Xlinesoft
Using PHPRunner 166
Google reCAPTCHA:
© 2018 Xlinesoft
167 PHPRunner 10.0 Manual
Key columns
Key column is the table field which lets you query each table row individually and modify each
row without altering other rows in the same table. The values that compose a key column are
unique; no two values are the same. You can specify any numbers of the columns that form a
key. Generally, one key column is sufficient.
In your application primary key is required for those tables that need Edit, Delete or View
functionality, need to work with images or provide functionality like Print/Export selected
records. Do not to remove the key columns from the query.
© 2018 Xlinesoft
Using PHPRunner 168
The best option is to use autoincrement field as a primary key. Your database will take of
generating the proper key value every time you add a new record.
In MS Access the best choice for key column is auto number field.
In SQL Server use INT IDENTITY field, in MySQL use INT AUTO_INCREMENT field.
© 2018 Xlinesoft
169 PHPRunner 10.0 Manual
Export/Import pages
Export
Starting from version 9.8 onwards you are able to use new settings for the export function:
Export raw/formatted values option will work in both old (non-Bootstrap) and new layouts.
The Field Separator option and the new option to choose a list of fields are available in Bootstrap
layouts only.
The export page by default is opened in popup. This is how it will look on the generated pages in
Bootstrap layout.
© 2018 Xlinesoft
Using PHPRunner 170
· Word
· XML
Labels are used as headings in Excel/Word files. Field names are used as headings in XML/CSV files.
This is done in order for CSV files that is exported using PHPRunner to be imported into other
software.
Import
Supported file formats are:
· CSV
Field names or labels can be used as headers in Excel files. In CSV files field names should be used
as headings.
© 2018 Xlinesoft
171 PHPRunner 10.0 Manual
PHPRunner adds the new records or updates the existing ones while importing.
During import PHPRunner will try to insert a new record first. If the insert fails for any reason like
duplicate primary key it will try to locate and update this record with new data.
It will update the existing records instead of adding them in the following cases:
2. Key fields selected on the 'Choose pages' screen match the primary key in the database.
You can copy and paste import data instead of uploading the whole file.
At first copy a few lines of data from Excel. You do not have to include column headers. Then paste
it into the import page.
© 2018 Xlinesoft
Using PHPRunner 172
Map columns define date format and import the data. Examples of supported date formats:
· dd.mm.yyyy
· mm/dd/yyyy
· yyyy-mm-dd
· dd/mm/yyyy
© 2018 Xlinesoft
173 PHPRunner 10.0 Manual
If you wish to combine the import with any extra actions, use BeforeInsert Event. For example, if
you want to specify the file creation date or fill in an OwnerID field.
Note: since PHPRunner creates temporary files used for import preview in templates_c folder
under output directory, web server user needs to have editing permissions on this folder.
Choose between portrait and landscape orientation, tune PDF export by setting the scale.
© 2018 Xlinesoft
Using PHPRunner 174
2.11.8 Geocoding
Geocoding
Geocoding is used for tables where location data is displayed as maps. It is recommended to
use Latitude and Longitude fields and update them each time when a record is added or
updated. Select existing fields for storing latitude and longitude data or create new ones. Then
select address field(s) to be used during geocoding.
For more information about displaying data as maps, see Insert map.
© 2018 Xlinesoft
175 PHPRunner 10.0 Manual
Quick jump
Search and Filter settings
On the Choose fields page choose fields to appear on each page by selecting/clearing the
corresponding check boxes. Note that you can display different fields on different devices. Also you
can adjust search and filter settings here.
© 2018 Xlinesoft
Using PHPRunner 176
Columns by device
You can select different fields to display on different devices. This feature helps you customize your
list pages hiding certain columns on devices with smaller screens. You can easily copy selected
fields from one column (device) to another using buttons with left/right arrow.
© 2018 Xlinesoft
177 PHPRunner 10.0 Manual
Click Apply to all tables button to apply the selected above options to all tables.
© 2018 Xlinesoft
Using PHPRunner 178
When you start typing in the search box, AJAX popup displays search suggestions. For more
information, see AJAX-based Functionality: AJAX Auto Suggest.
Case-sensitive search
Use this option to filter out search results that match the case of your search query. If this option
is not selected, the search is case insensitive.
You can define default search option (Equals, Contains etc.) for each field on search panel.
© 2018 Xlinesoft
179 PHPRunner 10.0 Manual
Searchable fields
When you make some field searchable, you allow searching by this field in the Quick search box
and also you can define other search options such as Search panel, Advanced search and 'All fields'
search for this field. To be able to select field for quick search, enable the option Show basic
search options for the List page on the Choose pages page.
Options
You can select what search options will be available for each field on search panel. Also you can
define the default search option for each field.
© 2018 Xlinesoft
Using PHPRunner 180
Use this option to add fields to the search panel on the List page. Search panel allows you to define
the search criteria. For more information, see Web interface guide: Search panel on List page.
© 2018 Xlinesoft
181 PHPRunner 10.0 Manual
Users will not be able to search until they specify required search fields. For example, homes for
sale database do not allow to show any data until zip code is selected.
© 2018 Xlinesoft
Using PHPRunner 182
Use this option to add fields to the 'All fields' quick search.
Allows to display fields on the Filter Panel. Filters provide instant feedback on numbers of records
matching each criteria. You can select multiple criteria or multiple intervals for each filter. Filter
panel is located on the left side. For more information about filters' settings, see "Filter as" settings.
© 2018 Xlinesoft
183 PHPRunner 10.0 Manual
While searching for a data using Search panel, you can save searches in the database for later
retrieval (use Save search button in the browser). Select <project_name>_searches as table for
saving searches or create new one.
© 2018 Xlinesoft
Using PHPRunner 184
Quick jump
Language Error reporting
Label Editor Section 508 compatibility
Email settings Table specific settings
Landing page Enterprise Edition settings
Map settings SMS Settings
The Miscellaneous page allows to set project, table specific and Enterprise Edition settings.
© 2018 Xlinesoft
185 PHPRunner 10.0 Manual
Project settings
Language
Use the Language drop-down box to choose the Project language. By clicking Multiple languages
button you can select several Project languages and give the user ability to choose language while
logging in.
© 2018 Xlinesoft
Using PHPRunner 186
Regional settings
Choose required country from drop-down box.
Label Editor
Label Editor allows you to edit table and field labels (Table labels tab), custom labels (Custom
labels tab), add tooltips to the Edit forms (Edit form tooltips tab) and edit web page titles (Page
titles tab). You can translate labels into several languages. Click Choose languages to add more
languages to the project.
You can export multilanguage labels to CSV file (use Export to CSV button), then edit labels in the
external editor and import the file back (use Import from CSV button). If you use languages other
than English in the project, we recommend to edit CSV files using Google Docs or OpenOffice. Due
to problems with character encoding we do not recommend using Microsoft Excel for projects with
multiple languages.
Table labels
Modify table and field labels to make them more good-looking to users. Filter labels by table or field
to limit the data displayed. Use <br> to insert a line break in field label.
© 2018 Xlinesoft
187 PHPRunner 10.0 Manual
Custom labels
Use custom labels to translate error messages in regular expressions and your own validation
plugins. Also you can create your own custom labels to display some messages to a user. Filter
labels by label id to limit the data displayed.
© 2018 Xlinesoft
Using PHPRunner 188
If you have created Custom labels and want to place some text on a page, which will vary
depending on the selected language, you can add PHP code snippet to the page and use the
following code in it:
Don't forget to replace CustomLabelID with the correct custom label identifier.
Also you can use custom labels in page template. Open Visual Editor and switch to HTML mode.
Then add the following code:
{$custom CustomLabelID}
Runner.getCustomLabel('CustomLabelID')
While editing page title you can use text for all pages and field values, e.g. {%ID} and {%Make},
for View and Edit pages. For example:
© 2018 Xlinesoft
189 PHPRunner 10.0 Manual
Also you can use the field values from the master table on the List page of details table. Here is the
example of page title for Order details table:
Add a tooltip to a field to display some additional information about it on the Edit page and during
inline editing on the List page. To create a multiline tooltip, use <br> as a line separator.
© 2018 Xlinesoft
Using PHPRunner 190
Page titles
To edit a web page title, deselect a Default checkbox next to it and make changes. Filter page
titles by table or page to limit the data displayed.
© 2018 Xlinesoft
191 PHPRunner 10.0 Manual
Project logo
© 2018 Xlinesoft
Using PHPRunner 192
To change your project logo, you can enter here text or your HTML-code.
Here is an example of the code that can be used to display logo icon and text:
© 2018 Xlinesoft
193 PHPRunner 10.0 Manual
You can do even more with PHP code by using the function setProjectLogo from the Labels/Titles
API.
In the following example you are adding logo and the current year to the project logo.
Simply put the logo.png to the images folder of your application and add the following code to
AfterAppInit event.
$currentYear = date("Y");
Labels.setProjectLogo('
<DIV style="position: relative; height: 40px; top: -6px; white-space: nowrap;">
<IMG height="80%" id="navbarlogo" alt="Project logo"
src="http://mywebsite.com/images/logo.png">
Cars project'.$currentYear.'
</DIV>
');
© 2018 Xlinesoft
Using PHPRunner 194
Placeholders are in-place tooltips that disappear as soon user starts typing something in that field.
Live Demo
SMS Settings
Here you can set you Twilio Account that can be used used to send SMS data to users.
To use that functionality first you need to Open an account with https://www.twilio.com/
Note that Twilio is not free. Their rates depend on number of messages you going to send
and many other things.
See more:
Two-factor authentication
© 2018 Xlinesoft
195 PHPRunner 10.0 Manual
Runner_sms function
Email settings
Here you can enter email which will be used to send emails to users and define settings of the
custom mail server, if you do not use the built-in mail server. Note that SMTP server, SMTP server
port as well as Secure connection (SSL) settings may differ from the stated in the example below.
Contact your Mail Service Provider to get necessary information.
Landing page
Select the page to open when the user enters the site (if login is disabled or login and guest user
login are enabled) or just after login. You can enter custom URL, e.g URL with search options
carscars_list.php?qs=audi.
© 2018 Xlinesoft
Using PHPRunner 196
Map settings
Select map provider and enter API Key (if required). You can get Bing maps API key for development
purposes for free at bingmapsportal.com.
Error reporting
You can select to display detailed error messages or your custom error message.
© 2018 Xlinesoft
197 PHPRunner 10.0 Manual
Select this check box to make online content accessible to a wide range of people with disabilities.
For more information, visit http://www.section508.gov/.
Check keyboard-based navigation through table links on the List page (Arrow Up, Arrow Down, Tab,
Shift Tab). The keyboard shortcuts available are described below:
When using special internet browser readers, the Hotkeys reference link will be available.
Displays a warning message before leaving Add/Edit pages with unsaved changes.
Displays Next/Prev buttons on Edit/View pages that allows to proceed to the next record without
going back to the list page.
Select this check box to turn on row highlighting feature. It highlights current table row on the list
page.
Allows resizing any column on the List page by dragging its edge.
© 2018 Xlinesoft
Using PHPRunner 198
Allows adjusting search and filter settings. For more information, see Choose fields: Search and
Filter settings.
This option adds "More ..." link to long text field while
first XXX characters are displayed on the page. "More
..." link displays a popup with the whole field content.
Also you can enter number of records to appear on each list page.
Note: to make this option work correctly you must choose the key field for the selected table on
the Choose pages screen.
With this option turned on no records will be shown on initial page load. You will need to run a
search in order to display results.
Defines what options to show in pagination control. "all" (without quotes) means show all records.
Web reports
Enable online report/chart builder. Click Administrator button to specify the password to access
the Web Reports and Charts admin area.
© 2018 Xlinesoft
199 PHPRunner 10.0 Manual
You can add CAPTCHA to the Add/Edit/Login/Register/Remind password pages. You can choose
between Flash-based CAPTCHA (it is simple but doesn't work on most mobile devices) and
Google reCAPTCHA.
© 2018 Xlinesoft
Using PHPRunner 200
You can add CAPTCHA to Add or Edit page on the Choose pages screen (click Settings near
Edit record or Add new and select Display CAPTCHA checkbox). To add CAPTCHA to Login
page, on the Security screen click Login form appearance and select Display CAPTCHA
checkbox. To add CAPTCHA to Register and Remind password pages, on the Security screen
click Registration and passwords and select Display CAPTCHA checkbox.
Then click CAPTCHA settings and choose what CAPTCHA to use: Flash-based CAPTCHA (it is
simple but doesn't work on most mobile devices) or Google reCAPTCHA. To use Google
reCAPTCHA, register your web site at https://www.google.com/recaptcha/intro/index.html,
copy site key and secret key there and paste them into the CAPTCHA settings.
© 2018 Xlinesoft
201 PHPRunner 10.0 Manual
When you open a page with CAPTCHA you can see a page element labeled captcha. Drag this
element to change its location.
© 2018 Xlinesoft
Using PHPRunner 202
2.15 Security
You can password-protect access to your database with PHPRunner. You can choose one the
following options:
· Hardcoded - all your users will use the same hardcoded login/password combination.
For more information about Login with Facebook option, see Facebook connect.
© 2018 Xlinesoft
203 PHPRunner 10.0 Manual
· Active Directory - Active Directory authentication. For more information, see Active
Directory.
If using authentication PHPRunner will generate additional PHP page login.php intended for username
and password validation.
Registration and passwords allows you to create user self-register page, password reminder, change
password pages. Use Locking and Audit to set up record locking and user actions logging. Use
Encryption to encrypt important data in the database. When using authentication, choose Login
form appearance. If Database or Active Directory option is selected, you can set Advanced
Security Settings and define Permissions.
If you need to customize email templates that will be send to the users/admins when a new user is
registered use the Email templates dialog.
© 2018 Xlinesoft
Using PHPRunner 204
If you have selected the Remember Password check box and then opens one of the internal page
of application, such as a Menu or List page, you will be logged in automatically.
· "Only one person or several persons with the same access rights have access to the site" -
use the Hardcoded username and password option.
· "There are the site administrator (owner) and guests. The administrator has full access to the
site, guests have read-only access to some pages/reports/charts" - use the Username and
password from database option, enable guest login in the Advanced security settings,
configure the access for guests in the User group permissions.
· "There are many users with different access levels and administrators with the full access" -
use the Username and password from database option, configure Advanced security
settings if you need to restrict the access within one table, configure User group permissions
to assign table level permissions, configure Admin group for administrators.
· "If all user accounts and passwords are stored in the Active Directory" - use the Active
Directory option.
Choose between separate login page, login box in popup or embedded into the page. Now you have
an option to logon right from the List page. But make sure that guests have access to that page.
You can add CAPTCHA to the Login page.
© 2018 Xlinesoft
205 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 206
© 2018 Xlinesoft
207 PHPRunner 10.0 Manual
Adding CAPTCHA
To add CAPTCHA to the Login page select the Display CAPTCHA checkbox. CAPTCHA is a simple
test to determine if a user is a computer or a human. It is used to prevent spam abuse on the
websites. Click CAPTCHA settings and choose what CAPTCHA to use: Flash-based CAPTCHA (it is
simple but doesn't work on most mobile devices) or Google reCAPTCHA.
© 2018 Xlinesoft
Using PHPRunner 208
Flash-based CAPTCHA:
© 2018 Xlinesoft
209 PHPRunner 10.0 Manual
Google reCAPTCHA:
If you need to customize email templates that will be send to the users/admins when a new user is
registered use the Email templates dialog.
Quick jump
Adding CAPTCHA
Email settings
Email templates
On Security page click Registration and passwords to create user self-register page or password
reminder, change password pages.
© 2018 Xlinesoft
Using PHPRunner 210
To create new user registration page, select the corresponding checkbox and click Choose fields
to select fields that will appear on the registration page.
© 2018 Xlinesoft
211 PHPRunner 10.0 Manual
Select Send activation link checkbox to send email with activation link to a user after the
registration. The purpose of the activation link is to ensure that the user signs up with a real,
active email address that they own. This limits the number of times someone can sign up, and
prevents people who have been booted off a site from signing up again multiple times with fake
email addresses. User access is denied until activation link is open in the browser. Select one of the
existing fields or create new one to store activation flag. This field needs to be numeric (Number,
INT or TINYINT).
If you need to customize email templates that will be send to the users/admins when a new user is
registered use the Email templates dialog.
© 2018 Xlinesoft
Using PHPRunner 212
If you are going to use Send email to user or Remind password page options, do not forget to
choose a field where user email is stored.
Restrict weak password option allows to restrict using of weak passwords. You can select
minimum password length, number of unique characters, digits or symbols.
© 2018 Xlinesoft
213 PHPRunner 10.0 Manual
Password hashing.
Option to use industry standard BCRYPT hashing algorithm. Send password reset link to user's email,
link expires in 24 hours. BCRYPT requires PHP 5.5 or better.
For instance, you want to provide admin with direct access to the login table. To do so add the
following code to BeforeAdd/BeforeEdit events of login table:
For BCRYPT:
For MD5:
© 2018 Xlinesoft
Using PHPRunner 214
Adding CAPTCHA
You can add CAPTCHA to the remind password page and new user registration page (select the
corresponding Display CAPTCHA checkbox). CAPTCHA is a simple test to determine if a user is a
computer or a human. It is used to prevent spam abuse on the websites. Click CAPTCHA settings
and choose what CAPTCHA to use: Flash-based CAPTCHA (it is simple but doesn't work on most
mobile devices) or Google reCAPTCHA.
© 2018 Xlinesoft
215 PHPRunner 10.0 Manual
Email settings
© 2018 Xlinesoft
Using PHPRunner 216
Here you can enter email which will be used to send emails to users and define settings of the
custom mail server, if you do not use the built-in mail server. Note that SMTP server and SMTP
server port settings may differ from the stated in the example below. Contact your Mail Service
Provider to get necessary information.
If you use two-factor authentication for Gmail you need to generate and use an application specific
password.
You can find details on the Gmail Accounts Help page.
Every user who logged in successfully can view, edit, and delete other users data.
© 2018 Xlinesoft
217 PHPRunner 10.0 Manual
This option allows to restrict users to view and edit their own records only. To use this option
for database-based login, you need to set a relationship between table that holds usernames
and passwords and main data table. In case of Active Directory authentication select field to
save username in.
3. Users can see other users data, can edit their own data only
This option is similar to Option 2, however, all users can view other users data but cannot edit
or delete them.
© 2018 Xlinesoft
Using PHPRunner 218
Login as guest
This option adds guest read-only access to the database. If this option is selected, "Login as
guest" link will be added to the login screen. Guest user cannot edit, delete or add new records
to the database.
If you need to customize email templates that will be send to the users/admins when a new
user is registered use the Email templates dialog.
© 2018 Xlinesoft
219 PHPRunner 10.0 Manual
This feature allows to assign table level permissions on database tables and views. I.e. user A can
add data into table1 and edit data in table2, user B can edit and search data in table1 and can
delete data in table2 etc.
To use this feature proceed to the Security page in PHPRunner, click the Permissions button.
· in the PHPRunner directly before building project (Static permissions option). In this case if
you want to change some security settings you'll need to open PHPRunner project, make some
changes on the User Group Permissions dialog and rebuild project.
· on the generated pages (Dynamic permissions option). PHPRunner create new tables for user
group permissions settings in the database and build admin area in the application.
Administrators can update permissions online.
Static permissions
On this screen, you can create user groups with assigned set of permissions.
First of all choose GroupID field that stores group name or id.
© 2018 Xlinesoft
Using PHPRunner 220
To add a new group, click the Add group button. A dialog box will appear where you can choose
username which defines this group and define initial set of permissions. Afterwards, you can change
permissions for certain tables.
© 2018 Xlinesoft
221 PHPRunner 10.0 Manual
You can create a user group based on non-existing GroupID field value (if you plan to add users to
this group later).
Apart from this, you can create a default group with a default set of permissions. When a user that
does not belong to any of specified groups is logged in, the default set of permissions mentioned
above is assigned to him. For example, as shown on the screenshot above, the user not belonging
to any of the groups, is able to edit and delete data, but is not able to add or search records in any
table.
To delete selected group, click the Del group button. To overwrite existing group, click the Add
group button and choose the same group id value.
When Advanced Security options are in use, you can set any group to be an admin group (enable
Admin group check box).
The main difference between static and dynamic permissions is that PHPRunner create new tables
for user group permissions settings in the database and build admin area in the application. Admins
can update permissions online.
Dynamic permissions require three database tables to store permissions, groups, and group
members. PHPRunner allows you to create these tables or select existing ones. By adding a prefix in
front of table names PHPRunner allows several projects to share the same database.
On this screen you should select existing tables or chose prefix for the new tables where user group
permissions will be stored and add admin user on the Set Initial Permissions dialog.
© 2018 Xlinesoft
Using PHPRunner 222
© 2018 Xlinesoft
223 PHPRunner 10.0 Manual
After building the project you need to login as admin, add groups, set up permissions and assign
users to created groups.
© 2018 Xlinesoft
Using PHPRunner 224
© 2018 Xlinesoft
225 PHPRunner 10.0 Manual
Audit settings
You can record the user actions like login/logout/record editing/adding/deleting etc to a
database or file. On default the action logging is disabled.
To enable logging:
· Log to database. Select a log table. To create new log table, select <Create new> in
Log table list box and enter the table name to the text box below, for example
project1_audit.
© 2018 Xlinesoft
Using PHPRunner 226
· Log to file. Enter the log file name, for example audit.log. The current date is added
automatically to the file name and log file is stored as audit_yyyymmdd.log, for
example audit_20091222.log. When specified as action.log, the log files will be stored
into your project root folder. To change this enter the file name as <folder>/<file
name>. For example, log/audit.log.
3. Select the Log login/logout actions and Lock user account after three
unsuccessful logins check boxes to enable the corresponding actions. Note that Lock
user account after three unsuccessful logins option is available only if you selected Log
to database.
4. Select tables to which the user actions should be logged. You can log only modifications
performed to the table records (e.g. action = add, key field = 10) or modifications and field
values (e.g. action = add, key field = 10, field = color, new value = red). So select the
corresponding check boxes in the Table modifications area.
5. Click Ok.
To analyze information from the log table, you can add report or chart to your project or
use online report/chart builder.
Date Time IP User Table Action Key field Field Old value New value
© 2018 Xlinesoft
227 PHPRunner 10.0 Manual
Dec 23,2009 15:41:48 127.0.0.1 admin carsbcolor edit 1 color Taffeta White1 Taffeta
White
Record locking
You can use record locking to prevent simultaneous update of the same data on the Edit page.
A locked record means it is not available for editing by other users. On default the record
locking is disabled.
3. Select a lock table. The lock table is used to store record locks. To create new lock
table, select <Create new> in Lock table list box and enter the table name to the text box
below, for example project1_locking.
4. Select tables to which the record locking should be applied. You need to select the
corresponding check boxes in the Table modifications area under Record locking.
5. Click Ok.
© 2018 Xlinesoft
Using PHPRunner 228
User who tries to edit a locked record would be shown the message that the record is locked.
Note: admin user is able to unlock a record if it was blocked for too long or take ownership.
If user goes to the Edit page and then clicks Back, it turns out that the record remains
blocked. To prevent this, automatic unlocking method is used. By default, the record will be
unlocked after 300 seconds. You can change this value by editing the file include/locking.php:
The variable $ConfirmTime determines how often the Edit page sends confirmation that the
record is still locked. The variable $UnlockTime determines the time (in seconds) after the last
confirmation when the record will be unlocked automatically.
© 2018 Xlinesoft
229 PHPRunner 10.0 Manual
Quick jump
Active Directory authentication and Permissions
Active Directory authentication allows users to log in to the generated by PHPRunner applications if
they have an account in an Active Directory domain. You need to define the Active Directory
domain and server. When logging in the login name and password are checked against Active
Directory. In the simplest use case no additional configuration is needed.
Note: Active Directory authentication feature is available only in the Enterprise Edition of
PHPRunner. See Editions Comparison.
© 2018 Xlinesoft
Using PHPRunner 230
Login automatically check box enables Autologon functionality: if a person is already logged into
Windows, he/she will be automatically logged into the generated application. To use Automatic
logon, make sure Windows Authentication is enabled in Internet Information Services (IIS).
· Run IIS as administrator of the computer (Click Start -> Control Panel ->
Administrative Tools -> Internet Information Services (IIS) Manager).
· Expand the server in Connections frame and choose the site, or click on server if you
wish to apply settings for all sites.
© 2018 Xlinesoft
231 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 232
If you enabled Login automatically and Use dynamic permissions check boxes, you also need
to specify domain user login and password.
Build your project and login as admin to the generated application. In Admin Area on Admin Rights
page you can add groups via Add Group and assign permissions to them. Note that you can not
create groups manually since they are stored on the Active Directory server and should be modified
there.
© 2018 Xlinesoft
233 PHPRunner 10.0 Manual
2.15.9 Encryption
Encryption feature allows you to encrypt important data in the database such as credit card
number or Social Security number. You need to select encryption method, enter encryption key and
choose fields to be encrypted.
Note: Encryption feature is available only in the Enterprise Edition of PHPRunner. See Editions
Comparison.
© 2018 Xlinesoft
Using PHPRunner 234
You can select database-based or code-based encryption method. Note that database-based
encryption method is available only for MySQL, Oracle, PostgreSQL and MS SQL Server databases.
Database-based method is recommended since some features will not work in case of code-based
method: encrypted fields are not involved in the sorting and grouping, search suggest and search
with all search operators other than Equal will not work etc. So make sure you encrypt really
important data.
Database-based encryption
Code-based encryption
To use PHP encryption, mcrypt extension needs to be enabled in php.ini (in PHP 5.3 and higher it is
included in the distribution by default).
When using PHP encryption encrypted fields are not involved in sorting and grouping, search
suggest and search with all search operators other than Equal will not work.
Encryption key
The encryption key length more than 10 characters is recommended. Use Generate button to
generate a random key. You can encrypt only text fields. Since the encrypted value is much longer
than source value (at least 2-3 times), you should choose fields with maximum length such as TEXT
in MySQL or MEMO in MS Access.
© 2018 Xlinesoft
235 PHPRunner 10.0 Manual
Note: PHPRunner does not encrypt existing data. Encryption will be applied only to the add/edit
operations.
Note: Once encrypted data are stored in the database you should not change the encryption
type or key, also you can not cancel the encryption otherwise data will remain encrypted.
Example of how encrypted data are stored in the database and displayed in the application
Oracle:
· Encryption: DBMS_CRYPTO.ENCRYPT()
· Decryption: DBMS_CRYPTO.DECRYPT()
MS SQL Server:
MySQL:
PostgreSQL:
· Encryption: pgp_sym_encrypt()
© 2018 Xlinesoft
Using PHPRunner 236
· Decryption: pgp_sym_decrypt()
To encrypt existing values in the database add following code to the List page: Before process
event of your table:
include_once("ciphcoding.php");
Then run you List page that contains encrypted fields with ciphcoding=1 parameter, eg:
mytable_list.php?ciphcoding=1
Once the data has been encrypted, it is necessary to delete the file ciphcoding.php in the output
directory, remove the code from the List page: Before process event and re-upload application.
We recommend to perform this procedure on the development machine or server without public
access.
$key variable should contain encryption key specified in PHPRunner on encryption screen.
echo $data["custname"];
© 2018 Xlinesoft
237 PHPRunner 10.0 Manual
Then you can see your application settings (Facebook App ID and Secret ID) at
http://www.facebook.com/developers/apps.php.
2. On the Security page enable Add login with Facebook check box and enter your Facebook
App ID and Secret ID.
© 2018 Xlinesoft
Using PHPRunner 238
Now you can see Login with Facebook button on the login page of your application.
© 2018 Xlinesoft
239 PHPRunner 10.0 Manual
If you have enabled Dynamic permissions, Facebook users will be assigned the rights of Default
group: Facebook users -> Default users.
You can use this feature if you need that during the login process the user should
receive test message with verification code. You need to have the Twilio account to use
this functionality. Use them for your SMS Settings in the application.
You can read more about the two-factor authentication on Twilio website
© 2018 Xlinesoft
Using PHPRunner 240
© 2018 Xlinesoft
241 PHPRunner 10.0 Manual
You can work with different types of objects on the Page designer screen: pages, cells and
elements. Each type has different set of options and properties. To see functionality that is
available for the current object you need to click on it on the Page designer tab. If you click on
the Common pages in the tables list you'll see tabs like menu, login, register and so on. You can
click on "+" tab to add page.
Below you can see buttons and controls available for that page, "Add menu link", "Add menu
group", "Insert", "Undo" and "Redo".
If you click on one of you project tables in the tables list you'll see tabs for project pages like
list, add, edit and so on.
© 2018 Xlinesoft
Using PHPRunner 242
Now you can see buttons and controls available for that page, "Add field", "Remove field",
"Insert", "Undo" and "Redo". You can find more info in the article Working with cells.
In the central part of the screen you'll see the preview area. You can click to select cells or
elements or even drag and drop elements between cells.
To the right side of the screen you'll see available properties and options. Use "Insert" button to
add code-based buttons, snippets and maps to the page. Use "Undo" and "Redo" buttons to
undo/redo last change on the page.
© 2018 Xlinesoft
243 PHPRunner 10.0 Manual
This will be useful in many scenarios. For instance you need to display a button on the list page
but don't need to see it when the same list page is shown in dashboard. Or you need to design
different list pages with different set of columns for different users. Now you can do this.
One of these pages is selected as the default. If page is marked as a draft it won't appear in
generated application. Using drafts you can quickly switch between versions of the page.
Copy page button - copies the current page. The auto incremented number will be added to
the new new page.
Rename page button - press this button to rename the current page.
Delete page button - press this button to delete the current page.
For example let's see the Page Designer interface for the menu page. First click on the Common
pages in the tables list. Menu tab will be opened in the top of the page, page preview will be
shown in the central part of the application. On the right side you'll see "menu page Properties"
and "Options" that can be changed for the menu page.
© 2018 Xlinesoft
Using PHPRunner 244
Click on the "login" tab to see the preview, properties and options available for the Login page:
© 2018 Xlinesoft
245 PHPRunner 10.0 Manual
Click on one of the cells of the current pages, for example on Login page click on the cell
containing "Username". The selected cell will he highlighted with light green fill and you'll see
© 2018 Xlinesoft
Using PHPRunner 246
Cell properties and options that are available for this cell to the right.
Now click on the "Username" element to see to the right properties and options available for it.
The selected element will be highlighted with red fill.
© 2018 Xlinesoft
247 PHPRunner 10.0 Manual
See also
Add menu link button is used to add links to the menu page for the project tables. Links added will
be shown on the generated welcome page.
Add menu group button is used for adding group to the menu page. You can add menu links into
© 2018 Xlinesoft
Using PHPRunner 248
different groups on the welcome page. To do this first add the new menu group and then drag and
drop the table link to the new group.
All menu links will be added to the group that is currently highlighted in the Page designer window. If
you need to move the link to another group just drag it to the other group or cell.
Insert button is used to add buttons, snippets and maps to the page.
Use Undo and Redo buttons to undo/redo last change on the page.
© 2018 Xlinesoft
249 PHPRunner 10.0 Manual
On the right side you can see the menu page properties and Options:
Press the "Security" button to choose the way the login form appearance form will be displayed
If you have enabled the change password and register page on the Security tab of the application
you will also be able to turn on/off change password and register pages settings. These settings are
also available on the user login settings form.
© 2018 Xlinesoft
Using PHPRunner 250
Add Section/Add Tab buttons are available for the Add, Edit, View page. After you press you
can see the section or tab in the preview area. Now you need to drag and drop fields to the New
section/Tab. To rename or format your section/tab click on it and modify its properties. See
© 2018 Xlinesoft
251 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 252
Insert button is used to add buttons, snippets and maps to the page.
Use Undo and Redo buttons to undo/redo last change on the page.
Page properties
Default/Draft page checkbox
This property is common for all pages. In the Page Designer you can create multiple pages of the
same type i.e. two or three list pages based on the same table. Previously you had to create a
custom view or two that were more difficult to manage and also created unnecessary pages. To
add a version simply click on + and check the choose the type of the page to be created. Then
press ok.
Page Options
Here you can see options available for the page. For example List page has options to control
Inline Add/Edit, Details link, List search or Totals. Add and Edit pages has the button to enable
captcha on the generated page.
© 2018 Xlinesoft
253 PHPRunner 10.0 Manual
List options
© 2018 Xlinesoft
Using PHPRunner 254
Totals options
Click on this control when you want to add totals functions to the fields list page. You can also
add the totals for each field in element's properties - Totals.
© 2018 Xlinesoft
255 PHPRunner 10.0 Manual
Misc options
Page layout
Press this button to open dialog with Layout settings available for the current page.
© 2018 Xlinesoft
Using PHPRunner 256
Form layout
© 2018 Xlinesoft
257 PHPRunner 10.0 Manual
You can leave simple edit form or press the button "generate form" to set the numbers of columns
on the Add/Edit page, labels position, and choose either separate controls and labels or no
© 2018 Xlinesoft
Using PHPRunner 258
Merging cells
If you need to merge cells click on one of the cells - it should become highlighted and the Cells menu
should appear to the right. Now press one of the Merge direction buttons.
Items that were inside the merging elements will be put into one cell.
Inserting cells
If you need to insert cells on the page click on one of the cells - it should become highlighted and
© 2018 Xlinesoft
259 PHPRunner 10.0 Manual
the Cells menu should appear to the right. Now press one of the Insert direction buttons.
Deleting cells
If you need to delete cells on the page click on one of the cells - it should become highlighted and
the Cells menu should appear to the right. Now press one of Delete buttons. You can delete a single
cell, the whole row or the whole column.
Splitting cells
If you need to split cell on the page click on one of the cells - it should become highlighted and the
Cells menu should appear to the right. Now press one of Split button. You can split a cell vertically or
horizontally.
Formatting cells
To change the default formatting options click on one of the cells - it should become highlighted and
the Cells properties should appear to the right. Now formatting controls to the right to change
default settings.
Custom CSS
Press the Custom CSS button to open the dialog. here you can add the CSS code that should be
applied to the cell. See more about Customizing CSS.
You can change format for multiple cells at once. To do this press CTRL and click on multiple cells.
Then change their format.
Press "Show modified only" link to see only modified cell properties.
© 2018 Xlinesoft
Using PHPRunner 260
© 2018 Xlinesoft
261 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 262
Buttons have some additional properties like label, icon, button style and size.
Some of the page elements like on the picture above are in fact groups of predefined simple
elements. They have values in brackets, like search_panel(2) or print_panel(4). These numbers
shows how much sub elements are inside this group. You can change settings for the whole group or
for one of the element inside that group.
© 2018 Xlinesoft
263 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 264
You can group/ungroup menu items if you need, change the link text, comments, and so on.
Table fields are also elements. To change fields order on specific page simply drag the field element
to the new place.
© 2018 Xlinesoft
265 PHPRunner 10.0 Manual
Totals type
You can add totals calculation to some fields on the list/printer-friendly pages. Totals calculation is
available with Simple horizontal and Advanced horizontal Grid type. You can choose between TOTAL,
AVERAGE and COUNT aggregate functions. To do it select the field you want to add totals
calculation to and in the properties on the right choose function type from totals drop-down box.
Another way of adding totals for fields is to click on the totals button in the list or print page
© 2018 Xlinesoft
Using PHPRunner 266
properties. There you can choose totals functions for several fields at once.
Grid elements have some special settings like tooltip, placeholder, Inline Add/Edit checkboxes.
Changes in Inline Add/Edit made in the Page Designer would automatically apply on the Choose fields
screen of the application.
To change them click on the element in the grid, and then use controls that appear to the right. You
can also access View As/Edit As settings and choose one of the calculated Totals from the right
panel of a grid element.
© 2018 Xlinesoft
267 PHPRunner 10.0 Manual
For Details icons in grid you can see "show records count", "badge-style record count" and "hide link
when no child record exists" options.
Press "Show modified only" link to see only modified element properties.
© 2018 Xlinesoft
Using PHPRunner 268
Custom CSS
Press the Custom CSS button to open the dialog. here you can add the CSS code that should be
© 2018 Xlinesoft
269 PHPRunner 10.0 Manual
Quick jump
Page layout
Grid type
Page layout
© 2018 Xlinesoft
Using PHPRunner 270
Click change button on the List page properties page layout to select page layout:
© 2018 Xlinesoft
271 PHPRunner 10.0 Manual
Grid type
Page Designer allows to flexible change the appearance of the grid type. You can choose one of
three simple types: horizontal, vertical or columns grid and one of three advanced modes. In the
advanced mode you can easily change properties for labels or cells of the grid when you need to
set some specific formatting. If you don't change anything in advanced mode the generated pages
will look the same as in the simple mode.
© 2018 Xlinesoft
Using PHPRunner 272
© 2018 Xlinesoft
273 PHPRunner 10.0 Manual
Tabs/Folding sections
You can use tabs and folding sections on the Add/Edit/View pages. To create the new tabs group
press the Add tab button on the top, then drag fields into them or when you need to re-order
them. Press the new tab in the tab properties to add the new tab to the group.
© 2018 Xlinesoft
Using PHPRunner 274
© 2018 Xlinesoft
275 PHPRunner 10.0 Manual
If you select several project languages in the Miscellaneous settings, you can translate the names
of tabs and sections. Click the ... button to open Label Editor and translate the names.
© 2018 Xlinesoft
Using PHPRunner 276
When working with tabs and sections on Add/Edit/View pages you can also change the way the
labels and field values are shown - in columns, above the controls or inline with them.
You can also separate controls and labels to apply some custom formatting. This can be done for
each Tab or section separately.
To do this press the Form Layout button then choose the desired settings for the Tab or Section.
© 2018 Xlinesoft
277 PHPRunner 10.0 Manual
Adding PHP code snippets you can modify the appearance and functionality of the prebuilt web
pages. For example, you can add additional control elements to a web page or display some
information.
1. Proceed to the Page Designer and select a page you wish to modify.
© 2018 Xlinesoft
Using PHPRunner 278
4. New page element labeled <Table name>_snippet will appear on the page. If your code
snippet displays some data on a web page, move the "snippet" element to where you wish to
see that data.
© 2018 Xlinesoft
279 PHPRunner 10.0 Manual
To edit a code snippet, Edit snippet code button. Also you can edit a code snippet on the Events
page.
© 2018 Xlinesoft
Using PHPRunner 280
Examples
PHP code:
echo now();
2. From the code snippet added to the Edit/View page you can get access to fields of the current
record. For example, you can print the value of field Make using the following code:
global $pageObject;
$record = $pageObject->getCurrentRecord();
echo $record["Make"];
© 2018 Xlinesoft
281 PHPRunner 10.0 Manual
Quick jump
Insert button into datagrid
Passing data between events
Examples
1. Proceed to the Page Designer and select a page you wish to modify.
© 2018 Xlinesoft
Using PHPRunner 282
4. Type in the button caption and code to be executed after button is pressed. You can add
both client-side (Javascript) and server-side (PHP) events. Click OK.
© 2018 Xlinesoft
283 PHPRunner 10.0 Manual
3. Now the button is added to your web page. You can drag the button to change its location.
© 2018 Xlinesoft
Using PHPRunner 284
To edit the code, click Edit button code in Properties. You may also edit the code on the Events
page.
© 2018 Xlinesoft
285 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 286
Note: a button inserted into a data grid will only work properly if you select a key field for the
table on the Choose page screen.
You can use the rowData and $button objects to program buttons inserted into a grid. See also
how to Hide buttons in select rows of a datagrid.
params["test"]="Some value";
params["name"]="My name";
In the OnServer event use $params["test"] to access the value of a parameter named "test".
OnServer event:
$result["response"]="Server response";
ClientAfter event:
alert(result["response"]);
© 2018 Xlinesoft
287 PHPRunner 10.0 Manual
Examples
Example 1. Inserting an "Add this product to shopping cart" button
For the Edit/View pages the $keys parameter in the OnServer event contains the information about
the current record. You may use $keys["KeyFieldName"] to access a specific key column.
For example, there is a Products table. To insert an Add this product to shopping cart button on
the View page, add the following code to the OnServer event (Server tab):
global $dal;
$record = $button->getCurrentRecord();
if ($record["ProductID"])
{
//add new records to the ShoppingCart table
//save current username in the UserID field
$ShoppingCart = $dal->Table("ShoppingCart");
$ShoppingCart->Product = $record["ProductID"];
$ShoppingCart->Quantity = 1;
$ShoppingCart->UserID = $_SESSION["UserID"];
$ShoppingCart->Add();
}
$result["txt"] = "Product was added";
For more information about using the Data Access Layer (DAL), see Data Access Layer.
To send records selected on the List page via email, add the following code to the OnServer event
(Server tab):
$email_msg = "";
$email_msg.= "List of records";
$i=1;
while($data = $button->getNextSelectedRecord())
{
$email_msg.= "Record: ".($i++)."\r\n";
$email_msg.= "Make: ".$data["make"]."\r\n";
$email_msg.= "Qwerty: ".$data["qwerty"]."\r\n";
$email_msg.= "\r\n";
}
//send email
$email = "[email protected]";
$subject = "Sample subject";
runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $email_msg));
© 2018 Xlinesoft
Using PHPRunner 288
Example 3. Modifying the value of a field for all selected records on the List page
To modify the value of a field for all selected records on the List page, add the following code to
the OnServer event (Server tab):
while($record = $button->getNextSelectedRecord())
{
$sql = "update Invoices set Status='Paid' where InvoiceID="
.$record["InvoiceID"];
DB::Exec($sql);
}
To make a button redirect to another page, add the following code to the OnBefore event (Client
Before tab) or OnAfter event (Client After tab):
location.href="http://cnn.com";
Let's say you have a button that retrieves a piece of sensitive info from the server that needs to
be shown to the customer for a short period of time. After that this message needs to be hidden.
To do this, add the following code to the OnAfter event (Client After tab):
Example 6.
Let's say you want to add a button to the View page that redirects to one of the application pages,
depending on the value of the Category field. To do so you may add this code to the OnServer
event (Server tab):
// get the value of the current record and pass it to the ClientAfter event
$result["record"] = $button->getCurrentRecord();
if (result.record["Category"]=='Schools')
location.href="Schools_list.php";
else if (result.record["Category"]=='Organisations')
© 2018 Xlinesoft
289 PHPRunner 10.0 Manual
location.href="Organisations_list.php";
else if (result.record["Category"]=='Careers')
location.href="Careers_list.php";
Example 7.
To refresh the page add the following code to the OnAfter event (Client After tab):
location.reload();
Quick jump
You can display the location data as separate map for each table record or insert large map to the
List page. PHPRunner supports several map providers so you can select the suitable one on the
Miscellaneous page -> Map settings.
To insert large map to the List page, follow the instructions below:
1. Proceed to the Page Designer and select a page you wish to modify.
© 2018 Xlinesoft
Using PHPRunner 290
Address field must be a text field. If you do not have a field with address and only want to
use Latitude/Longitude fields, comment out the following line:
//$mapSettings["addressField"] = "Address";
© 2018 Xlinesoft
291 PHPRunner 10.0 Manual
If you use Google Maps and store latitude/longitude information, you can enable clustering or
heat map option.
$mapSettings['clustering'] = true;
© 2018 Xlinesoft
Using PHPRunner 292
$mapSettings['heatMap'] = true;
Example:
© 2018 Xlinesoft
293 PHPRunner 10.0 Manual
3. Click OK.
4. Now map is added to your web page. You can drag the map element to change its location.
To edit the code, click Edit map settings. To delete it click Remove.
© 2018 Xlinesoft
Using PHPRunner 294
Example
Note that clickable markers on the large map will point to the View record page.
© 2018 Xlinesoft
295 PHPRunner 10.0 Manual
SELECT
CustomerID,
CompanyName,
ContactName,
ContactTitle,
Address,
Lat,
Lng,
© 2018 Xlinesoft
Using PHPRunner 296
Notice '\n', it allows to create multiline descriptions. concat() function is MySQL specific. Similar
functions exist in all databases.
2. Insert a map into List page. Here are settings I have used for this specific table.
Latitude and Longitude fields are required as we use address field for marker description purposes.
If you need to display GPS locations (map markers) by date, for example, new geo coordinates that
were inserted into database on a specific day add a WHERE clause to the SQL query of the table
where you insert your map.
For instance to select today's data you can use something like this:
© 2018 Xlinesoft
297 PHPRunner 10.0 Manual
The solution is to use latitude/longitude pairs instead of addresses for mapping purposes. Enable the
Geocoding option on the Choose pages screen to update latitude/longitude information each time
when a record is added or updated. The main question is how to convert existing addresses to
latitude/longitude pairs? We have added a small utility to PHPRunner that will do all the job for you.
Here are instructions:
1. Proceed to the table that stores addresses and add two new fields to that table. Fields need to
be able to store floating point numbers. In MySQL use Decimal(10,6) or Double. In MS Access use
Number with 'Field size' Double.
2. Proceed to the field that is setup as Map. Make sure that Address and Latitude/Longitude fields
are selected.
3. Proceed to the List page, choose to display all records, select all records, click 'Edit', then 'Save
all'. It will take some time to update all records but you only need to do this once. New/updated
records will update longitude/latitude automatically.
To speed up this process you may want temporarily remove 'View as' Map field from the List page
and add it back once geocoding process is finished.
Quick jump
Short Date Long Date Datetime
Time Currency Percent
Hyperlink Email Hyperlink File
Image Phone number Number
HTML Checkbox Map
Custom Audio Video
QRCode
You can customize your data appearance on the List/View/Print/Export pages using formatting
options on the "View as" settings dialog. You can define your field settings for all pages at once
or separately for each page.
© 2018 Xlinesoft
Using PHPRunner 298
To control the filed appearance on the page click on the field and then in Properties click on the
View As/Edit as button.
To set different field formats for different pages enable the Use different settings for all pages
check box. Depending on selected format you will see different box-dialogs.
© 2018 Xlinesoft
299 PHPRunner 10.0 Manual
Copy settings option allows you to copy field settings from another field.
© 2018 Xlinesoft
Using PHPRunner 300
Field events option allows to perform an action when cursor enters edit field or leaves it or mouse
is over a field. Perform any sort of validation, make other fields hidden or required etc. Designed to
work on Add, Edit, View and Register pages.
For example, the mouseover event is fired when a pointing device is moved onto the element.
See also How to access fields in the field events
© 2018 Xlinesoft
301 PHPRunner 10.0 Manual
Short Date
Dates will be displayed in short format ( 02/17/2003 ).
Long Date
Dates will be displayed in long format ( 17 February 2003 ).
Datetime
Datetime values will be displayed as date and time ( 02/17/2003 14:22:03 ).
© 2018 Xlinesoft
Using PHPRunner 302
Time
Datetime values will be displayed as time ( 14:22:03 ).
Currency
Numeric values like 14000 will be displayed as $14 000.00 ( actual format depends on your system
regional settings like currency symbol, decimal symbol etc.).
Percent
Example: 0.38 will be displayed as 38%.
Hyperlink
Choose this format if you store hyperlinks in this database field. Those hyperlinks will be made
clickable automatically.
Email Hyperlink
Choose this format if you store email addresses in this database field. It will be converted into
mailto HTML code automatically.
File
Choose this format if you store files in this field. For more information, see "View as" settings: File.
Image
Choose this format if you store images in this field. For more information, see "View as" settings:
Image.
Phone number
Formats number as a US phone number. Supports 7-digit or 10-digit numbers (123) 456-7890 or
123-4567.
Number
Choose this format if you like to format this field as a number. You can set the default number of
digits after the comma for all numeric fields.
© 2018 Xlinesoft
303 PHPRunner 10.0 Manual
HTML
Use this view type when you store formatted HTML code in database field and wish to display this
HTML code on the list page.
Checkbox
Use this view format to present field value as a check box. Works best with the following data
types:
· MySQL: TINYINT
· Oracle: NUMBER(1)
Map
Allows adding maps to your web pages. For more information, see "View as" settings: Map.
Custom
Allows formatting field values by adding php code. For more information, see "View as" setting:
Custom.
Audio
Choose this format if you store audio files in this field. For more information, see "View as" settings:
Audio.
Video
Choose this format if you store video files in this field. For more information, see "View as" settings:
Video.
© 2018 Xlinesoft
Using PHPRunner 304
QRCode
The QRCode control allows you to add QR Codes to your pages. For more information, see "Edit as"
settings: QRCode.
2.16.11.2 Audio
Select the field that contains the audio titles. Audio titles are displayed instead of the audio file
URL/path.
If the selected field contains audio file URL, select the corresponding check box.
Edit as type can be either Text field (enter audio file name there) or File/Image (upload files).
2.16.11.3 File
File format is available for Binary and Text fields. Depending on field type you will be able to
choose either folder where files are located (for text field) or field name that stores filenames
(for binary field).
Binary field
In this case file is stored in the database and you need to choose a field that stores name of
database file. This filename is required to set correct file type when you retrieve uploaded file
from the database. If you don't choose filename field or leave it empty, you will be presented
with Open with dialog every time you download this file from the database.
© 2018 Xlinesoft
305 PHPRunner 10.0 Manual
Text field
You can select to display filename or custom expression instead of filename. If you want to
display the thumbnail image, file size or icon, select the corresponding check boxes.
2.16.11.4 Image
© 2018 Xlinesoft
Using PHPRunner 306
Binary field
In this case images are stored in the database in the binary fields. PHPRunner creates code
that extracts images from the database on the fly. Supported image formats are JPEG, GIF
and BMP.
You can define fixed image size using the Image width and Image height text boxes.
If you want to display the thumbnail image, you should select the Display thumbnails check
box and choose the field name that stores the thumbnail.
Note: you need an additional binary field (field of MEDIUMBLOB type) to store thumbnails.
This field is the auxiliary one and we do not recommend to display it on your pages. You can
display/hide fields on the Choose fields page.
Text field
You can define fixed image size using the Image width and Image height text boxes.
© 2018 Xlinesoft
307 PHPRunner 10.0 Manual
If you want to display the thumbnail image, select the Display thumbnails check box. Then
you can define fixed thumbnail image size. To show list of thumbnails with one large image
preview, select the Set of thumbnails with preview check box.
© 2018 Xlinesoft
Using PHPRunner 308
2.16.11.5 QRCode
QRCode control allows you to generate QR Codes and display them on your web pages. QR Code (it
stands for "Quick Response") is a cell phone readable bar code that can store website URL's, plain
text, phone numbers, email addresses and any other alphanumeric data.
© 2018 Xlinesoft
309 PHPRunner 10.0 Manual
2.16.11.6 Video
Select The field contains Video file URL check box if the field stores URL of the video file, for
example http://yourwebsite.com/folder/somefile.mp4. Do not use this option if you use
File/Image as Edit as type for this field.
Edit as type can be either Text field (enter video file name there) or File/Image (upload files).
© 2018 Xlinesoft
Using PHPRunner 310
2.16.11.7 Map
Allows you to display location data as a separate map for each table record. To define the location
you may use the address or latitude/longitude coordinates. It is highly recommended to use Latitude
and Longitude fields to make maps function properly. You may use any widely-used address format
(e.g. "1600 Amphitheatre Parkway, Mountain View, CA"). The number given in the Zoom field will
define the level of zoom on your map.
© 2018 Xlinesoft
311 PHPRunner 10.0 Manual
You may access Global map settings to select a map provider. Enter API Key (if required).
You can get API keys for development purposes for free at https://developers.google.com (for
Google maps) or at bingmapsportal.com (for Bing maps).
Use the Geocoding option to update latitude/longitude information each time a record is added or
updated. Select existing fields for storing latitude and longitude data or create new ones. Then
select address field(s) to be used during geocoding.
You may set a custom icon for map marker pins. Click Browse next to the Marker icon and select
the icon image file. You may also set different icons for different map objects by using the PHP
expression option.
© 2018 Xlinesoft
Using PHPRunner 312
An example of how maps are displayed in a browser. Note that double left clicking will zoom in the
image and double right clicking will zoom out.
© 2018 Xlinesoft
313 PHPRunner 10.0 Manual
For more information about inserting large maps to the List page, see Insert map.
The solution is to use latitude/longitude pairs instead of addresses for mapping purposes. The main
question now is how to convert existing addresses to latitude/longitude pairs? For more information,
read Insert Map - Geocoding.
2.16.11.8 Custom
© 2018 Xlinesoft
Using PHPRunner 314
Input value is stored in the variable $value. Output value is assigned to the same variable $value.
You can access other fields of the same data record as $data["FieldName"].
If you chose Lookup wizard in the "Edit as" settings, use $value to access the Display field value
and $data["LinkFieldName"] to access the Link field value.
Examples:
$value = strtoupper($value);
2. Format 10-digit phone number into the following format (xxx) xxx-xxx:
if (strlen($value)==10)
{
$value="(" . substr($value,0,3) . ") " . substr($value,3,3) . "-" . substr($value,6);
}
© 2018 Xlinesoft
315 PHPRunner 10.0 Manual
3. Display value of field FirstName as <FirstName> <LastName> (if LastName field defined):
if ($data["LastName"])
$value = $value." ".$data["LastName"];
4. Display a number in black color if number is positive and red font if number is negative:
if ($value>0)
$color="black";
else
$color="red";
$value="<font color='$color'>$value</font>";
5. Display a field containing email address as email hyperlink (mailto function used). The value of
subject in mailto function is set to a value of another field:
$filesArray = my_json_decode($value);
foreach ($filesArray as $imageFile) {
$imageValue .= "<img alt=\"".htmlspecialchars($imageFile["usrName"])."\"
src=\"".htmlspecialchars($imageFile["name"])."\">";
}
$value = $imageValue;
See also
· Conditional formatting
© 2018 Xlinesoft
Using PHPRunner 316
The first example illustrates the profitability of the product line where we have a list of
products with their respective monthly profit figures. All positive numbers are displayed in black
and all negative in red. Changing the font color of this field based on its value helps the viewer
immediately spot the losing products and take necessary actions.
To set the formatting proceed to Visual Editor and double-click on the field you want to
format. In our case it is the field "Profitability". Select 'Custom' View As option. Add your code
in the custom code editor. If the value of the current field is greater than zero, the font color
will be black, otherwise red. Always remember to check the syntax of your code.
if ($value > 0) {
$color="black";
} else {
$color="red";
}
$value="<span style='color: " . $color . "'>" .$value . "</span>";
You can also represent the positive and negative results with images. For example there are
the red and green circles were added to highlight the performance of each product. To make
this work you will simply need to add two more lines to your custom code. Don't forget to
place the actual images in the project folder.
© 2018 Xlinesoft
317 PHPRunner 10.0 Manual
if ($value > 0) {
$value =$value. ' <img src="green.png" alt="" />';
$color="black";
} else {
$value ='<strong>'.$value. '</strong> <img src="red.png" alt='' />';
$color="red";
}
$value="<span style='color: " . $color . "'>" . $value . "</span>";
Now, lets say we want to highlight not only the font color itself but also change the
background of the cell to yellow.
© 2018 Xlinesoft
Using PHPRunner 318
Because we are no longer working with just the field values, but with the table structure, we
will have to use the events to set the background color.
Proceed to the Events screen in the software and select 'After record processed' event for
the list page of the Products table. The code will be similar to the one we used earlier. If the
value of the 'Profitability' field is less than zero and will set the background of the cell to
yellow. You can refer to the software manual for more examples and code syntax.
if ($data["Profitability"]<0)
$record["Profitability_css"].='background:yellow';
Let’s say you want to take it a step further and highlight the entire row of the losing
products.
In the same event you can use the same code for the condition check and only change the
code for setting the background of the row. You code should look like this. Once again you
can find the exact syntax for this example in the software manual.
if ($data["Profitability"] < 0)
$record["css"]="background:yellow;";
And if you want to change the background color of all rows regardless of the condition, you
can simply comment out the condition in this event:
$record["css"]="background:yellow;";
© 2018 Xlinesoft
319 PHPRunner 10.0 Manual
See also
Quick jump
Text field Text area Password
Date Time Checkbox
File/Image Lookup wizard Readonly
ColorPicker SignaturePad
You can customize your data appearance on the Add/Edit/Search using formatting options on the
"Edit as" settings dialog. You can define your field settings for all pages at once or separately for
each page.
To control the filed appearance on the page right-click the field and choose Properties. Note that
fields format you've chosen is preserved on the Advanced search page, for example, drop-down
boxes, date-pickers, check boxes formats.
© 2018 Xlinesoft
Using PHPRunner 320
To set different field formats for different pages enable Use different settings for all pages check
box. Depending on selected format you will see different box-dialogs.
© 2018 Xlinesoft
321 PHPRunner 10.0 Manual
Quick jump
Default value
© 2018 Xlinesoft
Using PHPRunner 322
Default value will be assigned to a field directly on the Add/Search pages. Default value should be a
valid PHP expression. Text expressions must be quoted.
35 Number.
"ABC" Text.
$_SERVER['REMOTE_ADDR'] IP address.
AutoUpdate value
AutoUpdate value will be assigned to a field every time record is updated on the Edit page. You can
use this feature to keep track of who and when updated the record. AutoUpdate value should be a
valid PHP expression. Text expressions must be quoted.
Placeholder
© 2018 Xlinesoft
323 PHPRunner 10.0 Manual
Placeholders are in-place tooltips that disappear as soon user starts typing something in that field.
© 2018 Xlinesoft
Using PHPRunner 324
Use this option to prevent users from entering duplicate values. Enter a message that will be
displayed when users enter value that already exists in database to Message field.
35 Number.
"ABCDEF" Text.
$_SERVER['REMOTE_ADDR'] IP address.
Copy settings option allows you to copy field settings from another field.
Field events option allows to perform an action when cursor enters edit field or leaves it or mouse
is over a field. Perform any sort of validation, make other fields hidden or required etc. Designed to
work on Add, Edit, View and Register pages.
For example, the editing event is fired when an element changes its value. Text fields fire this event
while user entering the text
See also How to access fields in the field events
© 2018 Xlinesoft
325 PHPRunner 10.0 Manual
Text field
Simple text box. For more information, see "Edit as" settings: Text field.
Text area
Multiline text area. For more information, see "Edit as" settings: Text area.
Password
Password field. All entered characters appear as "*".
© 2018 Xlinesoft
Using PHPRunner 326
Date
Date edit control. For more information, see "Edit as" settings: Date.
Time
Time edit control. For more information, see "Edit as" settings: Time.
Checkbox
Check box control. Works best with the following data types:
Select the Required field option to make the check box required so that it should be selected
before submitting a form. Use this option for the fields such as the Accept License Agreement and
Terms.
File/Image
Choose this format if you store files/images in this field. For more information, see "Edit as" settings:
File/Image.
Lookup wizard
Drop-down box with list of values. For more information, see "Edit as" settings: Lookup wizard.
Readonly
© 2018 Xlinesoft
327 PHPRunner 10.0 Manual
ColorPicker
The Color picker control that allows users select color the same way they do in Adobe Photoshop.
For more information, see "Edit as" settings: ColorPicker.
SignaturePad
The SignaturePad control allows you to add signature pad to your forms. For more information, see
"Edit as" settings: SignaturePad.
2.16.12.2 ColorPicker
Color picker control allows users select color the same way they do in Adobe Photoshop.
SignaturePad works with both mouse and touch devices. You may select ColorPicker as Edit
as type for any text field and enjoy your color picker on Add/Edit pages.
Note that Color picker control is a custom plugin. From now on you also can create your own
Edit control plugins. For more information, see How to create your own Edit control.
1. It would be nice if instead of hex color value we can show some visual representation of
selected color on List/View pages. We'll do so choosing 'View as' type 'Custom' and putting the
following code there:
© 2018 Xlinesoft
Using PHPRunner 328
2. By default PHPRunner sets focus to the first edit control when Add or Edit page is loaded.
This is not a desired behaviour for colorpciker control as we do not want to see colorpicker
popup window to open every time page is loaded. To prevent this from happening implement
setFocus function - simply return false every time.
2.16.12.3 Date
You can set start and end year range. Simple edit box also allows to enter time.
© 2018 Xlinesoft
329 PHPRunner 10.0 Manual
Default value will be assigned to a field directly on the Add/Search pages. AutoUpdate value will be
assigned to a field every time record is updated on the Edit page. You can use this feature to keep
track of who and when updated the record. Default and AutoUpdate values should be valid PHP
expressions.
© 2018 Xlinesoft
Using PHPRunner 330
2.16.12.4 File/Image
Depending on the field type this control allows uploading images and files to the database (binary
field) or to some directory on the Web server (text field).
Text field
File/Image upload control allows selecting and uploading multiple files at once. You only need one
database field to store all file names. For multiple file upload long text field is recommended, for
example, Memo in MS Access, Mediumtext in MySQL, TEXT or Varchar(max) in SQL Server.
Since images and files will be uploaded to some directory on the server, you need to enter the path
to that directory. The path should be relative to the folder with generated pages. Since some
hosting providers do not allow making reference to the directories, which are above the current
one, you can use the Absolute path option and specify the full path to the directory on the
server, in which files will be uploaded. E.g. C:\Inetpub\WWWROOT\project1\files.
© 2018 Xlinesoft
331 PHPRunner 10.0 Manual
Path to upload folder may contain PHP expression (select PHP expression option). So you do not
need to write event code to save each user's files to separate folder. Sample upload path in this
case is:
$folder = $_SESSION["UserID"];
Use the Delete file when associated record is deleted option to make sure that a file will be
deleted when associated record is deleted from the database. This option is global and if enabled is
applied to all tables and fields.
You can restrict the maximum number of files to store. Enter "0" for unlimited number of files. Note
that default value is "1" and you need to increase it to enable multiple upload.
Enable Basic upload control option to select the old style file upload control that lets users upload
one file at a time.
Advanced settings
© 2018 Xlinesoft
Using PHPRunner 332
PHPRunner allows creating thumbnails on the fly. To do this, select the Create thumbnails of the
fly check box and choose thumbnail size and thumbnail prefix. For example, if the original image
filename is example.gif and thumbnail image filename is th_example.gif correspondingly, then
thumbnail prefix is th_. Note that thumbnail images are stored in the same folder as the images.
Note: to use thumbnails functionality you need to have the GD library installed. On Windows you
need to uncomment php_gd2.dll extension in your php.ini file.
To resize images on upload, select the Resize images after upload option and select max width
or height of resulting image.
You can restrict the uploaded file size by setting maximum size of a single file and maximum size of
all uploaded files.
Add list of file extensions allowed to upload under Allowed file types. Empty string means no
restrictions.
© 2018 Xlinesoft
333 PHPRunner 10.0 Manual
You can drag one or more files from your desktop right to the upload control on web page. Drag
and drop feature is not supported in Internet Explorer.
© 2018 Xlinesoft
Using PHPRunner 334
To create thumbnails on the fly, select the Create thumbnails of the fly check box and choose
the field name to save thumbnails in.
Note: you need an additional binary field (field of MEDIUMBLOB type) to store thumbnails. This
field is the auxiliary one and we do not recommend to display it on your pages. You can display/hide
fields on the Choose fields page.
To resize images on upload, select the Resize images after upload option and select max width
or height of resulting image.
Quick jump
List of values
Database table
© 2018 Xlinesoft
335 PHPRunner 10.0 Manual
Lookup wizard is a list of values. Values can be entered manually (List of values option) or
retrieved from the database table (Database table option).
List of values
Use add/delete buttons to add/delete values and up/down buttons to order them.
© 2018 Xlinesoft
Using PHPRunner 336
Database table
You can select the existing database table/custom view to retrieve values from (Table dropdown
box) or create new custom view using Create new query button. For more information about
creating SQL query, see About SQL query designer.
Note: if selected table is included in the project, the rules applied to the project tables (such as
modified SQL query, Advanced Security, changes made to the SQLQuery object in the After table
initialized event) will be also applied to the lookup table. For example, you can limit the list of items
in dropdown with Advanced Security.
Display field
You can use Custom Expression for the Display field to display several values from different fields
with custom design in dropdown box. Click the arrow near Display field and then <Custom
expression>.
© 2018 Xlinesoft
337 PHPRunner 10.0 Manual
WHERE expression
The WHERE expression allows to sort dropdown box content. In our example if you put "phone like
'%555%'" into WHERE box only Contacts with 555 in phone number will be displayed.
© 2018 Xlinesoft
Using PHPRunner 338
To use table variables of the session in a WHERE clause, table names should be written as follows:
$_SESSION["Cars_masterkey1"]
$_SESSION["_Cars_OwnerID"]
CustomerID= ':user.CustomerID'
CustomerID= ':session.UserID'
Autofill
You can auto-fill several fields on the Add/Edit pages with values from the lookup table.
© 2018 Xlinesoft
339 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 340
Let's make the Model field content depends on the Make field value:
1. Set Lookup wizard as "Edit as" type for the Make and Model fields.
2. For the Model field select This dropdown is dependent on check box. Select Make as parent
field from the main table and filter field from lookup table.
© 2018 Xlinesoft
341 PHPRunner 10.0 Manual
You can also create chain of dependent dropdown lists where one dropdown list depends on two or
more master dropdown controls. For example, Model field content depends on values of Make and
YearOfMake fields. So you can select from only those models that were produced by selected
company on selected year. To perform this:
1. Set Lookup wizard as "Edit as" type for the Make, YearOfMake and Model fields.
3. For the Model field select This dropdown is dependent on check box and click Advanced.
Then select Make and YearOfMake fields and click OK.
© 2018 Xlinesoft
Using PHPRunner 342
Also more than one dependent dropdown box can be tied to the same master dropdown control.
© 2018 Xlinesoft
343 PHPRunner 10.0 Manual
The application will look for the occurrence of the typed in string anywhere in the list. For example,
when you enter 'co', it will show 'Corolla' and 'Accord'. If you want to change this behavior and
make it look for the values starting with the entered value, i.e. 'Corolla' only, add the following code
to the AfterAppInit:
$ajaxSearchStartsWith = true;
Checkbox list
List of values is displayed as set of check boxes. A user can select one or several values.
If you enable Horizontal layout check box, check boxes will be placed horizontally.
Radio button
List of values is displayed as set of radio buttons. A user can select only one value.
© 2018 Xlinesoft
Using PHPRunner 344
If you enable Horizontal layout check box, radio buttons will be placed horizontally.
© 2018 Xlinesoft
345 PHPRunner 10.0 Manual
2.16.12.6 SignaturePad
The SignaturePad control allows you to add signature pad to your forms. SignaturePad works
with both mouse and touch devices. Select SignaturePad as "Edit as" type for any text field
with a length of 200 characters or more and enjoy your signature pad on Add/Edit pages. You
should select Image as "View as" type for selected text field.
Note that Signature Pad control is a custom plugin. From now on you also can create your
own Edit control plugins. For more information, see How to create your own Edit control.
© 2018 Xlinesoft
Using PHPRunner 346
Multiline text area control. For advanced WYSIWYG edit capabilities select the Use Rich Text
Editor check box. For more information about using Rich Text Editor, see Rich Text Editor
plugins.
Validate As
Mask
Masked input allows you making a user to enter the data in certain format (dates,phone
numbers, etc).
© 2018 Xlinesoft
347 PHPRunner 10.0 Manual
You can use one of the predefined mask format or create your own custom expression.
· Date: 99/99/9999
2.16.12.9 Time
Time edit control. Use the Use Time picker check box to access time picker screen which
allows you to select time instead of typing it. Select 12 or 24 hour format and one of available
minute intervals. Enable the option "Display seconds" if you wish to display the time to the
nearest minute.
© 2018 Xlinesoft
Using PHPRunner 348
2.16.12.10Validation types
© 2018 Xlinesoft
349 PHPRunner 10.0 Manual
Validation types allow you to validate data that users enter on the add/edit page. You can use
standard validation types or create your own validation plugins. If field value doesn't match defined
format, web page users will see message saying what should be changed. Here is an example of
such message:
To add/edit validation rules, go to Visual Editor page, right-click a field and select Properties.
Validate As check box is available for Text field, Time, Password formats at Edit as tab. Then
you can choose one of validation types from the list.
© 2018 Xlinesoft
Using PHPRunner 350
Password - password field cannot be blank, cannot be 'Password' and should be at least 4
characters long.
US Zip Code - five or ten digit number. Valid formats: 12345, 12345-6789 or 123456789
US Phone Number - numbers, spaces, hyphens, and parentheses are allowed. Examples: (123)
456-7890, 123 456 7890, 123 4567
© 2018 Xlinesoft
351 PHPRunner 10.0 Manual
US State - this field should be two letter US state abbreviation. Examples: AK, AL, CA, MN.
US SSN - nine digit US social security number. Valid formats: 123-45-6789 or 123 45 6789
ip_address - valid ip address (four numbers between 0 and 255 separated by periods). ip_address
is the validation plugin. More info about adding your own validation types.
Regular expression - regular expression (regexp for short) is a special text string for describing a
search pattern. You can get more information about basic syntax for setting regular expressions at
http://www.regular-expressions.info/reference.html.
· [abc] matches a, b or c
\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.
(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
matches 1.2.3.4
To define regular expression, add regular expression to Regexp field and message that will be
displayed if value entered doesn't match defined regular expression to Message field. If
multilanguage support is turned on in your project, you will see Multilanguage button that allows
translating message into several languages. For more information about multiple language support,
see Miscellaneous_settings.
© 2018 Xlinesoft
Using PHPRunner 352
© 2018 Xlinesoft
353 PHPRunner 10.0 Manual
You can add any javascript code to your validation plugins. The javascript function should return
nothing if the value was validated successfully and return error message if the value was not
validated.
Example:
function ip_address(sVal)
{
var regexp = /\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|
[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|
[01]?[0-9][0-9]?)/;
if(!sVal.match(regexp))
return 'This field should be a valid IP address';
else
return true;
}
Step 4. Start PHPRunner. Now ip_address validation type is available in the list of validation types
and you can use it in your projects.
If you want to add a multilanguage message (i.e. error message) to your validation plugin, you need
to create a custom label in Label editor and use Runner.getCustomLabel("LABEL1") code in your
javascript function, where LABEL1 is custom label title. Note that GetCustomLabel function is
applicable only for editing fields like Add/Edit/Register/List with inline add/edit.
You can choose what fields will be shown on the Filter panel by using the Add/Remove field
buttons in the page designer.
© 2018 Xlinesoft
Using PHPRunner 354
You can customize your data appearance on the Filter Panel using formatting options on the
"Filter as" settings dialog. To open this dialog select the field and click on the View As/Edit
© 2018 Xlinesoft
355 PHPRunner 10.0 Manual
On the Filter As tab select Filter format on the left and set appropriate options.
© 2018 Xlinesoft
Using PHPRunner 356
Now you can see that the field is displayed on the Page Designer inside the Filter panel
element. Those fields have Filter As button in properties to the right.
© 2018 Xlinesoft
357 PHPRunner 10.0 Manual
You can click them to open the Filter as settings of the field.
Another way to enable/disable filter on your pages is to use Search and Filter settings.
2.16.13.2 Boolean
Displays filter as Checked/Unchecked values on default or your custom values (i.e. Yes/No,
True/False). This filter works best with Checkbox fields. You can select whether to show
totals.
© 2018 Xlinesoft
Using PHPRunner 358
Displays filter as list of values. You can select whether to allow multiple selection and show totals.
Sort filter options by display or database values. Set the number of first X filter options on initial
load (useful when you have lots of categories).
© 2018 Xlinesoft
359 PHPRunner 10.0 Manual
Select parent filter and filter data by categories and subcategories in the browser:
© 2018 Xlinesoft
Using PHPRunner 360
© 2018 Xlinesoft
361 PHPRunner 10.0 Manual
3. Allow multiple selection - "On demand", Show totals - "Max" (Horsepower field).
Displays filter as interval list. You can create intervals list manually or using Wizard, select
whether to allow multiple selection and show totals.
© 2018 Xlinesoft
Using PHPRunner 362
Use 'plus'/'minus' buttons to add/delete intervals and buttons with arrows to order them. Also
you can edit interval using button with pensil.
Use Wizard to generate multiple intervals at once. For numeric fields you can define the
intervals' step options and number of intervals.
© 2018 Xlinesoft
363 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 364
3. Allow multiple selection - "On demand", Show totals - "Max" (Horsepower field).
© 2018 Xlinesoft
365 PHPRunner 10.0 Manual
Displays filter as interval slider. You can select the appearance of slider knobs and slider step.
2.17 Editor
Quick jump
© 2018 Xlinesoft
Using PHPRunner 366
Visual Editor built-in in PHPRunner is an editor control that allows the user to edit HTML contents in
a more user friendly way. The editor control is very flexible and enables the advanced user to
change the appearance of the pages in design or html mode.
© 2018 Xlinesoft
367 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 368
Also you can enable Lock pages modified in Visual Editor automatically option in Project ->
Settings. After that all pages that you manually modify will be locked from further automatic
modifications.
The Visual Editor page allows you to modify the visual appearance of your pages and instantly
preview the results.
You can see two sections on that page:
· Tables list on the left. Moving across tables and their related pages, you can select a page
to view/modify. To filter pages by the page name, use the text field above the events tree.
· Editor on the right where you can alter certain aspects of your page, such as the project
theme, fonts size and custom CSS, and preview how the selected page will look like in a
browser.
© 2018 Xlinesoft
369 PHPRunner 10.0 Manual
This page has custom settings is an option that allows you to select the appearance for
pages that differ from the project ones.
A layout is a page template (for an Add page, Edit page etc). Each template defines corresponding
page structure and stored in the .ly file in the folder C:\Program
Files\PHPRunner10.0\templates\layouts.
You can choose the layouts for all pages by selecting the project scheme, for all List/Add/Edit/etc.
pages by selecting layout from the Layouts list and for the currently selected page by enabling This
page has custom settings option and then selecting layout from the Layouts list.
Styles
Style is a set of parameters that includes font, font size, margins, borders, alignment and more.
Styles are stored as the .style files in the folder C:\Program Files\PHPRunner10.0\styles.
Color schemes
The color scheme describes the color palette of layout elements. Color schemes are stored as the
.color files in the folder C:\Program Files\PHPRunner10.0\styles\colors.
Themes
Themes combine the properties of the Styles and the Color schemes.
© 2018 Xlinesoft
Using PHPRunner 370
How to change font in grid on the List How to make Bootstrap1 layout grid
page 100% width
How to hide "required" icon How to change cursor to a hand icon
while hovering over a dashboard
element
How to change the color of menu How to turn on word wrap for all table
items and project name cells
How to change the color of a regular How to turn off word wrap for all table
button cells
How to change the color of a main Making the 'View details' icon bigger
button
How to change the color of the menu How to change 'View details' icon
bar mouseover tooltip
How to change the text color of How to change icon to the word
breadcrumb item "Details"
How to change the text color of How to change the width, font size
breadcrumb container and color of search suggest window
How to change color of dashboard How to change the color of the info on
panel headers the Welcome page panels
How to set the image as the page How to make the login form semi-
background transparent
See also:
Building a nice looking login page with custom CSS
For example, let's say you want to add a background image only to one List page in the
project. Select this List page in Visual Editor. Enable This page has custom settings. Click
Custom CSS and add the following code:
body.function-list {
height:100%;
background:transparent url("http://mywebsite.com/images/some_pic.jpg")
no-repeat center center fixed;
background-size:cover;
}
When you have finished CSS customization, click the Close button to return to the view
mode.
You can also add some custom CSS in the Page Designer Cell/Element Properties.
© 2018 Xlinesoft
371 PHPRunner 10.0 Manual
Before custom CSS was applied After custom CSS was applied
© 2018 Xlinesoft
Using PHPRunner 372
Before custom CSS was applied After custom CSS was applied
Example 3. How to change the color of menu items and project name
.navbar-nav>li>a, a.navbar-brand {
color: red !important;
}
Before custom CSS was applied After custom CSS was applied
Before custom CSS was applied After custom CSS was applied
© 2018 Xlinesoft
373 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Using PHPRunner 374
background: green;
border-color: green;
}
Before custom CSS was applied After custom CSS was applied
Before custom CSS was applied After custom CSS was applied
© 2018 Xlinesoft
375 PHPRunner 10.0 Manual
ol.breadcrumb a {
color: red;
}
Before custom CSS was applied After custom CSS was applied
© 2018 Xlinesoft
Using PHPRunner 376
background: #808080;
}
Before custom CSS was applied After custom CSS was applied
© 2018 Xlinesoft
377 PHPRunner 10.0 Manual
Example 11. How to change cursor to a hand icon while hovering over a
dashboard element
.bs-dbelement {
cursor: pointer;
}
Before custom CSS was applied After custom CSS was applied
Example 12. How to turn on word wrap for all table cells
td.bs-gridcell {
white-space: normal;
}
© 2018 Xlinesoft
Using PHPRunner 378
Example 13. How to turn off word wrap for all table cells
td.bs-gridcell {
white-space: nowrap;
}
© 2018 Xlinesoft
379 PHPRunner 10.0 Manual
Before custom CSS was applied After custom CSS was applied
© 2018 Xlinesoft
Using PHPRunner 380
Add the following to the Javascript OnLoad event of the List page.
Before custom CSS was applied After custom CSS was applied
$("a[id^=details_]").find("span").attr("class","").text("Details");
Before custom CSS was applied After custom CSS was applied
Example 17. How to change the width, font size and color of search suggest
window.
© 2018 Xlinesoft
381 PHPRunner 10.0 Manual
.suggest_link, .suggest_link_over {
color: red;
font-size: 14px;
}
.search_suggest {
width: 300px;
}
Before custom CSS was applied After custom CSS was applied
Example 18. How to change the color of the info on the Welcome page panels
bs-welcome-content {
color: #CC7755;
Before custom CSS was applied After custom CSS was applied
Before custom CSS was applied After custom CSS was applied
© 2018 Xlinesoft
Using PHPRunner 382
Sample screenshot of the Login page with the background image set in Example 19:
Before custom CSS was applied After custom CSS was applied
Quick jump
How to change font in grid on the List How to make Bootstrap1 layout grid
page 100% width
How to hide "required" icon How to change cursor to a hand icon
while hovering over a dashboard
element
How to change the color of menu How to turn on word wrap for all table
items and project name cells
© 2018 Xlinesoft
383 PHPRunner 10.0 Manual
Quick jump
How to change the color of a regular How to turn off word wrap for all table
button cells
How to change the color of a main Making the 'View details' icon bigger
button
How to change the color of the menu How to change 'View details' icon
bar mouseover tooltip
How to change the text color of How to change icon to the word
breadcrumb item "Details"
How to change the text color of How to change the width, font size
breadcrumb container and color of search suggest window
How to change color of dashboard How to change the color of the info on
panel headers the Welcome page panels
How to set the image as the page How to make the login form semi-
background transparent
See also:
Building a nice looking login page with custom CSS
Quick jump
Link attributes
Tree-like menu
Drilldown menu
Welcome page
The Menu Builder lets you organize your tables and views into multi-level cascading menu for
quicker navigation. This feature is particularly useful if you have a large number of tables.
Once a project is created, menu consists of tables selected for the current project. Depending on
the selected layout menu will appear horizontally or vertically. On this stage menu is single-level.
More info on selecting layout.
© 2018 Xlinesoft
Using PHPRunner 384
© 2018 Xlinesoft
385 PHPRunner 10.0 Manual
You can change already created menu entries by double-clicking them, using Edit item button or
selecting Properties with right-mouse button. You can add new groups and links. Notice that group
can also include the link or serve just as folder for other groups and links.
Note: You can always change the type of any menu entry from link to group and vice versa.
Delete button on the right panel deletes currently selected menu item. Reset button resets menu
to its default state - as if project and menu was just created.
Link attributes
© 2018 Xlinesoft
Using PHPRunner 386
While adding or editing a link you are able to specify the following link attributes:
Link to - If Link type is set to External page, then add link to any web page. If Link type is set to
PHPRunner page, then firstly select a table within your project and then one of pages that are
available for selected table. Usually, you can choose between:
· Print page - prepares user-friendly page with data from the table for printing.
More info about what kind of PHPRunner pages you can create and use.
© 2018 Xlinesoft
387 PHPRunner 10.0 Manual
Click '...' button next to the page type list box to set link parameters. Example of link parameter:
orderby=aDescription. The link with parameter is carsbcolor_list.php?orderby=aDescription. If you
want to display the Country Sales Report order by the Sales figures you can set the parameter to
orderby=dSales. If you have more complex parameters the best way to proceed would be to copy
the parameter string from the application URL and paste it into the parameter dialog.
Note that user group permissions are applied to the internal links (PHPRunner pages) and not applied
to the external ones.
Link text - Link text will be displayed as menu item title. If multilanguage support is turned on in
your project, you will see Multilanguage button that allows translating link text into several
languages. More info on multiple language support.
Icon - select an image that will displayed before menu item title.
Style - Set menu item text style by adding custom CSS style description. You can add several CSS
properties using semicolon between them.
Here are several examples of how you can modify menu item text style:
© 2018 Xlinesoft
Using PHPRunner 388
· font-size:12px; color:red
· font-size:200%; font-weight:bold
· color:rgb(255,0,0); background-color:black
Open in new window option allows opening the links that compose a menu in new browser window.
Tree-like menu
To create a cascading menu, create new group(s) and drag and drop already created menu entries
into that groups building cascading structure or create new ones.
For layout with vertical menu the Tree-like menu check box allows to display cascade menu that
expands/collapses menu folders.
© 2018 Xlinesoft
389 PHPRunner 10.0 Manual
Drilldown menu
The Drilldown menu option might be handy with a multi-level hierarchical menu.
Instead of displaying the whole menu structure on each page, the drilldown menu shows only the
current submenu and its children.
The Breadcrumbs control helps the user to determine the position of the page in the application
hierarchy.
© 2018 Xlinesoft
Using PHPRunner 390
Without the Drilldown menu option you'll see the same menu on each page:
With the Drilldown menu option you'll see this menu on the Employees page:
Welcome page
Welcome page is the first page you see in browser. You are able to choose a several most
important menu items and display them on start page along with short description. To customize its
appearance, choose "welcome_page" in the Menu Builder.
© 2018 Xlinesoft
391 PHPRunner 10.0 Manual
Besides the possibilities to add links, groups, create cascading menu, you can alter icons, color,
description etc. of your welcome page.
© 2018 Xlinesoft
Using PHPRunner 392
Quick jump
Revisions
Intellisense
Events are the fragments of PHP code executed before or after record was added, edited, deleted,
when new user registers etc. Therefore events allow you to define some actions that will be
activated when certain conditions are met.
· send an email which contains the data from a new record, or shows changes to an existing
record;
© 2018 Xlinesoft
393 PHPRunner 10.0 Manual
Events can be divided into global and table events. Global events are not specific to any table or
view. Table events belong to a table or a view.
Add an event
1. Go to the Events page.
2. Select an event from the tree in the left pane. To show events with the actual code only, click
the button. To filter events by the event name, use text field above the events tree.
After you selected the event, on the right pane you will see definition of the function that
implements selected event and description of the function parameters. To hide the parameters
description click button.
© 2018 Xlinesoft
Using PHPRunner 394
While you are in Event Editor or in Visual Editor press and hold CTRL button and scroll your mouse
wheel to increase/decrease font size.
3. Add your own PHP code or click button to choose one of the predefined actions. More info
about predefined actions and sample events with code snippets. Read what common parameters
you can use in the events.
Button Description
Opens Search and Replace dialog that allows to search and replace within an
event or within all events.
© 2018 Xlinesoft
395 PHPRunner 10.0 Manual
5. Modify sample event code by putting the correct values instead of the values colored in red.
© 2018 Xlinesoft
Using PHPRunner 396
Note: You can add more than one action to the event.
To edit the event, select event from the tree and modify PHP code. To delete the event, select
Revisions
You can track all changes made in Event Editor, review and restore any revision. To see revision
history, click Revisions button.
Click Show changes at the bottom of revision panel to see changes between current and previous
revisions. To restore any revision, select that revision and click Restore revision.
© 2018 Xlinesoft
397 PHPRunner 10.0 Manual
Intellisense
Intellisense is a convenient way to access the functions' descriptions and variables. The Events
Editor recognizes the functions and variables and will pop up the function description or the list of
available variables to choose from.
© 2018 Xlinesoft
Using PHPRunner 398
PHP functions
© 2018 Xlinesoft
399 PHPRunner 10.0 Manual
Field names
© 2018 Xlinesoft
Using PHPRunner 400
On the Output directory screen you can choose output directory where all generated files will be
saved.
Preview
PHPRunner comes with built-in web server (Apache). In most cases you can leave all settings on
this page "as is", click Build and View in browser on the next screen. Built-in web server won't
interfere with your existing web server if you have one.
In some cases you may want to view generated application using your own web server. In this case
switch to I have my own web server option and enter URL manually. You should change output
directory as well to one of web server subdirectories (i.e. C:\xampp\htdocs\project1 if you use
XAMPP).
Note: If you don't have a web server and want to install one, check How to install local server.
Select the Full build check box to perform full build of the project. Otherwise, partial (faster) build
will be performed.
© 2018 Xlinesoft
401 PHPRunner 10.0 Manual
Compress javascript files option allows to compress generated Javascript files leading to faster
load times. Unless you need to debug Javascript code leave this option on.
To create new database connection, click the New button. Then specify connection name and
settings. Click OK.
If you are using MySQL locally, database connection settings may be as follows:
$host="localhost";
$user="root";
$pwd="";
$port="";
$sys_dbname="cars";
When uploading files to the server, you may use the following settings:
$host="localhost";
$user="mike375";
$pwd="dcHd*eS2";
© 2018 Xlinesoft
Using PHPRunner 402
$port="";
$sys_dbname="mike375_cars";
date.timezone = 'UTC'
date.timezone = 'EDT'
You can find the time zone abbreviation around the world at
http://www.timeanddate.com/library/abbreviations/timezones/.
After you successfully built PHP files you have the following options:
© 2018 Xlinesoft
403 PHPRunner 10.0 Manual
If for for some reason built-in web server doesn't start (nothing happens after you click 'View in
browser' button) make sure your antivirus or firewall software doesn't block the web server.
Turn it off for a minute and try 'View in browser' one more time. Built-in web server uses ports
8085-8090 so you may want to open them in your firewall.
· Open output folder - open Windows Explorer to browse the folder with generated PHP files.
· Create SQL script - to create SQL script for tables/data transfer to another server.
© 2018 Xlinesoft
Using PHPRunner 404
· Publish via FrontPage - if your website supports FrontPage Extensions use Frontpage
publishing feature.
· Demo Account - also you can open a free Demo Account with us and publish your project to
our demo web server with a single mouse click.
· Quick upload to InspiRunner.com - if you have account at InspiRunner.com, use this option
to publish your project.
If you prefer to use third-party tools to upload generated applications check the following topics:
If you having problems using PHPRunner or like to learn some advanced techniques you can check
PHPRunner articles or ask your questions in support forum.
To upload files to FTP server, you need to setup FTP location properties.
Enter Location name, Host name, User name and Password to enable Browse button. Click Browse
to choose directory to upload generated files. Choose between FTP, SFTP and FTPS protocols.
If your web hosting provider has a designated folder for databases, you need to move database file
to that directory. Connection string will be updated to match new database folder automatically.
© 2018 Xlinesoft
405 PHPRunner 10.0 Manual
If you have connected to database successfully but can't create folder or upload files you can use
Passive mode.
Fill in Remote Web site URL textbox to open downloaded pages in browser for test purposes.
To upload files choose FTP location and click Upload button. You can stop upload at any time by
clicking Stop button.
· Upload changed files only - to upload files that were changed since previous upload.
· Upload all files in the output directory - to upload all files including files that were created
not by PHPRunner.
Note: you can increase the upload speed by changing the number of FTP threads in Project ->
Settings.
© 2018 Xlinesoft
Using PHPRunner 406
PHPRunner can also build and package desktop applications as well as web applications. Applications
like Word or Excel, that can be installed on any Windows machine, require no Internet connection
and zero setup, like a screenshot below:
© 2018 Xlinesoft
407 PHPRunner 10.0 Manual
To make a new application, click "Create desktop app" after building the project.
© 2018 Xlinesoft
Using PHPRunner 408
When you build a desktop version of your application 'Publisher name', 'Application URL' and
'Application icon' fields are optional.
If your desktop application shows an error message, check the PHP Desktop knowledge base for
additional info. Look up your error message there and take the steps suggested.
How it works
First of all, Desktop apps functionality is built on the top of the open source PHP Desktop project.
PHP Desktop packages together the following software components:
· PHP
· Chrome browser
When you start PHP Desktop application, it starts the web server first specifying 'www' directory as
website root folder. Then it starts Chrome browser pointing to web server's home page. Browser
application is modified to hide all menus, navigation buttons and address bar. You just see the
application itself.
© 2018 Xlinesoft
409 PHPRunner 10.0 Manual
PHPRunner takes one extra step packaging the whole application into a single installable EXE file.
Inno Setup is used for this purpose. The whole packaging process is described with great details in
the 'Create Your First Desktop Application With PHP And PHP Desktop' tutorial.
Limitations
· Windows only
· PHP only
PHP Desktop, apparently, is for PHP only. However, since a standalone IIS Express browser
exists we can expect at some point that
If you want to make desktop version of your app available worldwide you definitely need to
sign the installer.
Desktop application is no different from the web application except it sits on your desktop. If
your application uses a remote database, you do need Internet connection to connect to
that database.
· You need to create an application that doesn't use database at all. An example - Euro
2016 desktop application. It connects to football-data.org API, retrieves data and displays
it. You don't need a website or a database in this scenario.
· When you need an access to hardware or to file system. Using a desktop app you can
access devices connected to end user machine, work with file system, use COM objects
etc. You can do pretty much everything the typical desktop application can.
· You can use your desktop application to connect to remote database. This is the less
typical scenario but still plausible. Probably you do not have a website or do not want to
maintain a website, take case of security etc. All you have is a database like MySQL or
Amazon RDS with remote access. In this case desktop application can be useful as well.
To upload files with FrontPage Server Extensions, you need to setup FrontPage location
properties.
© 2018 Xlinesoft
Using PHPRunner 410
Enter Host name, User, Password to enable Browse button. Click Browse to choose directory to
upload generated files.
If your web hosting provider has a designated folder for databases, you need to move database file
to that directory. Connection string will be updated to match new database folder automatically.
Fill in Remote Web site URL textbox to open downloaded pages in browser for test purposes.
To upload files choose FrontPage location and click Upload button. You can stop upload at any
time by clicking Stop button.
© 2018 Xlinesoft
411 PHPRunner 10.0 Manual
· Upload changed files only - to upload files that were changed since previous upload.
· Upload all files in the output directory - to upload all files including files that were created
not by PHPRunner.
3 Advanced topics
3.1 Events
Note: Change the values listed in red to match your specific needs.
© 2018 Xlinesoft
Advanced topics 412
$subject="Sample subject";
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' =>
$msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"];
If you need to customize email templates that will be send to the users read this article: Email
templates
To send an email with new data use Send email with new data action.
© 2018 Xlinesoft
413 PHPRunner 10.0 Manual
Note: Change the values listed in red to match your specific needs.
To send an email with old data use Send email with old data record action.
© 2018 Xlinesoft
Advanced topics 414
Note: Change the values listed in red to match your specific needs.
To save new data in another table use Save new data in another table action.
© 2018 Xlinesoft
415 PHPRunner 10.0 Manual
Note: Change the values listed in red to match your specific needs.
© 2018 Xlinesoft
Advanced topics 416
$tblEvents->Value["email"]=$values["email"];
$tblEvents->Value["age"]=$values["age"];
$tblEvents->Add();
See also
· Data_Access_Layer
Note: Change the values listed in red to match your specific needs.
© 2018 Xlinesoft
417 PHPRunner 10.0 Manual
$sql .= "'".$oldvalues["email"]."',";
$sql .= $oldvalues["age"];
$sql .= ")";
CustomQuery($sql);
See also
· Data_Access_Layer
To insert a record into another table use Insert a record into another table action.
© 2018 Xlinesoft
Advanced topics 418
Note: Change the values listed in red to match your specific needs.
See also
· DAL: CustomQuery()
Note: Change the values listed in red to match your specific needs.
© 2018 Xlinesoft
419 PHPRunner 10.0 Manual
}
else
{
// if dont exist do something else
}
Example
Let's assume we need to check the uniqueness of the entered SSN number. Use the following
code in the Before record added event:
To display a message on the Web page use Display a message on the Web page action.
© 2018 Xlinesoft
Advanced topics 420
Note: Change the values listed in red to match your specific needs.
© 2018 Xlinesoft
421 PHPRunner 10.0 Manual
Note: Change the values listed in red to match your specific needs.
Note: Change the values listed in red to match your specific needs.
1. Proceed to the Visual Editor page, switch to HTML mode and add a custom input field to
your form. Make sure you specify field ID.
2. Add the following code to Javascript OnLoad event of the page where custom field was
added:
© 2018 Xlinesoft
Advanced topics 422
3. In any event like Before record added or Before process use $_REQUEST["test"] to access
the custom field value.
Note: Change the values listed in red to match your specific needs.
Lets say you want to give each user a quick access to her own data in users table. It would
be nice to add 'My profile' link right to the main menu.
Link to user profile page looks like users_edit.php?editid1=XXXX. We assume that login table
name is users and XXXX is the value of primary key field in users table.
Note: Change the values listed in red to match your specific needs.
1. Save ID of user account in session variable. For this purpose add the following code to
AfterSuccessfulLogin event:
$_SESSION["user_id"]=$data["id"];
© 2018 Xlinesoft
423 PHPRunner 10.0 Manual
if ($menuItem->getTitle()=="My profile") {
$menuItem->setUrl("users_edit.php?editid1=".$_SESSION["user_id"]);
}
return true;
Note: Change the values listed in red to match your specific needs.
1. Add a new button to the Add or Edit page via Insert button function in Visual Editor.
$("#saveButton1").click();
return false;
3. Add the following code to the AfterAdd event of Add page or AfterEdit event of Edit page:
if($_REQUEST["golist"])
{
header("Location: ..._list.php");
exit();
}
Note: Change the values listed in red to match your specific needs.
$record["FieldName_css"]='background:red;';
Also you can change background color of a cell when the mouse hovers over it:
$record["FieldName_hovercss"]='background:yellow;';
© 2018 Xlinesoft
Advanced topics 424
See also
· Conditional formatting
Note: Change the values listed in red to match your specific needs.
$("input[type=text]").css('fontSize', '120%');
See also
· Javascript API
Note: Change the values listed in red to match your specific needs.
To make a change message use the following code in AfterAdd or AfterEdit events.
Example 1.
$pageObject->setMessageType(MESSAGE_ERROR);
$pageObject->setMessage("An Error Occurred");
© 2018 Xlinesoft
425 PHPRunner 10.0 Manual
Example 2.
$pageObject->setMessageType(MESSAGE_INFO);
$pageObject->setMessage("Data was saved, all good");
Note: These codes will always work for Edit page. And will not work for Add page if you choose
to display master data on details page.
Note: Change the values listed in red to match your specific needs.
$record["css"]='background:blue;';
Also you can change background color of a row when the mouse hovers over it:
$record["hovercss"]='background:yellow;';
See also
· Conditional formatting
© 2018 Xlinesoft
Advanced topics 426
Note: Change the values listed in red to match your specific needs.
See also
· Javascript API
Note: Change the values listed in red to match your specific needs.
$("input[name^='value_make'], select[name^='value_make']").width(150);
See also
· Javascript API
Note: Change the values listed in red to match your specific needs.
if ($data["Status"]=="processed")
{
$record["edit_link"] = false;
}
To be sure that record editing is disabled, also perform a checkup on the Edit page.
Let's say you added a button to the datagrid to export a single record. And if the record has
been already exported (value of field exported equals 1), you want to hide the export button
in this row.
© 2018 Xlinesoft
427 PHPRunner 10.0 Manual
Note: Change the values listed in red to match your specific needs.
1. Switch to HTML mode in Visual Editor and add wrappers around button's code. Here is the
sample code:
{BEGIN MyButton}
<A class="rnr-button button" id="MyButton" href="#" typeid="ib">
MyButton
</A>
{END MyButton}
2. Now in the List page: AfterRecordProcessed event add the following code:
if ($data['exported']!=1)
$record["MyButton"]=true;
This code will only display button if value of field exported equals 1.
Note: Change the values listed in red to match your specific needs.
1. To show the Horsepower field edit control only if user name equals "admin", use the
following code:
if (Security::getUserName()!="admin")
$pageObject->hideField("Horsepower");
2. To show the Horsepower field edit control only if current user belongs to the admin group,
use the following code:
if (Security::isAdmin())
$pageObject->hideField("Horsepower");
Note that this code sample will work only with static permissions.
3. To hide the Horsepower field edit control placed on tab or folding section on the
Edit/Add/View page, use the following code:
$pageObject->hideField("Horsepower");
© 2018 Xlinesoft
Advanced topics 428
Note: Change the values listed in red to match your specific needs.
if (!$values["EPAHighway"])
$pageObject->hideField("EPAHighway");
There is an option to hide empty fields on the View page automatically. To enable it, go to the
Choose pages screen, click the Settings button near the View record checkbox and then
select Hide empty fields checkbox.
Here is the typical list page with the list of cars sorted by make.
Sometimes you may need to make this screen less cluttered removing repeating values in the
Make column. Something like this:
© 2018 Xlinesoft
429 PHPRunner 10.0 Manual
$_SESSION["Make"]="";
2. Set 'View as' type of Make field to 'Custom' and paste the following code there:
if ($value==$_SESSION["Make"])
$value="";
else
$_SESSION["Make"]=$value;
global $strTableName;
if (isset($_SESSION[$strTableName.'_advsearch']))
{
$searchClauseObj = unserialize($_SESSION[$strTableName.'_advsearch']);
}
© 2018 Xlinesoft
Advanced topics 430
$fieldSearchData = $searchClauseObj->_where[$strTableName."_srchFields"];
global $strTableName;
if (isset($_SESSION[$strTableName.'_advsearch']))
{
$searchClauseObj = unserialize($_SESSION[$strTableName.'_advsearch']);
}
echo $searchClauseObj->_where[$searchClauseObj-
>sessionPrefix."_simpleSrch"];
The following code needs to be added to AfterAdd event of the master table.
Note: Change the values listed in red to match your specific needs.
header("Location: order_details_list.php?mastertable=orders&masterkey1=" .
$values["OrderID"]);
exit();
In this example:
© 2018 Xlinesoft
431 PHPRunner 10.0 Manual
To add this event insert PHP code snippet on the Page Designer page.
Note: Change the values listed in red to match your specific needs.
global $pageObject;
echo "Master Info<br>";
if ($data = $pageObject->getMasterRecord())
{
echo "Field1: ".$data["Field1"]."<br>";
echo "Field2: ".$data["Field2"]."<br>";
}
global $pageObject;
echo "Order Info<br>";
if ($data = $pageObject->getMasterRecord())
{
echo "Customer: ".$data["CustomerID"]."<br>";
echo "Employee: ".$data["EmployeeID"]."<br>";
}
Note: Change the values listed in red to match your specific needs.
ctrlCountry.on('change', function(e) {
if (this.getValue() == 'US') {
ctrlState.show();
} else {
ctrlState.hide();
}
});
You may want to hide field label as well. Use the following code to hide or show the whole
table row with state edit control based on country field selection. It will work in popup and
inline.
© 2018 Xlinesoft
Advanced topics 432
ctrlCountry.on('change', function(e) {
if (this.getValue() == 'US') {
pageObj.showField("state");
} else {
pageObj.hideField("state");
}
});
See also
· Javascript API
3.1.2.2 Database
Before deleting a record check for related records
Before deleting a record in the Orders table check for related items in the OrderDetails table.
Add the following code to the List page: Before record deleted event.
Note: Change the values listed in red to match your specific needs.
// Parameters:
// where - string with WHERE clause pointing to record to be deleted.
global $dal;
$tblOrder = $dal->Table("OrderDetails");
$rs = $tblOrder->Query("OrderID=".$deleted_values["OrderID"],"");
$data = db_fetch_array($rs);
if($data)
return false;
else
return true;
For more information about using Data Access Layer (DAL), see Data Access Layer.
Sometimes you need to present different data to different groups of users. Let's say you run a
classified ads board and needs to display last seven days data to regular users while admin
should be able to see all adds.
Note: Change the values listed in red to match your specific needs.
© 2018 Xlinesoft
433 PHPRunner 10.0 Manual
if (Security::getUserName()!="admin")
$query->addWhere("DATEDIFF(day,DateColumn, GETDATE()) <= 7");
if (Security::getUserName()!="admin")
$query->addWhere("DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= DateColumn");
if (Security::getUserName()!="admin")
$query->addWhere("DATEDIFF('d',DateColumn, Now()) <= 7");
4. When we use Dynamic Permissions code will be slightly different (MySQL example). If user
doesn't belong to admin group we only show last seven days data.
if (!Security::isAdmin())
$query->addWhere("DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= DateColumn");
See also
· Method: addWhere
Tables are linked via userid field in both. It would also make sense to turn on Advanced
security mode 'Users can see all data, can edit their own data only'.
Use the following code in Add page: Before Record Added event.
$limit = 3;
© 2018 Xlinesoft
Advanced topics 434
if ($count>= $limit)
{
echo "Limit reached: $count records added already";
exit();
}
Scenario 2. Each user has it's own limit. Limits are stored in the userlimit field of users table
if ($count>= $limit)
{
echo "Limit reached: $count records added already";
exit();
}
Select multiple values from checkboxes or a list field and have them appear as individual database entrie
To select multiple values from check boxes or a list field and have them appear as individual
database entries use the following code in Add page: Before Record Added event.
Note: Change the values listed in red to match your specific needs.
if ($values["fieldname"])
{
$arr = explode(",",$values["fieldname"]);
// This is the name of the multi check box or
// list select field, its value becomes $arr
for ($i=0;$i<count($arr);$i++)
{
$strInsert = "insert into TableName (field) values ('".$arr[$i]."')";
// add more fields from the add page to be inserted into database
db_exec($strInsert);
}
header("Location: MyPage_list.php");
© 2018 Xlinesoft
435 PHPRunner 10.0 Manual
Note: Change the values listed in red to match your specific needs.
global $dal;
$tblOrders = $dal->Table("Orders");
$rs = $tblOrders->Query("OrderID=".$_REQUEST["editid1"],"");
$data = db_fetch_array($rs);
$CustomerID = $data["CustomerID"];
echo "Orders placed by " .$CustomerID. "<br>";
$rsOrders = $tblOrders->Query("customerid='".$CustomerID."'","");
while($data=db_fetch_array($rsOrders))
{
echo "<a target=_blank href=Orders_edit.php?editid1=".$data["OrderID"].
">". $data["OrderID"]."</a> ".$data["OrderDate"]."<br>";
}
For more information about using Data Access Layer (DAL), see Data Access Layer.
To keep track of when records in a table are last modified or who made the modification you
have two options:
To store login name of the user who made the change, set default value to:
$_SESSION["UserID"]
now()
© 2018 Xlinesoft
Advanced topics 436
$values["DateUpdated"]=now();
$values["UpdateBy"]=$_SESSION["UserID"];
Note: Change the values listed in red to match your specific needs.
2. Create the custom button Update selected and add the following code
global $dal;
The Client Before tab should be blank (delete sample code there if any).
For more information about using Data Access Layer (DAL), see Data Access Layer.
To update two joined tables use the following code in Add page: Before record added and/or
Edit page: Before record updated events.
Note: Change the values listed in red to match your specific needs.
© 2018 Xlinesoft
437 PHPRunner 10.0 Manual
To update master and details tables use the following code for details table in Add page:
Before record added and/or Edit page: Before record updated events.
global $dal;
$tblDetail = $dal->Table("DetailTableName");
$tblDetail->Value["Field1"] = $values["Field1"];
$tblDetail->Param["OrderID"] = $values["OrderID"];
$tblDetail->Update();
unset($values["Field1"]);
Field1 is a field in the details table and OrderID is the linked field in the master table.
For more information about using Data Access Layer (DAL), see Data Access Layer.
1. Modify Orders SQL Query to add a dummy field named 'product'. Make sure this field is
searchable.
SELECT
OrderID,
CustomerID,
EmployeeID,
OrderDate,
ShipAddress,
ShipCity,
ShipRegion,
ShipPostalCode,
ShipCountry,
'' as product
FROM orders
$srchObj = SearchClause::getSearchObject("orders");
$value = $srchObj->getFieldValue("product");
In this event we do a subquery to find all orders that contain the product in question.
© 2018 Xlinesoft
Advanced topics 438
More information:
About Search API
setSearchSQL
3.1.2.3 Email
Email selected records
To send an email with several selected records on the List page, you need to create custom
button.
Note: Change the values listed in red to match your specific needs.
2. Create the custom button Update selected and add the following code
$body = "";
while( $data = $button->getNextSelectedRecord() )
{
$body .= "OrderID: " . $data['OrderID'] . "\n";
$body .= "Customer: " . $data['CustomerID'] . "\n";
$body .= "Employee: " . $data['EmployeeID'] . "\n-----------\n\n";
}
The Client Before tab should be blank (delete sample code there if any).
© 2018 Xlinesoft
439 PHPRunner 10.0 Manual
OrderID: 10249
Customer: TRADH
Employee: 6
-------------------
OrderID: 10251
Customer: VICTE
Employee: 3
-------------------
OrderID: 10253
Customer: HANAR
Employee: 3
-------------------
Note: How to send email to the current logged user
Instead of the hardcoded email address you can send it to the current logged user. If you use
email address as a username use the following:
$email=$_SESSION["UserID"];
If email address is stored in another field of users table you need to save it to the session
variable in AfterSuccessfulLogin event:
$_SESSION["email"]=$data["email"];
$email=$_SESSION["email"];
Sometimes you need to send an email to selected users. Let's say one of the fields on a page
EmailField contains user email. The key field on the page is KeyColumn, table name -
TableName.
Subject and text of the email are hard-coded and determined directly in the event
© 2018 Xlinesoft
Advanced topics 440
Note: Change the values listed in red to match your specific needs.
2. Create the custom button (e.g. "Email selected") and add the following code
$emails = array();
The Client Before tab should be blank (delete sample code there if any).
Note: Change the values listed in red to match your specific needs.
© 2018 Xlinesoft
441 PHPRunner 10.0 Manual
2. Create the custom button (e.g. "Email selected"). Add the following code to the Client
Before tab tab when you are using Bootstrap layout:
proxy["emailUsers"] = false;
return true;
}
proxy["emailUsers"] = true;
proxy["emailFrom"] = $("#emailFrom", context).val();
proxy["emailBody"] = $("#emailBody", context).val();
proxy["emailSubject"] = $("#emailSubject",
context).val();
$('[id="' + ctrl.id + '"]').click();
e.preventDefault();
win.destroy();
});
$("#emailUsersCancel").on("click", function( e ) {
e.preventDefault();
win.destroy();
});
}
};
© 2018 Xlinesoft
Advanced topics 442
these records?') ) {
return false;
}
Runner.displayPopup( args );
return false;
Add the following code to the Client Before tab tab when you are using simple non-
Bootstrap layout:
proxy["emailUsers"] = false;
return true;
}
win._obj.addButton({
label : Runner.lang.constants.TEXT_SAVE,
name : "saveButton",
template: "<a />",
classNames : "rnr-button main",
section: Runner.Y.WidgetStdMod.FOOTER,
action : function (e) {
var context = win._obj.bodyNode.getDOMNode();
proxy["emailUsers"] = true;
proxy["emailFrom"] = $("#emailFrom",
context).val();
proxy["emailBody"] = $("#emailBody",
context).val();
proxy["emailSubject"] = $("#emailSubject",
context).val();
$('[id="' + ctrl.id + '"]').click();
© 2018 Xlinesoft
443 PHPRunner 10.0 Manual
e.preventDefault();
win.destroy();
}
});
win._obj.addButton({
label : Runner.lang.constants.TEXT_CANCEL,
template: "<a />",
classNames : "rnr-button",
section: Runner.Y.WidgetStdMod.FOOTER,
action : function (e) {
e.preventDefault();
win.destroy();
}
});
}
};
Runner.displayPopup( args );
return false;
© 2018 Xlinesoft
Advanced topics 444
After selecting record(s) on the List page and clicking the "Email selected" button, you will
see a popup window where you can enter From, Subject and Body parameters of your
letter. Click "Save" button to send an email to selected user(s).
Note: Change the values listed in red to match your specific needs.
To send an email with new data to email addresses from user table use the following code in
one of the following events:
© 2018 Xlinesoft
445 PHPRunner 10.0 Manual
Note: Change the values listed in red to match your specific needs.
global $dal;
//select emails from Users table
$tblUsers = $dal->Table("UsersTableName");
$rs = $tblUsers->QueryAll();
while ($data = db_fetch_array($rs))
{
$email=$data["EmailAddress"];
$from="[email protected]";
$msg="Check what's hot this season";
$subject="Monthly newsletter";
$ret=runner_mail(array('to' => $email, 'subject' => $subject,
'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"]."<br>";
}
For more information about using Data Access Layer (DAL), see Data Access Layer.
Note: Change the values listed in red to match your specific needs.
Please note that attachments will only work when you selected "Use custom mailer server
settings" under "Email settings".
$email= "[email protected]" ;
$msg="File Attached";
$subject="Attached some files";
© 2018 Xlinesoft
Advanced topics 446
3.1.2.4 Upload
Rename uploaded files
Each uploaded to the disk file has two names: display name, that you can see on the site, and
physical file name on the disk. Let's study how to rename both display and physical file names.
Use the following code in Add page: Before record added and/or Edit page: Before record
updated events.
Note: Change the values listed in red to match your specific needs.
This code snippet changes the file names to the LastName field values.
// rename files
for($i = 0; $i < count($fileArray); $i++)
{
$fileName = $fileArray[$i]["name"];
$newFileName = "files/".$values["LastName"].$i.".jpg";
rename($fileName, getabspath($newFileName));
$fileArray[$i]["name"] = $newFileName;
}
© 2018 Xlinesoft
447 PHPRunner 10.0 Manual
$values["fieldname"] = my_json_encode($fileArray);
3.1.2.5 Misc
Check if start date is earlier than end date
On the Edit page verify that the start date is earlier than the end date. Use the following code
in the Edit page: Before record updated event.
Note: Change the values listed in red to match your specific needs.
Note: Change the values listed in red to match your specific needs.
global $dal;
$tblUsers = $dal->Table("UserTableName");
$rs = $tblUsers->Query("UserNameField='".$username."' and
PasswordField='".$password."'","");
$data = db_fetch_array($rs);
header("Location: tablename_edit.php?editid1=".$data["IDField"]);
exit();
For more information about using Data Access Layer (DAL), see Data Access Layer.
Restricting or allowing access by IP address is an easy task. Here are a few examples. This
code needs to be added to the beginning of AfterAppInit event. Please note that this tutorial
uses IPv4 addresses.
© 2018 Xlinesoft
Advanced topics 448
Note: Change the values listed in red to match your specific needs.
Then you can use $_SESSION["FirstName"] as default value of any field or in other events.
For example, at the end of day you need to enter several data records for each Employee. To
populate the Date and Employee fields with the most recent values, you need to complete the
following steps:
2. Create an AfterAdd event and use the following code to save Date and Employee values in
Session variables:
$_SESSION["Date"] = $values["Date"];
$_SESSION["Employee"] = $values["Employee"];
© 2018 Xlinesoft
449 PHPRunner 10.0 Manual
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
Before login
Description
Function BeforeLogin is executed on the login page before verifying username and
password.
Syntax
BeforeLogin($username,$password,$message,$pageObject)
Arguments
$message - if the function return false, place the message to be displayed into this
variable.
© 2018 Xlinesoft
Advanced topics 450
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
Applies to pages
Login
Description
Syntax
AfterSuccessfulLogin($username,$password,$data)
Arguments
$data - array with existing user record in the login table. Access fields by
$data["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$data["PlayerId"]. Note that $data["playerid"] or $data["PlayerID"] will not work.
In case of Active Directory based security data array contains attributes from user
record in AD. For instance, this is how you can retrieve user's email and store it in a
session variable:
© 2018 Xlinesoft
451 PHPRunner 10.0 Manual
$_SESSION["UserEmail"]=$data["email"];
Applies to pages
Login
Syntax
AfterUnsuccessfulLogin($username,$password,$message,$pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
Login
© 2018 Xlinesoft
Advanced topics 452
After Logout
Description
This event handler will not be called if the user closes the browser or the sessions times
out.
Syntax
AfterLogout($username)
Arguments
Return value
no return value
Applies to pages
Login
See also
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$pageObject)
Arguments
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
© 2018 Xlinesoft
453 PHPRunner 10.0 Manual
List, Add, Print, Search, Export, Report, Chart, Login, Register, Password reminder,
Change password, Menu
Example
2. Switch to HTML mode and find the line {END container_recordcontrols}. Add the
following code right before it:
<DIV>{$new_variable}</DIV>
Note: Change the values listed in red to match your specific needs.
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
© 2018 Xlinesoft
Advanced topics 454
Examples
Description
© 2018 Xlinesoft
455 PHPRunner 10.0 Manual
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$pageObject)
Arguments
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, Add, Print, Search, Export, Report, Chart, Login, Register, Password reminder,
Change password, Menu
Example
© 2018 Xlinesoft
Advanced topics 456
2. Switch to HTML mode and find the line {END container_recordcontrols}. Add the
following code right before it:
<DIV>{$new_variable}</DIV>
Note: Change the values listed in red to match your specific needs.
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
Examples
© 2018 Xlinesoft
457 PHPRunner 10.0 Manual
Description
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
© 2018 Xlinesoft
Advanced topics 458
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
Before registration
Description
Syntax
BeforeRegister($userdata,$message,$pageObject)
Arguments
$userdata - array that stores values entered on Registration page. To access specific
field value use $userdata["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$userdata["PlayerId"]. Note that $userdata["playerid"] or $userdata["PlayerID"] will
not work.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
Applies to pages
Registration
© 2018 Xlinesoft
459 PHPRunner 10.0 Manual
Syntax
AfterSuccessfulRegistration($userdata,$pageObject)
Arguments
$userdata - array that stores values entered on Registration page. To access specific
field value use $userdata["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$userdata["PlayerId"]. Note that $userdata["playerid"] or $userdata["PlayerID"] will
not work.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
Registration
© 2018 Xlinesoft
Advanced topics 460
Syntax
AfterUnsuccessfulRegistration($userdata,$message,$pageObject)
Arguments
$userdata - array that stores values entered on Registration page. To access specific
field value use $userdata["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$userdata["PlayerId"]. Note that $userdata["playerid"] or $userdata["PlayerID"] will
not work.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
Registration
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$pageObject)
© 2018 Xlinesoft
461 PHPRunner 10.0 Manual
Arguments
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, Add, Print, Search, Export, Report, Chart, Login, Register, Password reminder,
Change password, Menu
Example
2. Switch to HTML mode and find the line {END container_recordcontrols}. Add the
following code right before it:
<DIV>{$new_variable}</DIV>
Note: Change the values listed in red to match your specific needs.
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
© 2018 Xlinesoft
Advanced topics 462
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
Examples
© 2018 Xlinesoft
463 PHPRunner 10.0 Manual
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
Description
Syntax
BeforeChangePassword($oldpassword,$newpassword,$pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
© 2018 Xlinesoft
Advanced topics 464
Applies to pages
Change Password
Syntax
AfterChangePassword($oldpassword,$newpassword,$pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
Change Password
© 2018 Xlinesoft
465 PHPRunner 10.0 Manual
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$pageObject)
Arguments
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, Add, Print, Search, Export, Report, Chart, Login, Register, Password reminder,
Change password, Menu
Example
2. Switch to HTML mode and find the line {END container_recordcontrols}. Add the
following code right before it:
<DIV>{$new_variable}</DIV>
Note: Change the values listed in red to match your specific needs.
© 2018 Xlinesoft
Advanced topics 466
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
Examples
© 2018 Xlinesoft
467 PHPRunner 10.0 Manual
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
© 2018 Xlinesoft
Advanced topics 468
Syntax
BeforeRemindPassword($username,$email,$pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
Applies to pages
Password Reminder
Description
Syntax
© 2018 Xlinesoft
469 PHPRunner 10.0 Manual
AfterRemindPassword($username,$email,$pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
Password Reminder
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$pageObject)
Arguments
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
© 2018 Xlinesoft
Advanced topics 470
List, Add, Print, Search, Export, Report, Chart, Login, Register, Password reminder,
Change password, Menu
Example
2. Switch to HTML mode and find the line {END container_recordcontrols}. Add the
following code right before it:
<DIV>{$new_variable}</DIV>
Note: Change the values listed in red to match your specific needs.
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
© 2018 Xlinesoft
471 PHPRunner 10.0 Manual
Examples
Description
Function AfterAppInit is executed in the beginning of each page before any processing
takes place. Use this event to override any global PHPRunner variables. See help area in
Event editor for the list of available global variables.
© 2018 Xlinesoft
Advanced topics 472
Note: It's not recommended to display anything on the web page from this event. This
may break your application.
Syntax
AfterAppInit()
Applies to pages
All pages.
Example
Lets say you need to troubleshoot your application displaying executed SQL query on the
top of the page. Usually you proceed to include/appsettings.php file and set $dDebug
variable to true though changing this variable back and forth is a little or no joy.
Using AfterAppInit event you can display debug info simply adding debug=true to the
URL.
AfterAppInit code:
if ($_REQUEST["debug"]=="true")
$dDebug=true;
Database connection is not yet open in this event. If you need to perform any database
operations open database connection manually.
Example:
$myconn=db_connect();
$rs=db_query("select * from users where session_id='" .
$_SESSION["sessionid"]. "'",$myconn);
$data=db_fetch_array($rs);
if($data)
{
$_SESSION["Avatar"] = $data["avatar"];
}
© 2018 Xlinesoft
473 PHPRunner 10.0 Manual
Description
Function ModifyMenuItem is executed for each Menu item before a page is displayed in
the browser. Use this event to modify or hide menu items.
Syntax
ModifyMenuItem($menuItem)
Arguments
Return value
Methods
· getLinkType() - get the link type. Link types are: Internal (link to a page generated
by PHPRunner, e.g. List, Print etc.), External (link to any external web page), None
(menu item is not a link, e.g. group or separator).
· getUrl() - get the URL of external link.
· setPageType($pType) - set the page type (List, Add, Search, Print, Report, Chart).
Applies to pages
All pages with Menu element. Insert your code into the Menu Item: Modify event.
© 2018 Xlinesoft
Advanced topics 474
if ($menuItem->getLinkType() == 'External')
{
$menuItem->setUrl('http://localhost/mn1/carsmodels_list.php');
}
else if($menuItem->getLinkType() == 'Internal')
{
$menuItem->setParams('id=30');
if ($menuItem->getTable() == 'carsmake')
{
$menuItem->setTable('carsmodels');
}
}
else
{
return false;
}
return true;
Hide some menu items based on the application users. If the menu item is the link to
internal application page, you can assign the table permissions. However, if the menu
item is an external link the permissions will have to be set in Menu Item: Modify event.
Display the record counter for each menu item. The code will validate if the menu item is
an internal table or view and will concatenate the number of records with the menu item
name.
© 2018 Xlinesoft
475 PHPRunner 10.0 Manual
Description
Syntax
OnAuditLog($action,$params,$table,$keys,$newvalues,$oldvalues)
Arguments
$oldvalues - Array of previous field values. Applies to the Edit and Delete functions.
Return value
© 2018 Xlinesoft
Advanced topics 476
Applies to pages
All pages. Insert your code into the Before audit log event.
Example
If you do not want to record actions done by the admin in the audit log, you can use the
following code:
return true;
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
© 2018 Xlinesoft
477 PHPRunner 10.0 Manual
Syntax
CopyOnLoad($values,$where,$pageObject)
Arguments
$values - array of values to be displayed on the page. You can modify the values of this
array. To access specific field value use $values["FieldName"]. Example: to clear the
PassportNumber field value before copying, use $values["PassportNumber"]="";.
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$where - WHERE clause that points to the record to be copied. Example: ID=19.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
Description
© 2018 Xlinesoft
Advanced topics 478
Function BeforeAdd is executed before a record is physically added to the database. Will
work in all add modes: Inline Add, Regular Add and Add page in popup.
Syntax
BeforeAdd($values,$message,$inline,$pageObject)
Arguments
$values - array of values to be written to the database. To access specific field value
use $values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$inline - equals to true when the Inline Edit in process, false otherwise.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
Applies to pages
Select multiple values from checkboxes or a list field and have them appear as individual
database entries
© 2018 Xlinesoft
479 PHPRunner 10.0 Manual
Custom add
Description
Syntax
Arguments
$values - array of values to be written to the database. To access specific field value
use $values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$keys - array of key column values that point to the edited record. To access specific
key column use $keys["KeyFieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$keys["PlayerId"]. Note that $keys["playerid"] or $keys["PlayerID"] will not work.
$inline - equals to true when the Inline Add in process, false - otherwise.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
True: if you want the application to add the record for you.
Applies to
© 2018 Xlinesoft
Advanced topics 480
Example
Lets consider the situation when records are never added directly to the main table (e.g.
Cars). Instead, records are added to the temporary TempCars table and then moved to
the main Cars table once approved by admin. In this case the following code in
CustomAdd event will do the job:
global $dal;
$tblTempCars = $dal->Table("TempCars");
$tblTempCars->Value["make"]=$values["make"];
$tblTempCars->Value["model"]=$values["model"];
$tblTempCars->Value["yearOfMake"]=$values["yearOfMake"];
$tblTempCars->Add();
return false;
You may notice that BeforeAdd event does the similar job. The main difference is that
when you return false in BeforeAdd event this situation is considered as error and user
will understand that something went wrong. On the other side, returning false in
CustomAdd event is perfectly legitimate and application execution continues after that.
Description
Function AfterAdd is executed after a record is physically added to the database. Will
work in all add modes: Inline Add, Regular Add and Add page in popup.
Syntax
AfterAdd($values,$keys,$inline,$pageObject)
Arguments
$values - array of values to be written to the database. To access specific field value
use $values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
© 2018 Xlinesoft
481 PHPRunner 10.0 Manual
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$keys - array of key column values that point to the new record. To access specific key
column use $keys["KeyFieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$keys["PlayerId"]. Note that $keys["playerid"] or $keys["PlayerID"] will not work.
$inline - equals to true when the Inline Edit in process, false otherwise.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
If you need to display a message on the page or pass a variable value to JavaScript you need
to add the following to the end of your event code:
$pageObject->stopPRG = true;
A complete code example. Passing the value of true to JavaScript variable named "saved":
$pageObject->setProxyValue('saved', true);
$pageObject->stopPRG = true;
Applies to pages
Description
© 2018 Xlinesoft
Advanced topics 482
Syntax
ProcessValues<PageName>($values,$pageObject)
Arguments
$values - array of values to be displayed on the page. To access specific field value use
$values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
No return value.
Applies to pages
View, Edit
Example
$values["Comment"]="";
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$pageObject)
Arguments
© 2018 Xlinesoft
483 PHPRunner 10.0 Manual
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, Add, Print, Search, Export, Report, Chart, Login, Register, Password reminder,
Change password, Menu
Example
2. Switch to HTML mode and find the line {END container_recordcontrols}. Add the
following code right before it:
<DIV>{$new_variable}</DIV>
Note: Change the values listed in red to match your specific needs.
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
© 2018 Xlinesoft
Advanced topics 484
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
Examples
© 2018 Xlinesoft
485 PHPRunner 10.0 Manual
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
Description
Function BeforeEdit is executed before a data record is updated in the database. Will
work in all edit modes: Inline Edit, Regular Edit and Edit page in popup.
Syntax
BeforeEdit($values,$where,$oldvalues,$keys,$message,$inline,$pageObject)
Arguments
$values - array of values to be written to the database. To access specific field value
use $values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
© 2018 Xlinesoft
Advanced topics 486
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$where -WHERE clause that points to the edited record. Example: ID=19.
$oldvalues - array with existing field values. To access specific column value use
$oldvalues["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$oldvalues["PlayerId"]. Note that $oldvalues["playerid"] or $oldvalues["PlayerID"] will
not work.
If the field was assigned an alias in the SQL query, then the $oldvalues array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $oldvalues["Inv_Salesrep"].
$keys - array of key column values that point to the edited record. To access specific
key column use $keys["KeyFieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$keys["PlayerId"]. Note that $keys["playerid"] or $keys["PlayerID"] will not work.
$inline - equals to true when the Inline Edit in process, false otherwise.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
Applies to pages
© 2018 Xlinesoft
487 PHPRunner 10.0 Manual
Description
Syntax
Arguments
$values - array of values to be written to the database. To access specific field value
use $values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$where -WHERE clause that points to the edited record. Example: ID=19.
$oldvalues - array with existing field values. To access specific column value use
$oldvalues["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$oldvalues["PlayerId"]. Note that $oldvalues["playerid"] or $oldvalues["PlayerID"] will
not work.
If the field was assigned an alias in the SQL query, then the $oldvalues array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $oldvalues["Inv_Salesrep"].
$keys - array of key column values that point to the edited record. To access specific
key column use $keys["KeyFieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$keys["PlayerId"]. Note that $keys["playerid"] or $keys["PlayerID"] will not work.
© 2018 Xlinesoft
Advanced topics 488
$inline - equals to true when the Inline Edit in process, false otherwise.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
True: if you want the application to update the record for you.
Applies to
Example
Lets consider the situation when records are never edited directly in the main table (e.g.
Cars). Instead, records are added to the temporary TempCars table and then moved to
the main Cars table once approved by admin. In this case the following code in
CustomAdd event will do the job:
global $dal;
$tblTempCars = $dal->Table("TempCars");
$tblTempCars->Value["make"]=$values["make"];
$tblTempCars->Value["model"]=$values["model"];
$tblTempCars->Value["yearOfMake"]=$values["yearOfMake"];
$tblTempCars->Add();
return false;
Description
Syntax
ProcessValues<PageName>($values,$pageObject)
Arguments
© 2018 Xlinesoft
489 PHPRunner 10.0 Manual
$values - array of values to be displayed on the page. To access specific field value use
$values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
No return value.
Applies to pages
View, Edit
Example
$values["Comment"]="";
Description
Function AfterEdit is executed after a data record was updated in the database. Will
work in all edit modes: Inline Edit, Regular Edit and Edit page in popup.
Syntax
AfterEdit($values,$where,$oldvalues,$keys,$inline,$pageObject)
Arguments
$values - array of values to be written to the database. To access specific field value
use $values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
© 2018 Xlinesoft
Advanced topics 490
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$where -WHERE clause that points to the edited record. Example: ID=19.
$oldvalues - array with existing field values. To access specific column value use
$oldvalues["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$oldvalues["PlayerId"]. Note that $oldvalues["playerid"] or $oldvalues["PlayerID"] will
not work.
If the field was assigned an alias in the SQL query, then the $oldvalues array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $oldvalues["Inv_Salesrep"].
$keys - array of key column values that point to the edited record. To access specific
key column use $keys["KeyFieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$keys["PlayerId"]. Note that $keys["playerid"] or $keys["PlayerID"] will not work.
$inline - equals to true when the Inline Edit in process, false otherwise.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
If you need to display a message on the page or pass a variable value to JavaScript you need
to add the following to the end of your event code:
$pageObject->stopPRG = true;
A complete code example. Passing the value of true to JavaScript variable named "saved":
$pageObject->setProxyValue('saved', true);
$pageObject->stopPRG = true;
Applies to pages
© 2018 Xlinesoft
491 PHPRunner 10.0 Manual
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$values,$pageObject)
Arguments
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$values - array of displayed record contents. You can read and write to the array. To
access specific field value use $values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
View, Edit
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
© 2018 Xlinesoft
Advanced topics 492
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
Examples
© 2018 Xlinesoft
493 PHPRunner 10.0 Manual
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
Description
Syntax
BeforeDelete($where,$deleted_values,$message,$pageObject)
Arguments
$where - WHERE clause that points to the record to be deleted. Example: ID=19.
© 2018 Xlinesoft
Advanced topics 494
$deleted_values - array with the field values from the record to be deleted. To access
specific field value use $deleted_values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$deleted_values["PlayerId"]. Note that $deleted_values["playerid"] or
$deleted_values["PlayerID"] will not work.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
Applies to pages
List
Syntax
AfterDelete($where,$deleted_values,$message,$pageObject)
Arguments
$where - WHERE clause that points to the record has been deleted. Example: ID=19.
$deleted_values - array with the field values from the record has been deleted. To
access specific field value use $deleted_values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$deleted_values["PlayerId"]. Note that $deleted_values["playerid"] or
$deleted_values["PlayerID"] will not work.
© 2018 Xlinesoft
495 PHPRunner 10.0 Manual
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List
Syntax
AfterMassDelete($records_deleted,$pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List
© 2018 Xlinesoft
Advanced topics 496
Syntax
BeforeProcessRow<PageName>($data,$pageObject)
Arguments
$data - array of field values of the record being processed. To access specific field value
use $data["FieldName"]. Note that you can read the $data array and also write to it
changing the values before showing them on the page.
Field names are case-sensitive. If the field name is PlayerId, you should use
$data["PlayerId"]. Note that $data["playerid"] or $data["PlayerID"] will not work.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
Applies to pages
List, Print
Description
© 2018 Xlinesoft
497 PHPRunner 10.0 Manual
Syntax
BeforeMoveNext<PageName>($data,$row,$record,$pageObject)
Arguments
$data - array of field values of the record being processed. To access specific field value
use $data["FieldName"]. Note that you can only read the $data array.
Field names are case-sensitive. If the field name is PlayerId, you should use
$data["PlayerId"]. Note that $data["playerid"] or $data["PlayerID"] will not work.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, Print
See also
· Conditional formatting
Description
Function BeforeQuery<PageName> is executed before SELECT SQL query is
processed. Use this event if you like to modify default SQL query, add a WHERE clause
etc.
Syntax
BeforeQuery<PageName>($strSQL,$strWhereClause,$strOrderBy,$pageObject)
© 2018 Xlinesoft
Advanced topics 498
Arguments
Applies to pages
List, Print, Export, Chart
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$pageObject)
Arguments
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, Add, Print, Search, Export, Report, Chart, Login, Register, Password reminder,
Change password, Menu
Example
2. Switch to HTML mode and find the line {END container_recordcontrols}. Add the
following code right before it:
<DIV>{$new_variable}</DIV>
© 2018 Xlinesoft
499 PHPRunner 10.0 Manual
Note: Change the values listed in red to match your specific needs.
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
Examples
© 2018 Xlinesoft
Advanced topics 500
Description
ListGetRowCount event is executed before List page is processed. Use this function
when your database doesn't support record count.
You need to use this event together with ListFetchArray and ListQuery events. Read
about it in this article How to display data returned by stored procedure
Syntax
ListGetRowCount($searchObj,$masterTable,$masterKeysReq,$selectedRecords,$
pageObject)
Arguments
© 2018 Xlinesoft
501 PHPRunner 10.0 Manual
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
Applies to pages
List, Print
Examples
return 10;
Custom Query
Description
ListQuery event is executed before List page is processed. Use this event when data set
is more complicated than result of SQL query.
Here is the article that shows how to use ListFetchArray and ListQuery events together:
How to display data returned by stored procedure
Syntax
ListQuery($searchObj,$orderBy,$howOrderBy,$masterTable,$masterKeysReq,$se
lectedRecord,$pageSize,$myPage,$pageObject)
Arguments
© 2018 Xlinesoft
Advanced topics 502
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
Applies to pages
List, Print
Function ListFetchArray fetches records from the given array and returns them as array.
Use this function in conjunction with Custom query function.
Here is the article that shows how to use ListFetchArray and ListQuery events together:
How to display data returned by stored procedure
Syntax
ListFetchArray($rs,$pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, Print
© 2018 Xlinesoft
503 PHPRunner 10.0 Manual
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$pageObject)
Arguments
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
© 2018 Xlinesoft
Advanced topics 504
Applies to pages
List, Add, Print, Search, Export, Report, Chart, Login, Register, Password reminder,
Change password, Menu
Example
2. Switch to HTML mode and find the line {END container_recordcontrols}. Add the
following code right before it:
<DIV>{$new_variable}</DIV>
Note: Change the values listed in red to match your specific needs.
Description
Function BeforeQuery<PageName> is executed before SELECT SQL query is
processed. Use this event if you like to modify default SQL query, add a WHERE clause
etc.
Syntax
BeforeQuery<PageName>($strSQL,$strWhereClause,$strOrderBy,$pageObject)
Arguments
© 2018 Xlinesoft
505 PHPRunner 10.0 Manual
Applies to pages
List, Print, Export, Chart
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
Examples
© 2018 Xlinesoft
Advanced topics 506
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
© 2018 Xlinesoft
507 PHPRunner 10.0 Manual
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$pageObject)
Arguments
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, Add, Print, Search, Export, Report, Chart, Login, Register, Password reminder,
Change password, Menu
Example
2. Switch to HTML mode and find the line {END container_recordcontrols}. Add the
following code right before it:
<DIV>{$new_variable}</DIV>
Note: Change the values listed in red to match your specific needs.
© 2018 Xlinesoft
Advanced topics 508
BeforeQuery<PageName>($strSQL,$strWhereClause,$strOrderBy,$pageObject)
Arguments
Applies to pages
List, Print, Export, Chart
ChartModify
Quick jump
Add horizontal scroller Customize chart title
Add horizontal scroller and set initial zoom to 50% Values formatting
Change labels color and font size Multiple Y-axis
Series appearance Adding range markers
Change colors in pie/doughnut chart Create two series chart with two Y-Axis
Description
Function ChartModify occurs before chart is displayed. Use this event to modify chart
settings.
Syntax
ChartModify(chart,proxy,pageObj)
Arguments
© 2018 Xlinesoft
509 PHPRunner 10.0 Manual
$pageObject->setProxyValue("name", $_SESSION["UserID"]);
alert(proxy.name);
Applies to pages
Chart
Below are a few examples of how you can use ChartModify event.
© 2018 Xlinesoft
Advanced topics 510
Using separate API calls to set series color and font size:
© 2018 Xlinesoft
511 PHPRunner 10.0 Manual
Single color:
Gradient fill:
chart.title().fontColor("#FF0000");
© 2018 Xlinesoft
Advanced topics 512
Disable title:
chart.title(false);
Formatting values as currency. You can use any Javascript code to format values.
Here is how to add an extra Y-axis on the right ranging from 100 to 500 with ticks after each 25
points:
© 2018 Xlinesoft
513 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Advanced topics 514
More info:
http://playground.anychart.com/docs/7.13.0/samples/AGST_Range_Marker_04-plain
© 2018 Xlinesoft
515 PHPRunner 10.0 Manual
If your pie chart has more slices than colors you specify colors will be repeated.
Example 10. How to create two series chart with two Y-Axis.
An example of two series chart with two Y-Axis. The idea is to choose scales the
way that makes both series clearly visible.
© 2018 Xlinesoft
Advanced topics 516
series2.yScale(extraYScale);
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
© 2018 Xlinesoft
517 PHPRunner 10.0 Manual
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
Examples
Description
© 2018 Xlinesoft
Advanced topics 518
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
Description
Syntax
BeforeProcessRow<PageName>($data,$pageObject)
Arguments
$data - array of field values of the record being processed. To access specific field value
use $data["FieldName"]. Note that you can read the $data array and also write to it
changing the values before showing them on the page.
Field names are case-sensitive. If the field name is PlayerId, you should use
$data["PlayerId"]. Note that $data["playerid"] or $data["PlayerID"] will not work.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
© 2018 Xlinesoft
519 PHPRunner 10.0 Manual
Applies to pages
List, Print
Description
Syntax
BeforeMoveNext<PageName>($data,$row,$record,$pageObject)
Arguments
$data - array of field values of the record being processed. To access specific field value
use $data["FieldName"]. Note that you can only read the $data array.
Field names are case-sensitive. If the field name is PlayerId, you should use
$data["PlayerId"]. Note that $data["playerid"] or $data["PlayerID"] will not work.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, Print
© 2018 Xlinesoft
Advanced topics 520
See also
· Conditional formatting
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$pageObject)
Arguments
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, Add, Print, Search, Export, Report, Chart, Login, Register, Password reminder,
Change password, Menu
Example
2. Switch to HTML mode and find the line {END container_recordcontrols}. Add the
following code right before it:
© 2018 Xlinesoft
521 PHPRunner 10.0 Manual
<DIV>{$new_variable}</DIV>
Note: Change the values listed in red to match your specific needs.
BeforeQuery<PageName>($strSQL,$strWhereClause,$strOrderBy,$pageObject)
Arguments
Applies to pages
List, Print, Export, Chart
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
© 2018 Xlinesoft
Advanced topics 522
Arguments
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
Examples
© 2018 Xlinesoft
523 PHPRunner 10.0 Manual
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
Description
Syntax
ProcessValues<PageName>($values,$pageObject)
Arguments
$values - array of values to be displayed on the page. To access specific field value use
$values["FieldName"].
© 2018 Xlinesoft
Advanced topics 524
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
No return value.
Applies to pages
View, Edit
Example
$values["Comment"]="";
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$values,$pageObject)
Arguments
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$values - array of displayed record contents. You can read and write to the array. To
access specific field value use $values["FieldName"].
© 2018 Xlinesoft
525 PHPRunner 10.0 Manual
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
View, Edit
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
Examples
© 2018 Xlinesoft
Advanced topics 526
Description
Syntax
BeforeProcess<PageName>($pageObject)
© 2018 Xlinesoft
527 PHPRunner 10.0 Manual
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
Before display
Description
Syntax
BeforeShow<PageName>($xt,$templatefile,$pageObject)
Arguments
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, Add, Print, Search, Export, Report, Chart, Login, Register, Password reminder,
Change password, Menu
Example
2. Switch to HTML mode and find the line {END container_recordcontrols}. Add the
following code right before it:
© 2018 Xlinesoft
Advanced topics 528
<DIV>{$new_variable}</DIV>
Note: Change the values listed in red to match your specific needs.
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
Examples
© 2018 Xlinesoft
529 PHPRunner 10.0 Manual
Description
Syntax
BeforeImport($pageObject, $message)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
$message - this message will be displayed on the page if import were cancelled
Applies to pages
Import
© 2018 Xlinesoft
Advanced topics 530
Description
Function BeforeInsert is executed before a record is inserted. Use this event to modify
the record before it is inserted.
Syntax
Arguments
$values - array of values to be written to the database. To access specific field value
use $values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
$message - this message will be added to the Import Log if record wasn't imported
Return value
Applies to pages
Import
© 2018 Xlinesoft
531 PHPRunner 10.0 Manual
Syntax
AfterImport($count,$skipCount,$pageObject)
Arguments
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
Import
Before process
Description
Syntax
BeforeProcess<PageName>($pageObject)
Arguments
© 2018 Xlinesoft
Advanced topics 532
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password, Menu
JavaScript OnLoad
Description
Function OnPageLoad occurs after page is displayed in browser. Use this event to work
with the "edit" controls using the Javascript API.
Syntax
OnPageLoad(pageObj,pageid,proxy,inlineRow)
Arguments
inlineRow - InlineRow object available in Add/Edit page events in the inline mode.
Applies to pages
List, View, Add, Edit, Print, Search, Export, Report, Chart, Login, Register, Password
reminder, Change password
Examples
© 2018 Xlinesoft
533 PHPRunner 10.0 Manual
Description
Function BeforeOut is executed before a record is exported. Use this event to modify
the record before it is exported.
Syntax
BeforeOut($data,$values,$pageObject)
Arguments
Field names are case-sensitive. If the field name is PlayerId, you should use
$data["PlayerId"]. Note that $data["playerid"] or $data["PlayerID"] will not work.
$values - Out Data. Array of values to be written to the database. To access specific
field value use $values["FieldName"].
© 2018 Xlinesoft
Advanced topics 534
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$pageObject - an object representing the current page. For more information, see
RunnerPage class.
Return value
Applies to pages
Export
Description
Function AfterTableInit is executed in the beginning of each page before any processing
takes place, right after AfterAppInit. Use this event to override any table-specific
PHPRunner variables. See help area in Event editor for the list of available table variables.
Note: It's not recommended to display anything on the web page from this event. This
may break your application.
Syntax
AfterTableInit()
Applies to pages
All table specific pages like List, Print, Edit, Add, Export etc.
Example
© 2018 Xlinesoft
535 PHPRunner 10.0 Manual
$tdata<tableName>[".pageSize"] = 10;
Add a field name to the end of SELECT clause of the current SQL query
Remove a field name from the SELECT clause of the current SQL query
Replace field name in the SELECT clause of the current SQL query with new one
Description
Function GetTablePermissions occurs after table initialized. Use this event to return an
access mask for the table:
A - Add;
D - Delete;
E - Edit;
S - List/View/Search;
P - Print/Export;
I - Import;
Syntax
GetTablePermissions($permissions)
Arguments
$permissions - string containing the permissions calculated for a given user and table.
Return value
$permissions - string containing the permissions calculated for a given user and table.
© 2018 Xlinesoft
Advanced topics 536
Applies to pages
All table specific pages like List, Print, Edit, List, Add, Export etc.
Example
return $permissions;
Description
Function IsRecordEditable occurs after table initialized. Use this event to implement
custom edit permissions. This event is executed once for each record on the List page as
well as on the Edit page. This event will be also called before record is deleted.
Syntax
IsRecordEditable($values,$isEditable)
Arguments
$values - array of values to be written to the database. To access specific field value
use $values["FieldName"].
Field names are case-sensitive. If the field name is PlayerId, you should use
$values["PlayerId"]. Note that $values["playerid"] or $values["PlayerID"] will not
work.
If the field was assigned an alias in the SQL query, then the $values array will get
the alias instead of field name from the database. E.g. if you have SQL query select
salesrep_id AS Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
Return value
© 2018 Xlinesoft
537 PHPRunner 10.0 Manual
Applies to pages
List, Edit
Example 1
Example 2
if ($values["ID"] & 1)
return false;
else
return true;
Quick jump
When a PHPRunner-generated page runs, the page goes through a life cycle in which it performs a
series of processing steps. These include initialization, retrieving data, instantiating controls and
rendering. It is important to understand the page life cycle so that you can write code at the
appropriate life-cycle stage for the effect you intend.
Global Events
AfterAppInit Occurs in the beginning of each page before any processing takes
place. Use this event to override any global PHPRunner variables. See
help area in Event editor for the list of available global variables.
© 2018 Xlinesoft
Advanced topics 538
AfterTableInit Occurs in the beginning of each page before any processing takes
place, right after AfterAppInit. Use this event to override any table-
specific PHPRunner variables. See help area in Event editor for the list
of available table variables.
ModifyMenuItem This event will be executed for each Menu item before a page is
displayed in the browser. Use this event to modify or hide menu items.
List/Print pages
BeforeProcessList Occurs when page processing starts and database connection is
BeforeProcessPrint established.
Use this event for the following:
- change database connection to point to another database
- read request data and populate session variables
- redirect to another page
BeforeDelete This event will be executed once for each record to be deleted.
Use this event for the following:
- prevent a record from being deleted
- save deleted record in another table
BeforeProcessRowList Occurs after database record is retrieved from the database before
BeforeProcessRowPrint formatting is applied.
Use this event for the following:
- modify value of any column
- prevent certain records from being displayed on the page
- calculate/display your own totals and subtotals
BeforeMoveNextList Occurs after database record is retrieved from the database and
BeforeMoveNextPrint formatting is applied.
Use this event for the following:
- display an empty row or a header between group of records.
- apply additional formatting to any column
© 2018 Xlinesoft
539 PHPRunner 10.0 Manual
OnPageLoad Occurs after page is displayed in browser. Use this event to work with
the "edit" controls using the Javascript API.
Edit/Add pages
BeforeProcessEdit Occurs after page is processed and ready to be displayed in the
BeforeProcessAdd browser.
Use this event for the following:
- define a new template variable or change the value of existing one
- display different template
BeforeEdit Occurs before new data is written to the database. Will work in all
BeforeAdd add/edit modes: Inline Add/Edit, Regular Add/Edit and Add/Edit page in
popup.
Use this event for the following:
- prevent data record from being added or edited
- send an email
- save old record in another table
- add a record to the log table
AfterEdit Occurs after data was written to the database. Will work in all add/edit
AfterAdd modes: Inline Add/Edit, Regular Add/Edit and Add/Edit page in popup.
Use this event for the following:
- send an email
- add a record to the log table
OnPageLoad Occurs after page is displayed in browser. Use this event to work with
the "edit" controls using the Javascript API.
Login/Registration pages
BeforeProcessLogin Occurs after page is processed and ready to be displayed in the
BeforeProcessRegister browser.
© 2018 Xlinesoft
Advanced topics 540
BeforeLogin Occurs before user logs in or new user data is written to the database.
BeforeRegister Use this event for the following:
- prevent user from being logged in or registered
- send an email
- add a record to the log table
OnPageLoad Occurs after page is displayed in browser. Use this event to work with
the "edit" controls using the Javascript API.
View/Search/Report/Chart pages
BeforeProcess<PageNam Occurs after page is processed and ready to be displayed in the
e> browser.
Use this event for the following:
- define a new template variable or change the value of existing one
- display different template
© 2018 Xlinesoft
541 PHPRunner 10.0 Manual
OnPageLoad Occurs after page is displayed in browser. Use this event to work with
the "edit" controls using the Javascript API.
Import page
BeforeImport This event is executed before import is started.
BeforeInsert Occurs before a record is inserted. Use this event to modify the record
before it is inserted.
$pageObject - an object of RunnerPage class that represents a current page. For more
information, see RunnerPage class.
Example:
Example:
If the field was assigned an alias in the SQL query, then the $values array will get the alias
instead of field name from the database. E.g. if you have SQL query select salesrep_id AS
Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
Example:
© 2018 Xlinesoft
Advanced topics 542
echo $keys["ID"];
$xt - template engine object. Use $xt->assign($name, $val) to assign a value $val to the
variable $name.
Example:
Field events option allows to perform an action when cursor enters edit field or leaves it or mouse
is over a field. Perform any sort of validation, make other fields hidden or required etc. Designed to
work on Add, Edit and Register pages.
For example, the editing event is fired when an element changes its value. Text fields fire this event
while user entering the text.
© 2018 Xlinesoft
543 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Advanced topics 544
We have two tables: categories and sub_categories. CategoryID is a two-digit category code.
In sub_categories table SubID consists of two-digit category code and and two-digit subcategory
code.
What we need to do is to simplify adding a large number of subcategories. When user types in first
two digit (category) we want to show category name underneath and also calculate the next
subcategory number. We will do that using field events.
Code
© 2018 Xlinesoft
545 PHPRunner 10.0 Manual
First we need to create Field Event for SubID field. We will use 'editing' event here which will be
called every time the content of field is changed.
ClientBefore:
In ClientBefore code we check the length of entered code and only send it to server side when
code is two digits long.
Server:
© 2018 Xlinesoft
Advanced topics 546
On Server side we pull CategoryName from categories table and also calculate next subcategory ID.
We pass both category name and new subcategory code back to ClientAfter event.
ClientAfter:
$("#sub_tip").remove();
$("input[id=value_SubID_1]").after("<div id='sub_tip' style='margin-top: 10px;
color: blue;'>"+result["catName"]+"</div>");
ctrl.setValue(result["newCat"]);
In this event we remove previous tooltip with category name and add a new one. We also make it
appear in blue color. Then we set the value of SubID with new subcategory code we received from
the Server event.
See also:
3.2.1 Buttons
3.2.1.1 Button object
Button object
The $button object is used in the OnServer event (Server tab) of the inserted into the
grid buttons. See Inserting button.
Methods
Method Description
© 2018 Xlinesoft
547 PHPRunner 10.0 Manual
Methods
getCurrentRecord
Gets the current record.
Syntax
getCurrentRecord()
Arguments
No arguments.
Return value
If the button is inserted in the grid on the List page or on the Edit/View page, it returns
an associative array (field name => value). Otherwise it returns false.
Example
Let's assume we have a button on the Classified Ad View page, which allows writing a
letter to the person who posted the announcement. The page from which the message
will be sent is reply_add.php and we need to pass the email parameter to this page.
OnServer event:
$record = $button->getCurrentRecord();
$result["email"]=$record["email"];
ClientAfter event:
location.href='reply_add.php?email='+result["email"];
getNextSelectedRecord
Returns associative arrays with values of the records selected on List page (marked with
checkboxes). If nothing is selected or all selected records are processed, returns false.
It is available to any buttons on the List page.
Syntax
© 2018 Xlinesoft
Advanced topics 548
getNextSelectedRecord()
Arguments
No arguments.
Return value
Returns associative arrays with values of the records selected on List page (marked with
checkboxes). If nothing is selected or all selected records are processed, returns false.
It is available to any buttons on the List page.
Example
while($record = $button->getNextSelectedRecord())
{
$message = "Dear ".$record["FirstName"];
runner_mail(array('to' => $record["email"], 'subject' => "Greetings",
'body' => $message));
}
After you inserted button to a datagrid, you can use rowData object to manipulate records.
rowData object is available in OnBefore event (Client Before tab) and OnAfter event (Client
After tab) of the inserted button and on Edit/View pages. See Inserting button.
rowData.fields - object, where index is the field name and value - JQuery container object
that contains the field.
alert(rowData.fields['ID'].html());
© 2018 Xlinesoft
549 PHPRunner 10.0 Manual
rowData.id - ID of the record. If you are running Inline Edit, you can use the
Runner.getControl function.
Example:
Each table in DAL is presented as PHP class, all fields are PHP variables declared in this class.
Variables/Arrays
Variable/Array Description
global $dal;
© 2018 Xlinesoft
Advanced topics 550
$tblCars = $dal->Table("Cars");
$tblCars->Value["Make"]="Volvo";
global $dal;
$tblCars = $dal->Table("Cars");
$tblCars->Make="Volvo";
global $dal;
Param["FieldName"] $tblUsers = $dal->Table("UsersTable");
$tblUsers->Param["FirstName"]="Bob";
$tblUsers->Value["FirstName"]="Jim";
$tblUsers->Update();
Methods
Method Description
© 2018 Xlinesoft
551 PHPRunner 10.0 Manual
Examples
See also
In Enterprise Edition of PHPRunner you can use multiple database connections in a single
project. This article explains how you can access data from multiple databases in your events.
© 2018 Xlinesoft
Advanced topics 552
1. Finds first matching table by it's name in all connections, starting with the primary
connection.
global $dal;
$dal->Table("table")
2. Schema name helps to identify tables with identical names located in different schemas in
databases like Oracle, Postgre and SQL Server.
global $dal;
$dal->Table("table","schema")
3. Here schema name can be left empty. Last parameter is the connection name as it appears
on Datasource tables screen.
global $dal;
$dal->Table("table","schema","connection")
global $dal;
$table = $dal->Table("cars", "", "cars at localhost");
© 2018 Xlinesoft
553 PHPRunner 10.0 Manual
$rs = $table->QueryAll();
while ($data = db_fetch_array($rs)) {
echo $data["Make"].
", ".$data["Model"].
"<br>";
}
global $cman;
$cman->byName("cars at localhost")->exec("update carscars set
yearofmake=2002 where make='Audi'");
global $cman;
$connection = $cman->byName("cars at localhost");
$rs = $connection->query("select count(*) as c from cars where make='Audi'
");
$data = $rs->fetchAssoc();
echo "Number of Audi cars listed: ".$data["c"];
3.2.2.3 Methods
Add
Inserts new record into the database. This function is deprecated and we recommend use
DB:Insert() function from Database API.
Syntax
Add()
Arguments
No arguments.
Return value
No return value.
Example
global $dal;
© 2018 Xlinesoft
Advanced topics 554
$tblEvents = $dal->Table("EventsTable");
$tblEvents->Value["event"]="First event";
$tblEvents->Value["public"]="yes";
$tblEvents->Add();
See also
· Method: Delete
CustomQuery
Runs custom SQL query. This function is deprecated and we recommend use DB:Query()
function from Database API.
Syntax
CustomQuery($sql)
Arguments
Return value
Example 1
Example 2
See also
© 2018 Xlinesoft
555 PHPRunner 10.0 Manual
· Method: Query
· Method: QueryAll
Delete
Deletes one or more records from the database.This function is deprecated and we
recommend use DB:Delete() function from Database API.
Syntax
Delete()
Arguments
No arguments.
Return value
No return value.
Example 1
global $dal;
$tblUsers = $dal->Table("UsersTable");
$tblUsers->Param["ID"]=32;
$tblUsers->Delete();
Example 2
global $dal;
$tblUsers = $dal->Table("UsersTable");
$tblUsers->Param["FirstName"]="Bob";
$tblUsers->Param["Email"]="[email protected]";
$tblUsers->Delete();
See also
© 2018 Xlinesoft
Advanced topics 556
· Method: Add
DBLookup
Executes an SQL query passed as a parameter and returns the first value of the first
entry or null if nothing is found.
Syntax
DBLookup($sql)
Arguments
Return value
Returns the first value of the first entry or null if nothing is found.
Example
FetchByID
Selects one or more records from the database matching the condition. This function is
deprecated and we recommend use DB:Select() function from Database API.
Syntax
FetchByID()
Arguments
No arguments.
Return value
Example
Select all records where ID is '32'. To fetch a returned row as an associative array use
db_fetch_array function.
global $dal;
$tblUsers = $dal->Table("UsersTable");
$tblUsers->Param["ID"]=32;
$rs = $tblUsers->FetchByID();
© 2018 Xlinesoft
557 PHPRunner 10.0 Manual
Query
Selects records from the database sorting data by the orderby field or fields and return
the recordset. This function is deprecated and we recommend use DB:Query() function
from Database API.
Syntax
Query(where, orderby)
Arguments
Return value
Example 1
Select all records where name contains 'Jim'. To fetch a returned row as an associative
array use db_fetch_array function.
global $dal;
$tblUsers = $dal->Table("UsersTable");
$rs = $tblUsers->Query("Name like '%Jim%'","Email DESC");
while( $data = db_fetch_array($rs) )
{
echo $data["fieldName"]."<br>";
}
select * from UsersTable where Name like '%Jim%' order by Email DESC
Example 2
Select and print all orders for John Sample. To fetch a returned row as an associative
array use db_fetch_array function.
© 2018 Xlinesoft
Advanced topics 558
global $dal;
$tblOrders = $dal->Table("OrdersTable");
$rs = $tblOrders->Query("Customer='John Sample'","OrderID DESC");
while ($data = db_fetch_array($rs))
{
echo "Order ".$data["OrderID"]." was placed ".$data["OrderDate"]." by
".$data["Customer"]."<br>";
}
See also
· Method: QueryAll
· Method: CustomQuery
QueryAll
Selects all records from the table. This function is deprecated and we recommend use
DB:Query() function from Database API.
Syntax
QueryAll()
Arguments
No arguments.
Return value
Example
global $dal;
//select emails from Users table
© 2018 Xlinesoft
559 PHPRunner 10.0 Manual
$tblUsers = $dal->Table("UsersTableName");
$rs = $tblUsers->QueryAll();
while ($data = db_fetch_array($rs))
{
$email.=$data["EmailAddress"].", ";
$from="[email protected]";
$msg="Check what's hot this season";
$subject="Monthly newsletter";
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' =>
$msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"]."<br>";
}
See also
· Method: Query
· Method: CustomQuery
TableName
Returns the table name. This function is used for complex query with calculated fields or
joined tables. This function is deprecated.
Syntax
TableName()
Arguments
No arguments.
Return value
Example
global $dal;
$tblProducts = $dal->Table("Products");
$sql = "select sum(UnitsInStock) as total, concat(Category,' ',
ProductName) as FullProductName from ";
$sql .= $tblProducts->TableName() . " group by country";
See also
· Method: UsersTableName
© 2018 Xlinesoft
Advanced topics 560
Update
Updates one or more records in the database. This function is deprecated and we
recommend use DB:Exec() function from Database API.
Syntax
Update()
Arguments
No arguments.
Return value
No return value.
Example
Update record where ID is 32 making FirstName field value 'Jim' and LastName field
value 'Morrison':
global $dal;
$tblUsers = $dal->Table("UsersTable");
$tblUsers->Param["ID"]=32;
$tblUsers->Value["FirstName"]="Jim";
$tblUsers->Value["LastName"]="Morrison";
$tblUsers->Update();
See also
UsersTableName
Returns properly formatted login table name. This function is deprecated and we
recommend using Security API
Syntax
UsersTableName()
Arguments
No arguments.
Return value
© 2018 Xlinesoft
561 PHPRunner 10.0 Manual
Example
See also
· Method: TableName
whereAdd
Adds new AND condition to the existing WHERE clause. This function is deprecated and
we recommend using Dynamic SQL query.
Syntax
whereAdd($where, $condition)
Arguments
Return value
See also
Database API functions similarly to the Data Access Layer (DAL) but is more convenient
to use and can work with multiple connections. We would recommend using Database
API, but DAL will work as well.
Methods
Method Description
© 2018 Xlinesoft
Advanced topics 562
3.2.3.2 Methods
SetConnection
Sets the current database connection. Recommended for use when working with multiple
database connections.
All consequent API calls made via DB:: functions will be executed via this connection.
When working with the default (primary) connection the call of this function is not
required.
Syntax
DB::SetConnection(name)
Arguments
Return value
No return value.
Example
// execute query
DB::Exec("update orders set Status='shipped' where OrderDate=CURDATE()");
© 2018 Xlinesoft
563 PHPRunner 10.0 Manual
See also
· DB::Exec(SQL)
Exec
Executes SQL query using current active connection.
Syntax
DB::Exec(SQL)
Arguments
SQL - query
Return value
Example
DB::Exec("insert into orders (Name, Amount, OrderDate) values ('Jonh Smith', 128.12, CURD
Query
Syntax
DB::Query(SQL)
Arguments
SQL - query
Return value
QueryResult object.
Example
© 2018 Xlinesoft
Advanced topics 564
LastId
Returns the last inserted autoincremented field value in the current connection.
Syntax
DB::LastId()
Arguments
no arguments
Return value
LastError
Returns the last error message in the current connection.
Syntax
DB::LastError()
Arguments
no arguments required
Return value
Insert
Inserts a record into a database.
© 2018 Xlinesoft
565 PHPRunner 10.0 Manual
Syntax
DB::Insert($table, array(field=>value))
Arguments
Return value
No return value.
Example
$data = array();
$data["make"] = "Toyota";
$data["model"] = "RAV4";
$data["price"] = 16000;
DB::Insert("cars", $data );
Delete
Deletes records from a database. The second parameter must be specified for the method
to be executed successfully.
Syntax
DB::Delete(table, array(field=>value))
DB::Delete(table, $where)
Arguments
array(field=>value) - array with values that define the condition of the delete query
Return value
No return value.
© 2018 Xlinesoft
Advanced topics 566
Example
$data = array();
$data["id"] = 50;
DB::Delete("cars", $data );
Alternative syntax
DB::Delete("cars", "id=50" );
Select
Retrieves data from the database.
Syntax
DB::Select(table, array(field=>value))
DB::Select(table, $where)
Arguments
array(field=>value) - array with values that define the condition of select query
Return value
Example 1
Retrieve all data from Cars table where the make is Toyota and the model is RAV4.
$data = array();
$data["make"] = "Toyota";
$data["model"] = "RAV4";
$rs = DB::Select("Cars", $data );
while( $record = $rs->fetchAssoc() )
{
© 2018 Xlinesoft
567 PHPRunner 10.0 Manual
echo $record["id"];
echo $record["make"];
}
Example 2
Retrieve all data from the table Cars where the price is less than 20,000.
PrepareSQL
This function prepares SQL query when you use SQL variables in it. SQL variables are
case-insensitive.
Read more about using SQL variables in SQL and Lookup wizards
Syntax
DB::prepareSQL(SQL)
Arguments
Return value
Example
· In “After Add” event you can use:
© 2018 Xlinesoft
Advanced topics 568
fetchAssoc()
Arguments
no arguments
Return value
Example
fetchNumeric
Syntax
fetchNumeric()
Arguments
no arguments
Return value
returns record as array with numeric keys:
0 => value, 1=>value;
Null, if there are no more records.
Example
© 2018 Xlinesoft
569 PHPRunner 10.0 Manual
echo $data[1];
}
value
This is an alternative way of working with the query. Covenient to use when the query returns
a single record.
Syntax
Arguments
fieldname or index
Return value
Value.
Example
This feature can be used anywhere where you use SQL Queries. With SQL variables you can
write cleaner code and easily implement custom dropdown boxes or advanced security. SQL
variables are case-insensitive.
· In Lookup Wizard WHERE clause. It can be used in dropdowns that are dependent on any
type of field, dependent on master dropdown, dependent with more complex rule than
equality (i.e. age is more than selected).
© 2018 Xlinesoft
Advanced topics 570
· In events by using prepareSQL function. For example, in “After Add” event you can use:
Grid Row Javascript API can be used to run Ajax event code on Click actions in the grid
row/field. It can be also used on the List page for the buttons inserted into the grid.
Methods
Method Description
row.setFieldValue() Field value set this way will not appear in the grid
and only applies to consequent getFieldValue calls.
© 2018 Xlinesoft
571 PHPRunner 10.0 Manual
See also
3.2.4.2 Methods
fieldCell
Returns jQuery object of table cell with this field.
Syntax
row.fieldCell(field);
Arguments
Return value
Example
row.fieldCell("make").css('background', 'red');
getFieldValue
Returns raw field value without formatting applied.
Syntax
row.getFieldValue(field);
Arguments
© 2018 Xlinesoft
Advanced topics 572
Return value
getFieldText
Returns field value with formatting applied. In other words returns HTML code of this
table cell.
Syntax
row.getFieldText(field);
Arguments
Return value
For instance, we have a Lookup Wizard field that has different Link field and Display field
selected. getFieldText(field) will return Display field value. getFieldValue(field) will return
Link field value.
setFieldText
Sets field's HTML as it appears in grid.
Syntax
row.setFieldText(field, text);
Arguments
Return value
No return value
setFieldValue
Sets the field value. Field value set this way will not appear in the grid and only applies
to consequent getFieldValue calls.
© 2018 Xlinesoft
573 PHPRunner 10.0 Manual
Syntax
row.setFieldValue(field, value);
Arguments
Return value
No return value.
Remarks
Field value set this way will not appear in the grid and only applies to consequent
getFieldValue calls.
record
Returns Jquery object representing table row.
Syntax
row.record()
Arguments
No arguments.
Return value
Example
row.record().css('background', 'red');
© 2018 Xlinesoft
Advanced topics 574
setMessage
Prints a message in one of row cells. Useful to debug/troubleshoot your click action
code.
Syntax
row.setMessage(str)
Arguments
Return value
No return value.
Example
getMessage
Syntax
row.getMessage()
Arguments
No arguments.
Return value
No return value.
Example
See also
© 2018 Xlinesoft
575 PHPRunner 10.0 Manual
· setMessage()
Javascript API allows you to work with the "edit" controls, manage search panel.
Javascript API objects are available in the Javascript OnLoad event of the appropriate
page.
Objects
Object Description
For example, use the following code to make the field red on the View page.
Examples
© 2018 Xlinesoft
Advanced topics 576
Control object allows you to work with the "edit" controls. Control object is available in
the Javascript OnLoad event of the appropriate page.
Before you start working with the "edit" controls, you need to get that controls. Use
.getControl() method to get controls by the field name and page id:
Example:
To get all the controls of the table, you need to pass only the table name as the
argument:
Example:
Methods
Method Description
© 2018 Xlinesoft
577 PHPRunner 10.0 Manual
clear() Sets "" as the control value and if the control was not
previously validated removes the message that it was
not validated.
Events
© 2018 Xlinesoft
Advanced topics 578
Examples
© 2018 Xlinesoft
579 PHPRunner 10.0 Manual
Methods
addClass
Adds the class to the control with a value.
Syntax
ctrl.addClass(className);
Arguments
Return value
No return value.
Example
See also
· Method: removeClass
addStyle
Adds the style to the control.
Syntax
ctrl.addStyle(style);
Arguments
Return value
No return value.
Example
© 2018 Xlinesoft
Advanced topics 580
addValidation
Syntax
ctrl.addValidation(validation_type);
Arguments
IsNumeric A number.
© 2018 Xlinesoft
581 PHPRunner 10.0 Manual
Return value
No return value.
Example 1
Example 2
See also
· Method: removeValidation
clear
Sets "" as the control value and if the control was not previously validated removes the
message that it was not validated.
Syntax
ctrl.clear();
© 2018 Xlinesoft
Advanced topics 582
Arguments
No arguments.
Return value
No return value.
Example
clearEvent
Deletes events.
Syntax
ctrl.clearEvent(event);
Arguments
Return value
No return value.
Example
See also
· Method: on
getDispElem
Returns jQuery object - the element (input, textarea, select etc.) that displays the value
of the selected field with the prefix value_ (e.g. value_Make for the field Make).
© 2018 Xlinesoft
583 PHPRunner 10.0 Manual
Syntax
ctrl.getDispElem();
Arguments
No arguments.
Return value
Example
getValue
Syntax
Arguments
No arguments.
Return value
Example1
Example2
Check box control hold the value of 'on' (checked off) and empty string if unchecked:
© 2018 Xlinesoft
Advanced topics 584
See also
· Method: setValue
hide
Hides the control.
Syntax
ctrl.hide();
Arguments
No arguments.
Return value
No return value.
Example
If you need to hide the control and the label, use pageObj.hideField().
See also
· Method: show
© 2018 Xlinesoft
585 PHPRunner 10.0 Manual
invalid
Gets the control status after the last validation.
Syntax
Arguments
No arguments.
Return value
Example
isReadonly
Syntax
Arguments
No arguments.
Return value
Example
Remarks
© 2018 Xlinesoft
Advanced topics 586
Readonly controls will be submitted with the form and saved in the database. Readonly
controls will be filled by Autofill feature. You can apply default values to Readonly
controls.
See also
· Method: makeReadonly
makeReadonly
Makes control readonly.
Syntax
ctrl.makeReadonly();
Arguments
No arguments.
Return value
No return value.
Example
Remarks
Readonly controls will be submitted with the form and saved in the database. Readonly
controls will be filled by Autofill feature. You can apply default values to Readonly
controls.
See also
· Method: isReadonly
makeReadWrite
Syntax
© 2018 Xlinesoft
587 PHPRunner 10.0 Manual
ctrl.makeReadWrite();
Arguments
No arguments.
Return value
No return value.
Example
See also
· Method: MakeReadonly
on
Adds an event to the control and transfer the array of arguments to the handler.
Syntax
ctrl.on(event,handler,arguments);
Arguments
Return value
No return value.
Example
ctrl.on('click', function() {
// call 'setValue' method to set new value
© 2018 Xlinesoft
Advanced topics 588
this.setValue('newValue');
});
See also
· Method: clearEvent
removeClass
Removes the class from the control.
Syntax
ctrl.removeClass(className);
Arguments
Return value
No return value.
Example
See also
· Method: addClass
removeValidation
Syntax
ctrl.removeValidation(validation_type);
Arguments
© 2018 Xlinesoft
589 PHPRunner 10.0 Manual
IsNumeric A number.
Return value
No return value.
Example
See also
· Method: addValidation
© 2018 Xlinesoft
Advanced topics 590
reset
Sets the control value to the original one.
Syntax
ctrl.reset();
Arguments
No arguments.
Return value
No return value.
Example
setDisabled
Syntax
ctrl.setDisabled();
Arguments
No arguments.
Return value
No return value.
Example
Remarks
© 2018 Xlinesoft
591 PHPRunner 10.0 Manual
Disabled controls will NOT be submitted with the form and will not be saved in the
database. Disabled controls will be filled by Autofill feature. You can apply default values
to Disabled controls.
See also
· Method: setEnabled
setEnabled
Makes control enabled.
Syntax
ctrl.setEnabled();
Arguments
No arguments.
Return value
No return value.
Example
See also
· Method: setDisabled
setFocus
Sets focus to the control and, depending on the triggerEvent argument, raises/does not
raise "focus" event.
Syntax
ctrl.setFocus(triggerEvent);
Arguments
triggerEvent - if true, the "focus" event, previously added to the control using on
function, is raised. If false or not specified, event is not raised.
© 2018 Xlinesoft
Advanced topics 592
Return value
No return value.
Example
See also
· Method: on
setValue
Syntax
ctrl.setValue(value);
Arguments
Return value
No return value.
Example1
function func() {
ctrlTotal.setValue(Number(ctrlPrice.getValue()) *
Number(ctrlQuantity.getValue()));
};
ctrlPrice.on('keyup', func);
ctrlQuantity.on('keyup', func);
© 2018 Xlinesoft
593 PHPRunner 10.0 Manual
Example2
Check box control hold the value of 'on' (checked off) and empty string if unchecked:
See also
· Method: getValue
show
Shows the control.
Syntax
ctrl.show();
Arguments
No arguments.
Return value
No return value.
Example
See also
· Method: hide
validate
Validates the control value against all previously added validation types.
© 2018 Xlinesoft
Advanced topics 594
Syntax
Arguments
No arguments.
Return value
Returns an array with two values: result (validation result, values - true or false) and
messageArr (the array of validation errors). If result is true, then the array messageArr
is blank.
Example
alert( message );
}
See also
· Method: validateAs
validateAs
Validates the control value for certain validation type. The control will not be marked as
not validated.
Syntax
Arguments
© 2018 Xlinesoft
595 PHPRunner 10.0 Manual
IsNumeric A number.
Return value
Example
See also
· Method: validate
© 2018 Xlinesoft
Advanced topics 596
inlineRow.data object contains values of the fields as they were before editing. Example:
inlineRow.data["Price"]
Methods
Method Description
Examples
if(inlineRow){
inlineRow.onCancel = function(){
console.log('edit cancelled');
};
}
if(inlineRow){
inlineRow.onBeforeCancel = function(){
inlineRow.revokeCancel = true;
};
}
Methods
Method Description
© 2018 Xlinesoft
597 PHPRunner 10.0 Manual
Methods
getSearchController
Gets the object of the search panel (SearchController object). getSearchController()
method is available in the JavaScript OnLoad event of the List/Chart/Report/Advanced
Search pages.
Syntax
Arguments
No arguments.
Return value
See also
hideField
Hides the field and field label. hideField() method is available in the JavaScript OnLoad
event of the Add/Edit/View/Register pages.
Syntax
pageObj.hideField(field);
Arguments
Return value
No return value.
© 2018 Xlinesoft
Advanced topics 598
Example 1
Example 2
See also
· Method: showField()
· Method: hideField()
showField
Shows the previously hidden field and field label. showField() method is available in the
JavaScript OnLoad event of the Add/Edit/View/Register pages.
Syntax
pageObj.showField(field);
Arguments
© 2018 Xlinesoft
599 PHPRunner 10.0 Manual
Return value
No return value.
Example 1
Example 2
See also
· Method: showField()
· Method: hideField()
getTabs
Returns RunnerTabs object, which represents a single tab group. If there are several tab
groups on the page, N is a zero-based tab group index. Call this function without
parameters will return first tab group. If N is more than number of tab groups null will be
returned.
© 2018 Xlinesoft
Advanced topics 600
Syntax
getTabs( [n] )
Arguments
n - zero based index of a tab group. If no argument specified, returns first tab group on
the page.
Return value
Example
See also
· Tabs/Sections API
SearchController object allows you to manage the search panel. It is available in the
Javascript OnLoad event on the List/Report/Chart pages (pages with Search panel) and
Advanced Search page.
Methods
Method Description
© 2018 Xlinesoft
601 PHPRunner 10.0 Manual
See also
· SearchField object
Methods
addField
Adds a field to search panel. Then calls the callback function, passing SearchField
object of added field as the argument. In the callback function you can use all the
functionality available for SearchField object.
Syntax
srch.addField(fieldName, callback(field))
Arguments
callback(field) - call to callback function. field is the SearchField object of added field.
This argument may be omitted.
Return value
No return value.
Example 1
© 2018 Xlinesoft
Advanced topics 602
Example 2
Add the Price field to the search panel and set search parameters:
Example 3
See also
· SearchField object
clear
Deletes all search fields from the search panel.
Syntax
srch.clear();
Arguments
No arguments.
Return value
No return value.
© 2018 Xlinesoft
603 PHPRunner 10.0 Manual
deleteField
Deletes all entries of specified field from the search panel.
Syntax
srch.deleteField(fieldName);
Arguments
Return value
No return value.
Example
display
Syntax
srch.display(value);
Arguments
Value Description
Return value
© 2018 Xlinesoft
Advanced topics 604
No return value.
Example
getSearchFields
Returns search fields related to all fields or only specified one.
Syntax
Arguments
Return value
If the argument is specified, then returns the array of search fields related to specified
field. If the argument is not specified, then returns the array of search fields related to
all fields.
Example
toggleCriteria
Hides or shows criteria block on the search panel, sets values of the search criteria.
Syntax
© 2018 Xlinesoft
605 PHPRunner 10.0 Manual
srch.toggleCriteria(value);
Arguments
Value Description
Return value
No return value.
Example
See also
· Method: toggleOptions()
toggleOptions
Hides or shows options on the search panel.
Syntax
srch.toggleOptions(value);
Arguments
Value Description
© 2018 Xlinesoft
Advanced topics 606
Return value
No return value.
Example
See also
· Method: toggleCriteria()
SearchField object allows to manage search fields on the search panel. It is used along
with SearchController object. It is available in the Javascript OnLoad event on the
List/Report/Chart pages (pages with Search panel) and Advanced Search page.
Methods
Method Description
© 2018 Xlinesoft
607 PHPRunner 10.0 Manual
Search options
See also
· SearchController object
Methods
addOption
Adds an option to the list of search options on the search panel (CONTAINS, EQUALS
etc.).
Syntax
© 2018 Xlinesoft
Advanced topics 608
field.addOption(option);
Arguments
option - one of the available search options with the following prefix
Runner.search.options. Example: Runner.search.options.MORE_THAN,
Runner.search.options.NOT_EMPTY.
Return value
No return value.
Example
getControl
Syntax
Arguments
No arguments.
Return value
Example
© 2018 Xlinesoft
609 PHPRunner 10.0 Manual
getName
Returns the field name.
Syntax
Arguments
No arguments.
Return value
Example
getOption
Returns the option that is currently selected on the search panel (CONTAINS, EQUALS
etc.).
Syntax
Arguments
No arguments.
© 2018 Xlinesoft
Advanced topics 610
Return value
Returns the option that is currently selected on the search panel. See search options
list.
Example
getOptions
Returns the list of search options that are currently available for selection.
Syntax
Arguments
No arguments.
Return value
Returns the array of available search options. See search options constants list.
Example
getSecondControl
Returns the second control object of the search field (for between option).
© 2018 Xlinesoft
611 PHPRunner 10.0 Manual
Syntax
Arguments
No arguments.
Return value
Example
Get the second control of the search field on the search panel:
remove
Syntax
field.remove();
Arguments
No arguments.
Return value
No return value.
Example
© 2018 Xlinesoft
Advanced topics 612
removeOption
Removes an option from the list of search options on the search panel (CONTAINS,
EQUALS etc.).
Syntax
field.removeOption(option);
Arguments
option - one of the available search options with the following prefix
Runner.search.options. Example: Runner.search.options.MORE_THAN,
Runner.search.options.NOT_EMPTY.
Return value
No return value.
Example
setOption
Selects option for search field on the search panel (CONTAINS, EQUALS etc.).
Syntax
field.setOption(option);
Arguments
© 2018 Xlinesoft
613 PHPRunner 10.0 Manual
option - one of the available search options with the following prefix
Runner.search.options. Example: Runner.search.options.MORE_THAN,
Runner.search.options.NOT_EMPTY.
Return value
No return value.
Example
3.2.5.7 Examples
How to ask for confirmation before saving record
To ask a user for confirmation before saving a record use the following code in Javascript
OnLoad event for Edit or Add page.
Note: Change the values listed in red to match your specific needs.
See also
· Javascript API
Let's say there are three fields on the add/edit page: Price, Quantity and Total. To calculate
total value on the fly use Javascript code (add it to the Add page: JavaScript OnLoad event or
Edit page: JavaScript OnLoad event on the Events tab).
Note: Change the values listed in red to match your specific needs.
© 2018 Xlinesoft
Advanced topics 614
function func() {
ctrlTotal.setValue(Number(ctrlPrice.getValue()) *
Number(ctrlQuantity.getValue()));
};
ctrlPrice.on('keyup', func);
ctrlQuantity.on('keyup', func);
See also
· Javascript API
Note: Change the values listed in red to match your specific needs.
$("input[type=text]").css('fontSize', '120%');
See also
· Javascript API
Note: Change the values listed in red to match your specific needs.
To get more information about using Javascript API, see Javascript API.
Proceed to the Style Editor, open the page you need to modify, click modify above styles list,
click on the Custom CSS tab and add the following code there:
input,textarea {
© 2018 Xlinesoft
615 PHPRunner 10.0 Manual
color:#003333;
font-family:Verdana,Arial,SunSans-Regular,Sans-Serif;
font-size:12pt;
}
Change the description of the control style (INPUT, TEXTAREA) in the file styles\default.css in
the generated project files
© 2018 Xlinesoft
Advanced topics 616
Note: Change the values listed in red to match your specific needs.
See also
· Javascript API
To change width of text field on Quick Search panel use the following code in Javascript
OnLoad event.
© 2018 Xlinesoft
617 PHPRunner 10.0 Manual
Note: Change the values listed in red to match your specific needs.
$("input[name^='value_make'], select[name^='value_make']").width(150);
See also
· Javascript API
Note: Change the values listed in red to match your specific needs.
pageObj.inlineAdd.inlineAdd();
pageObj.inlineEdit.editAllRecs();
3. Inline edit record number X, where X ranges from 1 to number of records on the page:
5. Edit record number X in popup (when Edit in popup mode is turned on):
© 2018 Xlinesoft
Advanced topics 618
6. View record number X in popup (when View in popup mode is turned on):
$("#addButton"+pageid).click();
8. Make new record appear at the end of the list (when Inline or 'Add in popup' mode is
enabled):
pageObj.addNewRecordsToBottom = true;
1. Inline Add:
2. Inline Edit:
fieldsData = {
name: field name,
value: raw field value as it appears in the database,
text: field value with formatting applied if any,
container: jQuery object, a container, where field value will be inserted
}
© 2018 Xlinesoft
619 PHPRunner 10.0 Manual
3. How to change the color of text and background of a field after Inline Add or Edit.
function funcAfter(fieldsData) {
for (f in fieldsData) {
var field = fieldsData[f];
if (field.name == 'status') {
if (field.value == 'Pending') {
field.container.closest('td').css('background', 'red');
field.container.closest('td').css('color', 'white');
} else if (field.value == 'Active') {
field.container.closest('td').css('background', 'orange');
field.container.closest('td').css('color', 'darkblue');
}
}
}
this.on('afterInlineEdit', funcAfter);
this.on('afterInlineAdd', funcAfter);
4. How to redirect user to View page after adding new record in popup.
function funcAfter(fieldsData) {
for (f in fieldsData) {
var field = fieldsData[f];
if (field.name == 'id') {
window.location.href = "documents_view.php?editid1=" +
field.value;
}
}
this.on('afterInlineAdd', funcAfter);
© 2018 Xlinesoft
Advanced topics 620
See also
· Javascript API
Note: Change the values listed in red to match your specific needs.
See also
· Javascript API
Note: Change the values listed in red to match your specific needs.
$("[id^='showHideSearchType']").click();
See also
· Javascript API
There is only one mandatory parameter, URL of the page to be displayed. You can use this
function anywhere you can use Javascript code i.e. in Javascript OnLoad event or ClientBefore
event of custom button.
Here is how you can display Add page of Products table in popup:
Runner.displayPopup( {
url: "products_add.php"
});
© 2018 Xlinesoft
621 PHPRunner 10.0 Manual
html: instead of specifying URL you can supply HTML code to be displayed in
popup window
More examples.
© 2018 Xlinesoft
Advanced topics 622
url: "products_add.php",
width: 700,
height: 500,
header: 'Add new product'
});
Use of close()
win.close();
© 2018 Xlinesoft
623 PHPRunner 10.0 Manual
In this function you can return false to prevent window from being closed.
Server code
$record = $button->getCurrentRecord();
$result["CustomerID"] = $record["CustomerID"];
ClientAfter code
Show Add page in popup, close popup on 'Save' and refresh the List
page
There is added a button to the list page to display Add page in popup and once record is
saved we close the popup and refresh the list page to show a new record.
window.popup = Runner.displayPopup({
url: Runner.pages.getUrl("carsmake","add"),
width: 700,
© 2018 Xlinesoft
Advanced topics 624
height: 700,
header: 'Add Category'
});
AfterAdd event
$pageObject->setProxyValue('saved', true);
$pageObject->stopPRG = true;
If you need to close popup without refreshing the page you need to comment the line:
window.parent.location.reload();
See also
· Javascript API
To enable/disable standard application buttons and manually added buttons, you need to complete
the following steps. Note that this will not work for buttons inserted directly into the grid.
Note: Change the values listed in red to match your specific needs.
1. Get button ID
To find out id of manually added button, select the button in Visual Editor and switch to HTML
mode. In the highlighted "button" code look for id="...". In the example below button id is
My_Button:
In the case of standard application buttons you need to do the following to get button id: build
application, open it in the browser and view the properties of the button using Chrome Developer
Tools or Firebug.
© 2018 Xlinesoft
625 PHPRunner 10.0 Manual
Use only the initial part of the button id (without numbers) in the code, such as delete_selected.
2. Add code
Add the following code to any Javascript OnLoad event or ClientAfter/ClientBefore event of other
buttons.
To disable a button:
var id = "My_Button";
var button = $("[id^=" + id + "]");
Runner.addDisabledClass(button);
To enable a button:
var id = "My_Button";
var button = $("[id^=" + id + "]");
Runner.delDisabledClass(button);
© 2018 Xlinesoft
Advanced topics 626
See also
· Javascript API
© 2018 Xlinesoft
627 PHPRunner 10.0 Manual
To do that add the following code to List page: Javascript OnLoad event
To refresh grid on the List page without page reloading, use the following code in Javascript
OnLoad event. Note that option AJAX search, pagination and sorting should be enabled
(Choose pages -> List page settings).
Runner.runnerAJAX(Runner.pages.getUrl(pageObj.tName, pageObj.pageType)+"?
a=return",
pageObj.ajaxBaseParams,
function(respObj){
pageObj.pageReloadHn.call(pageObj, respObj)
});
If you need to use both snippets at the same time, add the following code to the List page
Javascript OnLoad event. Note that option AJAX search, pagination and sorting should be
enabled (Choose pages -> List page settings).
window.listPage = pageObj;
And add the following code to the Edit page Javascript OnLoad.
this.on('afterSave', function() {
var pageObj = window.listPage;
Runner.runnerAJAX(Runner.pages.getUrl(pageObj.tName, pageObj.pageType)+"?
a=return",
pageObj.ajaxBaseParams,
function(respObj){
pageObj.pageReloadHn.call(pageObj, respObj)
});
});
See also
· Javascript API
© 2018 Xlinesoft
Advanced topics 628
Note: Change the values listed in red to match your specific needs.
ctrlCountry.on('change', function(e) {
if (this.getValue() == 'US') {
ctrlState.show();
} else {
ctrlState.hide();
}
});
You may want to hide field label as well. Use the following code to hide or show the whole
table row with state edit control based on country field selection. It will work in popup and
inline.
ctrlCountry.on('change', function(e) {
if (this.getValue() == 'US') {
pageObj.showField("state");
} else {
pageObj.hideField("state");
}
});
See also
· Javascript API
To manipulate a tab, you need to know the tab group name. To find this name proceed to the
Visual Editor page, select the page with tab, make tab group selected and switch to the
HTML mode. Tab group name will be highlighted (e.g. {$TabGroup New_tab1}). Here New_tab1
is the tab group name. Now paste it to the code below.
Besides the tab group name you need to know the tab index. Tab index is zero based: 0 - the
first tab, 1 - the second tab etc. Now you can use one of the following code samples.
Note: Change the values listed in red to match your specific needs.
1. To make the tab selected, use the following code in Javascript OnLoad event:
© 2018 Xlinesoft
629 PHPRunner 10.0 Manual
myTabs.selectChild(1);
2. To make the tab disabled, use the following code in Javascript OnLoad event:
myTabs.item(1).disable();
myTabs.on('click', function(e) {
if ( this.get("selection").get("disabled") ) {
myTabs.selectChild( prevSelected );
}
});
myTabs.on('selectionChange', function(e) {
prevSelected = e.prevVal.get('index');
});
3. To remove the tab, use the following code in Javascript OnLoad event:
if ( myTabs.item(tabIndex) ) {
savedTab = myTabs.item(tabIndex).getAttrs();
myTabs.remove(tabIndex);
}
4. To hide the tab, use the following code in Javascript OnLoad event:
tabToHide.get("boundingBox").hide();
tabToHide.hide();
if ( tabToHide.get('selection') ) {
siblingTab = tabToHide.next() || tabToHide.previous()
© 2018 Xlinesoft
Advanced topics 630
5. To show the hidden tab, use the following code in Javascript OnLoad event:
tabToShow .get("boundingBox").show();
myTabs.selectChild( tabIndex );
See also
· Javascript API
This code will work in Javascript OnLoad event or ClientBefore/ClientAfter event of custom
buttons.
Example
Gets the 'price' control in the inline mode and then sets its value to 1000.
© 2018 Xlinesoft
631 PHPRunner 10.0 Manual
This API allows you to manage tabs and sections added to Add, Edit and View pages. This API
is only designed to work with Bootstrap layouts. All tab group and tab indexes are zero-based.
0 - first tab, 1 - second tab etc.
These methods will work in the JavaScript OnLoad event on the Add/Edit/View pages.
Methods
Method Description
Tabs methods
addTab(headerHtml, paneHtml) creates a new tab and adds it to the end of tab group
Sections methods
headerElement()
bodyElement()
© 2018 Xlinesoft
Advanced topics 632
count()
Arguments
No arguments.
Return value
Example
See also
· RunnerPage.getTabs
activate
Activates/shows n-th tab. Tab index is zero-based.
Syntax
activate( n )
Arguments
© 2018 Xlinesoft
633 PHPRunner 10.0 Manual
Return value
No return value.
Example
See also
· RunnerPage.getTabs
· ActiveIdx
activeIdx
Gets an index of the currently selected tab.
Syntax
activeIdx()
Arguments
No arguments.
Return value
Example
See also
· RunnerPage.getTabs
· Activate
© 2018 Xlinesoft
Advanced topics 634
hide
Hides n-th tab (zero-based).
Syntax
hide( n )
Arguments
Return value
No return value.
Example
See also
· RunnerPage.getTabs
· RunnerTabs.show
show
Syntax
show( n )
Arguments
Return value
No return value.
Example
© 2018 Xlinesoft
635 PHPRunner 10.0 Manual
See also
· RunnerPage.getTabs
· RunnerTabs.hide
disable
Makes n-th tab disabled. Tab remains visible.
Syntax
disable( n )
Arguments
Return value
No return value.
Example
See also
· RunnerPage.getTabs
· RunnerTabs.enable
enable
Syntax
© 2018 Xlinesoft
Advanced topics 636
enable( n )
Arguments
Return value
No return value.
Example
See also
· RunnerPage.getTabs
· RunnerTabs.disable
headerElement
Returns the jQuery object of a tab header.
Syntax
headerElement( n )
Arguments
Return value
No return value.
Example
© 2018 Xlinesoft
637 PHPRunner 10.0 Manual
tabs.headerElement(1).html('<b>Active tab</b>');
See also
· RunnerPage.getTabs
bodyElement
Returns jQuery object of tab content.
Syntax
bodyElement( n )
Arguments
Return value
No return value.
Example
See also
· RunnerPage.getTabs
addTab
Creates a new tab and adds it to the end of tab group.
Syntax
Arguments
© 2018 Xlinesoft
Advanced topics 638
headerHtml
paneHtml
Return value
Example
Creates a new tab "New Tab" with content "New tab content" and adds it to the end of
tab group.
See also
· RunnerPage.getTabs
moveTo
Changes tabs order. n-th tab will be moved to m-th position. m-th tab will be moved to
n-th position.
If m is greater than number of tabs n-th tab will be moved to the end.
Syntax
moveTo( n, m )
Arguments
Return value
Example
Third tab will be moved to fourth position. Fourth tab will be moved to third position.
© 2018 Xlinesoft
639 PHPRunner 10.0 Manual
tabs.moveTo(2,3);
Syntax
getSectionCount()
Arguments
No arguments.
Return value
Example
getSection
Syntax
getSection( n )
Arguments
Return value
Example
© 2018 Xlinesoft
Advanced topics 640
headerElement
Syntax
headerElement()
Arguments
No arguments.
Return value
No return value.
Example
bodyElement
Syntax
bodyElement()
Arguments
No arguments.
Return value
© 2018 Xlinesoft
641 PHPRunner 10.0 Manual
No return value.
Example
expand
Expands section.
Syntax
expand()
Arguments
No arguments.
Return value
No return value.
Example
See also
· RunnerSection.collapse
© 2018 Xlinesoft
Advanced topics 642
collapse
Collapses section.
Syntax
collapse()
Arguments
No arguments.
Return value
No return value.
Example
See also
· RunnerSection.expand
Labels/Titles API allows you to work with the table/field labels and titles. Table/field
names are case-insensitive.
API functions work in events like AfterAppInit, AfterTableInit, BeforeProcess of the
appropriate page.
Functions
Function Description
© 2018 Xlinesoft
643 PHPRunner 10.0 Manual
3.2.7.2 Methods
getFieldLabel
Arguments
Return value
Example
© 2018 Xlinesoft
Advanced topics 644
See also
· setFieldLabel()
setFieldLabel
Sets the field label.
Syntax
Arguments
$label - new field label. Labels can be set in the Label Editor.
Return value
No return value.
Example
Labels can be set in the Label Editor. This example shows how to change the "carscars"
table "descr" field label to "New Description".
See also
· getFieldLabel()
getTableCaption
Gets the table caption.
Syntax
Labels::getTableCaption($table, $language)
Arguments
© 2018 Xlinesoft
645 PHPRunner 10.0 Manual
Return value
Example
See also
· setTableCaption()
setTableCaption
Sets the table caption.
Syntax
Arguments
$caption - new table caption. Captions can be set in the Label Editor
Return value
No return value.
Example
Captions can be set in the Label Editor. This example shows how to change the
"carscars" table caption to "New Cars".
See also
· getTableCaption()
© 2018 Xlinesoft
Advanced topics 646
getProjectLogo
Gets the project logo.
Syntax
Labels::getProjectLogo($language)
Arguments
Return value
Example
Gets the Project logo. Project logo can be set in the Label Editor.
See also
· setProjectLogo()
setProjectLogo
Sets the project logo.
Syntax
Labels::setProjectLogo($label, $language)
Arguments
$label - Project logo. $label parameter may contain any text or HTML code
Return value
No return value.
© 2018 Xlinesoft
647 PHPRunner 10.0 Manual
Example
Sets the Project logo. Project logo can be set in the Label Editor.
See also
· getProjectLogo()
getFieldTooltip
Gets the field tooltip.
Syntax
Arguments
Return value
Example
See also
· setFieldTooltip()
setFieldTooltip
Sets the field tooltip.
© 2018 Xlinesoft
Advanced topics 648
Syntax
Arguments
Return value
No return value.
Example
This example shows how to change the "carscars" table "descr" field tooltip to "My new
tooltip".
See also
· getFieldTooltip()
getPlaceholder
Gets the field placeholder.
Syntax
Arguments
© 2018 Xlinesoft
649 PHPRunner 10.0 Manual
Return value
Field placeholder. Placeholder can be set in the Edit As settings or the Label Editor on the
Misc settings.
Example
See also
· setPlaceholder()
setPlaceholder
Sets the field placeholder.
Syntax
Arguments
Return value
No return value.
Example
This example shows how to change the "carscars" table "descr" field placeholder to "Cars
description".
See also
© 2018 Xlinesoft
Advanced topics 650
· getPlaceholder()
getPageTitleTempl
This function work with page title templates and not with titles directly. Examples of
page title templates can be found in Label Editor
Syntax
Arguments
PAGE_MASTER_INFO_LIST
PAGE_MASTER_INFO_PRINT
PAGE_MASTER_INFO_REPORT
PAGE_MASTER_INFO_RPRINT
PAGE_MENU
PAGE_LOGIN
PAGE_REGISTER
PAGE_REMIND
PAGE_CHANGEPASS
Return value
© 2018 Xlinesoft
651 PHPRunner 10.0 Manual
Example
See also
· setPageTitleTempl()
setPageTitleTempl
This function work with page title templates and not with titles directly. Examples of
page title templates can be found in Label Editor
Syntax
Arguments
PAGE_MASTER_INFO_LIST
PAGE_MASTER_INFO_PRINT
PAGE_MASTER_INFO_REPORT
PAGE_MASTER_INFO_RPRINT
© 2018 Xlinesoft
Advanced topics 652
PAGE_MENU
PAGE_LOGIN
PAGE_REGISTER
PAGE_REMIND
PAGE_CHANGEPASS
Return value
No return value.
Example
See also
· getPageTitleTempl()
getBreadcrumbsLabelTempl
This function gets the current breadcrumbs template
Syntax
Arguments
© 2018 Xlinesoft
653 PHPRunner 10.0 Manual
PAGE_EXPORT
PAGE_IMPORT
PAGE_REPORT
PAGE_RPRINT
PAGE_CHART
PAGE_MASTER_INFO_LIST
PAGE_MASTER_INFO_PRINT
PAGE_MASTER_INFO_REPORT
PAGE_MASTER_INFO_RPRINT
PAGE_MENU
PAGE_LOGIN
PAGE_REGISTER
PAGE_REMIND
PAGE_CHANGEPASS
Return value
See also
· setBreadcrumbsLabelTempl()
setBreadcrumbsLabelTempl
Arguments
$masterTable - master table name (if we are on details table page at the moment).
© 2018 Xlinesoft
Advanced topics 654
PAGE_MASTER_INFO_LIST
PAGE_MASTER_INFO_PRINT
PAGE_MASTER_INFO_REPORT
PAGE_MASTER_INFO_RPRINT
PAGE_MENU
PAGE_LOGIN
PAGE_REGISTER
PAGE_REMIND
PAGE_CHANGEPASS
Return value
No return value.
Example
By default on Order Details table we will see the following breadcrumbs menu:
Home / Orders / Order Details [5187]
You can use any field from details table here (OrderID) or from master table
(master.OrderID)
or
© 2018 Xlinesoft
655 PHPRunner 10.0 Manual
See also
· getBreadcrumbsLabelTempl()
An object of the RunnerPage class represents the current page and is passed to the
event as a $pageObject parameter.
Methods
© 2018 Xlinesoft
Advanced topics 656
See also
3.2.8.2 Methods
getCurrentRecord
Gets the current record. Available on Edit/View pages.
Syntax
getCurrentRecord()
Arguments
No arguments.
Return value
Example
Get the current record and display the Make and Model fields' values:
$data = $pageObject->getCurrentRecord();
echo $data["Make"] ." ".$data["Model"];
See also
· getMasterRecord()
getMasterRecord
Syntax
getMasterRecord()
Arguments
© 2018 Xlinesoft
657 PHPRunner 10.0 Manual
No arguments.
Return value
Example
Get the master record and display the Make and Model fields' values:
$data = $pageObject->getMasterRecord();
echo $data["Make"] ." ".$data["Model"];
See also
· getCurrentRecord()
hideField
The hideField() method allows you to hide a field and its label. This method is available in
the BeforeDisplay event of the List/Add/Edit/View/Register pages.
Syntax
hideField($field)
Arguments
Return value
No return value.
Example
$pageObject->hideField("Make");
Remarks
Fields hidden by the hideField() method can be displayed using JavaScript API:
showField() method.
© 2018 Xlinesoft
Advanced topics 658
See also
· showField()
setProxyValue
Sets the variable to the given value. Use the setProxyValue() method to pass values
from PHP to JavaScript: you assign value to a variable in PHP and then use it in
Javascript. Method is available on all pages.
Syntax
setProxyValue($name, $value)
Arguments
$value - value assigned to the variable. $value may be a simple value (e.g. string,
number) or an array.
Return value
No return value.
Example
$pageObject->setProxyValue("name", $value);
$pageObject->setProxyValue("master",$pageObject->getMasterRecord());
alert(proxy['name']);
alert(proxy.master['Make']);
© 2018 Xlinesoft
659 PHPRunner 10.0 Manual
showField
Shows the previously hidden field and field label. showField() method is available in the
BeforeDisplay event of the Add/Edit/View/Register pages.
Syntax
showField($field)
Arguments
Return value
No return value.
Example
$pageObject->showField("Make");
See also
· hideField()
addTab
This method adds a tab to the Additional WHERE tabs on the list page. the addTab()
method is available in the BeforePocess event of List or Chart page.
Syntax
Arguments
© 2018 Xlinesoft
Advanced topics 660
Return value
Example
See also
· deleteTab()
· setTabTitle()
· setTabWhere()
deleteTab
This method deletes one of the Additional WHERE tabs on the list page. The deleteTab()
method is available in the BeforePocess event of List or Chart page.
Syntax
$pageObject->deleteTab($id);
Arguments
Return value
no return value
Example
$pageObject->deleteTab("anton");
See also
© 2018 Xlinesoft
661 PHPRunner 10.0 Manual
· addTab()
· Method: setTabTitle()
· Method: setTabWhere()
setTabTitle
This method sets the title of one of the Additional WHERE tabs on the list page. The
setTabTitle() method is available in the BeforePocess event of the List or Chart page.
Syntax
$pageObject->setTabTitle($id, $title);
Arguments
$id - id of the tab
$title - tab title that will be displayed
Return value
true - if the title was set
false - in all other cases
Example
See also
· addTab()
· deleteTab()
· setTabWhere()
setTabWhere
This method sets the WHERE clause of one of the Additional WHERE tabs on the
list page. The setTabWhere() method is available in the BeforePocess event of
© 2018 Xlinesoft
Advanced topics 662
Syntax
$pageObject->setTabWhere($id, $where);
Arguments
$id - id of the tab
$where - WHERE clause for the tab
Return value
Example
An example of using the setTabWhere() method to set the WHERE clause to the
tab:
$pageObject->setTabWhere("anton", "CustomerID='ANTON'");
See also
· addTab()
· deleteTab()
· setTabTitle()
AfterTableInitialized, List page: BeforeProcess events - you can read and write search
conditions here. Changes will be applied to SQL Query and also will be shown on search
panel.
List page: BeforeDisplay event - you can read and write search conditions here. Changes
will not be applied to SQL Query but will be shown on search panel.
© 2018 Xlinesoft
663 PHPRunner 10.0 Manual
See also
· Search Master and Details tables together
Functions
Function Description
3.2.9.2 Methods
getSearchObject
If $table parameter is not specified current table will be used
Syntax
SearchClause::getSearchObject($table)
Arguments
© 2018 Xlinesoft
Advanced topics 664
Return value
SearchClause object
getFieldValue
Returns search control value
Syntax
$srchObj->getFieldValue($field);
Arguments
Return value
Example
$srchObj = SearchClause::getSearchObject("Cars");
$srchObj->getFieldValue("Make");
See also
setFieldValue()
setFieldValue
Will replace existing value of search field if field already added to search panel. Will add
field to search panel if didn’t exist there.
Syntax
$srchObj->setFieldValue($field, $value);
Arguments
Return value
© 2018 Xlinesoft
665 PHPRunner 10.0 Manual
No return value
Example
Add the following code to the AfterTableInit event. It will replace existing value of search
field if field is already added to search panel and will add field to search panel if didn’t
exist there.
$srchObj = SearchClause::getSearchObject("Employees");
$value = $srchObj->getFieldValue("Department");
if( $value == null ) {
$srchObj->setFieldValue("Department", 10 );
}
See also
getFieldValue()
getSecondFieldValue
Returns second search control value, when Between is selected as a search option
Syntax
$srchObj->getSecondFieldValue($field);
Arguments
Return value
Returns second search control value, when Between is selected as a search option
See also
setSecondFieldValue()
setSecondFieldValue
Sets second search control value if Between option is selected.
Syntax
$srchObj->setSecondFieldValue($field, $value);
Arguments
© 2018 Xlinesoft
Advanced topics 666
Return value
No return value
See also
getSecondFieldValue()
getSearchOption
Returns search option.
Syntax
$srchObj->getSearchOption($field);
Arguments
Return value
Returns search option, which is one of the following constants:
CONTAINS
EQUALS
STARTS_WITH
MORE_THAN
LESS_THAN
BETWEEN
EMPTY_SEARCH
NOT_CONTAINS
NOT_EQUALS
NOT_STARTS_WITH
NOT_MORE_THAN
NOT_LESS_THAN
NOT_BETWEEN
NOT_EMPTY
See also
setSearchOption()
© 2018 Xlinesoft
667 PHPRunner 10.0 Manual
setSearchOption
Sets search option for the field. Accepts one of the following as a search option:
Syntax
$srchObj->setSearchOption($field, $option);
Arguments
CONTAINS
EQUALS
STARTS_WITH
MORE_THAN
LESS_THAN
BETWEEN
EMPTY_SEARCH
NOT_CONTAINS
NOT_EQUALS
NOT_STARTS_WITH
NOT_MORE_THAN
NOT_LESS_THAN
NOT_BETWEEN
NOT_EMPTY
Example
Make sure that for Year field 'Between' option is always selected. This examples shows
how to set "BETWEEN" search option for the "Year" field.
$srchObj = SearchClause::getSearchObject("Employees");
$value = $srchObj->getSearchOption("Year");
if ($value != BETWEEN) {
$srchObj->setSearchOption("Year", BETWEEN);
}
See also
getSearchOption()
setSearchSQL
Sets SQL expression for search. Replaces current search expression for this field.
Syntax
© 2018 Xlinesoft
Advanced topics 668
$srchObj->setSearchSQL($field, $sql);
Arguments
Return value
No return value
Example 1
$srchObj = SearchClause::getSearchObject("carsmodels");
$value = $srchObj->getFieldValue("make");
Example 2
Here is how you can search master and details tables together. For instance you have Orders
and OrderDetails tables and need to find orders that contain a certain product.
1. Modify Orders SQL Query to add a dummy field named 'product'. Make sure this field is
searchable.
SELECT
OrderID,
CustomerID,
EmployeeID,
OrderDate,
ShipAddress,
ShipCity,
ShipRegion,
ShipPostalCode,
ShipCountry,
'' as product
FROM orders
$srchObj = SearchClause::getSearchObject("orders");
© 2018 Xlinesoft
669 PHPRunner 10.0 Manual
$value = $srchObj->getFieldValue("product");
In this event we do a subquery to find all orders that contain the product in question.
See also
· getSearchObject()
· getFieldValue()
getAllFieldsSearchValue
Gets 'All fields search' value
Syntax
$srchObj->getAllFieldsSearchValue()
Arguments
No arguments
Return value
getFieldValue
See also
setAllFieldsSearchValue()
setAllFieldsSearchValue
Sets 'All fields search' value
Syntax
$srchObj->setAllFieldsSearchValue($value)
Arguments
© 2018 Xlinesoft
Advanced topics 670
Return value
No return value
See also
getAllFieldsSearchValue()
Functions
Function Description
© 2018 Xlinesoft
671 PHPRunner 10.0 Manual
getUserData() Returns array with user data from login table. Returns
false if user not found.
currentUserData() Returns array with current user data from login table.
3.2.10.2 Methods
getUserGroup
Returns current user group name. Makes more sense to use with static permissions
where each user belongs to single user group.
Syntax
Security::getUserGroup()
Arguments
No arguments
Return value
getUserGroups
Security::getUserGroups()
Arguments
No arguments
Return value
Example
© 2018 Xlinesoft
Advanced topics 672
$groups = Security::getUserGroups()
if( $groups["Accounting"] ) {
... do something
}
getUserName
Returns current Username
Syntax
Security::getUserName()
Arguments
No arguments
Return value
getDisplayName
Returns current Display Name
Syntax
Security::getDisplayName()
Arguments
No arguments
Return value
setDisplayName
Security::setDisplayName($str)
Arguments
© 2018 Xlinesoft
673 PHPRunner 10.0 Manual
Return value
No return value
isGuest
Returns true if user logged in as Guest, returns false otherwise
Syntax
Security::isGuest()
Arguments
No arguments
Return value
isAdmin
Returns true if user is an admin, returns false otherwise
Syntax
Security::isAdmin()
Arguments
No arguments
Return value
isLoggedIn
Returns true if user is logged in and not guest, returns false otherwise
Syntax
Security::isLoggedIn()
Arguments
No arguments
© 2018 Xlinesoft
Advanced topics 674
Return value
Returns true if user is logged in and not guest, returns false otherwise
loginAs
Logs user in, no redirects.
AftersuccessfulLogin will be called if second parameter is set to true.
This function will not work with Active Directory or Facebook login
Syntax
Arguments
$username - name of the user to be logged in.
true.
Return value
No return value.
logout
Just logout, no redirects.
Syntax
Security::logout()
Arguments
No arguments
Return value
No return value.
getOwnerId
This functions get OwnerID for specific table when Advanced Security like 'Users can see
and edit their own data' is in use.
© 2018 Xlinesoft
675 PHPRunner 10.0 Manual
Syntax
Security::getOwnerId($table)
Arguments
Return value
See also
setOwnerId()
setOwnerId
This functions set OwnerID for specific table when Advanced Security like 'Users can see
and edit their own data' is in use.
Syntax
Security::setOwnerId($table, $ownerid)
Arguments
$ownerid - owner id
Return value
See also
getOwnerId()
checkUsernamePassword
This function checks username and password and returns true if username/password are
correct, returns false otherwise.
If username/password are incorrect and $fireEvents is true AfterUnsuccessfulLogin event
will be fired.
This function doesn't actually performs the login, just validates username and password.
Syntax
© 2018 Xlinesoft
Advanced topics 676
Arguments
Return value
true - if username/password are correct
getUserData
Returns array with user data from login table.
Returns false if user not found.
Syntax
Security::getUserData($username)
Arguments
Return value
currentUserData
Syntax
Security::currentUserData()
© 2018 Xlinesoft
677 PHPRunner 10.0 Manual
Arguments
No arguments
Return value
Example
This example shows how to output the current user data
$userData = Security::currentUserData();
print_r($userData );
getPermissions
Gets permissions for certain table
Syntax
Security::getPermissions($table)
Arguments
Return value
See also
setPermissions()
setPermissions
Sets permissions for certain table for the current user. Permissions need to be set only
once per user session, i.e. in the After Successful Login event.
Permissions should be passed in the form of array where keys are specific permission
letters:
A - add,
D - delete,
E - edit,
© 2018 Xlinesoft
Advanced topics 678
S - search/list,
P - print/export,
I - import,
M - admin permission. When advanced permissions are in effect (users can see/edit their
own records only), this permissions grants access to all records.
Syntax
Security::setPermissions($table, $rights)
Arguments
Return value
No return value
Example 1
Enable Add and disable Delete functionality on "Cars" table for the current user.
$rights = Security::getPermissions("Cars");
$rights["A"] = true;
$rights["D"] = false;
Security::setPermissions("Cars", $rights);
Example 2
Check if current user has Add permissions on "Cars" table.
$rights = Security::getPermissions("Cars");
if($rights["A"])
echo "add permission available";
See also
getPermissions()
Password hashing
You can hash your password manually using events
© 2018 Xlinesoft
679 PHPRunner 10.0 Manual
For instance, you want to provide admin with direct access to the login table. To do so add
the following code to BeforeAdd/BeforeEdit events of login table:
For BCRYPT:
$values["password"] = getPasswordHash($values["password"]);
For MD5:
$values["password"] = md5($values["password"]);
SQLQuery class allows you to modify current SQL query to a table stored in the $query
object. The $query object is available only in the After table initialized event. It is immediately
usable and does not require initialization.
All the methods described below should be used in the After table initialized event. This
ensures that all changes made will be applied to all pages.
Methods
Method Description
3.2.11.2 Methods
addField
Adds a field name to the end of SELECT clause of the current SQL query.
Syntax
© 2018 Xlinesoft
Advanced topics 680
addField($calculatedField, $alias)
Arguments
$alias - alias of the field name. Example: "new_size". $alias field values can be used in
the following events:
· Before record processed, After record processed for the List page like
$data[$alias];
· Process record values, Before display for the Edit page like $values[$alias];
· Copy page: Onload, Before record added, After record updated, Process record
values for the Add page like $values[$alias];
· Process record values, Before display for the View page like $values[$alias].
Return value
No return value.
Example 1.
Example 2.
$query->addField("size+adjust", "new_size");
addWhere
If the current SQL query does not include WHERE clause, addWhere() adds it as
where($condition). Otherwise, WHERE clause will be added as a new condition as
© 2018 Xlinesoft
681 PHPRunner 10.0 Manual
and($condition).
Syntax
addWhere($condition)
Arguments
$condition - any condition clause. Example: "id_sizes < 3 or id_sizes > 6". id_sizes is the
field name.
Return value
No return value.
Example
deleteField
Removes a field name from the SELECT clause of the current SQL query.
Syntax
deleteField($field)
Arguments
Return value
No return value.
Example
To remove field name from the SELECT clause (data from the field 'id_sizes' are no longer
requested):
© 2018 Xlinesoft
Advanced topics 682
Remarks
Using deleteField function you can delete the alias field created by the addField function.
replaceField
Replaces a field name in the SELECT clause of the current SQL query with new one.
Syntax
Arguments
$alias - alias of the new field name. $alias parameter can be omitted. In this case
$replaceableField value is taken as alias.
Return value
No return value.
Example 1.
Example 2.
© 2018 Xlinesoft
683 PHPRunner 10.0 Manual
replaceWhere
Replaces WHERE clause of the current SQL query with new one.
Syntax
replaceWhere( $condition )
Arguments
$condition - any condition clause. Example: "id_sizes < 3 or id_sizes > 6". id_sizes is the
field name.
Return value
No return value.
Example 1.
To display records from the table where the value of the field test is 'passed':
Example 2.
To display records from a table where the value of the field size is 3 and the value of the
field adjust is less than 2:
Example 3.
In this tutorial we will find out how to troubleshoot chart errors in our applications. PHPRunner
applications use Flash-based charting component that receives data in XML format. If any error
© 2018 Xlinesoft
Advanced topics 684
happens while generating XML input you will see the following message instead of chart:
Lets go a bit deeper. Right click anywhere on the page (except on chart itself) and choose View
source. In HTML source search for the first occurrence of dchartdata.php? (dchartdata.asp?)
string. You should see something like this:
© 2018 Xlinesoft
685 PHPRunner 10.0 Manual
dchartdata file generates XML. As we can see something went wrong and this file produces the
error. View the source of this page again. Search for php error happened string ('asp error
happened' in ASPRunnerPro).
© 2018 Xlinesoft
Advanced topics 686
Now we can see the actual error message. In this specific case table named 'Cars' missing in the
database. Probably table was removed or renamed after project was built. To fix this you either
need to change the chart definition in your project or to rename this table back.
Let's say you have a database of cars. You have added a button to the List page that should
update selected cars statuses as 'Sold'. Your code looks good and passes syntax check but still
doesn't work when you run your application. The worst of all - it doesn't produce any visible errors.
In this article I'll show you how to catch errors like this one.
All modern browsers provide developer tools. Our screenshots are taken in Chrome. Open your list
page, hit F12 to display developers tools panel and proceed to Network tab. You should see
something like this:
© 2018 Xlinesoft
687 PHPRunner 10.0 Manual
Now select a few records and click 'Update Selected'. A new entry appears under Network tab -
browser executes buttonhandler.php file where our server side code is stored. If we expand
Response tab we can see our error description if any.
© 2018 Xlinesoft
Advanced topics 688
It looks like we have misspelled the table name in our code. Replacing 'car' with 'carscars' fixes the
issue. This was definitely helpful though some events can be tens or hundreds lines of code long
and single error message doesn't provide much help. To find the exact line of code that produces
the error scroll down the content of Response tab to find the entry that points to
buttonhandler.php file. Here it is:
<td nowrap="nowrap">#4. </td>
<td nowrap="nowrap">buttonhandler.php:49</td>
<td nowrap="nowrap">buttonHandler_Update_Selected</td>
Now we can open buttonhandler.php file in any text editor (Notepad++ recommended) and find line
40:
© 2018 Xlinesoft
689 PHPRunner 10.0 Manual
This also points to the fact that something is not right with our SQL query.
ctrl.setMessage(result["txt"]);
$result["txt"]="";
foreach($keys as $idx=>$val)
{
$sql = "update car set Status='Sold' where id=".$val["ID"];
$result["txt"].=$sql."<br>";
//CustomQuery($sql);
}
© 2018 Xlinesoft
Advanced topics 690
In this article we will be focusing on debugging and troubleshooting the JavaScript errors. We will
look at few examples to illustrate the methods used.
For this purpose we will be using developers tools that come with Chrome browser. If you use
Firefox - download and install the Firebug. Firebug is an extension to Mozilla Firefox web browser
which allows us to monitor and debug the JavaScript in any web page.
function func() {
ctrlTotals.setValue(+ctrlPrice.getValue()*+ctrlQuantity.getValue());
};
ctrlprice.on('keyup', func);
ctrlQuantity.on('keyup', func);
Let take a look at our first example where we intentionally misspelled the name of the field used in
defining the ctrlPrice variable on the JavaScript OnLoad event (ctrlPrice vs ctrlprice, case
sensitive). Since this is not a syntax error the Syntax Check won't pick up on it but browser will.
© 2018 Xlinesoft
691 PHPRunner 10.0 Manual
One thing to note here is when you are troubleshooting and you build your project, you might want
to uncheck the Compress javascript files option on the Output step. This will organize the code
in the way that is much easier to follow.
So, when the page is loaded we click F12 to display developers tools panel. We can see our error
message there and by clicking error message we can get right to the line of code that causes the
trouble. Error message in popup says: 'ctrlprice is not defined'. Replacing ctrlprice with correct
ctrlPrice fixes the issue.
Let's take a look at another example where we are calculating amount on the fly and are not
getting the anticipated result. We are calculating the order by multiplying the number of units in
the order by the price of the unit and adding a tax to the equation.
© 2018 Xlinesoft
Advanced topics 692
function func() {
var total=ctrlPrice.getValue()*+ctrlQuantity.getValue();
ctrlTotals.setValue(total * total*0.1 );
};
ctrlprice.on('keyup', func);
ctrlQuantity.on('keyup', func);
So, in the order where we have 3 units at $120 each with 10% sales tax our total should be $396
dollars. However, the total we are getting is $12960. To troubleshoot the issue we will insert a
breakpoint in our Javascript code and watch the values of each part of the equation separately to
identify the error. To add a breakpoint we need to proceed to Scripts tab in Developers tools, find
our file (pageevents_Order.js) and click the line number we we want to set our breakpoint.
© 2018 Xlinesoft
693 PHPRunner 10.0 Manual
Once breakpoint is inserted put cursor to Quantity field and hit any arrow key on the keyboard.
Program execution stops and we can see what's going on. We can use F10 key to move to the next
line of code (Step over).
Now lets add a few watch expressions on the right side. We can see that total and tax are
calculated properly however we multiplying them instead of adding up which causes the error. A
simple correction in the equation logic solves the issue.
© 2018 Xlinesoft
Advanced topics 694
Real life examples are more complicated though basic troubleshooting techniques are the same. As
a first step make sure there are no runtime Javascript errors then set a breakpoint and step
through the code to find logic flaws.
When your projects do not work as expected, especially when you use a load of events and
custom code, you can use the following debugging techniques to resolve the issue.
For this purpose set $dDebug variable in include/appsettings.php file to true. Especially
useful when you need to resolve master-details or advanced security issues.
$dDebug = true;
© 2018 Xlinesoft
695 PHPRunner 10.0 Manual
$dSQL = "";
$bUseMobileStyleOnly = false;
You can copy SQL query and run it against your database manually to see if it returns correct
results. To run SQL query manually use tools that comes with your database (Query designer
in MS Access, Enterprise Manager in SQL Server, phpMyAdmin in MySQL).
$dDebug = true;
The echo command is used to write output to a browser. The following example sends the text
"Hello World" to the browser:
Here are several examples of how you can use echo command:
3. Troubleshooting charts
© 2018 Xlinesoft
Advanced topics 696
Syntax:
Arguments:
The first line of code sample will display raw data (e.g. 2014-10-15), the second one -
formatted data (US date format, e.g. 10/15/2014).
Example 2. Data formatting for a button on View page or button inserted into the grid
$data = $button->getCurrentRecord();
$var = ViewControl::Format($data, 'Date Listed', 'Cars');
This function can be also used for the field that is configured as a Lookup wizard. In this case
raw data is stored in the Link field and ViewControl::Format function will display the values of
Display field.
After enabling Send email to user/admin you will see that Email templates button will become
active.
© 2018 Xlinesoft
697 PHPRunner 10.0 Manual
Click the button to open the dialog. Here you can customize email templates that will be send to
the users.
© 2018 Xlinesoft
Advanced topics 698
ctrl.setValue(100);
© 2018 Xlinesoft
699 PHPRunner 10.0 Manual
ctrl.getPeer( field )
Returns other field control from the same page of the same row in the inline mode:
var ctlPrice = ctrl.getPeer('price');
ctlPrice.setValue( 1000 );
pageObj.getControl( fieldName )
Returns field control. Works in any events where pageObj variable is available
var ctlPrice = pageObj.getControl('price');
ctlPrice.setValue( 1000 );
getCurrentRecord() - returns an associative array with field values (field name => value)
$data = $ajax->getCurrentRecord();
$result["record"] = $data;
$result["email"] = $data["email"];
PHPRunner adds an exciting new feature - custom edit controls. You are no longer limited by
stock Edit controls that come with the software. And the best of all, creating new Edit
controls is not complicated and we'll show how this can be done.
We will show you how to create ColorPicker and SignaturePad plugins. Before we proceed
check the following live demo that showcases both edit controls plugins. SignaturePad control
works on mobile devices as well.
© 2018 Xlinesoft
Advanced topics 700
ColorPicker control
Lets say we want to add a color picker control that allows users select color the same way
they do in Adobe Photoshop. Since our software comes with jQuery bundled we'll be searching
web for "jQuery colorpicker". This search returns a number of results and the one we'll be
using is miniColors. It looks nice and easy to integrate. Sources can be find at Github:
· copy files EditMyField.js and EditMyField.php from MyField folder to ColorPicker folder;
· if your plugin needs extra files copy them to ColorPicker folder keeping folders structure;
· open EditColorPicker.js in any text editor and replace all occurrences of EditMyField with
EditColorPicker. Do the same with EditColorPicker.php file.
$this->pageObject->AddJSFile("jquery.miniColors.min.js");
You may need to specify the load order of Javascript files. In this example file second.js
will be loaded after first.js:
$this->pageObject->AddJSFile("second.js", "first.js");
$this->pageObject->AddCSSFile("jquery.miniColors.css");
In EditColorPicker.php file find buildUserControl() function. This is were you build HTML code
for your control. If you leave predefined code as is it will display a simple text edit box. We
only going add a minor change telling colorpicker control to use black color theme:
© 2018 Xlinesoft
701 PHPRunner 10.0 Manual
class="black"
Lets see how we can turn this edit box into a colorpicker control. According to colorpicker
instructions we need to call miniColors Javascript referencing edit box. We'll do so adding the
following code to constructor function:
$("#"+this.valContId).miniColors({
letterCase: 'uppercase'
});
letterCase option tells control to convert color values entered manually to upper case.
this.valContId is the id of the control.
This is it, our control is ready. You can now launch PHPRunner, select ColorPicker as Edit as
type for any text field and enjoy your color picker on Add/Edit pages.
1. It would be nice if instead of hex color value we can show some visual representation of
selected color on List/View pages. We'll do so choosing 'View as' type 'Custom' and putting the
following code there:
2. By default PHPRunner sets focus to the first edit control when Add or Edit page is loaded.
This is not a desired behaviour for colorpciker control as we do not want to see colorpicker
popup window to open every time page is loaded. To prevent this from happening implement
setFocus function - simply return false every time.
If you need to change control behaviour check all functions and events in
source\include\common\runnerJS\Control.js file.
SignaturePad
The SignaturePad plugin allows to a add signature pad to your forms. SignaturePad works with
both mouse and touch devices. We will be using SignaturePad jQuery plugin that comes with
excellent documentation and examples.
The basic setup is the same: create new folder for SignaturePad plugin, copy and rename
files, add files that plugin needs to plugin directory. This plugin is a bit more complicated and
takes a few extra steps to integrate.
echo '
<div class="sigPad" style="width: '.($this->width+2).'px;">
<ul class="sigNav">
<li class="clearButton"><a href="#clear">Clear</a></li>
</ul>
© 2018 Xlinesoft
Advanced topics 702
';
if ($this->webValue) {
// save signature to file
require_once 'signature-to-image.php';
$img = sigJsonToImage($this->webValue, array(
'imageSize' => array($this->width, $this->height)
,'bgColour' => $this->bgcolor
));
$filename= $this->folder."/".generatePassword(15).".png";
imagepng($img, $filename);
$filesize = filesize($filename);
Note the way how file info is stored in the database. Since new version offers multiple files
upload we need to be able to store more info there than just file name. Besides the file name
itself we also save file size, file type and path to the file in JSON format. Here is how typical
file upload field looks in the database:
[{"name":"files\/h8hsoz5hd23b0ik.jpg", "usrName":"Chrysanthemum.jpg",
"size":879394,"type":"image\/jpeg",
"searchStr":"Chrysanthemum.jpg:sStrEnd"},
{"name":"files\/2p85jz854o6fbv8.jpg",
"usrName":"Desert.jpg","size":845941, "type":"image\/jpeg",
"searchStr":"Desert.jpg:sStrEnd"},
© 2018 Xlinesoft
703 PHPRunner 10.0 Manual
{"name":"files\/pm4fu8uv2u6xc1w.jpg", "usrName":"Hydrangeas.jpg",
"size":595284,"type":"image\/jpeg", "searchStr":"Hydrangeas.jpg:sStrEnd"}]
3. Customization
Now it's the time to customize our plugin. Users may need to change the appearance and
behaviour of signature pad i.e.:
As a first step we need to learn to pass settings from PHPRunner wizard to plugin. Proceed to
"Edit as" dialog in PHRRunner and click Add initialization script button. Here is the sample set
of settings of SignaturePad control:
This code is self-descriptive, you can pass any number of settings there. If you create your
own edit control plugin place sample initialization script to sample.php file that needs to be
located in the plugin folder.
Now we can access those settings in plugin's initUserControl() function. We can also pass
settings to Javascript part of the plugin.
© 2018 Xlinesoft
Advanced topics 704
if (this.required)
this.addValidation("IsRequired");
Signature is not required by default. To make it required add the following line of code to
initialization script under 'Edit as' properties:
$this->settings["required"]=false;
$this->settings["height"] = 100;
$this->settings["width"] = 300;
$this->settings["folder"]="files";
$filename= $this->folder."/".generatePassword(15).".png";
bgcolor array contains color value in RGB format (Red, Green, Blue, each color ranges from 0
to 255, 0xff is a hexadecimal representation of 255. array(0xff, 0xff, 0xff) means white color.
Now in Javascript control constructor function we can use this.bgColor to pass background
color to SignaturePad control:
We also need to pass backgound color to sigJsonToImage() function that converts JSON
signature data to image. We use $this->bgcolor variable here in readWebValue() PHP function.
© 2018 Xlinesoft
705 PHPRunner 10.0 Manual
This is it. As you can creating your own edit control plugins is not a rocket science and you
can build something useful in just a few lines of code.
If you develop a new edit control plugin on your own and want to share it with other users
feel free to contact our support team. We'll be launching our marketplace soon where you can
earn a buck or two selling plugins you have developed.
ctrl.getTooltip()
ctrl.setTooltip( message )
ctrl.addTooltip( message )
© 2018 Xlinesoft
Advanced topics 706
ctrl.setInvalid( message )
ctrl.setValid()
The page can not be saved when there are invalid fields on it.
setValid() only removes status set by setInvalid(), it has no effect on other validations.
The following stored procedure example returns data from the "test" table. It should be
created in the in the SQL Server.
CREATE PROCEDURE [dbo].[test_proc]
AS
BEGIN
SET NOCOUNT ON;
SELECT * from test
END
See also
· DB_Query
· ListFetchArray
· fetchAssoc
· How to execute stored procedures
© 2018 Xlinesoft
707 PHPRunner 10.0 Manual
CustomQuery("EXEC StoredProcNameHere");
CustomQuery("CALL StoredProcNameHere");
For example, say you have Orders table and Order Details table , where order number is a
common field in each. You can create a master-details relationship that will enable you to navigate
through the Orders and jump to Order Details that belong to current order only.
© 2018 Xlinesoft
Advanced topics 708
Examples
1. To get the current value of this variable use the following function that returns current
selected language.
mlang_getcurrentlang()
2. If you need to assign the value to the variable, use the variable directly.
$_SESSION["language"]="English";
© 2018 Xlinesoft
709 PHPRunner 10.0 Manual
- template variables start with dollar ($) sign. They may contain numbers, letters and underscores.
Example: {$variable_name}
{BEGIN block_name} {END block_name} is used to define block section (loops, condition
statements).
Functions
· assign($name, $val) is used to assign value $val to the variable $name.
list.php
include('libs/xtempl.php');
// create object
$xt = new Xtempl();
// assign some content. This would typically come from
// a database or other source, but we'll use static
© 2018 Xlinesoft
Advanced topics 710
The template file then contains the output interspersed with tags that PHPRunner replaces with
assigned content.
list.htm output
<html> <html>
<head> <head>
<title>User Info</title> <title>User Info</title>
</head> </head>
<body> <body>
User Information:<p> User Information:<p>
Name: {$name}<br> Name: george smith<br>
Address: {$address}<br> Address: 45th & Harris<br>
</body> </body>
</html> </html>
Template file contains a set of code sections wrapped by {BEGIN ...} and {END ...}.
view.htm
{BEGIN Model_fieldblock}
<tr><td class=shade width=150>Model</td><td width=250>
{$Model_value}
</td></tr>
{END Model_fieldblock}
$xt->assign("Model_fieldblock",true); - code snippet between {BEGIN ...} and {END ...} appears in the o
© 2018 Xlinesoft
711 PHPRunner 10.0 Manual
On the server side javascript code needs to be assigned to body or end variables in block array.
list.php
// create an array
$body = array();
// code assigned to "begin" variable replaces {BEGIN body} tag
$body["begin"]='<form name="frmSearch" method="GET"
action="carsadmin_cars_list.php">
<input type="Hidden" name="a" value="search">
<input type="Hidden" name="value" value="1">
</form>';
// code assigned to "end" variable replaces {END body} tag
$body["end"]="<script>if(document.getElementById('SearchFor'))
document.getElementById('ctlSearchFor').focus();</script>";
// using assignbyref() function as body is an array
$xt->assignbyref("body",$body);
list.htm output
Syntax
runner_mail($params)
© 2018 Xlinesoft
Advanced topics 712
Arguments
$params - array with input parameters. The following parameters are supported:
· from - sender email address. If none specified an email address from the wizard will
be used.
· fromName - sender name.
· to - receiver email address.
· cc - email addresses of secondary recipients.
· bcc - email addresses of recipients whose addresses are not to be revealed to other
recipients of the message.
· replyTo - reply email address.
· priority - message priority (use '1' for urgent, '2' - high, '3' - normal).
· body - plain text message body.
· htmlbody - html message body (do not use 'body' parameter in this case).
· charset - html message charset. If none specified the default website charset will
be used.
· attachments - attachments description. The 'path' (a path to the attachment) is
required. Other parameters are optional: 'name' overrides the attachment name,
'encoding' sets a file encoding, 'type' sets a MIME type. Attachments will only work
when PHP mail is not in use. Email settings.
Return value
Examples
$email="[email protected]";
$message="Hello there\nBest regards";
$subject="Sample subject";
runner_mail(array('to' => $email, 'subject' => $subject,
'body' => $message));
$email="[email protected]";
$message="Hello there\n<b>Best regards</b>";
$subject="Sample subject";
runner_mail(array('to' => $email, 'subject' => $subject,
'htmlbody' => $message, 'charset' => 'UTF-8'));
$email="[email protected]";
© 2018 Xlinesoft
713 PHPRunner 10.0 Manual
$subject="Sample subject";
$body="test";
$arr = runner_mail(array('to' => $email, 'subject' => $subject,
'body' => $body));
// if error happened print a message on the web page
if (!$arr["mailed"])
{
echo "Error happened: <br>";
echo $arr["message"];
}
$email="[email protected]";
$message="Hello there\nBest regards";
$subject="Sample subject";
runner_mail(array('to' => $email, 'cc' => '[email protected]',
'bcc' => '[email protected]', 'subject' => $subject, 'body' => $message));
$email="[email protected]";
$message="Hello there\nBest regards";
$subject="Sample subject";
$from="[email protected]";
$fromName="Bill Gates";
runner_mail(array('to' => $email, 'subject' => $subject, 'body' =>
$message, 'fromName'=> $fromName, 'from' => $from));
$email="[email protected],[email protected],[email protected]";
$message="Hello there\nBest regards";
$subject="Sample subject";
runner_mail(array('to' => $email, 'subject' => $subject, 'body' =>
$message));
$from = "[email protected]";
$to = "[email protected]";
$msg = "Find some documents (Invoice.pdf, Photo.jpg, signature.jpg)
attached.";
$subject="Documents";
$attachments = array();
© 2018 Xlinesoft
Advanced topics 714
if(!$ret["mailed"]){
echo $ret["message"];
}
Send email with new record data. Use this code in the After Add event.
$from = "[email protected]";
$to = "[email protected]";
$msg = "The new record was added: ";
$subject="New record";
Description
© 2018 Xlinesoft
715 PHPRunner 10.0 Manual
Syntax
runner_sms($number, $message)
Arguments
Return value
Example
Send sms to number. This function will only work if you have Twilio settings entered
under Security -> Two factor authentication
$number="+12345678901";
$message="You verification code";
runner_sms($number, $message);
'Table name' is an optional parameter that must be provided for templates that are table
specific such as 'list.php', 'edit.php' etc. If the 'table name' parameter is a specified file, it will
be processed for each table in the project. Otherwise the template file will be processed just
once.
Files.txt supports a conditional compilation. See Template language reference for more info on
syntax.
Example:
© 2018 Xlinesoft
Advanced topics 716
##endif##
This code snippet tells the wizard to create Add page (tablename_add.php file) if the 'Add' or
'Inline Add' options have been selected for this table.
Each business template (Cars, Vacations, Paypal etc) has its own 'files.txt' which overrides the
rules defined in the main file.
If you add your own files to the template, it's necessary for you to add a new line to the
'files.txt' file that defines how new file should be processed.
Quick jump
Expressions
Operators
Statements
Output modifiers
Macros and constants
Additional language elements
Template language is the framework that powers visual and code templates in PHPRunner.
Most template language expressions are references to the project file. Template language
elements are wrapped by ## characters:
##if @field.m_bAddPage##
Expressions
1. Strings
Example:
· "string1" - string1;
2. Numbers
Examples:
· 2
· 3.3
· -2
© 2018 Xlinesoft
717 PHPRunner 10.0 Manual
3. Variables
Examples:
Variables belong to one of the following data types: strings, numbers, objects and arrays.
4. Boolean expressions
Operators
1. Comparison operators
· == - equals.
You can only compare numbers and strings. Comparison result is either 0 or 1.
2. Boolean
· or or ||
· and or &&
· not or !
Result is either 0 or 1.
3. Parenthesis
Example:
© 2018 Xlinesoft
Advanced topics 718
4. Dot operator
To access structure members, the operator used is the dot operator denoted by (.).
Example:
@field.m_ListFormatObj.m_nColWidth
Example:
@TABLE.m_arrFieldObj.len
6. Priority order
There is an established order with the priority of each operator. From greatest to lowest
priority, the priority order is as follows:
1. .
2. .len
3. parenthesis
4. comparison operators
5. not
6. and
7. or
Statements
1. Display a value of a variable or an expression
Examples:
· ##3## - displays 3.
· ##@field.m_bAddPage## - displays 0 or 1.
2. Conditional statement
Examples:
##if @field.m_bAddPage##
...
##elseif @field.m_strLabel=="ID"##
© 2018 Xlinesoft
719 PHPRunner 10.0 Manual
...
##else##
...
##endif##
3. Loop statements
The variable is created when loop starts and destroyed with the 'endfor'.
Example:
Filter
Nested loops
Example:
© 2018 Xlinesoft
Advanced topics 720
The loop variable @index will take on the values 1, 2, ..., N through each of the N iterations of
the loop's body.
· 0 - otherwise.
It is useful when you need to perform some action only once i.e. skip a comma in front of table
name:
$tables = Array("Table1","Table2","Table3");
##if !@first## , ##endif##
In loops, @first terminates execution of the nearest enclosing foreach or repeat statement.
Control then passes to the statement that follows the terminated statement, if any:
Example. Get a list of fields ordered by nEditPageOrder (field order on the edit page):
Output modifiers
Modifiers are required to encode quotes, slashes and other "bad" characters that can break
template language elements. You can combine several modifiers. Modifiers order is important.
Example:
##@field.m_strLabel hs##
© 2018 Xlinesoft
721 PHPRunner 10.0 Manual
· h - HTML-encodes string.
· u - URL-encodes string.
· w - adds wrappers around the field name ([field name] or `field name`).
· t - adds wrappers around the table name ([dbo].[table name] or `table name`).
· c - removes spaces.
· a - builds valid PHP variable name from table name. Used in Data Access Layer.
· f - builds valid PHP variable name from field name. Used in Data Access Layer.
##define UseRTE(@field)
(@field.strEditFormat==EDIT_FORMAT_TEXT_AREA &&
@field.m_EditFormatObj.m_bUseRTE)
##
© 2018 Xlinesoft
Advanced topics 722
Macros and constants are processed in the same way. Therefore, we suggest to follow this
naming convention: constant names are written in upper case (e.g.
FORMAT_DATABASE_IMAGE), macro names use CamelCase convention (e.g. UseCalendar).
Spaces are not allowed in macro or constant names.
Example:
##if @field.strViewFormat==FORMAT_DATABASE_IMAGE##
##if UseRTE(@field)##
##foreach Fields as @f##
##Master.strCaption##
Example:
##@TABLE.arrFieldObj[[email protected]].strLabel##
This example shows how to access the Label property of a key column field or any other field.
© 2018 Xlinesoft
723 PHPRunner 10.0 Manual
Cars Users
5 Audi TT 3
Here is the default SQL query PHPRunner builds for table Cars:
select [ID],
[Make],
[Model],
[UserID],
From [Cars]
select Cars.[ID],
[Make],
[Model],
[UserID],
UserName
From [Cars]
inner join users on cars.userid=users.id
If you don't specify what table ID field belongs you see the error message similar to this one:
Error message:
© 2018 Xlinesoft
Advanced topics 724
3.3.1 Using FTP client to publish PHP pages to the remote Web server
When you have created a set of PHP pages with PHPRunner, you may use any FTP client to upload
them on a remote Web server. We will show you how to do it using popular FTP client WS_FTP Pro
as an example.
First of all, create your FTP server connection using WS_FTP Pro Connection Wizard. Follow the
directions in the Connection Wizard - type in server name or IP address, username and password.
Set connection type to FTP and connect to remote FTP server.
On the left panel (your local machine) proceed to the directory you have chosen as output
directory in PHPRunner. On the right panel you may see folders of your remote Web server. Create a
© 2018 Xlinesoft
725 PHPRunner 10.0 Manual
new folder on the remote server, name it PHPrunner and open it. Select all files on the left panel
(menu Edit - Select All) and click the Upload button.
When all necessary files have been copied to the Web server, start browser, type the name of your
Web site in the address line and add "/the name of the folder you just made" after it. In our
example, it will be: http://www.xlinesoft.com/test/PHPrunner/
3.3.2 Using FrontPage to publish PHP pages to the remote Web server
Here is how files generated by PHPRunner can be published on the Web using Frontpage:
· Run PHPRunner. Point it to your database and create your PHP pages. Lets assume that your
output folder is D:\Projects\Project1\output.
© 2018 Xlinesoft
Advanced topics 726
· Select Import Web Wizard. Enter your Web site address in the address box (i.e.
http://www.yourservername.com/PHPRunner) and click Ok.
· On the Import Web Wizard dialog, select PHPRunner output directory (D:
\Projects\Project1\output) as a source. Include subfolders and click Next.
Demo Account allows you quickly put PHP application generated by PHPRunner on our demo
web server for testing purposes.
· you don't have a web server on your local machine to test PHP pages
· you need to show generated application to your boss, friends or to support staff
To open and use Demo Account proceed to the Finished tab in PHPRunner and click Demo
Account button. To create an account enter your email and password. You will need this info
to manage your account online. After account is created use Upload button to transfer PHP
application to the web server. After successfull upload this application will open in browser.
Demo Account transfers generated pages and your database to the server. Currently
supported databases are MS Access, SQL Server, MySQL.
· Since this account is designed for demo purposes only first 1000 data records in each
tables of SQL Server/MySQL databases will be transferred to the server. MS Access
databases are transferred to the server wholly.
© 2018 Xlinesoft
727 PHPRunner 10.0 Manual
If you are interested in opening a full featured webhosting account that supports one click
publishing from PHPRunner, visit http://inspirunner.com for more details.
A violation of any of the below Terms and Conditions will result in the termination of your
account, with or without warning.
We provides free demo account for our users. Xlinesoft.com reserves the right to cancel any
account for any reason or no reason at all. Xlinesoft.com provides this service to any user that
abides to our terms and conditions. Failure to abide to these rules will result in account
termination. Furthermore, any one who conducts illegal activities may be prosecuted and
personal information disclosed to the appropriate authority. Xlinesoft.com reserves the right to
change the terms and conditions at any time and it is the member’s responsibility to check for
any updates of these terms. You are entirely liable for all activities conducted through your
account.
Your use of the Xlinesoft.com Demo Account is conditional upon your acceptance without
modification of the terms, conditions and notices contained herein. Your use of our Services
constitutes your agreement to all such terms, conditions and notices.
1.1 Upon after creating a Demo Account through Xlinesoft.com software you will become a
user of Xlinesoft.com Demo Account.
1.2 Xlinesoft.com does not issue credits for outages incurred through service disablement
resulting from Terms and Conditions violations.
2.1 We reserve the right to change the terms and conditions of this agreement at any time
without prior notice. Such changes will be posted on our web site at www.xlinesoft.com. You
agree to review any changes to this agreement and, if such changes are not acceptable to
you, immediately terminate your use of the Xlinesoft.com Demo Account. If you continue to
use the Xlinesoft.com service after the effective date of such changes, such use will
constitute acceptance of the changes.
3.1 By accepting this Agreement, you hereby acknowledge and agree that, in our sole
discretion, we may modify or discontinue, temporarily or permanently, any aspect of the
Xlinesoft.com Demo Account at any time with or without prior notice, including, without
limitation, modification or discontinuance of advertising, content and applications appearing as
© 2018 Xlinesoft
Advanced topics 728
part of the Xlinesoft.com Demo Account. You agree that we will not be liable to you or to any
third party for any modification, suspension or discontinuance of the Xlinesoft.com Demo
Account.
4. Privacy
4.1 Xlinesoft.com adheres to a Privacy Statement and will not release any confidential
information about you unless required by law or regulatory authority or while assisting an
investigation concerning fraud.
5.1 Xlinesoft.com Demo Account may be used for lawful purposes only. As a condition of your
use of the Xlinesoft.com Demo Account, you agree that you will not use our Website for any
purpose that is unlawful, illegal or prohibited by these Terms of Services, or our other terms,
conditions or notices. You agree that you will not modify, copy, distribute, transmit,
reproduce, publish, license, transfer, store, sell or create derivative works from, any data,
software, Services or products obtained through our Website. This includes, but is not limited
to: copyrighted material; trademarks; trade secrets or other intellectual property rights used
without proper authorization; material that is obscene, defamatory, constitutes an illegal
threat, or violates export control laws. Examples of unacceptable content or links include:
pirated software, hacker programs or archives, Warez sites, MP3, and IRC bots. Such misuse
can result in the cancellation of your entire account and the blacklisting of your domains
without notice. You or Xlinesoft.com may terminate your Demo Account at any time for any
reason.
Enterprise Edition of PHPRunner includes the online report/chart builder that allows you to view,
create, edit and delete reports and charts in the web browser.
To enable the online report/chart builder, select the Web Reports check box on the
Miscellaneous page and build the project. Then launch online report/chart builder by running
webreport.php in the browser (e.g. http://www.yourwebsite.com/project1/webreport.php).
Online report/chart builder uses PHPRunner project security model. So if you use a login page, you
need to logon to your application first.
© 2018 Xlinesoft
729 PHPRunner 10.0 Manual
You can view, edit or delete charts and reports if the permissions allow you to do so. Also you can
create new chart or new report.
While viewing a report or chart you can narrow the finding using Advanced search. While viewing a
report you can also print the current page or the whole report, open a report as Microsoft Word or
Microsoft Excel document.
© 2018 Xlinesoft
Advanced topics 730
On the Admin page you can select tables to be available for creating web reports and charts.
© 2018 Xlinesoft
731 PHPRunner 10.0 Manual
The Admin page is available only to the web reports and charts administrator that can be assigned
on the Security -> Permissions page. To specify the password to access the Web Reports and
Charts admin area, click the Administrator button on the Miscellaneous page.
© 2018 Xlinesoft
Advanced topics 732
A user with admin permissions can create/edit/delete custom SQL queries using the Custom SQL
button. The custom SQL queries later may be used by other users as a datasource for reports and
charts. For more information, see Custom SQL.
© 2018 Xlinesoft
733 PHPRunner 10.0 Manual
The Back and Next buttons allow you to jump to previous and next page correspondingly. Use
Jump to button to jump to any other page. The Save button saves the report and moves you to
the web reports menu (start page). Use the SQL Query button to view resulting SQL query and
query results. The Preview button allow you to see how you report will look.
© 2018 Xlinesoft
Advanced topics 734
Below you can find the description of the report creation steps:
Tables
On this page you can choose a table, view or SQL query as a datasource for your report. Note
that tables that are not added to the project from a database are not available for selection.
· All tables added to the project are available for selection. User tables (custom views) are
not available.
· When viewing a report, all user permissions (static and dynamic permissions, advanced
security option) and "view/edit" field settings do not work.
· While creating a report you will be able to create table relations (SQL joins) to query data
from two or more tables and add additional search conditions using WHERE clause.
· All tables added to the project and custom views created in PHPRunner are available for
selection.
· When viewing a report, user permissions and "view/edit" field settings work as usual.
· While creating a report you will not be able to create table relations (SQL joins) to query
data from two or more tables and add additional search conditions using WHERE clause.
The SQL queries defined in PHPRunner will be used to query data for report.
· Tables for selection are displayed as Caption (table title), e.g. Cars (carscars).
SQL queries
On the SQL queries tab a user with admin permissions can create new custom SQL query using
the New query button and edit the existing SQL queries using the SQL Query button. For
more information about custom SQL queries, see Custom SQL.
© 2018 Xlinesoft
735 PHPRunner 10.0 Manual
Table Relations
Note: this page is available if you selected a table from the database as report data source.
On this page you can create table relations (SQL joins) to query data from two or more tables,
based on a relationship between certain fields in these tables. You can add Inner Join, Left
Join, Right Join and Full Outer Join.
To add an SQL join, choose tables and fields to be joined and click Add Relation. The JOIN
clause will be added below the SELECT clause. Note that you can add several table relations.
© 2018 Xlinesoft
Advanced topics 736
Use SQL Query button to view resulting SQL query and query results.
© 2018 Xlinesoft
737 PHPRunner 10.0 Manual
Use the Remove Relation button to delete the selected table relation.
Where Condition
Note: this page is available if you selected a table from the database as report data source.
On this page you can add additional search conditions using WHERE clause. Select a field and
type search criteria in the text boxes on the right. Search criterion should be added as
<operator><value>. E.g. ='USA'; =2009; <>'red'; >10.
© 2018 Xlinesoft
Advanced topics 738
Use the SQL Query button to view resulting SQL query and query results.
© 2018 Xlinesoft
739 PHPRunner 10.0 Manual
Group fields
On this page you can add group fields to group the results by one or more columns. The
following picture explains how each option works.
If you clear the Details and summary check box, only summary will be shown in the report.
Besides standard intervals (new group starts when group field value changes) you can use
other interval types. Available interval types are different for each data type. Here is the
example of text group field using first letter as an interval.
© 2018 Xlinesoft
Advanced topics 740
Use the SQL Query button to view resulting SQL query and query results.
Totals
On this page you can choose what fields to display in the report and specify field labels. Also
you can apply aggregate functions like MIN, MAX, SUM and AVERAGE. The results of these
calculations will be displayed after each group and at the end of page/report. Note than you
can't modify settings for group fields. Use arrows on the left of the field names to change the
fields order.
© 2018 Xlinesoft
741 PHPRunner 10.0 Manual
Miscellaneous
On this page you can choose report layout. If you use grouping you can choose between
Stepped, Block, Outline and Align layouts. If you don't use grouping you can use only Tabular
layout.
Print-friendly page option enables/disables the following features: printing the whole report or
its page in print-friendly version, opening a report as Microsoft Word or Microsoft Excel
document.
Use Number of lines per page option to determine where to insert the page break, when you
print the whole report.
© 2018 Xlinesoft
Advanced topics 742
Sort fields
On this page you can define sort fields to sort the records in the report. Note than you can't
modify settings for group fields.
© 2018 Xlinesoft
743 PHPRunner 10.0 Manual
Use the SQL Query button to view resulting SQL query and query results.
Style Editor
On this page you can define font settings and background color to be used in the report.
Firstly, select report element and then define style settings for it. Using apply to dropdown list
box you can apply changes made to a group (row), field (column) or all text in the report. Use
Reset to default button to return to default settings.
© 2018 Xlinesoft
Advanced topics 744
Settings
On this page you can define the report name and title. If your project uses security, you have
also an option to make a report private. Private reports are not accessible by anyone but
owner. Non-private (public) ones will appear under "shared" section on the start page.
© 2018 Xlinesoft
745 PHPRunner 10.0 Manual
Dynamic Permissions
Note: this page is available if you enabled dynamic permissions in PHPRunner and a report is
not marked as private on the previous step.
On this page you can assign user group permissions to view/edit/delete a report.
© 2018 Xlinesoft
Advanced topics 746
The Back and Next buttons allow you to jump to previous and next page correspondingly. Use
Jump to button to jump to any other page. The Save button saves the chart and moves you to
the web reports menu (start page). Use the SQL Query button to view resulting SQL query and
query results. The Preview button allow you to see how you chart will look.
Below you can find the description of the chart creation steps:
Tables
On this page you can choose a table, view or SQL query as a data source for your chart. Note
that tables that are not added to the project from a database are not available for selection.
Tables from the database
· All tables added to the project are available for selection. User tables (custom views) are
not available.
© 2018 Xlinesoft
747 PHPRunner 10.0 Manual
· When viewing a chart, all user permissions (static and dynamic permissions, advanced
security option) and "view/edit" field settings do not work.
· While creating a chart you will be able to create table relations (SQL joins) to query data
from two or more tables and add additional search conditions using WHERE clause.
· All tables added to the project and custom views created in PHPRunner are available for
selection.
· When viewing a chart, user permissions and "view/edit" field settings work as usual.
· While creating a chart you will not be able to create table relations (SQL joins) to query
data from two or more tables and add additional search conditions using WHERE clause.
The SQL queries defined in PHPRunner will be used to query data for the chart.
· Tables for selection are displayed as Caption (table title), e.g. Cars (carscars).
SQL queries
On the SQL queries tab a user with admin permissions can create new custom SQL query using
the New query button and edit the existing SQL queries using the SQL Query button. For more
information about custom SQL queries, see Custom SQL.
© 2018 Xlinesoft
Advanced topics 748
Table Relations
Note: this page is available if you selected a table from the database as chart data source.
On this page you can create table relations (SQL joins) to query data from two or more tables,
based on a relationship between certain fields in these tables. You can add Inner Join, Left
Join, Right Join and Full Outer Join.
To add an SQL join, choose tables and fields to be joined and click Add Relation. The JOIN
clause will be added below the SELECT clause. You can add several table relations. Use the
Remove Relation button to delete the selected table relation.
© 2018 Xlinesoft
749 PHPRunner 10.0 Manual
Use SQL Query button to view resulting SQL query and query results.
Group By
Note: this page is available if you selected a table from the database as chart data source.
On this page you can add additional search conditions using WHERE clause. To do this select a
field in the first column and type search criteria in the Filter and OR... text boxes on the right.
Search criterion should be added as <operator><value>. E.g. ='USA' or =2009 or <>'red' or
>10.
© 2018 Xlinesoft
Advanced topics 750
Also you can define sort fields to sort the records in the chart. To do this select a field in the
first column and choose sort type and sort order.
In addition, you can add group fields to group the results by one or more columns and apply
aggregate functions like MIN, MAX, SUM, AVERAGE and COUNT. To do this select a field in the
first column, select the Group By check box and choose one of values in the dropdown list box
under this check box. You can filter the records that a GROUP BY clause returns using HAVING
clause. To do this select a field in the first column, select one of the aggregate functions and
type the condition as <operator><value> in the textbox under Having. E.g. >10 or = 500.
Let's build a chart showing the number of employees per city except 'London'. We need to use
WHERE clause to select employees that are not working in London, GROUP BY clause to group
records by city and COUNT function to calculate the number of employees in each city.
Use SQL Query button to view resulting SQL query and query results.
© 2018 Xlinesoft
751 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Advanced topics 752
Type
On this page you can select a chart type. For more information, see Chart types.
Parameters
On this page you can choose Data Series fields (fields with data) and label field (field with data
labels).
You can add unlimited number of data series. Additional Data series dropdown list boxes are
added automatically once you used available ones.
For more information about choosing data series for certain chart type, see Chart types.
© 2018 Xlinesoft
753 PHPRunner 10.0 Manual
Note: only numeric fields can be chosen as a Data Series. Therefore only numeric fields are
available for selection in Data Series dropdown list box.
The color options define the colors of the data series in the Line charts.
If we select Data Series and Label fields as shown on the image above, we receive the
following chart:
© 2018 Xlinesoft
Advanced topics 754
Appearance
On this page you can define how your chart will be displayed on the web page. The following
two pictures explain how each option works (on the first picture we numbered the options; on
the second one we showed how these options effect on the chart appearance).
© 2018 Xlinesoft
755 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Advanced topics 756
Use the Autoupdate check box to enable chart auto-refresh by specified time interval. The
Use animation check box enables the chart animation while opening a chart.
The Chart scrolling option allows you display a scrollable chart. Don't forget to define the
number of bars to show on the chart screen.
Use the Logarithmic Y-Axis option to convert a linear value axis to a logarithmic value axis. If
you have several data series on the chart, you can use the Multiple Y-Axes option to position
each data series relative to its own Y axis.
For more information about appearance settings for certain chart type, see Chart types.
Settings
On this page you can define the chart name and title. If your project uses security, you have
also an option to make a chart private. Private charts are not accessible by anyone but owner.
© 2018 Xlinesoft
757 PHPRunner 10.0 Manual
Non-private (public) ones will appear under "shared" section on the start page.
Dynamic Permissions
Note: this page is available if you enabled dynamic permissions in PHPRunner and a chart is
not marked as private on the previous step.
On this page you can assign user group permissions to view/edit/delete a chart.
© 2018 Xlinesoft
Advanced topics 758
A user with admin permissions (admin) can create custom SQL queries that later may be used by
other users as a datasource for reports and charts. Also admin can edit and delete custom SQL
queries.
To view/create/edit/delete custom SQL queries use the Custom SQL button on the start window.
© 2018 Xlinesoft
759 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Advanced topics 760
3. Enter SQL query name and the query code. If you wish to set permissions for the created
query right after its saving, select the Proceed to permissions screen check box. Note that
you can set permissions later on the Admin page (use the Admin page button on the start
window).
© 2018 Xlinesoft
761 PHPRunner 10.0 Manual
Note that you can use stored procedures in the SQL query for those databases where they are
supported (MS SQL Server, MySQL, Oracle, etc.).
4. Click Save.
When creating a report or chart a user can choose custom SQL query as a datasource (go to the
SQL queries tab on the Tables window). Admin can also create new custom SQL query using the
New query button and edit the existing SQL queries using the SQL Query button.
© 2018 Xlinesoft
Advanced topics 762
3.6.1 Yahoo!
3.6.1.1 Connecting to MySQL
To connect from PHPRunner to the remote MySQL database stored at your Yahoo! account, follow
the instructions below.
© 2018 Xlinesoft
763 PHPRunner 10.0 Manual
4. In the Other Site Building and Editing Tools section click the MySQL Database link.
6. Enter a database administrator user name and password. Note: Choose a user name
carefully, as you will not be able to change it later.
7. Click Submit.
2. Read General Public License Agreement and click I agree to These Terms.
3. Choose the site folder in which you'd like to install phpMyAdmin. Select an existing directory
or create a new directory, then choose the corresponding Install phpMyAdmin link to begin
the installation.
4. Type mysql as a Host/Server Name, enter your database administrator user name and
password.
5. Select the Connect using PHP check box and click Upload phprunner.php.
To obtain your FTP settings, log in to your account at webhosting.yahoo.com. Click the
Web Hosting Control Panel link, then select Manage tab. In the Web Hosting Account
Details section you will see your account FTP settings.
© 2018 Xlinesoft
Advanced topics 764
Return to the PHPRunner and enter Host name, User ID and Password. Then click Browse
to select a directory to upload files to. If you receive an error while creating new
directory, select the Passive mode check box.
© 2018 Xlinesoft
765 PHPRunner 10.0 Manual
7. Click Upload! button. Wait while PHPRunner uploads phprunner.php file to your Yahoo!
account, then click Close.
8. Click Connect.
© 2018 Xlinesoft
Advanced topics 766
9. To create a new database click New. After database is created, you will proceed to
datasource tables page.
If you receive an error while creating a database, you should do that in phpMyAdmin. So
proceed to the next step.
1. Go to your phpMyAdmin homepage. You can access the tool by visiting your phpMyAdmin
home page at http://www.yourdomain.com/subdirectory/, replacing yourdomain.com with your
own domain name and subdirectory with the name of the site folder in which your phpMyAdmin
files are installed.
3. Enter a database name and select the Character Sets and Collations under the Create new
database. Click Create.
© 2018 Xlinesoft
767 PHPRunner 10.0 Manual
Congratulations! You have connected to the MySQL database. Now it is time to create/modify
datasource tables.
To configure FTP client built into PHPRunner to upload files to your Yahoo! account, follow the
instructions below.
2. Click the Web Hosting Control Panel link, then select Manage tab.
3. In the Web Hosting Account Details section you will see your account FTP settings.
© 2018 Xlinesoft
Advanced topics 768
4. Start PHPRunner and open FTP location properties dialog. This dialog is available while
connecting to MySQL under Upload phprunner.php button or when a project is built on the last
program screen under Publish via FTP button.
5. Enter Host name, User ID and Password. Then click Browse to select a directory to upload files
to. If you receive an error while creating new directory, select the Passive mode check box.
© 2018 Xlinesoft
769 PHPRunner 10.0 Manual
6. Click OK.
Congratulations! FTP client is now configured to upload files to your Yahoo! account.
1. Start PHPRunner.
4. If you have already configured FTP client, choose FTP location and click Properties. Click
Browse to select a directory to upload your project files to. Update the Remote web site URL
textbox accordingly to selected site folder. E.g. if you selected a root site folder, the remote web
site URL will be http://www.yourdomain.com/. Click OK.
If you have not configured FTP client yet, follow the instructions below.
To obtain yout FTP settings, log in to your account at webhosting.yahoo.com. Click the Web
Hosting Control Panel link, then select Manage tab. In the Web Hosting Account Details
section you will see your account FTP settings.
© 2018 Xlinesoft
Advanced topics 770
Return to the PHPRunner and enter Host name, User ID and Password. Then click Browse to
select a directory to upload files to. If you receive an error while creating new directory, select
the Passive mode check box.
© 2018 Xlinesoft
771 PHPRunner 10.0 Manual
5. Choose Upload all files to upload all files generated by PHPRunner. More info about FTP upload.
7. Wait while PHPRunner uploads the project files to your Yahoo! account, then click Close. After
that your web site opens in a browser.
3.6.2 1&1
3.6.2.1 Connecting to MySQL
To connect from PHPRunner to the remote MySQL database stored at your 1&1 account, follow the
instructions below.
2. Select MySQL Administration from the Web Space & Access section.
© 2018 Xlinesoft
Advanced topics 772
6. The complete MySQL database information is displayed. You will use this information while
connecting to MySQL database from PHPRunner. It may take some time to set up your
database. When the status of your database became ready, you can go forward and connect
to your database from PHPRunner.
© 2018 Xlinesoft
773 PHPRunner 10.0 Manual
4. Enter a host name, user name and password indicated for your database in the 1&1 Control
panel.
5. Select the Connect using PHP check box and click Upload phprunner.php.
© 2018 Xlinesoft
Advanced topics 774
To obtain yout FTP settings, log in to the 1&1 Control Panel at https://admin.1and1.com.
If you have only one package, you will land on the Administration page. If you have more
than one package, select the relevant package to reach its Administration page. Select
FTP Account from the Web Space & Access section. You can see the FTP settings for
your account.
© 2018 Xlinesoft
775 PHPRunner 10.0 Manual
7. Click Upload! button. Wait while PHPRunner uploads phprunner.php file to your 1&1
account, then click Close.
8. Click Connect. If only one database is stored at the indicated server, you will proceed to
datasource tables page. If there are several databases on the server, you need to select a
database and click Next>>.
© 2018 Xlinesoft
Advanced topics 776
Congratulations! You have connected to the MySQL database. Now it is time to create/modify
datasource tables.
To configure FTP client built into PHPRunner to upload files to your 1&1 account, follow the
instructions below.
1. Log in to the 1&1 Control Panel at https://admin.1and1.com. If you have only one package, you
will land on the Administration page. If you have more than one package, select the relevant
package to reach its Administration page.
2. Select FTP Account from the Web Space & Access section. You can see the FTP settings for
your account. You will use this information later.
3. Start PHPRunner and open FTP location properties dialog. This dialog is available while
connecting to MySQL under Upload phprunner.php button or when a project is built on the last
program screen under Publish via FTP button.
© 2018 Xlinesoft
777 PHPRunner 10.0 Manual
4. Type yourdomain.com as a host name, replacing yourdomain.com with your domain name.
Enter User name and Password indicated for your FTP account in the 1&1 Control panel. Then click
Browse to select a directory to upload files to. If you receive an error while creating new directory,
select the Passive mode check box.
5. Click OK.
Congratulations! FTP client is now configured to upload files to your 1&1 account.
To publish generated project files to your 1&1 hosting account using built into PHPRunner FTP
client, follow the instructions below.
1. Start PHPRunner.
4. If you have already configured FTP client, choose FTP location and click Properties. Click
Browse to select a directory to upload your project files to. Update the Remote web site URL
© 2018 Xlinesoft
Advanced topics 778
textbox accordingly to selected site folder. E.g. if you selected a root site folder, the remote web
site URL will be http://www.yourdomain.com/. Click OK.
If you have not configured FTP client yet, follow the instructions below.
To obtain yout FTP settings, log in to the 1&1 Control Panel at https://admin.1and1.com. If
you have only one package, you will land on the Administration page. If you have more than
one package, select the relevant package to reach its Administration page. Select FTP
Account from the Web Space & Access section. You can see the FTP settings for your
account.
© 2018 Xlinesoft
779 PHPRunner 10.0 Manual
5. Choose Upload all files to upload all files generated by PHPRunner. More info about FTP upload.
7. Wait while PHPRunner uploads the project files to your 1&1 account, then click Close. After that
your web site opens in a browser.
3.6.3 GoDaddy.com
3.6.3.1 Connecting to MySQL
To connect from PHPRunner to the remote MySQL database stored at your GoDaddy account, follow
the instructions below.
© 2018 Xlinesoft
Advanced topics 780
5. Enter a database description, database name (that will also serve as a user name) and
password. Select 5.0 as MySQL version. Select Yes under Allow Direct Database Access.
6. Click OK. It may take a few minutes to create a database. Click your browser's Refresh
button to check if your database is ready.
7. Once you have set up a database for your account, click the Pencil icon next to the name
of your database. The complete MySQL database information will be displayed. You will use
this information while connecting to MySQL database from PHPRunner.
© 2018 Xlinesoft
781 PHPRunner 10.0 Manual
4. Enter a Host Name, User Name and Password indicated for your database in the GoDaddy
Hosting Control Center.
5. Click Connect.
© 2018 Xlinesoft
Advanced topics 782
Congratulations! You have connected to the MySQL database. Now it is time to create/modify
datasource tables.
To configure FTP client built into PHPRunner to upload files to your GoDaddy account, follow the
instructions below.
· FTP User Name - the user name for your hosting account.
If you are missing any of this information, log in to your GoDaddy Account Manager at
http://mya.godaddy.com/default.aspx?prog_id=GoDaddy. In the My Products section, click
Hosting. In your Hosting Account list, click the name of a hosting account you want to work
with. In the Account Details section, your Hosting Login displays.
© 2018 Xlinesoft
783 PHPRunner 10.0 Manual
2. Start PHPRunner and open FTP location properties dialog. This dialog is available while
connecting to MySQL under Upload phprunner.php button or when a project is built on the last
program screen under Publish via FTP button.
© 2018 Xlinesoft
Advanced topics 784
4. Click OK.
Congratulations! FTP client is now configured to upload files to your GoDaddy account.
1. Start PHPRunner.
4. If you have already configured FTP client, choose FTP location and click Properties. Click
Browse to select a directory to upload your project files to. Update the Remote web site URL
textbox accordingly to selected site folder. E.g. if you selected a root site folder, the remote web
site URL will be http://www.yourdomain.com/. Click OK.
If you have not configured FTP client yet, follow the instructions below.
· FTP User Name - the user name for your hosting account.
© 2018 Xlinesoft
785 PHPRunner 10.0 Manual
If you are missing any of this information, log in to your GoDaddy Account Manager at
http://mya.godaddy.com/default.aspx?prog_id=GoDaddy. In the My Products section, click
Hosting. In your Hosting Account list, click the name of a hosting account you want to work
with. In the Account Details section, your Hosting Login displays.
© 2018 Xlinesoft
Advanced topics 786
5. Choose Upload all files to upload all files generated by PHPRunner. More info about FTP upload.
7. Wait while PHPRunner uploads the project files to your GoDaddy account, then click Close. After
that your web site opens in a browser.
3.6.4 WebHost4Life.com
3.6.4.1 Connecting to MySQL
To connect from PHPRunner to the remote MySQL database stored at your WebHost4Life account,
follow the instructions below.
© 2018 Xlinesoft
787 PHPRunner 10.0 Manual
2. Click Database.
4. Enter a database name, database user name and password. Select 5.0.22 as MySQL
version.
6. Once your database is set up, you will see the complete MySQL database information. You
will use this information while connecting to MySQL database from PHPRunner.
© 2018 Xlinesoft
Advanced topics 788
4. Enter a Host Name, User Name and Password indicated for your database in the Hosting
Control Panel.
5. Click Connect.
© 2018 Xlinesoft
789 PHPRunner 10.0 Manual
Congratulations! You have connected to the MySQL database. Now it is time to create/modify
datasource tables.
To configure FTP client built into PHPRunner to upload files to your WebHost4Life account,
follow the instructions below.
If you are missing any of this information, log in to the Hosting Control Panel at
https://linuxcp.mysite4now.com/wcp/ for Linux hosting or
https://controlpanel.mysite4now.com/wcp/ for Windows hosting.
2. Start PHPRunner and open FTP location properties dialog. This dialog is available while
connecting to MySQL under Upload phprunner.php button or when a project is built on the
last program screen under Publish via FTP button.
© 2018 Xlinesoft
Advanced topics 790
select a directory to upload files to. If you receive an error while creating new directory,
select the Passive mode check box.
4. Click OK.
Congratulations! FTP client is now configured to upload files to your WebHost4Life account.
To publish generated project files to your WebHost4Life hosting account using built into
PHPRunner FTP client, follow the instructions below.
1. Start PHPRunner.
4. If you have already configured FTP client, choose FTP location and click Properties. Click
Browse and choose the www site folder. In the Remote web site URL textbox type
http://www.yourdomain.com/, replacing yourdomain.com with your domain name. Click OK.
If you have not configured FTP client yet, follow the instructions below.
© 2018 Xlinesoft
791 PHPRunner 10.0 Manual
If you are missing any of this information, log in to the Hosting Control Panel at
https://linuxcp.mysite4now.com/wcp/ for Linux hosting or
https://controlpanel.mysite4now.com/wcp/ for Windows hosting.
© 2018 Xlinesoft
Advanced topics 792
5. Choose Upload all files to upload all files generated by PHPRunner. More info about FTP
upload.
7. Wait while PHPRunner uploads the project files to your WebHost4Life account, then click
Close. After that your web site opens in a browser.
3.6.5 MyHosting.com
3.6.5.1 Connecting to MySQL
To connect from PHPRunner to the remote MySQL database stored at your MyHosting.com account,
follow the instructions below.
4. Your MySQL database details are displayed. You will use this information while connecting to
MySQL database from PHPRunner.
© 2018 Xlinesoft
793 PHPRunner 10.0 Manual
4. Enter the host/server name, user name and password indicated for your database in the
Control panel.
5. Select the Connect using PHP check box and click Upload phprunner.php.
© 2018 Xlinesoft
Advanced topics 794
If you are missing any of this information, log in to the MyHosting.com Control Panel at
https://support.myhosting.com/ and click Hosting. You can see the FTP settings for your
account.
© 2018 Xlinesoft
795 PHPRunner 10.0 Manual
files to. If you receive an error while creating new directory, select the Passive mode
check box.
7. Click Upload! button. Wait while PHPRunner uploads phprunner.php file to your
MyHosting.com account, then click Close.
8. Click Connect.
© 2018 Xlinesoft
Advanced topics 796
Congratulations! You have connected to the MySQL database. Now it is time to create/modify
datasource tables.
To configure FTP client built into PHPRunner to upload files to your MyHosting.com account, follow
the instructions below.
If you are missing any of this information, log in to the MyHosting.com Control Panel at
https://support.myhosting.com/ and click Hosting. You can see the FTP settings for your account.
© 2018 Xlinesoft
797 PHPRunner 10.0 Manual
2. Start PHPRunner and open FTP location properties dialog. This dialog is available while
connecting to MySQL under Upload phprunner.php button or when a project is built on the last
program screen under Publish via FTP button.
3. Type yourdomain.com as a host name and user name, replacing yourdomain.com with your
domain name. Enter password for your MyHosting.com account. Then click Browse to select a
directory to upload files to. If you receive an error while creating new directory, select the Passive
mode check box.
© 2018 Xlinesoft
Advanced topics 798
4. Click OK.
Congratulations! FTP client is now configured to upload files to your MyHosting.com account.
1. Start PHPRunner.
4. If you have already configured FTP client, choose FTP location and click Properties. Click
Browse and choose the docs site folder. In the Remote web site URL textbox type
http://www.yourdomain.com/, replacing yourdomain.com with your domain name. Click OK.
If you have not configured FTP client yet, follow the instructions below.
© 2018 Xlinesoft
799 PHPRunner 10.0 Manual
If you are missing any of this information, log in to the MyHosting.com Control Panel at
https://support.myhosting.com/ and click Hosting. You can see the FTP settings for your
account.
© 2018 Xlinesoft
Advanced topics 800
5. Choose Upload all files to upload all files generated by PHPRunner. More info about FTP upload.
7. Wait while PHPRunner uploads the project files to your MyHosting.com account, then click Close.
After that your web site opens in a browser.
3.6.6 InspiRunner.com
3.6.6.1 Connecting to MySQL
To connect from PHPRunner to the remote MySQL database stored at your InspiRunner.com
account, follow the instructions below.
© 2018 Xlinesoft
801 PHPRunner 10.0 Manual
3. Click Databases.
5. Enter a name for the database. Select the MySQL database type. Click OK.
7. Type a user name and a password that will be used for accessing the database.
8. Click OK.
4. Enter localhost as the host/server name, database user name and password.
8. Click Connect.
© 2018 Xlinesoft
Advanced topics 802
Congratulations! You have connected to the MySQL database. Now it is time to create/modify
datasource tables.
To configure FTP client built into PHPRunner to upload files to your InspiRunner.com account,
follow the instructions below.
If you are missing any of this information, log in to the InspiRunner.com Control Panel at
https://www.inspirunner.com:8443/login.php3.
2. Start PHPRunner and open FTP location properties dialog. This dialog is available while
connecting to MySQL under Upload phprunner.php button or when a project is built on the
last program screen under Publish via FTP button.
© 2018 Xlinesoft
803 PHPRunner 10.0 Manual
3. Click OK.
Congratulations! FTP client is now configured to upload files to your InspiRunner.com account.
To publish generated project files to your InspiRunner.com hosting account using built into
PHPRunner FTP client, follow the instructions below.
© 2018 Xlinesoft
Advanced topics 804
6. If you wish to upload the generated files to a website root folder, leave the directory
settings as is. Otherwise, click Browse to choose another directory.
© 2018 Xlinesoft
805 PHPRunner 10.0 Manual
8. Click Upload.
9. Wait while PHPRunner uploads the project files to your InspiRunner.com account, then
click Close. After that your web site opens in a browser.
© 2018 Xlinesoft
Advanced topics 806
If you are missing any of this information, log in to the InspiRunner.com Control Panel at
https://www.inspirunner.com:8443/login.php3.
5. Choose Upload all files to upload all files generated by PHPRunner. More info about
FTP upload.
7. Wait while PHPRunner uploads the project files to your InspiRunner.com account, then
click Close. After that your web site opens in a browser.
© 2018 Xlinesoft
807 PHPRunner 10.0 Manual
PHPRunner comes with built-in web server. However you may want to install your own web server.
This page explains how to install a local web server (XAMPP) and configure PHPRunner to use it.
This guide uses Windows XP and XAMPP v5.6.15. XAMPP is a free package that includes an easy-
to-set up web server (Apache), database server (MySQL), and a server-side scripting language
(PHP). More about XAMPP.
Download XAMPP
1. Visit http://www.apachefriends.org/en/xampp.html.
2. Select the Installer version of XAMPP for Windows (we download the Installer version of the
basic XAMPP package).
Install XAMPP
Note: If you are running the Skype VOIP application, or if you are running IIS Server, you will
need to exit them before proceeding. Apache cannot start as a service if Skype or IIS is also
running though when XAMPP is not in use, you can exit XAMPP to use Skype or IIS.
2. On the next screen you can select to install Apache and MySQL as services, which will make
them start automatically every time you start Windows and will allow other applications you may
have, such as Skype, to run simultaneously. If you don't choose this option, you will need to use
the XAMPP Control Panel application to start the servers individually each time you need them. This
may be desirable if you don't intend to use your servers that often.
© 2018 Xlinesoft
Advanced topics 808
Note: for Windows Vista, Apache Friends recommends not installing XAMPP into your c:\Program
Files\ folder.
© 2018 Xlinesoft
809 PHPRunner 10.0 Manual
4. XAMPP will then install. At one point, a command-line window will open; do not be alarmed this is
normal! After the installation is complete, you will get a message indicating so. Click Finish.
5. Next, you are prompted to start the XAMPP control panel, which can also be opened by selecting
Start » All Programs » XAMPP » XAMPP Control Panel, or by running c:\xampp\xampp-control.exe.
This tool lets you start and stop the various servers installed as part of XAMPP. Since Apache and
MySQL already started, select No.
Using XAMPP
The XAMPP control panel is used to control and monitor the status of services that XAMPP has
installed. When the control panel is running, the following icon will be visible in your system tray .
Double-clicking on this icon will bring up the Control Panel.
© 2018 Xlinesoft
Advanced topics 810
Since Apache and MySQL installed as services you do not need to start/stop them in the Control
panel. They start automatically every time you start Windows.
Go to http://localhost/ in a browser. If you are directed to a page with the XAMPP logo, your
installation was successful.
You can add or change the files in C:\xampp\htdocs to change what you see at http://localhost/.
Right after installation, this folder contains all the files for the XAMPP welcome web page. You can
remove or backup these files so that they do not conflict in anyway. XAMPP configuration interface
is available at http://localhost/xampp/index.php and is located at C:\xampp\htdocs\xampp.
Note: To send mails via PHP you need to modify php.ini file. In XAMPP it is stored at C:
\xampp\php. Change the line ;sendmail_from = [email protected] to sendmail_from =
your_email_address.
When connecting to MySQL, type "localhost" in the Host/Server name (or IP) field and "root" in
the User field. Leave Password field blank.
© 2018 Xlinesoft
811 PHPRunner 10.0 Manual
On the Output directory page switch to I have my own web server option and enter URL
manually (i.e. http://localhost/project1). Change output directory as well to one of web server
subdirectories (i.e. C:\xampp\htdocs\project1).
To add your own files with JavaScript/CSS/PHP code to a project, follow the instructions
below.
For example, you want to add two images right.png and wrong.png to the images folder,
new HTML template quiz.htm to the templates folder and simple CSS file quiz.css. To
© 2018 Xlinesoft
Advanced topics 812
perform this, create the folder images inside the source folder and copy files right.png
and wrong.png there. Create the folder templates inside the source folder and copy the
file quiz.htm there. Copy the file quiz.css directly into the source folder.
While building the project all files from the source folder will be copied to the output
folder keeping the subfolders' structure.
To link a JavaScript file to a page, select the page on the Visual Editor tab and switch
to the HTML mode. Then add the following code after the <END body> tag. In case of
Add/Edit/View pages shown in popup add this code snippet to the List page:
To link a JavaScript file to all project pages, select the Header item on the Visual
Editor tab and switch to the HTML mode. Then add the code as stated above.
CSS
To link a CSS file to a page, switch to the HTML mode on the Visual Editor tab and add
your code just after the following line:
To link a CSS file to all project pages, select the Header item on the Visual Editor tab
and switch to the HTML mode. Then add the code as stated above.
PHP
To add your PHP code, it is recommended to use events. Add the following code to the
After table initialized event to link a PHP file to a page or After application initialized
event to link a PHP file to all pages:
include("customfile.php");
include("include/dbcommon.php");
This code snippet assumes that your external PHP file is located in the main PHPRunner
folder.
© 2018 Xlinesoft
813 PHPRunner 10.0 Manual
1. If you need to work with Microsoft Access databases we suggest installing 32-bit version of
PHPRunner.
2. You also need to install Microsoft Access Database Engine to be able to connect your
database. You need to install it on both local machine and on the web server.
If it doesn't install, i.e. you see a warining related to 64bit Office components conflict try
running it from the command prompt with "/passive" parameter:
AccessDatabaseEngine.exe /passive
3. On the web server make sure you provided full permissions to web server user on the folder
where database file resides.
4. Make sure that your php.ini file contains the following line:
extension=php_com_dotnet.dll
If you need to work with Oracle databases you need to download and install the Oracle Instant
Client from this page:
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
You need to choose 32 or 64-bit client version depending on PHPRunner version that is
installed on your computer.
If you are using MS IIS and the PHPRunner wizard has successfully connected to the database
but when you run it the generated pages it fail to connect to Oracle, this might be the case
that IIS user doesn't have access to tnsnames.ora file.
The suggestion is to use server:port/instance format while connecting to Oracle. This way it
will always work in generated app to. Here is the sample tnsnames.ora file
AADEV =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = TestOracle.server.gov)(PORT =
1521))
)
(CONNECT_DATA =
(SID = AAINST)
© 2018 Xlinesoft
Advanced topics 814
(SERVER = DEDICATED)
)
)
extension=php_com_dotnet.dll
If your MySQL server doesn't allow you to connect directly, you can use PHP to connect to it. You
should perform the following steps to proceed.
1. On the Connect to MySQL page enable 'Connect using PHP' option and upload the connection
script phprunner.php to your site using Upload phprunner.php button or manually. The
phprunner.php file can be found in the installation folder, usually C:\Program
Files\PHPRunner10.0.
· Type Host/Server Name (localhost if your Web and Mysql server are located at the same
host), user name, password and click Connect.
© 2018 Xlinesoft
815 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Advanced topics 816
· Click Show schema to get the XML representation of your database's structure.
© 2018 Xlinesoft
817 PHPRunner 10.0 Manual
3. On the Connect to MySQL page enter the URL of the connection script phprunner.php, type
Host/Server Name, user name, password and click Connect. All connection settings are the
same as you've used on the previous step while testing phprunner.php in browser. Then select
database and click Next >>.
Note: some MySQL server won't allow to get a list of databases. In this case you need to
type in database name manually.
After you successfully connected to the database you can Select datasource table, list fields and
searchable fields.
Quick jump
AJAX-based Auto-Suggest
AJAX-based dependent dropdown boxes
Details Records Preview
Lookup wizard as Edit box with AJAX popup
© 2018 Xlinesoft
Advanced topics 818
AJAX-based pagination/sorting/search
PHPRunner comes with AJAX-based functionality added. Now you can search information more easily
than ever with google-like auto-suggest feature. Web pages with AJAX driven dependent dropdown
boxes are loaded faster. If you want to see details records you just need to mouse over the link,
and you don't need to proceed to the Details page. Also new feature for lookup fields was added.
Now you can choose the variant from suggest list which is refreshed each time while you are typing
in the text box instead of searching through all values in the dropdown boxes.
Note: If for some reasons you don't want to use AJAX-based functionality then all you need to
do is to change the $useAJAX and $suggestAllContent variables value in the
include\appsettings.php file to false.
$useAJAX = false;
$suggestAllContent = false;
AJAX-based Auto-Suggest
This feature comes in two versions and is enabled on the Basic and Advanced search pages. It is
similar in fashion to that of Google Suggest using AJAX technologies.
Search suggest makes your site much more user friendly. To see how it will look like just begin to
type in the search box. The picture below demonstrates the search suggest feature on the basic
search page:
© 2018 Xlinesoft
819 PHPRunner 10.0 Manual
By default, search suggest results include all values in which the search phrase presents. If you
want to be shown only those values that begin with the search phrase you should change the
$suggestAllContent variable value in the include\appsettings.php file to false.
Note: if a field is not shown at least on one page (list/view/edit/export etc.), then the field
values are not shown in search suggest results. This is done to secure the confidential data like
passwords and credit card numbers.
© 2018 Xlinesoft
Advanced topics 820
In PHPRunner you can see details records preview directly on the list page. All you need to do is to
mouse over the link. The following picture demonstrates how the details preview looks like:
The number of records in the details preview is limited. Only first ten details are displayed. If there
is an image in the details then only first five details are displayed.
For more information about how to enable details records preview, see Master-details relationship.
To turn on this feature, you should select the appropriate check box on the "Edit as" settings tab.
© 2018 Xlinesoft
821 PHPRunner 10.0 Manual
After you build your project, you can see how it works on the Edit, Add, and Search pages. When
you begin to type in the edit box AJAX popup appears and you can choose the needed value from
the suggest list. If you type in the text box the value which doesn't exist in the database and move
to another form control then the border of the text box will change color into red. When you correct
the value, it will change back to usual.
© 2018 Xlinesoft
Advanced topics 822
The application will look for the occurrence of the typed in string anywhere in the list. For example,
when you enter 'co', it will show 'Corolla' and 'Accord'. If you want to change this behavior and
make it look for the values starting with the entered value, i.e. 'Corolla' only, add the following code
to the AfterAppInit:
$ajaxSearchStartsWith = true;
If you try to submit the form with wrong value entered in the text box then the form will be
submitted with the previous correct value entry.
AJAX-based pagination/sorting/search
This option enables AJAX search, pagination and sorting that allows updating data without loading
the whole page again.
To turn this feature on proceed to the Choose pages screen and click '...' button next to the List
page check box. Then select the AJAX search, pagination and sorting check box.
© 2018 Xlinesoft
823 PHPRunner 10.0 Manual
In this article we will cover all the aspects of creating multilingual websites with the help of
PHPRunner. This process includes the following steps:
On the Miscellaneous page you can choose one or more languages which your website will support.
Use the Language drop-down box if you like to choose one language. By clicking Multiple
languages button you can select several languages and give the user ability to choose language
while logging in.
Chinese (Hong Kong S.A.R.) Chinese (Taiwan) Croatian Czech Danish Dutch
© 2018 Xlinesoft
Advanced topics 824
Urdu Welsh
Translations of system messages are stored in the language files (*.lng) located in the lang
directory (C:\Program Files\PHPRunner10.0\lang). For example, system messages in English
language is stored in the English.lng file:
© 2018 Xlinesoft
825 PHPRunner 10.0 Manual
To change the translation of system messages in some language, modify the corresponding
language file (*.lng).
To add translation of system messages in new language, create a copy of file English.lng and
translate all phrases there. Then modify the file languages.cfg that is also located in the lang
directory by adding this line (change the values listed in red to match your specific needs):
, where
Use custom labels to translate menu items, tab/section names, error messages in regular
expressions and your own validation plugins etc. When creating menu item, new tab/section or
regular expression, use the Multilanguage button to create and translate custom label. Use Label
Editor (Custom labels tab) to create custom labels for error messages in your own validation
plugins. In Label Editor you can also create your own custom labels to display some messages to a
user.
© 2018 Xlinesoft
Advanced topics 826
Use the methods listed below to access labels from the PHP code:
Method Description
Use the methods listed below to access labels from the Javascript code:
Method Description
© 2018 Xlinesoft
827 PHPRunner 10.0 Manual
If you have created custom label Message1 and want to place this message on a page, which will
vary depending on the selected language, add PHP code snippet to the page and use the following
code in it:
If you have created custom label Error_Message_1 for your validation plugin, use
GetCustomLabel("Error_Message_1") code in your javascript function. Note that
GetCustomLabel function is applicable only for editing fields like Add/Edit/Register/List with inline
add/edit.
In this PHP code snippet that sends email with new data we use GetFieldLabel method to get field
label. Don't forget to replace table_name with the correct name of the table.
$email="[email protected]";
$from="[email protected]";
$msg="";
$subject="New data record";
foreach($values as $field=>$value)
{
if(!IsBinaryType(GetFieldType($field)))
$msg.= GetFieldLabel("table_name", $field) ." : ".$value."\r\n";
}
© 2018 Xlinesoft
Advanced topics 828
1. To store data for each language in a separate table and redirect users to the page, depending
on the selected language.
Example. To implement this approach we use the following code in the BeforeProcessList event of
mydata_english table:
if ($_SESSION["language"]=="Spanish")
{
header("Location: mydata_spanish_list.php");
exit();
}
else if ($_SESSION["language"]=="French")
{
header("Location: mydata_french_list.php");
exit();
}
2. To store data for all languages in one table by adding new field for storing language. This
approach is easier to configure.
To implement this approach, you can use the method described in the Dynamic SQL query topic and
the following code:
If you have lookup table were data is stored on multiple languages, use the following code in the
WHERE clause in the Lookup wizard to display the data only for the currently selected language:
© 2018 Xlinesoft
829 PHPRunner 10.0 Manual
To choose Rich Text Editor type set Edit type of any text field to Textarea and select the Use RTE
check box. PHPRunner supports the following third party Rich Text Editors:
For more info on each editor, documentation, examples etc visit vendor's website.
Configuration
© 2018 Xlinesoft
Advanced topics 830
This editor support is built-in into PHPRunner. Nothing to download or configure. Just select it from
the list of available Rich Text Editors.
This editor is lightweight and footprint is very small. Documentation, support forum and examples
are available at http://www.kevinroth.com/rte/
InnovaStudio Editor
InnovaStudio Editor adds about 1000 files to the generated application, footprint is about 3.5Mb.
CKEditor
Proceed to http://www.ckeditor.com and download the latest version of CKEditor. Unzip it into C:
\Program Files\PHPRunner10.0\source\plugins folder. After that CKEditor will be available for
selection on Textarea dialog.
CKEditor adds 400+ files to the generated application, footprint is about 2.5Mb.
To enable the image upload feature CKFinder do the following (the instruction below applies to
CKFinder 2.5.0):
2.1 Find the CheckAuthentication() function and insert this line just before it (to be able to use
session variables):
include("../../include/dbcommon.php");
Replace
return false;
with
© 2018 Xlinesoft
831 PHPRunner 10.0 Manual
2.3 Define $baseDir variable. $baseDir - the path to the local directory (in the server). This is
the path used by CKFinder to handle the files in the server. Full write permissions must be
granted to this directory. You may point it to a directory directly:
$baseDir="C:\\Inetpub\\WWWROOT\\mywebsite.com\\project1\\plugins\\ckfinder\
\userfiles\\";
or
$baseDir="/home/var/www/mywebsite.com/project1/plugins/ckfinder/userfiles/";
Replace
with
Replace
##if @BUILDER.m_strRTEType==RTE_CK##
plugins\ckeditor plugins\ckeditor
##endif##
© 2018 Xlinesoft
Advanced topics 832
with
##if @BUILDER.m_strRTEType==RTE_CK##
plugins\ckeditor plugins\ckeditor
plugins\ckfinder plugins\ckfinder
##endif##
Then proceed to the Choose pages screen in PHPRunner and select the PDF View check box.
© 2018 Xlinesoft
833 PHPRunner 10.0 Manual
This option is global and will be applied to all tables, views and reports in your project. If this option
turned on "PDF view" link appears on View and Print All pages.
This plugin requires about 46 Mb on your hard drive and on the web server.
Note: make sure templates_c directory in the output directory is writable by the web server
user. On Windows server add full permissions on this directory for IUSR_... user. On Unix server set
766 permissions on this directory. This can be done via your website control panel or via shell
(chmod 766 templates_c).
Quick jump
Search panel on the List page
Column resizing
© 2018 Xlinesoft
Advanced topics 834
To display fields on the search panel, go to the Choose fields page, click the Search settings
button and select the corresponding check boxes under Search Panel.
Use Add field button to add fields to the search criteria. To remove a field from the search panel,
move the mouse to that field and click the close button .
You can add the same field twice which will produce OR search (e.g. username='admin' or
username='test'). By default Contains search is implemented. To change this click Show options
link.
Search panel and simple search box can be used simultaneously that will produce AND search.
You can use convenient data filtering via URL parameters. Sample search URL: carsmodels_list.php?
q=(make~equals~Volvo)(<model~сontains~70). This sort of parameters can be added to any List,
Print, Report or Chart pages.
Column resizing
You can resize any column on the List page by dragging its edge. To enable this option, proceed to
the Miscellaneous page and select the Resizable table columns check box.
© 2018 Xlinesoft
835 PHPRunner 10.0 Manual
Mobile template allows you to build mobile version of your web application (requires PHPRunner 6 or
later). To see how it works, you can open mobile-enabled live demos available at
http://xlinesoft.com/phprunner/livedemo4.htm from your mobile device.
Mobile Template is a paid add-on and can be purchased for $50. Buy now. PHPRunner10.0 requires
Mobile template v2. Upgrade from previous version of Mobile template $25. Buy now.
You need Mobile template if you use "Old style" layouts. For Bootstrap-based layouts Mobile
template is not required.
To build a mobile version of your website, proceed to Miscellaneous page in PHPRunner and select
Build Mobile version check box. PHPRunner detects mobile devices automatically and redirects to
the mobile version of your website. To display desktop version on tablets, clear Build Mobile
version check box.
When Build mobile version option is enabled on Miscellaneous page, Desktop/Mobile radio-
buttons appear above the list of tables in Visual Editor. You can switch between normal (desktop)
or mobile version of the current page and make changes to each version independently.
© 2018 Xlinesoft
Advanced topics 836
You can customize mobile pages appearance for any chosen page in Visual Editor i.e. add a button
or change the page layout.
Installation
To install mobile template for 32-bit version of PHPRunner unzip the template to C:\Program
Files (x86)\PHPRunner10.0\userLayouts\Mobile
To install mobile template for 64-bit version of PHPRunner unzip the template to C:\Program
Files\PHPRunner10.0\userLayouts\Mobile
© 2018 Xlinesoft
837 PHPRunner 10.0 Manual
Notes
How do I find if application is being accessed from mobile device?
PHPRunner provides MobileDetected() function that returns true if application is accessed from
mobile device. For example, you can hide certain tables from mobile users. Use ModifyMenuItem
event for this purpose:
<?php
if (MobileDetected())
echo "<font size='3'>My website</font>";
else
echo "<font size='6'>My website</font>";
?>
Testing
You can test test your mobile app on your mobile device as well as on the desktop: Testing
web apps in mobile mode.
There are a few different ways of how you can quickly test the mobile version of your
application.
1.1 Hit F12 to open Chrome Developers Tools. Click Mobile device icon in Chrome Developer
tools.
© 2018 Xlinesoft
Advanced topics 838
1.2 Your app now switches to mobile mode but since we store device info in cookies/session
you need to reset cookies for this app. The best thing is to use EditThisCookie Chrome plugin
as it only takes a couple of mouse clicks to clear cookies for the current website.
You can also do that using built-in tools. You can delete all cookies for selected website. Just
make sure you are not deleting all cookies for all websites.
© 2018 Xlinesoft
839 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Advanced topics 840
1.3 If you done everything right this is what you going to see. You can choose different device
types, horizontal or vertical orientation etc.
© 2018 Xlinesoft
841 PHPRunner 10.0 Manual
© 2018 Xlinesoft
Advanced topics 842
Choose output folder under your web server root folder i.e. C:\xampp\htdocs\project1 then
open a URL like http://desktop_computer_name/project1 in your browser on mobile device.
Another option - post your project to Demo Account, copy the link, email it to yourself. On your
mobile device open that email and click the link.
You can display your custom error message instead of detailed error messages. To enable this
option, go to Miscellaneous page -> Error reporting.
There is an Edit page, which is displayed in popup. BeforeEdit event of this page contains an error -
division by 0.
© 2018 Xlinesoft
843 PHPRunner 10.0 Manual
When trying to save the updated record, you will see an 'error occurred' message at the top of the
page.
© 2018 Xlinesoft
Advanced topics 844
© 2018 Xlinesoft
845 PHPRunner 10.0 Manual
PHPRunner may be ordered through our online store seven days a week, 24 hours a day.
© 2018 Xlinesoft