icd10 update (2013) from cms
[openemr.git] / phpmyadmin / db_qbe.php
blob940758cccf2ef4827ca9baea869de42c6526a617
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * query by example the whole database
6 * @package PhpMyAdmin
7 */
9 /**
10 * requirements
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/DBQbe.class.php';
14 $response = PMA_Response::getInstance();
16 // Gets the relation settings
17 $cfgRelation = PMA_getRelationsParam();
19 /**
20 * A query has been submitted -> (maybe) execute it
22 $message_to_display = false;
23 if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) {
24 if (! preg_match('@^SELECT@i', $sql_query)) {
25 $message_to_display = true;
26 } else {
27 $goto = 'db_sql.php';
28 include 'sql.php';
29 exit;
33 $sub_part = '_qbe';
34 require 'libraries/db_common.inc.php';
35 $url_query .= '&amp;goto=db_qbe.php';
36 $url_params['goto'] = 'db_qbe.php';
37 require 'libraries/db_info.inc.php';
39 if ($message_to_display) {
40 PMA_Message::error(__('You have to choose at least one column to display'))->display();
42 unset($message_to_display);
44 // create new qbe search instance
45 $db_qbe = new PMA_DBQbe($GLOBALS['db']);
47 /**
48 * Displays the Query by example form
50 if ($cfgRelation['designerwork']) {
51 $url = 'pmd_general.php' . PMA_generate_common_url(
52 array_merge(
53 $url_params,
54 array('query' => 1)
57 $response->addHTML(
58 PMA_Message::notice(
59 sprintf(
60 __('Switch to %svisual builder%s'),
61 '<a href="' . $url . '">',
62 '</a>'
67 $response->addHTML($db_qbe->getSelectionForm($cfgRelation));