name="sqlform" onsubmit=" // '; this.target = window.opener.parent.frame_content.name; return checkSqlQuery(this); // ]]" > ' . "\n"; } if ($is_querywindow) { echo '' ."\n"; if ($display_tab != 'sql' && $display_tab != 'full') { echo '' . "\n"; echo '' . "\n"; } } echo '' . "\n" .PMA_generate_common_hidden_inputs($db, $table) . "\n" .'' . "\n" .'' . "\n" .'' . "\n" .'' . "\n"; // display querybox if ($display_tab === 'full' || $display_tab === 'sql') { PMA_sqlQueryFormInsert($query, $is_querywindow, $delimiter); } // display uploads if ($display_tab === 'files' && $GLOBALS['is_upload']) { PMA_sqlQueryFormUpload(); } // Bookmark Support if ($display_tab === 'full' || $display_tab === 'history') { if (! empty($GLOBALS['cfg']['Bookmark'])) { PMA_sqlQueryFormBookmark(); } } // Encoding setting form appended by Y.Kawada if (function_exists('PMA_set_enc_form')) { echo PMA_set_enc_form(' '); } echo '
' . "\n"; if ($is_querywindow) { ?> ' . htmlspecialchars($db) . ''; // else use // $strDBLink = htmlspecialchars($db); $legend = sprintf($GLOBALS['strRunSQLQuery'], $strDBLink); if (empty($query)) { $query = str_replace('%d', PMA_backquote($db), $GLOBALS['cfg']['DefaultQueryDatabase']); } } else { $table = $GLOBALS['table']; $db = $GLOBALS['db']; // Get the list and number of fields // we do a try_query here, because we could be in the query window, // trying to synchonize and the table has not yet been created $fields_list = PMA_DBI_fetch_result( 'SHOW FULL COLUMNS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($GLOBALS['table'])); $strDBLink = ''; // else use // $strDBLink = htmlspecialchars($db); $legend = sprintf($GLOBALS['strRunSQLQuery'], $strDBLink); if (empty($query) && count($fields_list)) { $field_names = array(); foreach ($fields_list as $field) { $field_names[] = PMA_backquote($field['Field']); } $query = str_replace('%d', PMA_backquote($db), str_replace('%t', PMA_backquote($table), str_replace('%f', implode(', ', $field_names), $GLOBALS['cfg']['DefaultQueryTable']))); unset($field_names); } } $legend .= ': ' . PMA_showMySQLDocu('SQL-Syntax', 'SELECT'); if (count($fields_list)) { $sqlquerycontainer_id = 'sqlquerycontainer'; } else { $sqlquerycontainer_id = 'sqlquerycontainerfull'; } echo '' . "\n" .'
' . "\n" .'
' . "\n"; echo '' . $legend . '' . "\n"; echo '
' . "\n"; echo '
' . "\n" .'' . "\n"; echo '
' . "\n"; if (count($fields_list)) { echo '
' . "\n" .'' . "\n" .'' . "\n" .'
' . "\n"; if ($GLOBALS['cfg']['PropertiesIconic']) { echo '' . "\n"; } else { echo '' . "\n"; } echo '
' . "\n" .'
' . "\n"; } echo '
' . "\n"; echo '
' . "\n"; if (! empty($GLOBALS['cfg']['Bookmark'])) { ?>
' . "\n"; echo '' . "\n" .'' . "\n"; echo '
' . "\n"; echo '
' . "\n"; if ($is_querywindow) { ?> ' . "\n"; echo '
' . "\n"; echo '' . "\n"; echo ' ]' . "\n"; echo '' . "\n" .'' . "\n"; echo '
' . "\n"; echo '' ."\n"; echo '
' . "\n"; echo '
' . "\n"; } /** * prints bookmark fieldset * * @usedby PMA_sqlQueryForm() * @uses PMA_Bookmark_getList() * @uses $GLOBALS['db'] * @uses $GLOBALS['pmaThemeImage'] * @uses $GLOBALS['cfg']['ReplaceHelpImg'] * @uses $GLOBALS['strBookmarkQuery'] * @uses $GLOBALS['strBookmarkView'] * @uses $GLOBALS['strDelete'] * @uses $GLOBALS['strDocu'] * @uses $GLOBALS['strGo'] * @uses $GLOBALS['strSubmit'] * @uses $GLOBALS['strVar'] * @uses count() * @uses htmlspecialchars() */ function PMA_sqlQueryFormBookmark() { $bookmark_list = PMA_Bookmark_getList($GLOBALS['db']); if (! $bookmark_list || count($bookmark_list) < 1) { return; } echo '
'; echo ''; echo $GLOBALS['strBookmarkQuery'] . '' . "\n"; echo '
'; echo ' ' . "\n"; echo '
' . "\n"; echo '
' . "\n"; echo $GLOBALS['strVar']; if ($GLOBALS['cfg']['ReplaceHelpImg']) { echo ' ' .'' . $GLOBALS['strDocu'] . ' '; } else { echo ' (' . $GLOBALS['strDocu'] . '): '; } echo '' . "\n"; echo '
' . "\n"; echo '
' . "\n"; echo '' .'' . "\n"; echo '' .'' . "\n"; echo '' .'' . "\n"; echo '
' . "\n"; echo '
' . "\n"; echo '
' . "\n"; echo '
' . "\n"; echo ''; echo '
' . "\n"; echo '
' . "\n"; } /** * prints bookmark fieldset * * @usedby PMA_sqlQueryForm() * @uses $GLOBALS['cfg']['GZipDump'] * @uses $GLOBALS['cfg']['BZipDump'] * @uses $GLOBALS['cfg']['UploadDir'] * @uses $GLOBALS['cfg']['AvailableCharsets'] * @uses $GLOBALS['cfg']['AllowAnywhereRecoding'] * @uses $GLOBALS['strBzip'] * @uses $GLOBALS['strCharsetOfFile'] * @uses $GLOBALS['strCompression'] * @uses $GLOBALS['strError'] * @uses $GLOBALS['strGo'] * @uses $GLOBALS['strGzip'] * @uses $GLOBALS['strLocationTextfile'] * @uses $GLOBALS['strWebServerUploadDirectory'] * @uses $GLOBALS['strWebServerUploadDirectoryError'] * @uses $GLOBALS['charset'] * @uses $GLOBALS['max_upload_size'] * @uses PMA_supportedDecompressions() * @uses PMA_getFileSelectOptions() * @uses PMA_displayMaximumUploadSize() * @uses PMA_generateCharsetDropdownBox() * @uses PMA_generateHiddenMaxFileSize() * @uses PMA_CSDROPDOWN_CHARSET * @uses empty() */ function PMA_sqlQueryFormUpload(){ $errors = array (); $matcher = '@\.sql(\.(' . PMA_supportedDecompressions() . '))?$@'; // we allow only SQL here if (!empty($GLOBALS['cfg']['UploadDir'])) { $files = PMA_getFileSelectOptions(PMA_userDir($GLOBALS['cfg']['UploadDir']), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : ''); } else { $files = ''; } // start output echo '
'; echo ''; echo $GLOBALS['strLocationTextfile'] . ''; echo '
'; echo ' '; echo PMA_displayMaximumUploadSize($GLOBALS['max_upload_size']); // some browsers should respect this :) echo PMA_generateHiddenMaxFileSize($GLOBALS['max_upload_size']) . "\n"; echo '
'; if ($files === FALSE) { $errors[] = PMA_Message::error('strWebServerUploadDirectoryError'); } elseif (!empty($files)) { echo '
'; echo '' . $GLOBALS['strWebServerUploadDirectory'] .':' . "\n"; echo '' . "\n"; echo '
'; } echo '
' . "\n"; echo '
'; echo '
'; echo $GLOBALS['strCharsetOfFile'] . "\n"; echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', null, 'utf8', FALSE); echo '' . "\n"; echo '
' . "\n"; echo '
'; foreach ($errors as $error) { $error->display(); } } ?>