3 // vim: expandtab sw=4 ts=4 sts=4:
5 // In this file you may add PHP or HTML statements that will be used to define
6 // the footer for phpMyAdmin pages.
12 // If query window is wanted and open, update with latest selected db/table.
13 if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
15 <script type
="text/javascript">
18 if ($cfg['QueryFrameDebug']) {
20 document
.writeln("Updating query window. DB: <?php echo (isset($db) ? addslashes($db) : 'FALSE'); ?>, Table: <?php echo (isset($table) ? addslashes($table) : 'FALSE'); ?><br>");
21 document
.writeln("Window: " + parent
.frames
.queryframe
.querywindow
.location +
"<br>");
27 if (!isset($error_message) ||
$error_message == '') {
29 if (parent
.frames
.queryframe
&& parent
.frames
.queryframe
.document
&& parent
.frames
.queryframe
.document
.queryframeform
) {
30 parent
.frames
.queryframe
.document
.queryframeform
.db
.value
= "<?php echo (isset($db) ? addslashes($db) : ''); ?>";
31 parent
.frames
.queryframe
.document
.queryframeform
.table
.value
= "<?php echo (isset($table) ? addslashes($table) : ''); ?>";
37 function reload_querywindow () {
38 if (parent
.frames
.queryframe
&& parent
.frames
.queryframe
.querywindow
&& !parent
.frames
.queryframe
.querywindow
.closed
&& parent
.frames
.queryframe
.querywindow
.location
) {
39 <?php
echo ($cfg['QueryFrameDebug'] ?
'document.writeln("<a href=\'#\' onClick=\'parent.frames.queryframe.querywindow.focus(); return false;\'>Query Window</a> can be updated.<br>");' : ''); ?
>
42 if (!isset($error_message) ||
$error_message == '') {
44 if (!parent
.frames
.queryframe
.querywindow
.document
.sqlform
.LockFromUpdate ||
!parent
.frames
.queryframe
.querywindow
.document
.sqlform
.LockFromUpdate
.checked
) {
45 parent
.frames
.queryframe
.querywindow
.document
.querywindow
.db
.value
= "<?php echo (isset($db) ? addslashes($db) : '') ?>";
46 parent
.frames
.queryframe
.querywindow
.document
.querywindow
.query_history_latest_db
.value
= "<?php echo (isset($db) ? addslashes($db) : '') ?>";
47 parent
.frames
.queryframe
.querywindow
.document
.querywindow
.table
.value
= "<?php echo (isset($table) ? addslashes($table) : '') ?>";
48 parent
.frames
.queryframe
.querywindow
.document
.querywindow
.query_history_latest_table
.value
= "<?php echo (isset($table) ? addslashes($table) : '') ?>";
50 <?php
echo (isset($sql_query) ?
'parent.frames.queryframe.querywindow.document.querywindow.query_history_latest.value = "' . urlencode($sql_query) . '";' : '// no sql query update') . "\n"; ?
>
52 <?php
echo ($cfg['QueryFrameDebug'] ?
'alert(\'Querywindow submits. Last chance to check variables.\');' : '') . "\n"; ?
>
53 parent
.frames
.queryframe
.querywindow
.document
.querywindow
.submit();
58 // no submit, query was invalid
65 function focus_querywindow(sql_query
) {
66 if (parent
.frames
.queryframe
&& parent
.frames
.queryframe
.querywindow
&& !parent
.frames
.queryframe
.querywindow
.closed
&& parent
.frames
.queryframe
.querywindow
.location
) {
67 if (parent
.frames
.queryframe
.querywindow
.document
.querywindow
.querydisplay_tab
!= 'sql') {
68 parent
.frames
.queryframe
.querywindow
.document
.querywindow
.querydisplay_tab
.value
= "sql";
69 parent
.frames
.queryframe
.querywindow
.document
.querywindow
.query_history_latest
.value
= sql_query
;
70 parent
.frames
.queryframe
.querywindow
.document
.querywindow
.submit();
71 parent
.frames
.queryframe
.querywindow
.focus();
73 parent
.frames
.queryframe
.querywindow
.focus();
77 } else if (parent
.frames
.queryframe
) {
78 new_win_url
= 'querywindow.php3?sql_query=' + sql_query +
'&<?php echo PMA_generate_common_url(isset($db) ? addslashes($db) : '', isset($table) ? addslashes($table) : '', '&'); ?>';
79 parent
.frames
.queryframe
.querywindow
=window
.open(new_win_url
, '','toolbar=0,location=1,directories=0,status=1,menubar=0,scrollbars=yes,resizable=yes,width=<?php echo $cfg['QueryWindowWidth
']; ?>,height=<?php echo $cfg['QueryWindowHeight
']; ?>');
81 if (!parent
.frames
.queryframe
.querywindow
.opener
) {
82 parent
.frames
.queryframe
.querywindow
.opener
= parent
.frames
.queryframe
;
85 // reload_querywindow();
92 if (isset($focus_querywindow) && $focus_querywindow == "true") {
94 if (parent
.frames
.queryframe
&& parent
.frames
.queryframe
.querywindow
&& !parent
.frames
.queryframe
.querywindow
.closed
&& parent
.frames
.queryframe
.querywindow
.location
) {
108 * Close MySql non-persistent connections
110 if (isset($GLOBALS['dbh']) && $GLOBALS['dbh']) {
111 @mysql_close
($GLOBALS['dbh']);
113 if (isset($GLOBALS['userlink']) && $GLOBALS['userlink']) {
114 @mysql_close
($GLOBALS['userlink']);
124 * Generates profiling data if requested
126 if (isset($GLOBALS['cfg']['DBG']['enable'])
127 && $GLOBALS['cfg']['DBG']['enable']
128 && isset($GLOBALS['cfg']['DBG']['profile']['enable'])
129 && $GLOBALS['cfg']['DBG']['profile']['enable']) {
130 //run the basic setup code first
131 include('./libraries/dbg/setup.php3');
132 //if the setup ran fine, then do the profiling
133 if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']) {
134 include('./libraries/dbg/profiling.php3');
135 dbg_dump_profiling_results();
140 * Sends bufferized data
142 if (isset($GLOBALS['cfg']['OBGzip']) && $GLOBALS['cfg']['OBGzip']
143 && isset($GLOBALS['ob_mode']) && $GLOBALS['ob_mode']) {
144 PMA_outBufferPost($GLOBALS['ob_mode']);