David, I pasted your code exactly as you entered it in the above response into setup(). I did modify it to "substantiator" at one point, to try to get your code working (and commented it). Here are the 3 versions I have tried so far. Notice that they are commented out since none of the 3 worked. Notice that the top one attempts to use "employee_source".
/*
$employee_source = $this->src('employee_source')->query("SELECT employee, w2_wages, employee_email FROM employees WHERE email='$email' AND campaign= '$_SESSION[campaign]' ");
$contemporaneous_datasource = $this->src("contemporaneous_datasource");
$join = new Join($contemporaneous_datasource, $employee_source, array("email"=>"employee_email"));
*/
/* from 'sample' code on website
$employee_source = $this->src('substantiator')->query("SELECT employee, w2_wages, employee_email FROM employees WHERE email='$email' AND campaign= '$_SESSION[campaign]' ");
$join = new Join("contemporaneous_datasource",$employee_source,array("email"=>"employee_email"));
$join->pipe($this->dataStore('together'));
*/
/* this was your initial suggestion
$employee_source = $this->src('employee_source')->query("SELECT employee, w2_wages, employee_email FROM employees WHERE email='$email' AND campaign= '$_SESSION[campaign]' ");
$contemporaneous_datasource = $this->src("contemporaneous_datasource");
$join = new Join($contemporaneous_datasource, $employee_source, array("email"=>"employee_email"));
*/
Just to be clear, I am showing the settings
function settings()
{
// $szString=$_SESSION['campaign'].$_SESSION['userid'];
return array(
"dataSources"=>array(
"substantiator" => array(
"connectionString" => "mysql:host=mysql;dbname=substantiator",
"username" => "admin",
"password" => "xxx",
"charset" => "utf8"
),
"activity_datasource"=>array(
"class"=>'\koolreport\datasources\CSVDataSource',
// "filePath"=>"/app/assets/output/activity_".$_SESSION['campaign'].$_SESSION['userid'],
"filePath"=>"/app/assets/output/activity_Applerichb201@gmail.com",
"fieldSeparator"=>",",
),
"bus_comps_datasource"=>array(
"class"=>'\koolreport\datasources\CSVDataSource',
"filePath"=>"/app/assets/output/buscomps_Applerichb201@gmail.com",
"fieldSeparator"=>",",
),
"contemporaneous_datasource"=>array(
"class"=>'\koolreport\datasources\CSVDataSource',
"filePath"=>"/app/assets/output/contemporaneous_Applerichb201@gmail.com",
"fieldSeparator"=>",",
),
)
);
}
Additionally, here is your code and the error it causes:
$employee_source = $this->src('employee_source')->query("SELECT employee, w2_wages, employee_email FROM employees WHERE email='$email' AND campaign= '$_SESSION[campaign]' ");
$contemporaneous_datasource = $this->src("contemporaneous_datasource");
$join = new Join($contemporaneous_datasource, $employee_source, array("email"=>"employee_email"));
An uncaught Exception was encountered
Type: Exception
Message: Datasource not found 'employee_source'
Filename: /app/vendor/koolreport/core/src/KoolReport.php
Line Number: 255
Backtrace:
File: /app/assets/MyReport.php
Line: 125
Function: src
File: /app/vendor/koolreport/core/src/KoolReport.php
Line: 100
Function: setup
File: /app/application/controllers/Configure.php
Line: 2439
Function: __construct
File: /app/index.php
Line: 315
Function: require_once