-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
queryframe.php3
132 lines (113 loc) · 3.63 KB
/
queryframe.php3
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Gets the variables sent to this script, retains the db name that may have
* been defined as startup option and include a core library
*/
require('./libraries/grab_globals.lib.php3');
if (!empty($db)) {
$db_start = $db;
}
/**
* Gets a core script and starts output buffering work
*/
require('./libraries/common.lib.php3');
require('./libraries/ob.lib.php3');
if ($cfg['OBGzip']) {
$ob_mode = PMA_outBufferModeGet();
if ($ob_mode) {
PMA_outBufferPre($ob_mode);
}
}
// garvin: For re-usability, moved http-headers
// to a seperate file. It can now be included by header.inc.php3,
// queryframe.php3, querywindow.php3.
include('./libraries/header_http.inc.php3');
/**
* Displays the frame
*/
// Gets the font sizes to use
PMA_setFontSizes();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
<head>
<title>phpMyAdmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
<base<?php if (!empty($cfg['PmaAbsoluteUri'])) echo ' href="' . $cfg['PmaAbsoluteUri'] . '"'; ?> />
<link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php3?lang=<?php echo $lang; ?>&js_frame=left&num_dbs=0" />
<?php
if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
?>
<script type="text/javascript" language="javascript">
var querywindow = '';
function open_querywindow(url) {
if (!querywindow.closed && querywindow.location) {
querywindow.focus();
} else {
querywindow=window.open(url + '&db=' + document.queryframeform.db.value + '&table=' + document.queryframeform.table.value, '','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes,resizable=yes,width=<?php echo $cfg['QueryWindowWidth']; ?>,height=<?php echo $cfg['QueryWindowHeight']; ?>');
}
if (!querywindow.opener) {
querywindow.opener = self;
}
if (window.focus) {
querywindow.focus();
}
return false;
}
</script>
<?php
}
?>
</head>
<body bgcolor="<?php echo $cfg['LeftBgColor']; ?>">
<form name="queryframeform" action="queryframe.php3" method="get">
<input type="hidden" name="db" value="" />
<input type="hidden" name="table" value="" />
<input type="hidden" name="framename" value="queryframe" />
</form>
<?php
$anchor = 'querywindow.php3?' . PMA_generate_common_url('', '');
if ($cfg['QueryFrameJS']) {
$href = $anchor;
$target = '';
$onclick = 'onClick="javascript:open_querywindow(this.href); return false;"';
} else {
$href = $anchor;
$target = 'target="phpmain' . $hash . '"';
$onclick = '';
}
?>
<center>
<script type="text/javascript">
document.writeln('<a href="<?php echo $href; ?>" <?php echo $target . ' ' . $onclick; ?>><?php echo addslashes($strQueryFrame); ?></a>');
</script>
<noscript>
<a href="<?php echo $href; ?>&no_js=true" <?php echo $target . ' ' . $onclick; ?> target="phpmain<?php echo $hash; ?>"><?php echo $strQueryFrame; ?></a>
</noscript>
</center>
<form name="hashform" action="queryframe.php3">
<input type="hidden" name="hash" value="<?php echo $hash; ?>">
</form>
</body>
</html>
<?php
/**
* Close MySql connections
*/
if (isset($dbh) && $dbh) {
@mysql_close($dbh);
}
if (isset($userlink) && $userlink) {
@mysql_close($userlink);
}
/**
* Sends bufferized data
*/
if (isset($cfg['OBGzip']) && $cfg['OBGzip']
&& isset($ob_mode) && $ob_mode) {
PMA_outBufferPost($ob_mode);
}
?>