Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Grey: "We're a two-person company, it's just me an my wife. I'm the technical guru, and she handles the business operations. I have to know a lot about MySQL, but that's much too technical for her. I have frequently had to setup CGI scripts (I code in Perl) so she can manage some of our tables (suppliers, manufacturers, etc).

I discovered PHP Generator a couple of days ago, tried the free version,and within a few hours I had purchased the Pro version (as well as SQL Maestro for MySQL).

Today I am completing the conversion of the last of my custom table managers to PHP Generator. This is eliminating several thousand lines of code that I don't have to support any more!

Thanks for this fantastic product".

Steven Langfield: "I wanted to drop you a mail to say how freaking AMAZING your software is. It will be the best £100 I have ever spent. I have still to read all your documentation to take full advantage but what you have created is truly amazing".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

OnCustomDrawRow

This event occurs on rendering a grid row. It is an extremely useful event for conditional formatting such as changing font color, font styles, row background color, cell background color, etc. This event (as well as the OnExtendedCustomDrawRow one) is used for conditional formatting. The only difference between these two events is that OnCustomDrawRow has a more understandable parameter list while OnExtendedCustomDrawRow provides more flexible abilities.

 

Signature:

function OnCustomDrawRow ($rowData, &$cellFontColor, &$cellFontSize, &$cellBgColor,

    &$cellItalicAttr, &$cellBoldAttr)

 

Parameters:

$rowData

The associative array of values that corresponds to the currently processed row.

$cellFontColor

The parameter allows to set a font color for selected fields.

$cellFontSize

The parameter defines a font size of selected data.

$cellBgColor

The parameter allows to set a background color of fields.

$cellItalicAttr

Set the parameter to true to represent text in cursive font.

$cellBoldAttr

Set the parameter to true to use bold font.

 

NB. $rowData array keys should contain the real column names in the data source (table, view, or query). Don't use column captions instead!

 

Example 1:

Suppose we need to create a webpage with list of customers with addresses represented in cursive. This column in the data source is named 'address_id' and the column's caption is "Address".

 

To define the font attribute, use the following code:

 

$cellItalicAttr['address_id'] = true;

 

Example 2:

In the example below we need to display winning team score in red and losing team score in black; moreover, both scores should be in bold and displayed by a 16pt font.

 

$cellFontSize['home_team_score'] = '16pt';

$cellBoldAttr['home_team_score'] = true;

 

$cellFontSize['away_team_score'] = '16pt';

$cellBoldAttr['away_team_score'] = true;

 

if ($rowData['home_team_score'] > $rowData['away_team_score'])

  $cellFontColor['home_team_score'] = '#F65317';

else

  $cellFontColor['away_team_score'] = '#000000';



Prev Return to chapter overview Next