Translated using Weblate (Slovak)
[phpmyadmin.git] / db_search.php
blob349f720a3a4ff4611d52e85cf45d583f5c080fda
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * searches 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';
44 // Main search form has been submitted, get results
45 if (isset($_REQUEST['submit_search'])) {
46 $response->addHTML($db_search->getSearchResults());
47 } else {
48 $response->addHTML('<div id="searchresults"></div>');
51 // If we are in an Ajax request, we need to exit after displaying all the HTML
52 if ($GLOBALS['is_ajax_request'] == true && empty($_REQUEST['ajax_page_request'])) {
53 exit;
56 // Display the search form
57 $response->addHTML(
58 '<div id="togglesearchresultsdiv"><a id="togglesearchresultlink"></a></div>'
59 . '<br class="clearfloat" />'
61 $response->addHTML($db_search->getSelectionForm());
62 $response->addHTML($db_search->getResultDivs());