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