Exemplo n.º 1
0
 function QPInsertUpdate($tableName, $valuesArray, $whereArray)
 {
     $sql = BuildSQL($tableName, $whereArray);
     if ($this->query($sql)) {
         //$this->SelectRows($tableName, $whereArray);
         if ($this->numRows() > 0) {
             return $this->UpdateRows($tableName, $valuesArray, $whereArray);
         } else {
             return $this->InsertRow($tableName, $valuesArray);
         }
     }
 }
Exemplo n.º 2
0
         $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');
         }
     } else {
         // Houston, we have a problem, sql build failed
         $usrMsg[] = array('message' => $success['message'], 'level' => $success['level']);
     }
     if ($usrMsg) {
Exemplo n.º 3
0
     // we're done
 }
 if ($error) {
     break;
 }
 // if we are here, the user wants to generate output
 switch ($report->reporttype) {
     case 'frm':
         $output = BuildForm($report, $delivery_method);
         if ($output === true) {
             $error = true;
         }
         break;
     case 'rpt':
         $ReportData = '';
         $success = BuildSQL($report);
         if ($success['level'] == 'success') {
             // 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 {