/** * Get a navigation button * * @param string $caption iconic caption for button * @param string $title text for button * @param integer $pos position for next query * @param string $html_sql_query query ready for display * @param boolean $back whether 'begin' or 'previous' * @param string $onsubmit optional onsubmit clause * @param string $input_for_real_end optional hidden field for special treatment * @param string $onclick optional onclick clause * * @return string html content * * @access private * * @see _getMoveBackwardButtonsForTableNavigation(), * _getMoveForwardButtonsForTableNavigation() */ private function _getTableNavigationButton($caption, $title, $pos, $html_sql_query, $back, $onsubmit = '', $input_for_real_end = '', $onclick = '') { $caption_output = ''; if ($back) { if (PMA_Util::showIcons('TableNavigationLinksMode')) { $caption_output .= $caption; } if (PMA_Util::showText('TableNavigationLinksMode')) { $caption_output .= ' ' . $title; } } else { if (PMA_Util::showText('TableNavigationLinksMode')) { $caption_output .= $title; } if (PMA_Util::showIcons('TableNavigationLinksMode')) { $caption_output .= ' ' . $caption; } } $title_output = ' title="' . $title . '"'; return '<td>' . '<form action="sql.php" method="post" ' . $onsubmit . '>' . PMA_URL_getHiddenInputs($this->__get('db'), $this->__get('table')) . '<input type="hidden" name="sql_query" value="' . $html_sql_query . '" />' . '<input type="hidden" name="pos" value="' . $pos . '" />' . '<input type="hidden" name="is_browse_distinct" value="' . $this->__get('is_browse_distinct') . '" />' . '<input type="hidden" name="goto" value="' . $this->__get('goto') . '" />' . $input_for_real_end . '<input type="submit" name="navig"' . ' class="ajax" ' . 'value="' . $caption_output . '" ' . $title_output . $onclick . ' />' . '</form>' . '</td>'; }
/** * Function to get html for tracking report and tracking report export * * @param string $url_query url query * @param array $data data * @param array $url_params url params * @param boolean $selection_schema selection schema * @param boolean $selection_data selection data * @param boolean $selection_both selection both * @param int $filter_ts_to filter time stamp from * @param int $filter_ts_from filter time stamp tp * @param array $filter_users filter users * * @return string */ function PMA_getHtmlForTrackingReport($url_query, $data, $url_params, $selection_schema, $selection_data, $selection_both, $filter_ts_to, $filter_ts_from, $filter_users) { $html = '<h3>' . __('Tracking report') . ' [<a href="tbl_tracking.php' . $url_query . '">' . __('Close') . '</a>]</h3>'; $html .= '<small>' . __('Tracking statements') . ' ' . htmlspecialchars($data['tracking']) . '</small><br/>'; $html .= '<br/>'; list($str1, $str2, $str3, $str4, $str5) = PMA_getHtmlForElementsOfTrackingReport($selection_schema, $selection_data, $selection_both); // Prepare delete link content here $drop_image_or_text = ''; if (PMA_Util::showIcons('ActionLinksMode')) { $drop_image_or_text .= PMA_Util::getImage('b_drop.png', __('Delete tracking data row from report')); } if (PMA_Util::showText('ActionLinksMode')) { $drop_image_or_text .= __('Delete'); } /* * First, list tracked data definition statements */ if (count($data['ddlog']) == 0 && count($data['dmlog']) == 0) { $msg = PMA_Message::notice(__('No data')); $msg->display(); } $html .= PMA_getHtmlForTrackingReportExportForm1($data, $url_params, $selection_schema, $selection_data, $selection_both, $filter_ts_to, $filter_ts_from, $filter_users, $str1, $str2, $str3, $str4, $str5, $drop_image_or_text); $html .= PMA_getHtmlForTrackingReportExportForm2($url_params, $str1, $str2, $str3, $str4, $str5); $html .= "<br/><br/><hr/><br/>\n"; return $html; }
* Displays the table structure ('show table' works correct since 3.23.03) * * @package PhpMyAdmin */ require_once 'libraries/common.inc.php'; require_once 'libraries/mysql_charsets.inc.php'; require_once 'libraries/structure.lib.php'; require_once 'libraries/index.lib.php'; require_once 'libraries/tbl_info.inc.php'; if (!defined('PHPMYADMIN')) { exit; } /* TABLE INFORMATION */ // table header $HideStructureActions = ''; if (PMA_Util::showText('ActionLinksMode') && $GLOBALS['cfg']['HideStructureActions'] === true) { $HideStructureActions .= ' HideStructureActions'; } $html_form = '<form method="post" action="tbl_structure.php" name="fieldsForm" ' . 'id="fieldsForm" class="ajax' . $HideStructureActions . '">'; $response->addHTML($html_form); $response->addHTML(PMA_URL_getHiddenInputs($db, $table)); $tabletype = '<input type="hidden" name="table_type" value='; if ($db_is_system_schema) { $tabletype .= '"information_schema" />'; } else { if ($tbl_is_view) { $tabletype .= '"view" />'; } else { $tabletype .= '"table" />'; } }
/** * Returns the breadcrumbs as HTML * * @return string HTML formatted breadcrumbs */ private function _getBreadcrumbs() { $retval = ''; $tbl_is_view = PMA_Table::isView($this->_db, $this->_table); $server_info = !empty($GLOBALS['cfg']['Server']['verbose']) ? $GLOBALS['cfg']['Server']['verbose'] : $GLOBALS['cfg']['Server']['host']; $server_info .= empty($GLOBALS['cfg']['Server']['port']) ? '' : ':' . $GLOBALS['cfg']['Server']['port']; $separator = "<span class='separator item'> »</span>"; $item = '<a href="%1$s%2$s" class="item">'; if (PMA_Util::showText('TabsMode')) { $item .= '%4$s: '; } $item .= '%3$s</a>'; $retval .= "<div id='floating_menubar'></div>"; $retval .= "<div id='serverinfo'>"; if (PMA_Util::showIcons('TabsMode')) { $retval .= PMA_Util::getImage('s_host.png', '', array('class' => 'item')); } $retval .= sprintf($item, $GLOBALS['cfg']['DefaultTabServer'], PMA_URL_getCommon(), htmlspecialchars($server_info), __('Server')); if (mb_strlen($this->_db)) { $retval .= $separator; if (PMA_Util::showIcons('TabsMode')) { $retval .= PMA_Util::getImage('s_db.png', '', array('class' => 'item')); } $retval .= sprintf($item, $GLOBALS['cfg']['DefaultTabDatabase'], PMA_URL_getCommon(array('db' => $this->_db)), htmlspecialchars($this->_db), __('Database')); // if the table is being dropped, $_REQUEST['purge'] is set to '1' // so do not display the table name in upper div if (mb_strlen($this->_table) && !(isset($_REQUEST['purge']) && $_REQUEST['purge'] == '1')) { include './libraries/tbl_info.inc.php'; $retval .= $separator; if (PMA_Util::showIcons('TabsMode')) { $icon = $tbl_is_view ? 'b_views.png' : 's_tbl.png'; $retval .= PMA_Util::getImage($icon, '', array('class' => 'item')); } $retval .= sprintf($item, $GLOBALS['cfg']['DefaultTabTable'], PMA_URL_getCommon(array('db' => $this->_db, 'table' => $this->_table)), str_replace(' ', ' ', htmlspecialchars($this->_table)), $tbl_is_view ? __('View') : __('Table')); /** * Displays table comment */ if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) { if (mb_strstr($show_comment, '; InnoDB free')) { $show_comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment); } $retval .= '<span class="table_comment"'; $retval .= ' id="span_table_comment">"'; $retval .= htmlspecialchars($show_comment); $retval .= '"</span>'; } // end if } else { // no table selected, display database comment if present $cfgRelation = PMA_getRelationsParam(); // Get additional information about tables for tooltip is done // in libraries/db_info.inc.php only once if ($cfgRelation['commwork']) { $comment = PMA_getDbComment($this->_db); /** * Displays table comment */ if (!empty($comment)) { $retval .= '<span class="table_comment"' . ' id="span_table_comment">"' . htmlspecialchars($comment) . '"</span>'; } // end if } } } $retval .= '<div class="clearfloat"></div>'; $retval .= '</div>'; return $retval; }
?> </th> <th><?php echo __('Show'); ?> </th> </tr> </thead> <tbody> <?php // Print out information about versions $drop_image_or_text = ''; if (PMA_Util::showIcons('ActionLinksMode')) { $drop_image_or_text .= PMA_Util::getImage('b_drop.png', __('Delete tracking data for this table')); } if (PMA_Util::showText('ActionLinksMode')) { $drop_image_or_text .= __('Drop'); } $style = 'odd'; while ($one_result = $GLOBALS['dbi']->fetchArray($all_tables_result)) { list($table_name, $version_number) = $one_result; $table_query = ' SELECT * FROM ' . PMA_Util::backquote($cfgRelation['db']) . '.' . PMA_Util::backquote($cfgRelation['tracking']) . ' WHERE `db_name` = \'' . PMA_Util::sqlAddSlashes($_REQUEST['db']) . '\' AND `table_name` = \'' . PMA_Util::sqlAddSlashes($table_name) . '\' AND `version` = \'' . $version_number . '\''; $table_result = PMA_queryAsControlUser($table_query); $version_data = $GLOBALS['dbi']->fetchArray($table_result); $tmp_link = 'tbl_tracking.php' . $url_query . '&table=' . htmlspecialchars($version_data['table_name']); $delete_link = 'db_tracking.php' . $url_query . '&table=' . htmlspecialchars($version_data['table_name']) . '&delete_tracking=true&'; ?> <tr class="noclick <?php echo $style; ?> ">
/** * Function to get html for tracking report and tracking report export * * @param string $url_query url query * @param array $data data * @param array $url_params url params * @param boolean $selection_schema selection schema * @param boolean $selection_data selection data * @param boolean $selection_both selection both * @param int $filter_ts_to filter time stamp from * @param int $filter_ts_from filter time stamp tp * @param array $filter_users filter users * * @return string */ function PMA_getHtmlForTrackingReport($url_query, $data, $url_params, $selection_schema, $selection_data, $selection_both, $filter_ts_to, $filter_ts_from, $filter_users) { $html = '<h3>' . __('Tracking report') . ' [<a href="tbl_tracking.php?' . $url_query . '">' . __('Close') . '</a>]</h3>'; $html .= '<small>' . __('Tracking statements') . ' ' . htmlspecialchars($data['tracking']) . '</small><br/>'; $html .= '<br/>'; $html .= '<form method="post" action="tbl_tracking.php' . PMA_URL_getCommon($url_params + array('report' => 'true', 'version' => $_REQUEST['version'])) . '">'; $str1 = '<select name="logtype">' . '<option value="schema"' . ($selection_schema ? ' selected="selected"' : '') . '>' . __('Structure only') . '</option>' . '<option value="data"' . ($selection_data ? ' selected="selected"' : '') . '>' . __('Data only') . '</option>' . '<option value="schema_and_data"' . ($selection_both ? ' selected="selected"' : '') . '>' . __('Structure and data') . '</option>' . '</select>'; $str2 = '<input type="text" name="date_from" value="' . htmlspecialchars($_REQUEST['date_from']) . '" size="19" />'; $str3 = '<input type="text" name="date_to" value="' . htmlspecialchars($_REQUEST['date_to']) . '" size="19" />'; $str4 = '<input type="text" name="users" value="' . htmlspecialchars($_REQUEST['users']) . '" />'; $str5 = '<input type="hidden" name="list_report" value="1" />' . '<input type="submit" value="' . __('Go') . '" />'; $html .= sprintf(__('Show %1$s with dates from %2$s to %3$s by user %4$s %5$s'), $str1, $str2, $str3, $str4, $str5); // Prepare delete link content here $drop_image_or_text = ''; if (PMA_Util::showIcons('ActionsLinksMode')) { $drop_image_or_text .= PMA_Util::getImage('b_drop.png', __('Delete tracking data row from report')); } if (PMA_Util::showText('ActionLinksMode')) { $drop_image_or_text .= __('Delete'); } /* * First, list tracked data definition statements */ if (count($data['ddlog']) == 0 && count($data['dmlog']) == 0) { $msg = PMA_Message::notice(__('No data')); $msg->display(); } if ($selection_schema || $selection_both && count($data['ddlog']) > 0) { list($temp, $ddlog_count) = PMA_getHtmlForDataDefinitionStatements($data, $filter_users, $filter_ts_from, $filter_ts_to, $url_params, $drop_image_or_text); $html .= $temp; unset($temp); } //endif /* * Secondly, list tracked data manipulation statements */ if (($selection_data || $selection_both) && count($data['dmlog']) > 0) { $html .= PMA_getHtmlForDataManipulationStatements($data, $filter_users, $filter_ts_from, $filter_ts_to, $url_params, $ddlog_count, $drop_image_or_text); } $html .= '</form>'; $html .= '<form method="post" action="tbl_tracking.php' . PMA_URL_getCommon($url_params + array('report' => 'true', 'version' => $_REQUEST['version'])) . '">'; $html .= sprintf(__('Show %1$s with dates from %2$s to %3$s by user %4$s %5$s'), $str1, $str2, $str3, $str4, $str5); $str_export1 = '<select name="export_type">' . '<option value="sqldumpfile">' . __('SQL dump (file download)') . '</option>' . '<option value="sqldump">' . __('SQL dump') . '</option>' . '<option value="execution" onclick="alert(\'' . PMA_escapeJsString(__('This option will replace your table and contained data.')) . '\')">' . __('SQL execution') . '</option>' . '</select>'; $str_export2 = '<input type="hidden" name="report_export" value="1" />' . '<input type="submit" value="' . __('Go') . '" />'; $html .= '</form>'; $html .= '<form class="disableAjax" method="post" action="tbl_tracking.php' . PMA_URL_getCommon($url_params + array('report' => 'true', 'version' => $_REQUEST['version'])) . '">'; $html .= '<input type="hidden" name="logtype" value="' . htmlspecialchars($_REQUEST['logtype']) . '" />'; $html .= '<input type="hidden" name="date_from" value="' . htmlspecialchars($_REQUEST['date_from']) . '" />'; $html .= '<input type="hidden" name="date_to" value="' . htmlspecialchars($_REQUEST['date_to']) . '" />'; $html .= '<input type="hidden" name="users" value="' . htmlspecialchars($_REQUEST['users']) . '" />'; $html .= "<br/>" . sprintf(__('Export as %s'), $str_export1) . $str_export2 . "<br/>"; $html .= '</form>'; $html .= "<br/><br/><hr/><br/>\n"; return $html; }