Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improve some repetitive code

  • Loading branch information...
commit 5d636a8672911cec580e4896bb86402e1e6e4f56 1 parent 8a0d2d6
@zixtor zixtor authored
Showing with 8 additions and 21 deletions.
  1. +8 −21 tbl_zoom_select.php
View
29 tbl_zoom_select.php
@@ -211,27 +211,14 @@
//Append it to row array as where_clause
$row['where_clause'] = $uniqueCondition[0];
- if ($dataLabel == $criteriaColumnNames[0] || $dataLabel == $criteriaColumnNames[1]) {
- $data[] = array(
- $criteriaColumnNames[0] => $row[$criteriaColumnNames[0]],
- $criteriaColumnNames[1] => $row[$criteriaColumnNames[1]],
- 'where_clause' => $uniqueCondition[0]
- );
- } elseif ($dataLabel) {
- $data[] = array(
- $criteriaColumnNames[0] => $row[$criteriaColumnNames[0]],
- $criteriaColumnNames[1] => $row[$criteriaColumnNames[1]],
- $dataLabel => $row[$dataLabel],
- 'where_clause' => $uniqueCondition[0]
- );
- } else {
- $data[] = array(
- $criteriaColumnNames[0] => $row[$criteriaColumnNames[0]],
- $criteriaColumnNames[1] => $row[$criteriaColumnNames[1]],
- $dataLabel => '',
- 'where_clause' => $uniqueCondition[0]
- );
- }
+ $tmpData = array(
+ $criteriaColumnNames[0] => $row[$criteriaColumnNames[0]],
+ $criteriaColumnNames[1] => $row[$criteriaColumnNames[1]],
+ 'where_clause' => $uniqueCondition[0]
+ );
+ $tmpData[$dataLabel] = ($dataLabel) ? $row[$dataLabel] : '';
+
+ $data[] = $tmpData;
}
/*
* Form for displaying point data and also the scatter plot
Please sign in to comment.
Something went wrong with that request. Please try again.