diff --git a/tbl_zoom_select.php b/tbl_zoom_select.php index 2352fc1fb7..ad90043308 100644 --- a/tbl_zoom_select.php +++ b/tbl_zoom_select.php @@ -36,14 +36,13 @@ $GLOBALS['js_include'][] = 'jquery/timepicker.js'; */ if (isset($_REQUEST['get_data_row']) && $_REQUEST['get_data_row'] == true) { - $extra_data = array(); $row_info_query = 'SELECT * FROM `' . $_REQUEST['db'] . '`.`' . $_REQUEST['table'] . '` WHERE ' . $_REQUEST['where_clause']; $result = PMA_DBI_query( $row_info_query . ";" , null, PMA_DBI_QUERY_STORE); $fields_meta = PMA_DBI_get_fields_meta($result); - while ($row = PMA_DBI_fetch_assoc($result)) - $extra_data['row_info'] = $row; - + while ($row = PMA_DBI_fetch_assoc($result)) { + $extra_data['row_info'] = $row; + } PMA_ajaxResponse(NULL, true, $extra_data); } @@ -52,44 +51,41 @@ $titles['Browse'] = PMA_tbl_setTitle($GLOBALS['cfg']['PropertiesIconic'], $pmaTh * Not selection yet required -> displays the selection form */ - // Gets some core libraries - require_once './libraries/tbl_common.php'; - //$err_url = 'tbl_select.php' . $err_url; - $url_query .= '&goto=tbl_select.php&back=tbl_select.php'; +// Gets some core libraries +require_once './libraries/tbl_common.php'; +$url_query .= '&goto=tbl_select.php&back=tbl_select.php'; - /** - * Gets tables informations - */ - require_once './libraries/tbl_info.inc.php'; +/** + * Gets tables informations + */ +require_once './libraries/tbl_info.inc.php'; - /** - * Displays top menu links - */ - require_once './libraries/tbl_links.inc.php'; +/** + * Displays top menu links + */ +require_once './libraries/tbl_links.inc.php'; - if (! isset($goto)) { - $goto = $GLOBALS['cfg']['DefaultTabTable']; - } - // Defines the url to return to in case of error in the next sql statement - $err_url = $goto . '?' . PMA_generate_common_url($db, $table); +if (! isset($goto)) { + $goto = $GLOBALS['cfg']['DefaultTabTable']; +} +// Defines the url to return to in case of error in the next sql statement +$err_url = $goto . '?' . PMA_generate_common_url($db, $table); - // Gets the list and number of fields - - list($fields_list, $fields_type, $fields_collation, $fields_null) = PMA_tbl_getFields($table,$db); - $fields_cnt = count($fields_list); - - // retrieve keys into foreign fields, if any - // check also foreigners even if relwork is FALSE (to get - // foreign keys from innodb) - $foreigners = PMA_getForeigners($db, $table); - $flag = 1; - $tbl_fields_type = $tbl_fields_collation = $tbl_fields_null = array(); - if(!isset($zoom_submit) && !isset($inputs)) - $dataLabel = PMA_getDisplayField($db,$table); - - ?> +// Gets the list and number of fields +list($fields_list, $fields_type, $fields_collation, $fields_null) = PMA_tbl_getFields($table,$db); +$fields_cnt = count($fields_list); +// retrieve keys into foreign fields, if any +// check also foreigners even if relwork is FALSE (to get +// foreign keys from innodb) +$foreigners = PMA_getForeigners($db, $table); +$flag = 1; +$tbl_fields_type = $tbl_fields_collation = $tbl_fields_null = array(); +if (! isset($zoom_submit) && ! isset($inputs)) { + $dataLabel = PMA_getDisplayField($db,$table); +} +?>
- - /> - - -
@@ -145,112 +129,105 @@ if(isset($inputs) && ($inputs[0] != 'pma_null' || $inputs[1] != 'pma_null')) "; +for ($i = 0; $i < 4; $i++) { + if ($i == 2) { + echo ""; echo __("Additional search criteria"); - echo ""; + echo ""; } - ?> - - - + ' + . htmlspecialchars($fc) . ''; + } else { + echo "\n" . ' ' + . ''; + } + } + } elseif (preg_match('@char|blob|text|set@i', $tbl_fields_type[$i])) { + foreach ($GLOBALS['cfg']['TextOperators'] as $fc) { + if (isset($zoomFunc[$i]) && $zoomFunc[$i] == $fc) { + echo "\n" . ' ' + . ''; + } else { + echo "\n" . ' ' + . ''; + } + } + } else { + foreach ($GLOBALS['cfg']['NumOperators'] as $fc) { + if (isset($zoomFunc[$i]) && $zoomFunc[$i] == $fc) { + echo "\n" . ' ' + . ''; + } else { + echo "\n" . ' ' + . ''; + } + } + } // end if... else... - if (strncasecmp($tbl_fields_type[$i], 'enum', 4) == 0) { - foreach ($GLOBALS['cfg']['EnumOperators'] as $fc) { - if(isset($zoomFunc[$i]) && $zoomFunc[$i] == htmlspecialchars($fc)){ - echo "\n" . ' ' - . ''; - } - else { - echo "\n" . ' ' - . ''; - } - } - } elseif (preg_match('@char|blob|text|set@i', $tbl_fields_type[$i])) { - foreach ($GLOBALS['cfg']['TextOperators'] as $fc) { - if(isset($zoomFunc[$i]) && $zoomFunc[$i] == $fc){ - echo "\n" . ' ' - . ''; - } - else { - echo "\n" . ' ' - . ''; - } - } - } else { - foreach ($GLOBALS['cfg']['NumOperators'] as $fc) { - if(isset($zoomFunc[$i]) && $zoomFunc[$i] == $fc){ - echo "\n" . ' ' - . ''; - } - else { - echo "\n" . ' ' - . ''; - } - } - } // end if... else... - - if ($tbl_fields_null[$i]) { - foreach ($GLOBALS['cfg']['NullOperators'] as $fc) { - if(isset($zoomFunc[$i]) && $zoomFunc[$i] == $fc){ - echo "\n" . ' ' - . ''; - } - else { - echo "\n" . ' ' - . ''; - } - } - } + if ($tbl_fields_null[$i]) { + foreach ($GLOBALS['cfg']['NullOperators'] as $fc) { + if (isset($zoomFunc[$i]) && $zoomFunc[$i] == $fc) { + echo "\n" . ' ' + . ''; + } else { + echo "\n" . ' ' + . ''; + } + } + } ?> - + } else { ?> - + @@ -260,22 +237,20 @@ for($i = 0 ; $i < 4 ; $i++){ - - - @@ -302,9 +277,9 @@ for($i = 0 ; $i < 4 ; $i++){ - + +} ?>
@@ -334,7 +309,7 @@ if(isset($zoom_submit) && $inputs[0] != 'pma_null' && $inputs[1] != 'pma_null' & $sql_query .= ' FROM ' . PMA_backquote($table); for($i = 0 ; $i < 4 ; $i++){ if($inputs[$i] == 'pma_null') - continue; + continue; $tmp = array(); // The where clause $charsets = array(); @@ -350,7 +325,7 @@ if(isset($zoom_submit) && $inputs[0] != 'pma_null' && $inputs[1] != 'pma_null' & if ($w) { $sql_query .= ' WHERE ' . implode(' AND ', $w); } - $sql_query .= ' LIMIT ' . $maxPlotLimit; +$sql_query .= ' LIMIT ' . $maxPlotLimit; /* * Query execution part @@ -359,19 +334,19 @@ if(isset($zoom_submit) && $inputs[0] != 'pma_null' && $inputs[1] != 'pma_null' & $fields_meta = PMA_DBI_get_fields_meta($result); while ($row = PMA_DBI_fetch_assoc($result)) { //Need a row with indexes as 0,1,2 for the PMA_getUniqueCondition hence using a temporary array - $tmpRow = array(); - foreach($row as $val) - $tmpRow[] = $val; +$tmpRow = array(); +foreach($row as $val) + $tmpRow[] = $val; //Get unique conditon on each row (will be needed for row update) - $uniqueCondition = PMA_getUniqueCondition($result, $fields_cnt, $fields_meta, $tmpRow, true); +$uniqueCondition = PMA_getUniqueCondition($result, $fields_cnt, $fields_meta, $tmpRow, true); - //Append it to row array as where_clause - $row['where_clause'] = $uniqueCondition[0]; - if($dataLabel == $inputs[0] || $dataLabel == $inputs[1]) +//Append it to row array as where_clause +$row['where_clause'] = $uniqueCondition[0]; +if($dataLabel == $inputs[0] || $dataLabel == $inputs[1]) $data[] = array($inputs[0] => $row[$inputs[0]], $inputs[1] => $row[$inputs[1]], 'where_clause' => $uniqueCondition[0]); - else if($dataLabel) +else if($dataLabel) $data[] = array($inputs[0] => $row[$inputs[0]], $inputs[1] => $row[$inputs[1]], $dataLabel => $row[$dataLabel], 'where_clause' => $uniqueCondition[0]); - else +else $data[] = array($inputs[0] => $row[$inputs[0]], $inputs[1] => $row[$inputs[1]], $dataLabel => '', 'where_clause' => $uniqueCondition[0]); } @@ -389,45 +364,45 @@ if(isset($zoom_submit) && $inputs[0] != 'pma_null' && $inputs[1] != 'pma_null' &
-
+
-
+
-
+
+ } ?>