tbl_sql.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Table SQL executor
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. use PhpMyAdmin\Config\PageSettings;
  9. use PhpMyAdmin\Response;
  10. use PhpMyAdmin\SqlQueryForm;
  11. /**
  12. *
  13. */
  14. require_once 'libraries/common.inc.php';
  15. PageSettings::showGroup('Sql');
  16. /**
  17. * Runs common work
  18. */
  19. $response = Response::getInstance();
  20. $header = $response->getHeader();
  21. $scripts = $header->getScripts();
  22. $scripts->addFile('makegrid.js');
  23. $scripts->addFile('vendor/jquery/jquery.uitablefilter.js');
  24. $scripts->addFile('sql.js');
  25. require 'libraries/tbl_common.inc.php';
  26. $url_query .= '&amp;goto=tbl_sql.php&amp;back=tbl_sql.php';
  27. $err_url = 'tbl_sql.php' . $err_url;
  28. // After a syntax error, we return to this script
  29. // with the typed query in the textarea.
  30. $goto = 'tbl_sql.php';
  31. $back = 'tbl_sql.php';
  32. // Decides what query to show in SQL box.
  33. $query_to_show = isset($_GET['sql_query']) ? $_GET['sql_query'] : true;
  34. /**
  35. * Query box, bookmark, insert data from textfile
  36. */
  37. $response->addHTML(
  38. SqlQueryForm::getHtml(
  39. $query_to_show, false,
  40. isset($_POST['delimiter'])
  41. ? htmlspecialchars($_POST['delimiter'])
  42. : ';'
  43. )
  44. );