= $filter_ts_from
&& $timestamp <= $filter_ts_to
&& (in_array('*', $filter_users) || $filtered_user)
) {
$tmp_entries[] = array(
'id' => $id,
'timestamp' => $timestamp,
'username' => $entry['username'],
'statement' => $entry['statement']
);
}
$id++;
}
return($tmp_entries);
}
/**
* Function to get html for data definition and data manipulation statements
*
* @param string $url_query url query
* @param int $last_version last version
*
* @return string
*/
function PMA_getHtmlForDataDefinitionAndManipulationStatements($url_query,
$last_version
) {
$html = '
';
$html .= '';
$html .= '
';
return $html;
}
/**
* Function to get html for activate/deactivate tracking
*
* @param string $action activate|deactivate
* @param string $url_query url query
* @param int $last_version last version
*
* @return string
*/
function PMA_getHtmlForActivateDeactivateTracking(
$action, $url_query, $last_version
) {
$html = '
';
$html .= '';
$html .= '
';
return $html;
}
/**
* Function to get the list versions of the table
*
* @return array
*/
function PMA_getListOfVersionsOfTable()
{
$cfgRelation = PMA_getRelationsParam();
$sql_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($_REQUEST['table']) . "' " .
" ORDER BY version DESC ";
return PMA_queryAsControlUser($sql_query);
}
/**
* Function to get html for displaying last version number
*
* @param array $sql_result sql result
* @param int $last_version last version
* @param array $url_params url parameters
* @param string $url_query url query
*
* @return string
*/
function PMA_getHtmlForTableVersionDetails($sql_result, $last_version, $url_params,
$url_query
) {
$tracking_active = false;
$html = '
\n";
return $html;
}
/**
* Generate HTML element for report form
*
* @param boolean $selection_schema selection schema
* @param boolean $selection_data selection data
* @param boolean $selection_both selection both
*
* @return array
*/
function PMA_getHtmlForElementsOfTrackingReport(
$selection_schema, $selection_data, $selection_both
) {
$str1 = '';
$str2 = '';
$str3 = '';
$str4 = '';
$str5 = ''
. '';
return array($str1, $str2, $str3, $str4, $str5);
}
/**
* Generate HTML for export form
*
* @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
* @param string $str1 HTML for logtype select
* @param string $str2 HTML for "from date"
* @param string $str3 HTML for "to date"
* @param string $str4 HTML for user
* @param string $str5 HTML for "list report"
* @param string $drop_image_or_text HTML for image or text
*
* @return string HTML for form
*/
function 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
) {
$ddlog_count = 0;
$html = '';
return $html;
}
/**
* Generate HTML for export form
*
* @param array $url_params Parameters
* @param string $str1 HTML for logtype select
* @param string $str2 HTML for "from date"
* @param string $str3 HTML for "to date"
* @param string $str4 HTML for user
* @param string $str5 HTML for "list report"
*
* @return string HTML for form
*/
function PMA_getHtmlForTrackingReportExportForm2(
$url_params, $str1, $str2, $str3, $str4, $str5
) {
$html = '';
$html .= '';
return $html;
}
/**
* Function to get html for data manipulation statements
*
* @param array $data data
* @param array $filter_users filter users
* @param int $filter_ts_from filter time staml from
* @param int $filter_ts_to filter time stamp to
* @param array $url_params url parameters
* @param int $ddlog_count data definition log count
* @param string $drop_image_or_text drop image or text
*
* @return string
*/
function PMA_getHtmlForDataManipulationStatements($data, $filter_users,
$filter_ts_from, $filter_ts_to, $url_params, $ddlog_count,
$drop_image_or_text
) {
// no need for the secondth returned parameter
list($html,) = PMA_getHtmlForDataStatements(
$data, $filter_users, $filter_ts_from, $filter_ts_to, $url_params,
$drop_image_or_text, 'dmlog', __('Data manipulation statement'),
$ddlog_count, 'dml_versions'
);
return $html;
}
/**
* Function to get html for one data manipulation statement
*
* @param array $entry entry
* @param array $filter_users filter users
* @param int $filter_ts_from filter time stamp from
* @param int $filter_ts_to filter time stamp to
* @param string $style style
* @param int $line_number line number
* @param array $url_params url parameters
* @param int $offset line number offset
* @param string $drop_image_or_text drop image or text
* @param string $delete_param parameter for delete
*
* @return string
*/
function PMA_getHtmlForOneStatement($entry, $filter_users,
$filter_ts_from, $filter_ts_to, $style, $line_number, $url_params, $offset,
$drop_image_or_text, $delete_param
) {
$statement = PMA_Util::formatSql($entry['statement'], true);
$timestamp = strtotime($entry['date']);
$filtered_user = in_array($entry['username'], $filter_users);
$html = null;
if ($timestamp >= $filter_ts_from
&& $timestamp <= $filter_ts_to
&& (in_array('*', $filter_users) || $filtered_user)
) {
$html = '
';
}
return $html;
}
/**
* Function to get html for data definition statements in schema snapshot
*
* @param array $data data
* @param array $filter_users filter users
* @param int $filter_ts_from filter time stamp from
* @param int $filter_ts_to filter time stamp to
* @param array $url_params url parameters
* @param string $drop_image_or_text drop image or text
*
* @return array
*/
function PMA_getHtmlForDataDefinitionStatements($data, $filter_users,
$filter_ts_from, $filter_ts_to, $url_params, $drop_image_or_text
) {
list($html, $line_number) = PMA_getHtmlForDataStatements(
$data, $filter_users, $filter_ts_from, $filter_ts_to, $url_params,
$drop_image_or_text, 'ddlog', __('Data definition statement'),
1, 'ddl_versions'
);
return array($html, $line_number);
}
/**
* Function to get html for data statements in schema snapshot
*
* @param array $data data
* @param array $filter_users filter users
* @param int $filter_ts_from filter time stamp from
* @param int $filter_ts_to filter time stamp to
* @param array $url_params url parameters
* @param string $drop_image_or_text drop image or text
* @param string $which_log dmlog|ddlog
* @param string $header_message message for this section
* @param int $line_number line number
* @param string $table_id id for the table element
*
* @return array
*/
function PMA_getHtmlForDataStatements($data, $filter_users,
$filter_ts_from, $filter_ts_to, $url_params, $drop_image_or_text,
$which_log, $header_message, $line_number, $table_id
) {
$offset = $line_number;
$html = '
';
return $html;
}
/**
* Function to get html for field
*
* @param array $field field
* @param string $style style
*
* @return string
*/
function PMA_getHtmlForField($field, $style)
{
$html = '
';
return $html;
}
/**
* Function to get html for the indexes in schema snapshot
*
* @param array $indexes indexes
*
* @return string
*/
function PMA_getHtmlForIndexes($indexes)
{
$html = '