' . "\n"; } if ($is_querywindow) { $html .= '' . "\n"; if ($display_tab != 'sql' && $display_tab != 'full') { $html .= '' . "\n"; $html .= '' . "\n"; } } $html .= '' . "\n" . PMA_URL_getHiddenInputs($db, $table) . "\n" .'' . "\n" .'' . "\n" .'' . "\n" .'' . "\n"; // display querybox if ($display_tab === 'full' || $display_tab === 'sql') { $html .= PMA_getHtmlForSqlQueryFormInsert( $query, $is_querywindow, $delimiter ); } // display uploads if ($display_tab === 'files' && $GLOBALS['is_upload']) { $html .= PMA_getHtmlForSqlQueryFormUpload(); } // Bookmark Support if ($display_tab === 'full' || $display_tab === 'history') { if (! empty($GLOBALS['cfg']['Bookmark'])) { $html .= PMA_getHtmlForSqlQueryFormBookmark(); } } // Encoding setting form appended by Y.Kawada if (function_exists('PMA_Kanji_encodingForm')) { $html .= PMA_Kanji_encodingForm(); } $html .= '' . "\n"; // print an empty div, which will be later filled with // the sql query results by ajax $html .= '
'; return $html; } /** * return HTML for Sql Query Form Insert * * @param string $query query to display in the textarea * @param boolean $is_querywindow if inside querywindow or not * @param string $delimiter default delimiter to use * * @return string * * @usedby PMA_getHtmlForSqlQueryForm() */ function PMA_getHtmlForSqlQueryFormInsert( $query = '', $is_querywindow = false, $delimiter = ';' ) { // enable auto select text in textarea if ($GLOBALS['cfg']['TextareaAutoSelect']) { $auto_sel = ' onclick="selectContent(this, sql_box_locked, true);"'; } else { $auto_sel = ''; } // enable locking if inside query window if ($is_querywindow) { $locking = ' onkeypress="document.sqlform.elements[\'LockFromUpdate\'].' .'checked = true;"'; $height = $GLOBALS['cfg']['TextareaRows'] * 1.25; } else { $locking = ''; $height = $GLOBALS['cfg']['TextareaRows'] * 2; } $table = ''; $db = ''; $fields_list = array(); if (! strlen($GLOBALS['db'])) { // prepare for server related $legend = sprintf( __('Run SQL query/queries on server %s'), '"' . htmlspecialchars( ! empty($GLOBALS['cfg']['Servers'][$GLOBALS['server']]['verbose']) ? $GLOBALS['cfg']['Servers'][$GLOBALS['server']]['verbose'] : $GLOBALS['cfg']['Servers'][$GLOBALS['server']]['host'] ) . '"' ); } elseif (! strlen($GLOBALS['table'])) { // prepare for db related $db = $GLOBALS['db']; // if you want navigation: $tmp_db_link = ''; // else use // $tmp_db_link = htmlspecialchars($db); $legend = sprintf(__('Run SQL query/queries on database %s'), $tmp_db_link); if (empty($query)) { $query = PMA_Util::expandUserString( $GLOBALS['cfg']['DefaultQueryDatabase'], 'backquote' ); } } 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 = $GLOBALS['dbi']->getColumns( $db, $GLOBALS['table'], null, true ); $tmp_db_link = ''; // else use // $tmp_db_link = htmlspecialchars($db); $legend = sprintf(__('Run SQL query/queries on database %s'), $tmp_db_link); if (empty($query)) { $query = PMA_Util::expandUserString( $GLOBALS['cfg']['DefaultQueryTable'], 'backquote' ); } } $legend .= ': ' . PMA_Util::showMySQLDocu('SELECT'); if (count($fields_list)) { $sqlquerycontainer_id = 'sqlquerycontainer'; } else { $sqlquerycontainer_id = 'sqlquerycontainerfull'; } $html = '' . '