Skip to content
Snippets Groups Projects
Commit b67f2184 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Report.php: fixed bug that 'INSERT' and 'UPDATE' causes an exception.

parent 4052c893
No related branches found
No related tags found
No related merge requests found
...@@ -387,40 +387,42 @@ class Report { ...@@ -387,40 +387,42 @@ class Report {
// Prepare row alteration // Prepare row alteration
$arrRbgd = explode("|", $this->frArray[$full_level . "." . "rbgd"]); $arrRbgd = explode("|", $this->frArray[$full_level . "." . "rbgd"]);
//--------------------------------- if (is_array($result)) {
// Process each row of resultset //---------------------------------
$columnValueSeperator = ""; // Process each row of resultset
$rowIndex = 0; $columnValueSeperator = "";
foreach ($result as $row) { $rowIndex = 0;
// record number counter foreach ($result as $row) {
$this->variables->resultArray[$full_level . ".line."]["count"] = ++$rowIndex; // record number counter
$this->variables->resultArray[$full_level . ".line."]["count"] = ++$rowIndex;
// replace {{<level>.line.count}} and {{<level>.line.total}} in __result__, if the variables specify their own full_level. This can't be replaced before firing the query.
for ($ii = 0; $ii < count($row); $ii++) { // replace {{<level>.line.count}} and {{<level>.line.total}} in __result__, if the variables specify their own full_level. This can't be replaced before firing the query.
$row[$ii] = str_replace("{{" . $full_level . ".line.count}}", $rowIndex, $row[$ii]); for ($ii = 0; $ii < count($row); $ii++) {
$row[$ii] = str_replace("{{" . $full_level . ".line.total}}", $rowTotal, $row[$ii]); $row[$ii] = str_replace("{{" . $full_level . ".line.count}}", $rowIndex, $row[$ii]);
} $row[$ii] = str_replace("{{" . $full_level . ".line.total}}", $rowTotal, $row[$ii]);
}
// SEP set seperator (empty on first run) // SEP set seperator (empty on first run)
$content .= $columnValueSeperator; $content .= $columnValueSeperator;
$columnValueSeperator = $this->variables->doVariables($this->frArray[$full_level . "." . "rsep"]); $columnValueSeperator = $this->variables->doVariables($this->frArray[$full_level . "." . "rsep"]);
// RBGD: even/odd rows // RBGD: even/odd rows
$content .= str_replace("rbgd", $arrRbgd[$rowIndex % 2], $this->frArray[$full_level . "." . "rbeg"]); $content .= str_replace("rbgd", $arrRbgd[$rowIndex % 2], $this->frArray[$full_level . "." . "rbeg"]);
//----------------------------- //-----------------------------
// COLUMNS: Collect all columns // COLUMNS: Collect all columns
$content .= $this->collectRow($row, $keys, $full_level, $rowIndex); $content .= $this->collectRow($row, $keys, $full_level, $rowIndex);
// REND // REND
$content .= $this->variables->doVariables($this->frArray[$full_level . "." . "rend"]); $content .= $this->variables->doVariables($this->frArray[$full_level . "." . "rend"]);
// Trigger subqueries of this level // Trigger subqueries of this level
$content .= $this->triggerReport($cur_level + 1, $this->indexArray[$counter], $counter + 1); $content .= $this->triggerReport($cur_level + 1, $this->indexArray[$counter], $counter + 1);
// RENR // RENR
$content .= $this->variables->doVariables($this->frArray[$full_level . "." . "renr"]); $content .= $this->variables->doVariables($this->frArray[$full_level . "." . "renr"]);
}
} }
//Print althead or tail //Print althead or tail
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment