Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhura Jayaratne <madhura.cj@gmail.com>2012-04-28 05:54:50 +0400
committerMadhura Jayaratne <madhura.cj@gmail.com>2012-04-28 05:54:50 +0400
commit3c9378b8e7221087254ea0159f74b5ff34083bce (patch)
tree0c761edce1a77e99b02cbf657f83436c743cd5d7 /tbl_chart.php
parent9fe22f9e586780d00699004e09a9de5da43576a7 (diff)
Improve creating charts with query results
Diffstat (limited to 'tbl_chart.php')
-rw-r--r--tbl_chart.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/tbl_chart.php b/tbl_chart.php
index 7002405007..131c21f50c 100644
--- a/tbl_chart.php
+++ b/tbl_chart.php
@@ -48,6 +48,7 @@ if (strlen($GLOBALS['table'])) {
$data = array();
$result = PMA_DBI_try_query($sql_query);
+$fields_meta = PMA_DBI_get_fields_meta($result);
while ($row = PMA_DBI_fetch_assoc($result)) {
$data[] = $row;
}
@@ -85,8 +86,10 @@ url_query = '<?php echo $url_query;?>';
<label for ="radio_line"><?php echo _pgettext('Chart type', 'Line'); ?></label>
<input type="radio" name="chartType" value="spline" id="radio_spline" />
<label for ="radio_spline"><?php echo _pgettext('Chart type', 'Spline'); ?></label>
+ <span class="span_pie" style="display:none;">
<input type="radio" name="chartType" value="pie" id="radio_pie" />
<label for ="radio_pie"><?php echo _pgettext('Chart type', 'Pie'); ?></label>
+ </span>
<span class="barStacked" style="display:none;">
<input type="checkbox" name="barStacked" value="1" id="checkbox_barStacked" />
<label for ="checkbox_barStacked"><?php echo __('Stacked'); ?></label>
@@ -117,8 +120,11 @@ url_query = '<?php echo $url_query;?>';
<select name="chartSeries" id="select_chartSeries">
<option value="columns"><?php echo __('The remaining columns'); ?></option>
<?php
+ $numeric_types = array('int', 'real', 'year', 'bit');
foreach ($keys as $idx => $key) {
- echo '<option>' . htmlspecialchars($key) . '</option>';
+ if (in_array($fields_meta[$idx]->type, $numeric_types)) {
+ echo '<option>' . htmlspecialchars($key) . '</option>';
+ }
}
?>
</select>