2.5.2 maybe
[phpmyadmin/crack.git] / footer.inc.php3
blob37573fc4aba2fa0104b58537d0c18be4d22df847
1 <?php
2 /* $Id$ */
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.
8 /**
9 * Query window
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">
16 <!--
17 <?php
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>");
22 <?php
26 <?php
27 if (!isset($error_message) || $error_message == '') {
29 if (top.frames.queryframe && top.frames.queryframe.document && top.frames.queryframe.document.queryframeform) {
30 top.frames.queryframe.document.queryframeform.db.value = "<?php echo (isset($db) ? addslashes($db) : ''); ?>";
31 top.frames.queryframe.document.queryframeform.table.value = "<?php echo (isset($table) ? addslashes($table) : ''); ?>";
33 <?php
37 function reload_querywindow () {
38 if (top.frames.queryframe && top.frames.queryframe.querywindow && !top.frames.queryframe.querywindow.closed && top.frames.queryframe.querywindow.location) {
39 <?php echo ($cfg['QueryFrameDebug'] ? 'document.writeln("<a href=\'#\' onClick=\'top.frames.queryframe.querywindow.focus(); return false;\'>Query Window</a> can be updated.<br>");' : ''); ?>
41 <?php
42 if (!isset($error_message) || $error_message == '') {
44 top.frames.queryframe.querywindow.document.querywindow.db.value = "<?php echo (isset($db) ? addslashes($db) : '') ?>";
45 top.frames.queryframe.querywindow.document.querywindow.query_history_latest_db.value = "<?php echo (isset($db) ? addslashes($db) : '') ?>";
46 top.frames.queryframe.querywindow.document.querywindow.table.value = "<?php echo (isset($table) ? addslashes($table) : '') ?>";
47 top.frames.queryframe.querywindow.document.querywindow.query_history_latest_table.value = "<?php echo (isset($table) ? addslashes($table) : '') ?>";
49 <?php echo (isset($sql_query) ? 'top.frames.queryframe.querywindow.document.querywindow.query_history_latest.value = "' . urlencode($sql_query) . '";' : '// no sql query update') . "\n"; ?>
51 <?php echo ($cfg['QueryFrameDebug'] ? 'alert(\'Querywindow submits. Last chance to check variables.\');' : '') . "\n"; ?>
52 top.frames.queryframe.querywindow.document.querywindow.submit();
53 <?php
54 } else {
56 // no submit, query was invalid
57 <?php
63 function focus_querywindow(sql_query) {
64 if (top.frames.queryframe && top.frames.queryframe.querywindow && !top.frames.queryframe.querywindow.closed && top.frames.queryframe.querywindow.location) {
65 if (top.frames.queryframe.querywindow.document.querywindow.querydisplay_tab != 'sql') {
66 top.frames.queryframe.querywindow.document.querywindow.querydisplay_tab.value = "sql";
67 top.frames.queryframe.querywindow.document.querywindow.query_history_latest.value = sql_query;
68 top.frames.queryframe.querywindow.document.querywindow.submit();
69 top.frames.queryframe.querywindow.focus();
70 } else {
71 top.frames.queryframe.querywindow.focus();
74 return false;
75 } else if (top.frames.queryframe) {
76 new_win_url = 'querywindow.php3?sql_query=' + sql_query + '&<?php echo PMA_generate_common_url(isset($db) ? addslashes($db) : '', isset($table) ? addslashes($table) : '', '&'); ?>';
77 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']; ?>');
79 if (!top.frames.queryframe.querywindow.opener) {
80 top.frames.queryframe.querywindow.opener = top.frames.queryframe;
83 // reload_querywindow();
84 return false;
88 reload_querywindow();
89 <?php
90 if (isset($focus_querywindow) && $focus_querywindow == "true") {
92 if (top.frames.queryframe && top.frames.queryframe.querywindow && !top.frames.queryframe.querywindow.closed && top.frames.queryframe.querywindow.location) {
93 self.focus();
95 <?php
99 //-->
100 </script>
101 <?php
106 * Close MySql non-persistent connections
108 if (isset($GLOBALS['dbh']) && $GLOBALS['dbh']) {
109 @mysql_close($GLOBALS['dbh']);
111 if (isset($GLOBALS['userlink']) && $GLOBALS['userlink']) {
112 @mysql_close($GLOBALS['userlink']);
116 </body>
118 </html>
119 <?php
122 * Generates profiling data if requested
124 if (isset($GLOBALS['cfg']['DBG']['enable'])
125 && $GLOBALS['cfg']['DBG']['enable']
126 && isset($GLOBALS['cfg']['DBG']['profile']['enable'])
127 && $GLOBALS['cfg']['DBG']['profile']['enable']) {
128 //run the basic setup code first
129 include('./libraries/dbg/setup.php3');
130 //if the setup ran fine, then do the profiling
131 if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']) {
132 include('./libraries/dbg/profiling.php3');
133 dbg_dump_profiling_results();
138 * Sends bufferized data
140 if (isset($GLOBALS['cfg']['OBGzip']) && $GLOBALS['cfg']['OBGzip']
141 && isset($GLOBALS['ob_mode']) && $GLOBALS['ob_mode']) {
142 PMA_outBufferPost($GLOBALS['ob_mode']);