2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Handles table search tab
6 * display table search form, create SQL query from form data
7 * and include sql.php to execute it
13 * Gets some core libraries
15 require_once 'libraries/common.inc.php';
16 require_once 'libraries/mysql_charsets.lib.php';
17 require_once 'libraries/TableSearch.class.php';
19 $response = PMA_Response
::getInstance();
20 $header = $response->getHeader();
21 $scripts = $header->getScripts();
22 $scripts->addFile('makegrid.js');
23 $scripts->addFile('sql.js');
24 $scripts->addFile('tbl_select.js');
25 $scripts->addFile('tbl_change.js');
26 $scripts->addFile('jquery/jquery-ui-timepicker-addon.js');
27 $scripts->addFile('gis_data_editor.js');
33 foreach ($post_params as $one_post_param) {
34 if (isset($_POST[$one_post_param])) {
35 $GLOBALS[$one_post_param] = $_POST[$one_post_param];
39 $table_search = new PMA_TableSearch($db, $table, "normal");
42 * Not selection yet required -> displays the selection form
44 if (! isset($_POST['columnsToDisplay']) && ! isset($_POST['displayAllColumns'])) {
45 // Gets some core libraries
46 include_once 'libraries/tbl_common.inc.php';
47 //$err_url = 'tbl_select.php' . $err_url;
48 $url_query .= '&goto=tbl_select.php&back=tbl_select.php';
50 * Gets table's information
52 include_once 'libraries/tbl_info.inc.php';
55 $goto = $GLOBALS['cfg']['DefaultTabTable'];
57 // Defines the url to return to in case of error in the next sql statement
58 $err_url = $goto . '?' . PMA_generate_common_url($db, $table);
59 // Displays the table search form
60 $response->addHTML($table_search->getSelectionForm($goto));
64 * Selection criteria have been submitted -> do the work
66 $sql_query = $table_search->buildSqlQuery();