add unique numbers to $strFileCouldNotBeRead to improve support when someone gets...
[phpmyadmin/crack.git] / footer.inc.php
blobb0e7647939039e1296605f44bd7fd39437b9a026
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 /**
6 * WARNING: This script has to be included at the very end of your code because
7 * it will stop the script execution!
8 */
10 require_once('./libraries/relation.lib.php'); // for PMA_setHistory()
12 /**
13 * Query window
16 // If query window is wanted and open, update with latest selected db/table.
17 if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
20 <script type="text/javascript">
21 <!--
22 <?php
23 if (!isset($no_history) && !empty($db) && (!isset($error_message) || $error_message == '')) {
24 $tables = PMA_DBI_try_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE);
25 $num_tables = ($tables) ? @PMA_DBI_num_rows($tables) : 0;
26 $common_url_query = PMA_generate_common_url($db);
27 if ($num_tables) {
28 $num_tables_disp = ' (' . $num_tables . ')';
29 } else {
30 $num_tables_disp = ' (-)';
33 var forceQueryFrameReload = false;
34 <?php
35 // $is_drop_database comes from sql.php when we saw a DROP DATABASE
36 // $force_queryframe_reload comes from db_operations.php
37 if ((isset($is_drop_database) && $is_drop_database) || (isset($force_queryframe_reload) && $force_queryframe_reload == TRUE)) {
39 forceQueryFrameReload = true;
40 <?php
43 var dbBoxSetupDone = false;
44 function dbBoxSetup() {
45 if (dbBoxSetupDone != true) {
46 if (parent.frames.queryframe && parent.frames.queryframe.document.left && parent.frames.queryframe.document.left.lightm_db) {
47 parent.frames.queryframe.document.left.lightm_db.value = '<?php echo addslashes($db); ?>';
48 dbBoxSetupDone = true;
49 } else {
50 setTimeout("dbBoxSetup();",500);
54 if (parent.frames.queryframe && parent.frames.queryframe.document && parent.frames.queryframe.document.queryframeform) {
55 parent.frames.queryframe.document.queryframeform.db.value = "<?php echo (isset($db) ? addslashes($db) : ''); ?>";
56 parent.frames.queryframe.document.queryframeform.table.value = "<?php echo (isset($table) ? addslashes($table) : ''); ?>";
58 if (parent.frames.queryframe && parent.frames.queryframe.document && parent.frames.queryframe.document.left && parent.frames.queryframe.document.left.lightm_db) {
59 selidx = parent.frames.queryframe.document.left.lightm_db.selectedIndex;
60 if (parent.frames.queryframe.document.left.lightm_db.options[selidx].value == "<?php echo addslashes($db); ?>" && forceQueryFrameReload == false) {
61 parent.frames.queryframe.document.left.lightm_db.options[selidx].text =
62 parent.frames.queryframe.document.left.lightm_db.options[selidx].text.replace(/(.*)\([0-9]+\)/,'$1<?php echo $num_tables_disp;?>');
63 } else {
64 parent.frames.queryframe.location.reload();
65 setTimeout("dbBoxSetup();",2000);
68 <?php
72 function reload_querywindow () {
73 if (parent.frames.queryframe && parent.frames.queryframe.querywindow && !parent.frames.queryframe.querywindow.closed && parent.frames.queryframe.querywindow.location) {
74 <?php
75 if (!isset($no_history) && (!isset($error_message) || $error_message == '')) {
76 if (isset($LockFromUpdate) && $LockFromUpdate == '1' && isset($sql_query)) {
77 // When the button 'LockFromUpdate' was selected in the querywindow, it does not submit it's contents to
78 // itself. So we create a SQL-history entry here.
79 if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
80 PMA_setHistory((isset($db) ? $db : ''), (isset($table) ? $table : ''), $cfg['Server']['user'], $sql_query);
84 if (!parent.frames.queryframe.querywindow.document.sqlform.LockFromUpdate || !parent.frames.queryframe.querywindow.document.sqlform.LockFromUpdate.checked) {
85 parent.frames.queryframe.querywindow.document.querywindow.db.value = "<?php echo (isset($db) ? addslashes($db) : '') ?>";
86 parent.frames.queryframe.querywindow.document.querywindow.query_history_latest_db.value = "<?php echo (isset($db) ? addslashes($db) : '') ?>";
87 parent.frames.queryframe.querywindow.document.querywindow.table.value = "<?php echo (isset($table) ? addslashes($table) : '') ?>";
88 parent.frames.queryframe.querywindow.document.querywindow.query_history_latest_table.value = "<?php echo (isset($table) ? addslashes($table) : '') ?>";
90 <?php echo (isset($sql_query) ? 'parent.frames.queryframe.querywindow.document.querywindow.query_history_latest.value = "' . urlencode($sql_query) . '";' : '// no sql query update') . "\n"; ?>
92 parent.frames.queryframe.querywindow.document.querywindow.submit();
94 <?php
95 } else {
97 // no submit, query was invalid
98 <?php
104 function focus_querywindow(sql_query) {
105 if (parent.frames.queryframe && parent.frames.queryframe.querywindow && !parent.frames.queryframe.querywindow.closed && parent.frames.queryframe.querywindow.location) {
106 if (parent.frames.queryframe.querywindow.document.querywindow.querydisplay_tab != 'sql') {
107 parent.frames.queryframe.querywindow.document.querywindow.querydisplay_tab.value = "sql";
108 parent.frames.queryframe.querywindow.document.querywindow.query_history_latest.value = sql_query;
109 parent.frames.queryframe.querywindow.document.querywindow.submit();
110 parent.frames.queryframe.querywindow.focus();
111 } else {
112 parent.frames.queryframe.querywindow.focus();
115 return false;
116 } else if (parent.frames.queryframe) {
117 new_win_url = 'querywindow.php?sql_query=' + sql_query + '&<?php echo PMA_generate_common_url(isset($db) ? addslashes($db) : '', isset($table) ? addslashes($table) : '', '&'); ?>';
118 parent.frames.queryframe.querywindow=window.open(new_win_url, '','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes,resizable=yes,width=<?php echo $cfg['QueryWindowWidth']; ?>,height=<?php echo $cfg['QueryWindowHeight']; ?>');
120 if (!parent.frames.queryframe.querywindow.opener) {
121 parent.frames.queryframe.querywindow.opener = parent.frames.queryframe;
124 // reload_querywindow();
125 return false;
129 reload_querywindow();
130 <?php
131 if (isset($focus_querywindow) && $focus_querywindow == "true") {
133 if (parent.frames.queryframe && parent.frames.queryframe.querywindow && !parent.frames.queryframe.querywindow.closed && parent.frames.queryframe.querywindow.location) {
134 self.focus();
136 <?php
140 //-->
141 </script>
142 <?php
147 * Close database connections
149 if (isset($GLOBALS['dbh']) && $GLOBALS['dbh']) {
150 @PMA_DBI_close($GLOBALS['dbh']);
152 if (isset($GLOBALS['userlink']) && $GLOBALS['userlink']) {
153 @PMA_DBI_close($GLOBALS['userlink']);
157 <?php include('./config.footer.inc.php'); ?>
158 <script type="text/javascript" language="javascript" src="libraries/tooltip.js"></script>
159 </body>
161 </html>
162 <?php
165 * Generates profiling data if requested
167 if (isset($GLOBALS['cfg']['DBG']['enable'])
168 && $GLOBALS['cfg']['DBG']['enable']
169 && isset($GLOBALS['cfg']['DBG']['profile']['enable'])
170 && $GLOBALS['cfg']['DBG']['profile']['enable']) {
171 //run the basic setup code first
172 require_once('./libraries/dbg/setup.php');
173 //if the setup ran fine, then do the profiling
174 if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']) {
175 require_once('./libraries/dbg/profiling.php');
176 dbg_dump_profiling_results();
181 * Sends bufferized data
183 if (isset($GLOBALS['cfg']['OBGzip']) && $GLOBALS['cfg']['OBGzip']
184 && isset($GLOBALS['ob_mode']) && $GLOBALS['ob_mode']) {
185 PMA_outBufferPost($GLOBALS['ob_mode']);
189 * Stops the script execution
191 exit;