Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 58 lines (48 sloc) 1.636 kb
958039b Patch #554925 - Search into database, thanks to Thomas Chaumeny
Loïc Chapeaux authored
1 <?php
b800466 @lem9 avoid vim error on loading
lem9 authored
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
958039b Patch #554925 - Search into database, thanks to Thomas Chaumeny
Loïc Chapeaux authored
3 /**
9b81e50 more sanitation on input vars;
Sebastian Mendel authored
4 * searchs the entire database
5 *
6 * @todo make use of UNION when searching multiple tables
7 * @todo display executed query, optional?
e56949f @nijel Use package name PhpMyAdmin
nijel authored
8 * @package PhpMyAdmin
958039b Patch #554925 - Search into database, thanks to Thomas Chaumeny
Loïc Chapeaux authored
9 */
10
9b81e50 more sanitation on input vars;
Sebastian Mendel authored
11 /**
01bcab2 @zixtor Use PMA_DbSearch in db_search.php
zixtor authored
12 * Gets some core libraries
9b81e50 more sanitation on input vars;
Sebastian Mendel authored
13 */
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
14 require_once 'libraries/common.inc.php';
01bcab2 @zixtor Use PMA_DbSearch in db_search.php
zixtor authored
15 require_once 'libraries/DbSearch.class.php';
958039b Patch #554925 - Search into database, thanks to Thomas Chaumeny
Loïc Chapeaux authored
16
a054562 @roccivic PMA_Footer and PMA_Header no longer need to be singletons
roccivic authored
17 $response = PMA_Response::getInstance();
18 $header = $response->getHeader();
19 $scripts = $header->getScripts();
4a74037 @roccivic Dropped header.inc.php in favor of the PMA_Header class
roccivic authored
20 $scripts->addFile('db_search.js');
21 $scripts->addFile('sql.js');
22 $scripts->addFile('makegrid.js');
431df61 @lem9 Upgraded to jquery-ui-timepicker-addon 1.1.1
lem9 authored
23 $scripts->addFile('jquery/jquery-ui-timepicker-addon.js');
4767612 Added a division to include the search results in, suppressed some
ninadsp authored
24
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
25 require 'libraries/db_common.inc.php';
9b81e50 more sanitation on input vars;
Sebastian Mendel authored
26
27 // If config variable $GLOBALS['cfg']['Usedbsearch'] is on false : exit.
28 if (! $GLOBALS['cfg']['UseDbSearch']) {
6971295 @Chanaka Renamed PMA_CommonFunctions::getInstance()-> with PMA_Util::
Chanaka authored
29 PMA_Util::mysqlDie(
01bcab2 @zixtor Use PMA_DbSearch in db_search.php
zixtor authored
30 __('Access denied'), '', false, $err_url
31 );
958039b Patch #554925 - Search into database, thanks to Thomas Chaumeny
Loïc Chapeaux authored
32 } // end if
6884f97 @nijel no more support for php3
nijel authored
33 $url_query .= '&amp;goto=db_search.php';
aa7136b revised
Sebastian Mendel authored
34 $url_params['goto'] = 'db_search.php';
958039b Patch #554925 - Search into database, thanks to Thomas Chaumeny
Loïc Chapeaux authored
35
01bcab2 @zixtor Use PMA_DbSearch in db_search.php
zixtor authored
36 // Create a database search instance
37 $db_search = new PMA_DbSearch($GLOBALS['db']);
958039b Patch #554925 - Search into database, thanks to Thomas Chaumeny
Loïc Chapeaux authored
38
dca620c @lem9 Improve comments
lem9 authored
39 // Display top links if we are not in an Ajax request
219ec73 @nijel Spacing around if
nijel authored
40 if ( $GLOBALS['is_ajax_request'] != true) {
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
41 include 'libraries/db_info.inc.php';
4767612 Added a division to include the search results in, suppressed some
ninadsp authored
42 }
993db13 @roccivic Fixed ajax-loaded db search pages
roccivic authored
43 $response->addHTML('<div id="searchresults">');
958039b Patch #554925 - Search into database, thanks to Thomas Chaumeny
Loïc Chapeaux authored
44
01bcab2 @zixtor Use PMA_DbSearch in db_search.php
zixtor authored
45 // Main search form has been submitted, get results
aa7136b revised
Sebastian Mendel authored
46 if (isset($_REQUEST['submit_search'])) {
01bcab2 @zixtor Use PMA_DbSearch in db_search.php
zixtor authored
47 $response->addHTML($db_search->getSearchResults());
b10429b @zixtor Fix comment
zixtor authored
48 }
958039b Patch #554925 - Search into database, thanks to Thomas Chaumeny
Loïc Chapeaux authored
49
01bcab2 @zixtor Use PMA_DbSearch in db_search.php
zixtor authored
50 // If we are in an Ajax request, we need to exit after displaying all the HTML
993db13 @roccivic Fixed ajax-loaded db search pages
roccivic authored
51 if ($GLOBALS['is_ajax_request'] == true && empty($_REQUEST['ajax_page_request'])) {
e23ba53 @zixtor Rearrange content in db_search.php
zixtor authored
52 exit;
53 }
958039b Patch #554925 - Search into database, thanks to Thomas Chaumeny
Loïc Chapeaux authored
54
dca620c @lem9 Improve comments
lem9 authored
55 // Display the search form
01bcab2 @zixtor Use PMA_DbSearch in db_search.php
zixtor authored
56 $response->addHTML($db_search->getSelectionForm($url_params));
48d9cf9 @zixtor Remove HTML-PHP mix used for displaying db search form
zixtor authored
57 ?>
Something went wrong with that request. Please try again.