Translated using Weblate (Korean)
[phpmyadmin.git] / db_search.php
blobacfec8e55be8e86b269d4f98992d5b027030a8d8
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * searchs the entire database
6 * @todo make use of UNION when searching multiple tables
7 * @todo display executed query, optional?
8 * @package PhpMyAdmin
9 */
11 /**
12 * Gets some core libraries
14 require_once 'libraries/common.inc.php';
15 require_once 'libraries/DbSearch.class.php';
17 $response = PMA_Response::getInstance();
18 $header = $response->getHeader();
19 $scripts = $header->getScripts();
20 $scripts->addFile('db_search.js');
21 $scripts->addFile('sql.js');
22 $scripts->addFile('makegrid.js');
23 $scripts->addFile('jquery/jquery-ui-timepicker-addon.js');
25 require 'libraries/db_common.inc.php';
27 // If config variable $GLOBALS['cfg']['Usedbsearch'] is on false : exit.
28 if (! $GLOBALS['cfg']['UseDbSearch']) {
29 PMA_Util::mysqlDie(
30 __('Access denied'), '', false, $err_url
32 } // end if
33 $url_query .= '&amp;goto=db_search.php';
34 $url_params['goto'] = 'db_search.php';
36 // Create a database search instance
37 $db_search = new PMA_DbSearch($GLOBALS['db']);
39 // Display top links if we are not in an Ajax request
40 if ( $GLOBALS['is_ajax_request'] != true) {
41 include 'libraries/db_info.inc.php';
43 $response->addHTML('<div id="searchresults">');
45 // Main search form has been submitted, get results
46 if (isset($_REQUEST['submit_search'])) {
47 $response->addHTML($db_search->getSearchResults());
50 // If we are in an Ajax request, we need to exit after displaying all the HTML
51 if ($GLOBALS['is_ajax_request'] == true && empty($_REQUEST['ajax_page_request'])) {
52 exit;
55 // Display the search form
56 $response->addHTML($db_search->getSelectionForm($url_params));