Fixed non-monitor if no events SQL bug.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@586 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
7fcd679c4a
commit
99f7275881
|
@ -60,7 +60,7 @@ if ( $view == "console" )
|
||||||
$HTTP_SESSION_VARS[event_reset_time] = "2000-01-01 00:00:00";
|
$HTTP_SESSION_VARS[event_reset_time] = "2000-01-01 00:00:00";
|
||||||
|
|
||||||
$db_now = strftime( "%Y-%m-%d %H:%M:%S" );
|
$db_now = strftime( "%Y-%m-%d %H:%M:%S" );
|
||||||
$sql = "select M.*, count(E.Id) as EventCount, count(if(E.StartTime>'$HTTP_SESSION_VARS[event_reset_time]' && E.Archived = 0,1,NULL)) as ResetEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 DAY && E.Archived = 0,1,NULL)) as DayEventCount from Monitors as M left join Events as E on E.MonitorId = M.Id group by E.MonitorId order by Id";
|
$sql = "select M.*, count(E.Id) as EventCount, count(if(E.StartTime>'$HTTP_SESSION_VARS[event_reset_time]' && E.Archived = 0,1,NULL)) as ResetEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 DAY && E.Archived = 0,1,NULL)) as DayEventCount from Monitors as M left join Events as E on E.MonitorId = M.Id group by M.Id order by M.Id";
|
||||||
$result = mysql_query( $sql );
|
$result = mysql_query( $sql );
|
||||||
if ( !$result )
|
if ( !$result )
|
||||||
echo mysql_error();
|
echo mysql_error();
|
||||||
|
|
Loading…
Reference in New Issue