Topic: Unable to Access Global Variables on Reports

Hello, I am unable to access system global variables on reports. While they are accessible on any other page. Any Idea?

For example I tried calling on rep501.php the global variable $bank_account_types even exclusively including includes/sysnames.inc like below code

$page_security = 'SA_DIMENSIONREP';
// ----------------------------------------------------------------
// $ Revision:    2.0 $
// Creator:    Joe Hunt
// date_:    2005-05-19
// Title:    Dimension Summary
// ----------------------------------------------------------------
$path_to_root="..";

include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/gl/includes/gl_db.inc");
include_once($path_to_root . "/includes/sysnames.inc");


//----------------------------------------------------------------------------------------------------

write_sql_to_file("Dimension Inquiry control_cols".print_r($bank_account_types,true));

but it gives following error and the global variable is not read

Undefined variable: bank_account_types in file: /home/pakerp/web/pakerp.net/public_html/reporting/rep501.php at line 30

While these variables are accessible from all other UI pages. Why?

www.boxygen.pk

Re: Unable to Access Global Variables on Reports

What happens if you add

global $bank_account_types;

or

include_once($path_to_root . "/includes/ui/ui_lists.inc");

before your code?

3 (edited by boxygen 06/18/2019 05:24:52 pm)

Re: Unable to Access Global Variables on Reports

I think I didn't sleep well last night. All is working now smile

www.boxygen.pk