} if ($usrMsg) { // then we have a message to display and no report to show if ($_POST['FilterForm']) { // return to the filter form $Title = RPT_CRITERIA; $IncludePage = 'forms/ReportsFilter.html'; } else { // return to the page setup form $Title = RPT_PAGESETUP; $IncludePage = 'forms/ReportsPageUpdate.html'; } } else { // send the report (Both of these function exit the script (the point of no return) if ($_POST['todo'] == RPT_BTN_EXPCSV) { GenerateCSVFile($ReportData, $Prefs); } if ($_POST['todo'] == RPT_BTN_EXPPDF) { GeneratePDFFile($ReportData, $Prefs); } } break; case RPT_BTN_CONT: default: $Title = RPT_CRITERIA; $IncludePage = 'forms/ReportsFilter.html'; } // end switch 'todo' } // end if (!isset($_POST['todo'])) include $PathPrefix . 'includes/header.inc';
// Generate the output data array $sql = $success['data']; $report->page->filter->text = $success['description']; // fetch the filter message if (!($ReportData = BuildDataArray($sql, $report))) { $messageStack->add(PHREEFORM_NODATA . ' The sql was: ' . $sql, 'caution'); $error = true; break; } // Check for the report returning with data if (!$ReportData) { $messageStack->add(PHREEFORM_NODATA . ' The failing sql= ' . $sql, 'caution'); $error = true; } else { if ($_REQUEST['action'] == 'exp_csv') { $output = GenerateCSVFile($ReportData, $report, $delivery_method); } if ($_REQUEST['action'] == 'exp_xml') { $output = GenerateXMLFile($ReportData, $report, $delivery_method); } if ($_REQUEST['action'] == 'exp_html') { $output = GenerateHTMLFile($ReportData, $report, $delivery_method); } if ($_REQUEST['action'] == 'exp_pdf') { $output = GeneratePDFFile($ReportData, $report, $delivery_method); } } } else { // Houston, we have a problem $messageStack->add($success['message'], $success['level']); $error = true;