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
......@@ -387,40 +387,42 @@ class Report {
// Prepare row alteration
$arrRbgd = explode("|", $this->frArray[$full_level . "." . "rbgd"]);
//---------------------------------
// Process each row of resultset
$columnValueSeperator = "";
$rowIndex = 0;
foreach ($result as $row) {
// 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++) {
$row[$ii] = str_replace("{{" . $full_level . ".line.count}}", $rowIndex, $row[$ii]);
$row[$ii] = str_replace("{{" . $full_level . ".line.total}}", $rowTotal, $row[$ii]);
}
if (is_array($result)) {
//---------------------------------
// Process each row of resultset
$columnValueSeperator = "";
$rowIndex = 0;
foreach ($result as $row) {
// 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++) {
$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)
$content .= $columnValueSeperator;
$columnValueSeperator = $this->variables->doVariables($this->frArray[$full_level . "." . "rsep"]);
// SEP set seperator (empty on first run)
$content .= $columnValueSeperator;
$columnValueSeperator = $this->variables->doVariables($this->frArray[$full_level . "." . "rsep"]);
// RBGD: even/odd rows
$content .= str_replace("rbgd", $arrRbgd[$rowIndex % 2], $this->frArray[$full_level . "." . "rbeg"]);
// RBGD: even/odd rows
$content .= str_replace("rbgd", $arrRbgd[$rowIndex % 2], $this->frArray[$full_level . "." . "rbeg"]);
//-----------------------------
// COLUMNS: Collect all columns
$content .= $this->collectRow($row, $keys, $full_level, $rowIndex);
//-----------------------------
// COLUMNS: Collect all columns
$content .= $this->collectRow($row, $keys, $full_level, $rowIndex);
// REND
$content .= $this->variables->doVariables($this->frArray[$full_level . "." . "rend"]);
// REND
$content .= $this->variables->doVariables($this->frArray[$full_level . "." . "rend"]);
// Trigger subqueries of this level
$content .= $this->triggerReport($cur_level + 1, $this->indexArray[$counter], $counter + 1);
// Trigger subqueries of this level
$content .= $this->triggerReport($cur_level + 1, $this->indexArray[$counter], $counter + 1);
// RENR
$content .= $this->variables->doVariables($this->frArray[$full_level . "." . "renr"]);
// RENR
$content .= $this->variables->doVariables($this->frArray[$full_level . "." . "renr"]);
}
}
//Print althead or tail
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment