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: " + top
.frames
.queryframe
.querywindow
.location +
"<br>");
26 if (top
.frames
.queryframe
&& top
.frames
.queryframe
.document
&& top
.frames
.queryframe
.document
.queryframeform
) {
27 top
.frames
.queryframe
.document
.queryframeform
.db
.value
= "<?php echo (isset($db) ? addslashes($db) : ''); ?>";
28 top
.frames
.queryframe
.document
.queryframeform
.table
.value
= "<?php echo (isset($table) ? addslashes($table) : ''); ?>";
31 function reload_querywindow () {
32 if (top
.frames
.queryframe
&& top
.frames
.queryframe
.querywindow
&& !top
.frames
.queryframe
.querywindow
.closed
&& top
.frames
.queryframe
.querywindow
.location
) {
33 <?php
echo ($cfg['QueryFrameDebug'] ?
'document.writeln("<a href=\'#\' onClick=\'top.frames.queryframe.querywindow.focus(); return false;\'>Query Window</a> can be updated.<br>");' : ''); ?
>
36 if (!isset($error_message) ||
$error_message == '') {
38 top
.frames
.queryframe
.querywindow
.document
.querywindow
.db
.value
= "<?php echo (isset($db) ? addslashes($db) : '') ?>";
39 top
.frames
.queryframe
.querywindow
.document
.querywindow
.query_history_latest_db
.value
= "<?php echo (isset($db) ? addslashes($db) : '') ?>";
40 top
.frames
.queryframe
.querywindow
.document
.querywindow
.table
.value
= "<?php echo (isset($table) ? addslashes($table) : '') ?>";
41 top
.frames
.queryframe
.querywindow
.document
.querywindow
.query_history_latest_table
.value
= "<?php echo (isset($table) ? addslashes($table) : '') ?>";
43 <?php
echo (isset($sql_query) ?
'top.frames.queryframe.querywindow.document.querywindow.query_history_latest.value = "' . urlencode($sql_query) . '";' : '// no sql query update') . "\n"; ?
>
45 <?php
echo ($cfg['QueryFrameDebug'] ?
'alert(\'Querywindow submits. Last chance to check variables.\');' : '') . "\n"; ?
>
46 top
.frames
.queryframe
.querywindow
.document
.querywindow
.submit();
50 // no submit, query was invalid
57 function focus_querywindow(sql_query
) {
58 if (top
.frames
.queryframe
&& top
.frames
.queryframe
.querywindow
&& !top
.frames
.queryframe
.querywindow
.closed
&& top
.frames
.queryframe
.querywindow
.location
) {
59 if (top
.frames
.queryframe
.querywindow
.document
.querywindow
.querydisplay_tab
!= 'sql') {
60 top
.frames
.queryframe
.querywindow
.document
.querywindow
.querydisplay_tab
.value
= "sql";
61 top
.frames
.queryframe
.querywindow
.document
.querywindow
.query_history_latest
.value
= sql_query
;
62 top
.frames
.queryframe
.querywindow
.document
.querywindow
.submit();
63 top
.frames
.queryframe
.querywindow
.focus();
65 top
.frames
.queryframe
.querywindow
.focus();
69 } else if (top
.frames
.queryframe
) {
70 new_win_url
= 'querywindow.php3?sql_query=' + sql_query +
'&<?php echo PMA_generate_common_url(isset($db) ? addslashes($db) : '', isset($table) ? addslashes($table) : '', '&'); ?>';
71 top
.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
']; ?>');
73 if (!top
.frames
.queryframe
.querywindow
.opener
) {
74 top
.frames
.queryframe
.querywindow
.opener
= top
.frames
.queryframe
;
77 // reload_querywindow();
84 if (isset($focus_querywindow) && $focus_querywindow == "true") {
86 if (top
.frames
.queryframe
&& top
.frames
.queryframe
.querywindow
&& !top
.frames
.queryframe
.querywindow
.closed
&& top
.frames
.queryframe
.querywindow
.location
) {
100 * Close MySql non-persistent connections
102 if (isset($GLOBALS['dbh']) && $GLOBALS['dbh']) {
103 @mysql_close
($GLOBALS['dbh']);
105 if (isset($GLOBALS['userlink']) && $GLOBALS['userlink']) {
106 @mysql_close
($GLOBALS['userlink']);
116 * Generates profiling data if requested
118 if (isset($GLOBALS['cfg']['DBG']['enable'])
119 && $GLOBALS['cfg']['DBG']['enable']
120 && isset($GLOBALS['cfg']['DBG']['profile']['enable'])
121 && $GLOBALS['cfg']['DBG']['profile']['enable']) {
122 //run the basic setup code first
123 include('./libraries/dbg/setup.php3');
124 //if the setup ran fine, then do the profiling
125 if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']) {
126 include('./libraries/dbg/profiling.php3');
127 dbg_dump_profiling_results();
132 * Sends bufferized data
134 if (isset($GLOBALS['cfg']['OBGzip']) && $GLOBALS['cfg']['OBGzip']
135 && isset($GLOBALS['ob_mode']) && $GLOBALS['ob_mode']) {
136 PMA_outBufferPost($GLOBALS['ob_mode']);