$val) { if ($fields_meta[$i]->type == 'bit') { $row[$col] = PMA_printableBitValue($val, $fields_meta[$i]->length); } $i++; } $extra_data['row_info'] = $row; } PMA_ajaxResponse(null, true, $extra_data); } /** * Handle AJAX request for changing field information * (value,collation,operators,field values) in input form * @var post_params Object containing parameters for the POST request */ if (isset($_REQUEST['change_tbl_info']) && $_REQUEST['change_tbl_info'] == true) { $extra_data = array(); $field = $_REQUEST['field']; if ($field == 'pma_null') { $extra_data['field_type'] = ''; $extra_data['field_collation'] = ''; $extra_data['field_operators'] = ''; PMA_ajaxResponse(null, true, $extra_data); } // Gets the list and number of fields list($fields_list, $fields_type, $fields_collation, $fields_null) = PMA_tbl_getFields($_REQUEST['db'], $_REQUEST['table']); $foreigners = PMA_getForeigners($db, $table); $titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse foreign values')); $key = array_search($field, $fields_list); $extra_data['field_type'] = $fields_type[$key]; $extra_data['field_collation'] = $fields_collation[$key]; // HTML for operators $html = ''; $extra_data['field_operators'] = $html; // retrieve keys into foreign fields, if any // check also foreigners even if relwork is FALSE (to get // foreign keys from innodb) $foreignData = PMA_getForeignData($foreigners, $field, false, '', ''); // HTML for field values $html = PMA_getForeignFields_Values( $foreigners, $foreignData, $field, array($_REQUEST['it'] => $fields_type[$key]), $_REQUEST['it'], $_REQUEST['db'], $_REQUEST['table'], $titles, $GLOBALS['cfg']['ForeignKeyMaxLimit'], '' ); $extra_data['field_value'] = $html; PMA_ajaxResponse(null, true, $extra_data); } $titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse foreign values')); /** * Not selection yet required -> displays the selection form */ // Gets some core libraries require_once './libraries/tbl_common.inc.php'; $url_query .= '&goto=tbl_select.php&back=tbl_select.php'; /** * Gets tables informations */ require_once './libraries/tbl_info.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); // Gets the list and number of fields list($fields_list, $fields_type, $fields_collation, $fields_null) = PMA_tbl_getFields($db, $table); $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); $tbl_fields_type = $tbl_fields_collation = $tbl_fields_null = array(); if (! isset($zoom_submit) && ! isset($inputs)) { $dataLabel = PMA_getDisplayField($db, $table); } ?>
'; $tbl_fields_func[$i] .= $GLOBALS['PMA_Types']->getTypeOperatorsHtml( preg_replace('@\(.*@s', '', $fields_type[$key]), $fields_null[$key], $zoomFunc[$i] ); $tbl_fields_func[$i] .= ''; $foreignData = PMA_getForeignData($foreigners, $inputs[$i], false, '', ''); $tbl_fields_value[$i] = PMA_getForeignFields_Values( $foreigners, $foreignData, $inputs[$i], $tbl_fields_type, $i, $db, $table, $titles, $GLOBALS['cfg']['ForeignKeyMaxLimit'], $fields ); } } } /* * Form for input criteria */ ?>
>
"; } ?>
"; echo __("Additional search criteria"); echo "
/>
'; ?>
isUnaryOperator($func_type); $whereClause = PMA_tbl_search_getWhereClause( $fields[$i], $inputs[$i], $types[$i], $collations[$i], $func_type, $unaryFlag ); if ($whereClause) { $w[] = $whereClause; } } // end for if ($w) { $sql_query .= ' WHERE ' . implode(' AND ', $w); } $sql_query .= ' LIMIT ' . $maxPlotLimit; /* * Query execution part */ $result = PMA_DBI_query($sql_query . ";", null, PMA_DBI_QUERY_STORE); $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; } //Get unique conditon on each row (will be needed for row update) $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]) { $data[] = array( $inputs[0] => $row[$inputs[0]], $inputs[1] => $row[$inputs[1]], 'where_clause' => $uniqueCondition[0] ); } elseif ($dataLabel) { $data[] = array( $inputs[0] => $row[$inputs[0]], $inputs[1] => $row[$inputs[1]], $dataLabel => $row[$dataLabel], 'where_clause' => $uniqueCondition[0] ); } else { $data[] = array( $inputs[0] => $row[$inputs[0]], $inputs[1] => $row[$inputs[1]], $dataLabel => '', 'where_clause' => $uniqueCondition[0] ); } } /* * Form for displaying point data and also the scatter plot */ ?>
>