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>");' : ''); ?
>
35 top
.frames
.queryframe
.querywindow
.document
.querywindow
.db
.value
= "<?php echo (isset($db) ? addslashes($db) : '') ?>";
36 top
.frames
.queryframe
.querywindow
.document
.querywindow
.query_history_latest_db
.value
= "<?php echo (isset($db) ? addslashes($db) : '') ?>";
37 top
.frames
.queryframe
.querywindow
.document
.querywindow
.table
.value
= "<?php echo (isset($table) ? addslashes($table) : '') ?>";
38 top
.frames
.queryframe
.querywindow
.document
.querywindow
.query_history_latest_table
.value
= "<?php echo (isset($table) ? addslashes($table) : '') ?>";
40 <?php
echo (isset($sql_query) ?
'top.frames.queryframe.querywindow.document.querywindow.query_history_latest.value = "' . urlencode($sql_query) . '";' : '// no sql query update') . "\n"; ?
>
42 <?php
echo ($cfg['QueryFrameDebug'] ?
'alert(\'Querywindow submits. Last chance to check variables.\');' : '') . "\n"; ?
>
43 <?php
echo ((!isset($error_message) ||
$error_message == '') ?
'top.frames.queryframe.querywindow.document.querywindow.submit();' : '// no submit, query was invalid') . "\n"; ?
>
47 function focus_querywindow(sql_query
) {
48 if (top
.frames
.queryframe
&& top
.frames
.queryframe
.querywindow
&& !top
.frames
.queryframe
.querywindow
.closed
&& top
.frames
.queryframe
.querywindow
.location
) {
49 top
.frames
.queryframe
.querywindow
.focus();
51 } else if (top
.frames
.queryframe
) {
52 new_win_url
= 'querywindow.php3?sql_query=' + sql_query +
'&<?php echo PMA_generate_common_url(isset($db) ? addslashes($db) : '', isset($table) ? addslashes($table) : '', '&'); ?>';
53 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
']; ?>');
55 if (!top
.frames
.queryframe
.querywindow
.opener
) {
56 top
.frames
.queryframe
.querywindow
.opener
= top
.frames
.queryframe
;
59 // reload_querywindow();
73 * Close MySql non-persistent connections
75 if (isset($GLOBALS['dbh']) && $GLOBALS['dbh']) {
76 @mysql_close
($GLOBALS['dbh']);
78 if (isset($GLOBALS['userlink']) && $GLOBALS['userlink']) {
79 @mysql_close
($GLOBALS['userlink']);
89 * Generates profiling data if requested
91 if (isset($GLOBALS['cfg']['DBG']['enable'])
92 && $GLOBALS['cfg']['DBG']['enable']
93 && isset($GLOBALS['cfg']['DBG']['profile']['enable'])
94 && $GLOBALS['cfg']['DBG']['profile']['enable']) {
95 //run the basic setup code first
96 include('./libraries/dbg/setup.php3');
97 //if the setup ran fine, then do the profiling
98 if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']) {
99 include('./libraries/dbg/profiling.php3');
100 dbg_dump_profiling_results();
105 * Sends bufferized data
107 if (isset($GLOBALS['cfg']['OBGzip']) && $GLOBALS['cfg']['OBGzip']
108 && isset($GLOBALS['ob_mode']) && $GLOBALS['ob_mode']) {
109 PMA_outBufferPost($GLOBALS['ob_mode']);