【php开源代码栏目提醒】:本文主要为网学会员提供queryframe.php,希望对需要queryframe.php网友有所帮助,学习一下!
<?php
/* $Id: queryframe.php,v 2.30 2005/08/11 15:07:57 lem9 Exp $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Gets the variables sent to this script, retains the db name that may have
* been defined as startup option and include a core library
*/
require_once('./libraries/grab_globals.lib.php');
if (!empty($db)) {
$db_start = $db;
}
/**
* Gets a core script and starts output buffering work
*/
require_once('./libraries/common.lib.php');
require_once('./libraries/bookmark.lib.php');
require_once('./libraries/ob.lib.php');
if ($cfg['OBGzip']) {
$ob_mode = PMA_outBufferModeGet();
if ($ob_mode) {
PMA_outBufferPre($ob_mode);
}
}
// garvin: For re-usability, moved http-headers
// to a seperate file. It can now be included by header.inc.php,
// queryframe.php, querywindow.php.
require_once('./libraries/header_http.inc.php');
/**
* Displays the frame
*/
// Gets the font sizes to use
PMA_setFontSizes();
/**
* Relations
*/
require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
echo "<?xml version=\"1.0\" encoding=\"" . $GLOBALS['charset'] . "\"?".">"; // remove vertical scroll bar bug in ie
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD X
HTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
<head>
<title>phpMyAdmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
<base<?php if (!empty($cfg['PmaAbsoluteUri'])) echo ' href="' . $cfg['PmaAbsoluteUri'] . '"'; ?> />
<link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?<?php echo PMA_generate_common_url(); ?>&js_frame=left&num_dbs=0" />
<?php
if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
?>
<script type="text/javascript" language="javascript">
<!--
var querywindow = '';
function open_querywindow(url) {
if (!querywindow.closed && querywindow.location) {
querywindow.focus();
} else {
querywindow=window.open(url + '&db=' + document.queryframeform.db.value + '&table=' + document.queryframeform.table.value, '','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes,resizable=yes,width=<?php echo $cfg['QueryWindowWidth']; ?>,height=<?php echo $cfg['QueryWindowHeight']; ?>');
}
if (!querywindow.opener) {
querywindow.opener = blank;
}
if (window.focus) {
querywindow.focus();
}
return false;
}
/**
* function resizeRowsLeft()
* added 2004-07-20 by Michael Keck <mail@michaelkeck.de>
* - this function checks the complete frameset of
* index.php (parent.frames)
* - gets the offsetHeight of qfcontainer
* - sets a new frameset.rows - definition for the
* frameset 'leftFrameset' in 'index.php' dynamic.
* this script was tested on
* IE 6, Opera 7.53, Netsacpe 7.1 and Firefox 0.9
* and should work on all other DOM-Browsers and old IE-Browsers.
* It will never work on Netscape smaller Version 6 and IE smaller Version 4.
* Please give me feedback if any browser doesn't work with this script
* mailto:mail@michaelkeck.de?subject=resizeFrames - Browser: [the browser]
**/
function resizeRowsLeft() {
if (document.getElementById('qfcontainer')) { // dom browsers
// get the height of the div-element 'qfcontainer'
// we must add 10 (px) for framespacing
newHeight = document.getElementById('qfcontainer').offsetHeight+10;
// check if the frameset exists
// please see index.php and check the frameset-definitions
if (parent.document.getElementById('mainFrameset') && parent.document.getElementById('leftFrameset')) {
parent.document.getElementById('leftFrameset').rows=newHeight+',*';
}
} else {
if (document.all) { // older ie-browsers
// get the height of the div-element 'qfcontainer'
// we must add 10 (px) for framespacing
newHeight=document.all('qfcontainer').offsetHeight+10;
// check if the frameset exists
// please see index.php and check the frameset-definitions
if (parent.leftFrameset) {
parent.leftFrameset.rows=newHeight+',*';
}
}
}
}
//-->
</script>
<?php
// setup the onload handler for resizing frames
$js_frame_onload=' onload="resizeRowsLeft();"';
}
if ($cfg['QueryFrame']) {
?>
<script type="text/javascript" language="javascript">
<!--
// added 2004-09-16 by Michael Keck (mkkeck)
// bug: #1027321
// drop-down databases list keep focus on database change
// modified 2004-11-06: bug #1046434 (L