// Overrride stored settings with selected values $Prefs = ReadPostData($ReportID, $Prefs); // reads and updates the database if ($_POST['todo'] == RPT_BTN_PGSETUP) { // return to the page setup screen $Title = RPT_PAGESETUP; $IncludePage = 'forms/ReportsPageUpdate.html'; } else { // return to the criterai screen $Title = RPT_CRITERIA; $IncludePage = 'forms/ReportsFilter.html'; } break; case RPT_BTN_EXPCSV: case RPT_BTN_EXPPDF: $Prefs = ReadPostData($ReportID, $Prefs); // include the necessary files to build report require $PathPrefix . 'includes/tcpdf/tcpdf.php'; // TCPDF class to generate reports require 'WriteReport.inc'; $ReportData = ''; $success = BuildSQL($Prefs); if ($success['level'] == 'success') { // Generate the output data array $sql = $success['data']; $Prefs['filterdesc'] = $success['filterdesc']; // fetch the filter message $ReportData = BuildDataArray($ReportID, $sql, $Prefs); // Check for the report returning with data if (!$ReportData) { $usrMsg[] = array('message' => RPT_NODATA . ' The failing sql=' . $sql, 'level' => 'warn');
if ($Prefs['standard_report']) { $Prefs['description'] = ''; } // clear name if default report $ShowReplace = false; $IncludePage = 'template_save.php'; break; case 'update': // Overrride stored settings with selected values $Prefs = ReadPostData($ReportID, $Prefs, $_POST, 'save'); // reads and updates the database break; case 'exp_csv': case 'exp_pdf': case 'exp_html': $Prefs = ReadPostData($ReportID, $Prefs, $_POST); $ReportData = ''; $success = BuildSQL($Prefs); $failed = false; if ($success['level'] == 'success') { // Generate the output data array $sql = $success['data']; $Prefs['filterdesc'] = $success['filterdesc']; // fetch the filter message $ReportData = BuildDataArray($ReportID, $sql, $Prefs); // Check for the report returning with data if (!$ReportData) { $messageStack->add(RW_RPT_NODATA . ' The failing sql= ' . $sql, 'caution'); $failed = true; } } else {