I created a launch form and added some Php code to the Before Edit section. The Php code fetches data from database and saves the result in a JavaScript variable. The JavaScript variable is used to display a Google Chart. The Following code is used in Before Edit section:
Code: Select all
$select = "SELECT count(*) as total, workmen.tbl_workmen_name FROM tasks, workmen WHERE tasks.workman_id = workmen.workmen_id GROUP BY workmen.workmen_id;";
$stmt = nuRunQuery($select);
$data = "window.googleChartsData = [['Worker', 'Task Count'],";
while($row = db_fetch_object($stmt)) {
$data .= "['". $row->tbl_workmen_name . "', " . $row->total . "],";
}
$data .= "];";
nuAddJavaScript($data);
Thanks,
Nadir Latif