Refactoring db print view
Signed-off-by: Marc Delisle <marc@infomarc.info>
This commit is contained in:
parent
7ee56a7d60
commit
12ceeed2d0
@ -10,6 +10,7 @@
|
||||
*
|
||||
*/
|
||||
require_once 'libraries/common.inc.php';
|
||||
require_once 'libraries/db_printview.lib.php';
|
||||
|
||||
$response = PMA_Response::getInstance();
|
||||
$header = $response->getHeader();
|
||||
@ -115,30 +116,24 @@ if ($num_tables == 0) {
|
||||
echo '<table width="100%">';
|
||||
|
||||
if (! empty($sts_data['Create_time'])) {
|
||||
echo '<tr>';
|
||||
echo '<td class="right">' . __('Creation:') . '</td>';
|
||||
echo '<td class="right">';
|
||||
echo PMA_Util::localisedDate(strtotime($sts_data['Create_time']));
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo PMA_getHtmlForOneDate(
|
||||
__('Creation:'),
|
||||
$sts_data['Create_time']
|
||||
);
|
||||
}
|
||||
|
||||
if (! empty($sts_data['Update_time'])) {
|
||||
echo '<tr>';
|
||||
echo '<td class="right">' . __('Last update:') . '</td>';
|
||||
echo '<td class="right">';
|
||||
echo PMA_Util::localisedDate(strtotime($sts_data['Update_time']));
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo PMA_getHtmlForOneDate(
|
||||
__('Last update:'),
|
||||
$sts_data['Update_time']
|
||||
);
|
||||
}
|
||||
|
||||
if (! empty($sts_data['Check_time'])) {
|
||||
echo '<tr>';
|
||||
echo '<td class="right">' . __('Last check:') . '</td>';
|
||||
echo '<td class="right">';
|
||||
echo PMA_Util::localisedDate(strtotime($sts_data['Check_time']));
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo PMA_getHtmlForOneDate(
|
||||
__('Last check:'),
|
||||
$sts_data['Check_time']
|
||||
);
|
||||
}
|
||||
echo '</table>';
|
||||
}
|
||||
|
||||
30
libraries/db_printview.lib.php
Normal file
30
libraries/db_printview.lib.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Set of functions related to db printview
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get html for one of the db dates
|
||||
*
|
||||
* @param string $title the title
|
||||
* @param string $date which date to display
|
||||
*
|
||||
* @return string html content
|
||||
*/
|
||||
function PMA_getHtmlForOneDate($title, $date)
|
||||
{
|
||||
$html = '<tr>'
|
||||
. '<td class="right">' . $title . '</td>'
|
||||
. '<td class="right">'
|
||||
. PMA_Util::localisedDate(strtotime($date))
|
||||
. '</td>'
|
||||
. '</tr>';
|
||||
return $html;
|
||||
}
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user