mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 16:04:35 +02: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:
@@ -48,13 +48,13 @@ if(is_admin() !== false) {
|
||||
<div class="form-group">
|
||||
<label for="start" class="col-sm-4 control-label">Start: </label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control date" id="start" name="start" value="<?php echo date('Y-m-d H:i'); ?>" data-date-format="YYYY-MM-DD HH:mm">
|
||||
<input type="text" class="form-control date" id="start" name="start" value="<?php echo date($config['dateformat']['byminute']); ?>" data-date-format="YYYY-MM-DD HH:mm">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="end" class="col-sm-4 control-label">End: </label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control date" id="end" name="end" value="<?php echo date('Y-m-d H:i',strtotime('+1 hour')); ?>" data-date-format="YYYY-MM-DD HH:mm">
|
||||
<input type="text" class="form-control date" id="end" name="end" value="<?php echo date($config['dateformat']['byminute'],strtotime('+1 hour')); ?>" data-date-format="YYYY-MM-DD HH:mm">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -208,7 +208,7 @@ $('#map-stub').typeahead({
|
||||
|
||||
$(function () {
|
||||
$("#start").datetimepicker({
|
||||
minDate: '<?php echo date('Y-m-d H:i'); ?>'
|
||||
minDate: '<?php echo date($config['dateformat']['byminute']); ?>'
|
||||
});
|
||||
$("#end").datetimepicker();
|
||||
$("#start").on("dp.change", function (e) {
|
||||
|
||||
@@ -32,7 +32,7 @@ $pdf->AddPage('L');
|
||||
$numresults = 250;
|
||||
}
|
||||
|
||||
$full_query = "SELECT D.device_id,name,state,time_logged,DATE_FORMAT(time_logged, '%D %b %Y %T') as humandate $query LIMIT $start,$numresults";
|
||||
$full_query = "SELECT D.device_id,name,state,time_logged,DATE_FORMAT(time_logged, '".$config['dateformat']['mysql']['compact']."') as humandate $query LIMIT $start,$numresults";
|
||||
|
||||
foreach (dbFetchRows($full_query, $param) as $alert_entry) {
|
||||
$hostname = gethostbyid(mres($alert_entry['device_id']));
|
||||
|
||||
@@ -46,7 +46,7 @@ if ($rowCount != -1) {
|
||||
$sql .= " LIMIT $limit_low,$limit_high";
|
||||
}
|
||||
|
||||
$sql = "SELECT `S`.`schedule_id`, DATE_FORMAT(`S`.`start`, '%D %b %Y %T') AS `start`, DATE_FORMAT(`S`.`end`, '%D %b %Y %T') AS `end`, `S`.`title` $sql";
|
||||
$sql = "SELECT `S`.`schedule_id`, DATE_FORMAT(`S`.`start`, '".$config['dateformat']['mysql']['compact']."') AS `start`, DATE_FORMAT(`S`.`end`, '".$config['dateformat']['mysql']['compact']."') AS `end`, `S`.`title` $sql";
|
||||
|
||||
foreach (dbFetchRows($sql,$param) as $schedule) {
|
||||
$status = 0;
|
||||
|
||||
@@ -39,7 +39,7 @@ if ($rowCount != -1) {
|
||||
$sql .= " LIMIT $limit_low,$limit_high";
|
||||
}
|
||||
|
||||
$sql = "SELECT D.device_id,name AS alert,state,time_logged,DATE_FORMAT(time_logged, '%D %b %Y %T') as humandate,details $sql";
|
||||
$sql = "SELECT D.device_id,name AS alert,state,time_logged,DATE_FORMAT(time_logged, '".$config['dateformat']['mysql']['compact']."') as humandate,details $sql";
|
||||
|
||||
$rulei = 0;
|
||||
foreach (dbFetchRows($sql,$param) as $alertlog) {
|
||||
|
||||
@@ -46,7 +46,7 @@ if ($rowCount != -1) {
|
||||
$sql .= " LIMIT $limit_low,$limit_high";
|
||||
}
|
||||
|
||||
$sql = "SELECT `E`.*,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate $sql";
|
||||
$sql = "SELECT `E`.*,DATE_FORMAT(datetime, '".$config['dateformat']['mysql']['compact']."') as humandate $sql";
|
||||
|
||||
foreach (dbFetchRows($sql,$param) as $eventlog) {
|
||||
$dev = device_by_id_cache($eventlog['host']);
|
||||
|
||||
@@ -60,7 +60,7 @@ if ($rowCount != -1) {
|
||||
$sql .= " LIMIT $limit_low,$limit_high";
|
||||
}
|
||||
|
||||
$sql = "SELECT S.*, DATE_FORMAT(timestamp, '%Y-%m-%d %T') AS date $sql";
|
||||
$sql = "SELECT S.*, DATE_FORMAT(timestamp, '".$config['dateformat']['mysql']['compact']."') AS date $sql";
|
||||
|
||||
foreach (dbFetchRows($sql,$param) as $syslog) {
|
||||
$dev = device_by_id_cache($syslog['device_id']);
|
||||
|
||||
Reference in New Issue
Block a user