Allows display of appointments in descending order, take 2.
[openemr.git] / phpmyadmin / tbl_select.php
blob4cbf7593f7279905131841f32d7352c3107cf038
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';
20 $response = PMA_Response::getInstance();
21 $header = $response->getHeader();
22 $scripts = $header->getScripts();
23 $scripts->addFile('makegrid.js');
24 $scripts->addFile('sql.js');
25 $scripts->addFile('tbl_select.js');
26 $scripts->addFile('tbl_change.js');
27 $scripts->addFile('jquery/jquery-ui-timepicker-addon.js');
28 $scripts->addFile('jquery/jquery.uitablefilter.js');
29 $scripts->addFile('gis_data_editor.js');
31 $table_search = new PMA_TableSearch($db, $table, "normal");
33 /**
34 * No selection criteria received -> display the selection form
36 if (! isset($_POST['columnsToDisplay']) && ! isset($_POST['displayAllColumns'])) {
37 // Gets some core libraries
38 include_once 'libraries/tbl_common.inc.php';
39 //$err_url = 'tbl_select.php' . $err_url;
40 $url_query .= '&amp;goto=tbl_select.php&amp;back=tbl_select.php';
41 /**
42 * Gets table's information
44 include_once 'libraries/tbl_info.inc.php';
46 if (! isset($goto)) {
47 $goto = $GLOBALS['cfg']['DefaultTabTable'];
49 // Defines the url to return to in case of error in the next sql statement
50 $err_url = $goto . '?' . PMA_URL_getCommon($db, $table);
51 // Displays the table search form
52 $response->addHTML($table_search->getSecondaryTabs());
53 $response->addHTML($table_search->getSelectionForm($goto));
55 } else {
56 /**
57 * Selection criteria have been submitted -> do the work
59 $sql_query = $table_search->buildSqlQuery();
61 /**
62 * Parse and analyze the query
64 include_once 'libraries/parse_analyze.inc.php';
66 PMA_executeQueryAndSendQueryResponse(
67 $analyzed_sql_results, false, $db, $table, null, null, null, false, null,
68 null, null, null, $goto, $pmaThemeImage, null, null, null, $sql_query,
69 null, null