home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / queryframe.php < prev    next >
Encoding:
PHP Script  |  2003-11-26  |  3.8 KB  |  133 lines

  1. <?php
  2. /* $Id: queryframe.php,v 2.2 2003/11/26 22:52:24 rabus Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5.  
  6. /**
  7.  * Gets the variables sent to this script, retains the db name that may have
  8.  * been defined as startup option and include a core library
  9.  */
  10. require_once('./libraries/grab_globals.lib.php');
  11. if (!empty($db)) {
  12.     $db_start = $db;
  13. }
  14.  
  15.  
  16. /**
  17.  * Gets a core script and starts output buffering work
  18.  */
  19. require_once('./libraries/common.lib.php');
  20. require_once('./libraries/ob.lib.php');
  21. if ($cfg['OBGzip']) {
  22.     $ob_mode = PMA_outBufferModeGet();
  23.     if ($ob_mode) {
  24.         PMA_outBufferPre($ob_mode);
  25.     }
  26. }
  27.  
  28. // garvin: For re-usability, moved http-headers
  29. // to a seperate file. It can now be included by header.inc.php,
  30. // queryframe.php, querywindow.php.
  31.  
  32. require_once('./libraries/header_http.inc.php');
  33.  
  34. /**
  35.  * Displays the frame
  36.  */
  37. // Gets the font sizes to use
  38. PMA_setFontSizes();
  39. ?>
  40. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  41.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  42. <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; ?>">
  43.  
  44. <head>
  45.     <title>phpMyAdmin</title>
  46.     <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
  47.     <base<?php if (!empty($cfg['PmaAbsoluteUri'])) echo ' href="' . $cfg['PmaAbsoluteUri'] . '"'; ?> />
  48.     <link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?lang=<?php echo $lang; ?>&js_frame=left&num_dbs=0" />
  49. <?php
  50. if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
  51. ?>
  52. <script type="text/javascript" language="javascript">
  53. var querywindow = '';
  54.  
  55. function open_querywindow(url) {
  56.  
  57.     if (!querywindow.closed && querywindow.location) {
  58.         querywindow.focus();
  59.     } else {
  60.         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']; ?>');
  61.     }
  62.  
  63.     if (!querywindow.opener) {
  64.        querywindow.opener = self;
  65.     }
  66.  
  67.     if (window.focus) {
  68.         querywindow.focus();
  69.     }
  70.  
  71.     return false;
  72. }
  73. </script>
  74. <?php
  75. }
  76. ?>
  77. </head>
  78.  
  79. <body bgcolor="<?php echo $cfg['LeftBgColor']; ?>" style="margin-left: 0px; margin-top: 5px; margin-right: 0px; margin-bottom: 0px">
  80. <form name="queryframeform" action="queryframe.php" method="get">
  81. <input type="hidden" name="db" value="" />
  82. <input type="hidden" name="table" value="" />
  83. <input type="hidden" name="framename" value="queryframe" />
  84. </form>
  85.  
  86. <?php
  87. $anchor = 'querywindow.php?' . PMA_generate_common_url('', '');
  88. if ($cfg['QueryFrameJS']) {
  89.     $href = $anchor;
  90.     $target = '';
  91.     $onclick = 'onClick="javascript:open_querywindow(this.href); return false;"';
  92. } else {
  93.     $href = $anchor;
  94.     $target = 'target="phpmain' . $hash . '"';
  95.     $onclick = '';
  96. }
  97. ?>
  98. <center>
  99. <script type="text/javascript">
  100. document.writeln('<a href="<?php echo $href; ?>" <?php echo $target . ' ' . $onclick; ?>><?php echo addslashes($strQueryFrame); ?></a>');
  101. </script>
  102. <noscript>
  103. <a href="<?php echo $href; ?>&no_js=true" <?php echo $target . ' ' . $onclick; ?> target="phpmain<?php echo $hash; ?>"><?php echo $strQueryFrame; ?></a>
  104. </noscript>
  105. </center>
  106.  
  107. <form name="hashform" action="queryframe.php">
  108.     <input type="hidden" name="hash" value="<?php echo $hash; ?>">
  109. </form>
  110. </body>
  111. </html>
  112.  
  113. <?php
  114. /**
  115.  * Close MySql connections
  116.  */
  117. if (isset($dbh) && $dbh) {
  118.     @mysql_close($dbh);
  119. }
  120. if (isset($userlink) && $userlink) {
  121.     @mysql_close($userlink);
  122. }
  123.  
  124.  
  125. /**
  126.  * Sends bufferized data
  127.  */
  128. if (isset($cfg['OBGzip']) && $cfg['OBGzip']
  129.     && isset($ob_mode) && $ob_mode) {
  130.      PMA_outBufferPost($ob_mode);
  131. }
  132. ?>
  133.