Translated using Weblate (Czech)
[phpmyadmin.git] / tbl_select.php
blob84d82784b1fc8d0ad3239fb7362cab2697fd17c4
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Handles table search tab
6 * display table search form, create SQL query from form data
7 * and call PMA_executeQueryAndSendQueryResponse() to execute it
9 * @package PhpMyAdmin
12 /**
13 * Gets some core libraries
15 require_once 'libraries/common.inc.php';
16 require_once 'libraries/mysql_charsets.inc.php';
17 require_once 'libraries/TableSearch.class.php';
18 require_once 'libraries/sql.lib.php';
19 require_once 'libraries/bookmark.lib.php';
21 $response = PMA_Response::getInstance();
22 $header = $response->getHeader();
23 $scripts = $header->getScripts();
24 $scripts->addFile('makegrid.js');
25 $scripts->addFile('sql.js');
26 $scripts->addFile('tbl_select.js');
27 $scripts->addFile('tbl_change.js');
28 $scripts->addFile('jquery/jquery-ui-timepicker-addon.js');
29 $scripts->addFile('jquery/jquery.uitablefilter.js');
30 $scripts->addFile('gis_data_editor.js');
32 $table_search = new PMA_TableSearch($db, $table, "normal");
34 // Request to column min-max value.
35 if (isset($_REQUEST['range_search'])) {
36 $response = PMA_Response::getInstance();
37 $min_max = $table_search->getColumnMinMax($_REQUEST['column']);
38 $response->addJSON('column_data', $min_max);
39 exit;
42 /**
43 * No selection criteria received -> display the selection form
45 if (! isset($_POST['columnsToDisplay']) && ! isset($_POST['displayAllColumns'])) {
46 // Gets some core libraries
47 include_once 'libraries/tbl_common.inc.php';
48 //$err_url = 'tbl_select.php' . $err_url;
49 $url_query .= '&amp;goto=tbl_select.php&amp;back=tbl_select.php';
50 /**
51 * Gets table's information
53 include_once 'libraries/tbl_info.inc.php';
55 if (! isset($goto)) {
56 $goto = PMA_Util::getScriptNameForOption(
57 $GLOBALS['cfg']['DefaultTabTable'], 'table'
60 // Defines the url to return to in case of error in the next sql statement
61 $err_url = $goto . PMA_URL_getCommon(array('db' => $db, 'table' => $table));
62 // Displays the table search form
63 $response->addHTML($table_search->getSecondaryTabs());
64 $response->addHTML($table_search->getSelectionForm($goto));
66 } else {
68 /**
69 * Selection criteria have been submitted -> do the work
71 $sql_query = $table_search->buildSqlQuery();
73 /**
74 * Parse and analyze the query
76 include_once 'libraries/parse_analyze.inc.php';
78 PMA_executeQueryAndSendQueryResponse(
79 $analyzed_sql_results, // analyzed_sql_results
80 false, // is_gotofile
81 $db, // db
82 $table, // table
83 null, // find_real_end
84 null, // sql_query_for_bookmark
85 null, // extra_data
86 null, // message_to_show
87 null, // message
88 null, // sql_data
89 $GLOBALS['goto'], // goto
90 $pmaThemeImage, // pmaThemeImage
91 null, // disp_query
92 null, // disp_message
93 null, // query_type
94 $sql_query, // sql_query
95 null, // selectedTables
96 null // complete_query