1) { $html .= '
'; $html .= PMA_URL_getHiddenInputs($url_params); $html .= '
'; $html .= __('Select binary log to view'); $html .= ''; $html .= '
'; $html .= '
'; } return $html; } /** * Returns the html for binary log information. * * @param Array $binary_log_file_names Binary logs file names * @param Array $url_params links parameters * * @return string */ function PMA_getLogInfo($binary_log_file_names, $url_params) { /** * Need to find the real end of rows? */ if (! isset($_REQUEST['pos'])) { $pos = 0; } else { /* We need this to be a integer */ $pos = (int) $_REQUEST['pos']; } $sql_query = 'SHOW BINLOG EVENTS'; if (! empty($_REQUEST['log'])) { $sql_query .= ' IN \'' . $_REQUEST['log'] . '\''; } $sql_query .= ' LIMIT ' . $pos . ', ' . (int) $GLOBALS['cfg']['MaxRows']; /** * Sends the query */ $result = $GLOBALS['dbi']->query($sql_query); /** * prepare some vars for displaying the result table */ // Gets the list of fields properties if (isset($result) && $result) { $num_rows = $GLOBALS['dbi']->numRows($result); } else { $num_rows = 0; } if (empty($_REQUEST['dontlimitchars'])) { $dontlimitchars = false; } else { $dontlimitchars = true; $url_params['dontlimitchars'] = 1; } //html output $html = PMA_Util::getMessage(PMA_Message::success(), $sql_query); $html .= '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . ''; $html .= PMA_getAllLogItemInfo($result, $dontlimitchars); $html .= '' . '
'; $html .= PMA_getNavigationRow($url_params, $pos, $num_rows, $dontlimitchars); $html .= '
' . __('Log name') . '' . __('Position') . '' . __('Event type') . '' . __('Server ID') . '' . __('Original position') . '' . __('Information') . '
'; return $html; } /** * Returns the html for Navigation Row. * * @param Array $url_params Links parameters * @param int $pos Position to display * @param int $num_rows Number of results row * @param bool $dontlimitchars Whether limit chars * * @return string */ function PMA_getNavigationRow($url_params, $pos, $num_rows, $dontlimitchars) { $html = ""; // we do not know how much rows are in the binlog // so we can just force 'NEXT' button if ($pos > 0) { $this_url_params = $url_params; if ($pos > $GLOBALS['cfg']['MaxRows']) { $this_url_params['pos'] = $pos - $GLOBALS['cfg']['MaxRows']; } $html .= ''; } else { $html .= '>' . _pgettext('Previous page', 'Previous'); } // end if... else... $html .= ' < - '; } $this_url_params = $url_params; if ($pos > 0) { $this_url_params['pos'] = $pos; } if ($dontlimitchars) { unset($this_url_params['dontlimitchars']); $tempTitle = __('Truncate Shown Queries'); $tempImgMode = 'partial'; } else { $this_url_params['dontlimitchars'] = 1; $tempTitle = __('Show Full Queries'); $tempImgMode = 'full'; } $html .= '' . ''; // we do not now how much rows are in the binlog // so we can just force 'NEXT' button if ($num_rows >= $GLOBALS['cfg']['MaxRows']) { $this_url_params = $url_params; $this_url_params['pos'] = $pos + $GLOBALS['cfg']['MaxRows']; $html .= ' - '; } else { $html .= '>' . _pgettext('Next page', 'Next'); } // end if... else... $html .= ' > '; } return $html; } /** * Returns the html for all binary log items. * * @param resource $result MySQL Query result * @param bool $dontlimitchars Whether limit chars * * @return string */ function PMA_getAllLogItemInfo($result, $dontlimitchars) { $html = ""; $odd_row = true; while ($value = $GLOBALS['dbi']->fetchAssoc($result)) { $html .= '' . ' ' . $value['Log_name'] . ' ' . ' ' . $value['Pos'] . ' ' . ' ' . $value['Event_type'] . ' ' . ' ' . $value['Server_id'] . ' ' . ' ' . (isset($value['Orig_log_pos']) ? $value['Orig_log_pos'] : $value['End_log_pos']) . ' ' . ' ' . PMA_Util::formatSql($value['Info'], ! $dontlimitchars) . ' '; $odd_row = !$odd_row; } return $html; } ?>