mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #1110 from laf/issue-279
Updated mysql DATE_FORMAT() and php date() to use $config variables
This commit is contained in:
@@ -31,7 +31,7 @@ if( !empty($_POST['string']) ) {
|
||||
$sql .= " AND message LIKE '%".mres($_POST['string'])."%'";
|
||||
}
|
||||
|
||||
$entries = dbFetchRows("SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` WHERE `host` = ? $sql ORDER BY `datetime` DESC LIMIT 0,250", array($device['device_id']));
|
||||
$entries = dbFetchRows("SELECT *,DATE_FORMAT(datetime, '".$config['dateformat']['mysql']['compact']."') as humandate FROM `eventlog` WHERE `host` = ? $sql ORDER BY `datetime` DESC LIMIT 0,250", array($device['device_id']));
|
||||
|
||||
echo(' <div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">
|
||||
|
@@ -40,7 +40,7 @@ if ($_POST['program'])
|
||||
$param[] = $_POST['program'];
|
||||
}
|
||||
|
||||
$sql = "SELECT *, DATE_FORMAT(timestamp, '%Y-%m-%d %T') AS date from syslog WHERE device_id = ? $where";
|
||||
$sql = "SELECT *, DATE_FORMAT(timestamp, '".$config['dateformat']['mysql']['compact']."') AS date from syslog WHERE device_id = ? $where";
|
||||
$sql .= " ORDER BY timestamp DESC LIMIT 1000";
|
||||
echo(' <div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">
|
||||
|
@@ -10,7 +10,7 @@ echo("<img src='images/16/report.png'> Recent Events</a>");
|
||||
echo(' </div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
|
||||
$eventlog = dbFetchRows("SELECT *,DATE_FORMAT(datetime, '%d/%b/%y %T') as humandate FROM `eventlog` WHERE `host` = ? ORDER BY `datetime` DESC LIMIT 0,10", array($device['device_id']));
|
||||
$eventlog = dbFetchRows("SELECT *,DATE_FORMAT(datetime, '".$config['dateformat']['mysql']['compact']."') as humandate FROM `eventlog` WHERE `host` = ? ORDER BY `datetime` DESC LIMIT 0,10", array($device['device_id']));
|
||||
foreach ($eventlog as $entry)
|
||||
{
|
||||
include("includes/print-event-short.inc.php");
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
if ($config['enable_syslog'])
|
||||
{
|
||||
$syslog = dbFetchRows("SELECT *, DATE_FORMAT(timestamp, '%Y-%m-%d %T') AS date from syslog WHERE device_id = ? ORDER BY timestamp DESC LIMIT 20", array($device['device_id']));
|
||||
$syslog = dbFetchRows("SELECT *, DATE_FORMAT(timestamp, '".$config['dateformat']['mysql']['compact']."') AS date from syslog WHERE device_id = ? ORDER BY timestamp DESC LIMIT 20", array($device['device_id']));
|
||||
if (count($syslog))
|
||||
{
|
||||
echo('<div class="container-fluid">');
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$entries = dbFetchRows("SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` WHERE `host` = ? AND `type` = 'interface' AND `reference` = '".$port['port_id']."' ORDER BY `datetime` DESC LIMIT 0,250", array($device['device_id']));
|
||||
$entries = dbFetchRows("SELECT *,DATE_FORMAT(datetime, '".$config['dateformat']['mysql']['compact']."') as humandate FROM `eventlog` WHERE `host` = ? AND `type` = 'interface' AND `reference` = '".$port['port_id']."' ORDER BY `datetime` DESC LIMIT 0,250", array($device['device_id']));
|
||||
echo('<table cellspacing="0" cellpadding="2" width="100%">');
|
||||
|
||||
foreach ($entries as $entry)
|
||||
|
@@ -48,7 +48,7 @@ if ($_SESSION['userlevel'] >= "7")
|
||||
if ($vars['rev'] == $svnlog["rev"]) {
|
||||
echo('<span class="pagemenu-selected">');
|
||||
}
|
||||
$linktext = "r" . $svnlog["rev"] . " <small>" . date("d M H:i", strtotime($svnlog["date"])) . "</small>";
|
||||
$linktext = "r" . $svnlog["rev"] . " <small>" . date($config['dateformat']['byminute'], strtotime($svnlog["date"])) . "</small>";
|
||||
echo(generate_link($linktext, array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'showconfig', 'rev' => $svnlog["rev"])));
|
||||
|
||||
if ($vars['rev'] == $svnlog["rev"]) {
|
||||
|
Reference in New Issue
Block a user