tbl_printview.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Print view for table
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. /**
  9. * include the common file
  10. */
  11. require_once 'libraries/common.inc.php';
  12. $response = PMA_Response::getInstance();
  13. $response->getHeader()->enablePrintView();
  14. require 'libraries/tbl_common.inc.php';
  15. // Check parameters
  16. if (! isset($the_tables) || ! is_array($the_tables)) {
  17. $the_tables = array();
  18. }
  19. /**
  20. * Gets the relations settings
  21. */
  22. require_once 'libraries/transformations.lib.php';
  23. require_once 'libraries/Index.class.php';
  24. require_once 'libraries/tbl_printview.lib.php';
  25. $cfgRelation = PMA_getRelationsParam();
  26. /**
  27. * Defines the url to return to in case of error in a sql statement
  28. */
  29. if (strlen($table)) {
  30. $err_url = 'tbl_sql.php?' . PMA_URL_getCommon($db, $table);
  31. } else {
  32. $err_url = 'db_sql.php?' . PMA_URL_getCommon($db);
  33. }
  34. /**
  35. * Selects the database
  36. */
  37. $GLOBALS['dbi']->selectDb($db);
  38. /**
  39. * Multi-tables printview
  40. */
  41. if (isset($_POST['selected_tbl']) && is_array($_POST['selected_tbl'])) {
  42. $the_tables = $_POST['selected_tbl'];
  43. } elseif (strlen($table)) {
  44. $the_tables[] = $table;
  45. }
  46. $response->addHTML(PMA_getHtmlForTablesInfo($the_tables));
  47. $response->addHTML(
  48. PMA_getHtmlForTablesDetail(
  49. $the_tables, $db, $cfg, $cfgRelation,
  50. isset($pk_array)? $pk_array: array(),
  51. $cell_align_left
  52. )
  53. );
  54. /**
  55. * Displays the footer
  56. */
  57. $response->addHTML(PMA_getHtmlForPrintViewFooter());
  58. exit;
  59. ?>