Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / tbl_select.php
blobe25c6307cfa59844f28e5abaf623900eba80cfc7
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 include sql.php 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.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');
29 $post_params = array(
30 'ajax_request',
31 'session_max_rows'
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");
41 /**
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 .= '&amp;goto=tbl_select.php&amp;back=tbl_select.php';
49 /**
50 * Gets table's information
52 include_once 'libraries/tbl_info.inc.php';
54 if (! isset($goto)) {
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));
62 } else {
63 /**
64 * Selection criteria have been submitted -> do the work
66 $sql_query = $table_search->buildSqlQuery();
67 include 'sql.php';