Added mysql_free_result calls.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1820 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
321f8cbf5c
commit
1f14862239
|
@ -226,6 +226,7 @@ if ( isset($action) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$ctrl_command = $monitor['Command'];
|
||||
if ( !preg_match( '/^\//', $ctrl_command ) )
|
||||
|
@ -934,6 +935,7 @@ if ( isset($action) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$control = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -996,6 +998,7 @@ if ( isset($action) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$old_function = $monitor['Function'];
|
||||
$old_enabled = $monitor['Enabled'];
|
||||
|
@ -1020,6 +1023,7 @@ if ( isset($action) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( $zid > 0 )
|
||||
{
|
||||
|
@ -1027,6 +1031,7 @@ if ( isset($action) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$zone = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1082,6 +1087,7 @@ if ( isset($action) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( ZM_OPT_X10 )
|
||||
{
|
||||
|
@ -1092,6 +1098,7 @@ if ( isset($action) )
|
|||
{
|
||||
$x10_monitor = array();
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1139,6 +1146,7 @@ if ( isset($action) )
|
|||
{
|
||||
$zones[] = $zone;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
foreach ( $zones as $zone )
|
||||
{
|
||||
$new_zone = $zone;
|
||||
|
@ -1175,6 +1183,7 @@ if ( isset($action) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$row = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$changes[] = "Sequence = ".($row['MaxSequence']+1);
|
||||
|
||||
$sql = "insert into Monitors set ".implode( ", ", $changes );
|
||||
|
@ -1235,6 +1244,7 @@ if ( isset($action) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
fixDevices();
|
||||
if ( $cookies ) session_write_close();
|
||||
if ( daemonCheck() )
|
||||
|
@ -1252,10 +1262,12 @@ if ( isset($action) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$result = mysql_query( "select * from Monitors where Id = '$smid'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$smonitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$sql = "update Monitors set Sequence = '".$smonitor['Sequence']."' where Id = '".$monitor['Id']."'";
|
||||
$result = mysql_query( $sql );
|
||||
|
@ -1303,6 +1315,7 @@ if ( isset($action) )
|
|||
{
|
||||
continue;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
$sql = "select Id from Events where MonitorId = '$mark_mid'";
|
||||
$result = mysql_query( $sql );
|
||||
|
@ -1314,6 +1327,7 @@ if ( isset($action) )
|
|||
{
|
||||
$mark_eids[] = $row['Id'];
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
foreach( $mark_eids as $mark_eid )
|
||||
{
|
||||
deleteEvent( $mark_eid );
|
||||
|
@ -1511,6 +1525,7 @@ if ( isset($action) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$db_user = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1566,6 +1581,7 @@ if ( isset($action) )
|
|||
{
|
||||
$definitions[] = $monitor['Id'].":".$monitor['Function'].":".$monitor['Enabled'];
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
$definition = join( ',', $definitions );
|
||||
if ( $new_state )
|
||||
$run_state = $new_state;
|
||||
|
|
|
@ -39,17 +39,13 @@ function getEnumValues( $table, $column )
|
|||
{
|
||||
$enum_values = array();
|
||||
$result = mysql_query( "DESCRIBE $table $column" );
|
||||
if ( $result )
|
||||
{
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$row = mysql_fetch_assoc($result);
|
||||
mysql_free_result( $result );
|
||||
preg_match_all( "/'([^']+)'/", $row['Type'], $enum_matches );
|
||||
$enum_values = $enum_matches[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
echo mysql_error();
|
||||
}
|
||||
return $enum_values;
|
||||
return( $enum_values );
|
||||
}
|
||||
|
||||
function getSetValues( $table, $column )
|
||||
|
@ -70,6 +66,7 @@ function getUniqueValues( $table, $column, $as_string=1 )
|
|||
else
|
||||
$values = $row[0];
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -91,6 +88,7 @@ function getTableColumns( $table, $as_string=1 )
|
|||
else
|
||||
$columns[] = $row[Type];
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -106,6 +106,7 @@ function exportEventFrames( $event )
|
|||
{
|
||||
$frames[] = $row;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
ob_start();
|
||||
exportHeader( $zmSlangFrames." ".$event['Id'] );
|
||||
|
@ -190,6 +191,7 @@ function exportFileList( $eid )
|
|||
if ( !($result = mysql_query( $sql )) )
|
||||
die( mysql_error() );
|
||||
$event = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$event_path = sprintf( "%s/%s/%d", ZM_DIR_EVENTS, $event['MonitorName'], $event['Id'] );
|
||||
$files = array();
|
||||
|
|
|
@ -67,6 +67,7 @@ function userLogin( $username, $password="" )
|
|||
{
|
||||
unset( $user );
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
if ( $cookies ) session_write_close();
|
||||
}
|
||||
|
||||
|
@ -900,6 +901,7 @@ function createListThumbnail( $event, $overwrite=false )
|
|||
if ( !($result = mysql_query( $sql )) )
|
||||
die( mysql_error() );
|
||||
$frame = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$frame_id = $frame['FrameId'];
|
||||
|
||||
if ( ZM_WEB_LIST_THUMB_WIDTH )
|
||||
|
@ -1321,6 +1323,7 @@ function fixSequences()
|
|||
}
|
||||
$sequence++;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
|
||||
function firstSet()
|
||||
|
|
|
@ -28,6 +28,7 @@ $result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
|
||||
|
|
|
@ -44,6 +44,7 @@ if ( !empty($cid) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$control = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -33,6 +33,7 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
{
|
||||
$controls[] = $row;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
|
|
@ -31,6 +31,7 @@ if ( $group )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$row = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$group_sql = "and find_in_set( Id, '".$row['MonitorIds']."' )";
|
||||
}
|
||||
$sql = "select * from Monitors where Function != 'None' and Controllable = 1 $group_sql order by Sequence";
|
||||
|
@ -46,6 +47,7 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
}
|
||||
$mids[$row['Id']] = $row['Name'];
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
|
|
@ -31,6 +31,7 @@ $result = mysql_query( $sql );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$cmds = getControlCommands( $monitor );
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ $result = mysql_query( "select * from Monitors as M inner join Controls as C on
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$presets = array();
|
||||
for ( $i = 1; $i <= $monitor['NumPresets']; $i++ )
|
||||
|
|
|
@ -38,6 +38,7 @@ if ( $group )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$row = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$group_sql = "and find_in_set( Id, '".$row['MonitorIds']."' )";
|
||||
}
|
||||
|
||||
|
@ -59,6 +60,7 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
$row['ScaledHeight'] = reScale( $monitor['Height'], $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
$monitors[] = $row;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
$monitor = $monitors[$mon_idx];
|
||||
$next_mid = $mon_idx==(count($monitors)-1)?$monitors[0]['Id']:$monitors[$mon_idx+1]['Id'];
|
||||
|
|
|
@ -30,6 +30,7 @@ if ( $eid )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$new_event = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
elseif ( $eids )
|
||||
{
|
||||
|
@ -58,6 +59,7 @@ elseif ( $eids )
|
|||
$new_event['Notes'] = "";
|
||||
}
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
|
|
@ -113,6 +113,7 @@ else
|
|||
if ( !($result = mysql_query( $count_sql )) )
|
||||
die( mysql_error() );
|
||||
$row = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$n_events = $row['EventCount'];
|
||||
if ( !empty($limit) && $n_events > $limit )
|
||||
{
|
||||
|
@ -138,6 +139,7 @@ else
|
|||
else
|
||||
$unarchived = true;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
?>
|
||||
function toggleCheck(element,name)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
|
|||
$filter_data = $row;
|
||||
}
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
$auto_str = "";
|
||||
if ( isset($filter_data) )
|
||||
|
|
|
@ -88,6 +88,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
|
|||
$filter_data = $row;
|
||||
}
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
?>
|
||||
<?php if ( count($filter_names) ) { ?>
|
||||
<td align="left" colspan="3" class="text"><?= $zmSlangSaveAs ?>: <?= buildSelect( $select_name, $filter_names, "submitToFilter( document.filter_form );" ); ?> <?= $zmSlangOrEnterNewName ?>: <input type="text" size="32" name="new_<?= $select_name ?>" value="<?= $filter_name ?>" class="form"></td>
|
||||
|
|
|
@ -28,6 +28,7 @@ $result = mysql_query( $sql );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$event = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( $fid )
|
||||
{
|
||||
|
@ -35,6 +36,7 @@ if ( $fid )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$frame = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -42,6 +44,7 @@ else
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$frame = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$fid = $frame['FrameId'];
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ $result = mysql_query( $sql );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$event = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$sql = "select *, unix_timestamp( TimeStamp ) as UnixTimeStamp from Frames where EventID = '$eid' order by FrameId";
|
||||
$result = mysql_query( $sql );
|
||||
|
@ -37,6 +38,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
|
|||
{
|
||||
$frames[] = $row;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
|
|
@ -27,6 +27,7 @@ $result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
|
|
@ -38,6 +38,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
|
|||
}
|
||||
$groups[] = $row;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
|
|
|
@ -48,12 +48,14 @@ if ( !empty($mid) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
if ( ZM_OPT_X10 )
|
||||
{
|
||||
$result = mysql_query( "select * from TriggersX10 where MonitorId = '$mid'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$x10_monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -112,6 +114,7 @@ if ( !empty($preset) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$preset = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
foreach ( $preset as $name=>$value )
|
||||
{
|
||||
if ( isset($value) )
|
||||
|
@ -220,6 +223,7 @@ function loadLocations( Form )
|
|||
returnLocationSelect.options.length = option_count;
|
||||
<?php
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
?>
|
||||
}
|
||||
else
|
||||
|
|
|
@ -32,6 +32,7 @@ while ( $preset = mysql_fetch_assoc( $result ) )
|
|||
{
|
||||
$presets[$preset['Id']] = $preset['Name'];
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
|
|
@ -31,6 +31,7 @@ if ( $group )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$row = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$group_sql = "and find_in_set( Id, '".$row['MonitorIds']."' )";
|
||||
}
|
||||
|
||||
|
@ -47,6 +48,7 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
}
|
||||
$monitors[] = $row;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
$rows = intval(((count($monitors)-1)/ZM_WEB_MONTAGE_MAX_COLS)+1);
|
||||
$cols = intval(ceil(count($monitors)/$rows));
|
||||
|
|
|
@ -44,6 +44,7 @@ $result = mysql_query( $sql );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$montage_width = ZM_WEB_MONTAGE_WIDTH?ZM_WEB_MONTAGE_WIDTH:reScale( $monitor['Width'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
$montage_height = ZM_WEB_MONTAGE_HEIGHT?ZM_WEB_MONTAGE_HEIGHT:reScale( $monitor['Height'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
|
|
|
@ -37,6 +37,7 @@ if ( $mid )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
elseif ( ZM_OPT_CONTROL )
|
||||
{
|
||||
|
@ -47,6 +48,7 @@ elseif ( ZM_OPT_CONTROL )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$row = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$group_sql = "and find_in_set( Id, '".$row['MonitorIds']."' )";
|
||||
}
|
||||
$sql = "select * from Monitors where Function != 'None' and Controllable = 1 $group_sql order by Sequence";
|
||||
|
@ -65,6 +67,7 @@ elseif ( ZM_OPT_CONTROL )
|
|||
$control_mid = $row['Id'];
|
||||
}
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
|
|
@ -198,6 +198,7 @@ if ( $tab == "users" )
|
|||
</tr>
|
||||
<?php
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
?>
|
||||
<tr><td colspan="12" class="ruled"> </td></tr>
|
||||
<tr><td colspan="12" align="right"><input type="button" value="<?= $zmSlangAddNewUser ?>" class="form" onClick="javascript: newWindow( '<?= $PHP_SELF ?>?view=user&uid=-1', 'zmUser', <?= $jws['user']['w'] ?>, <?= $jws['user']['h'] ?> );"<?php if ( !canEdit( 'System' ) ) { ?> disabled<?php } ?>> <input type="submit" name="delete_btn" value="<?= $zmSlangDelete ?>" class="form" disabled> <input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow();"></td></tr>
|
||||
|
|
|
@ -27,6 +27,7 @@ $result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$zmu_command = getZmuCommand( " -m $mid -B -C -H -O" );
|
||||
$zmu_output = exec( escapeshellcmd( $zmu_command ) );
|
||||
|
|
|
@ -33,6 +33,7 @@ while( $state = mysql_fetch_assoc( $result ) )
|
|||
{
|
||||
$states[] = $state;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
|
|
@ -30,6 +30,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
|
|||
{
|
||||
$stats[] = $row;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
|
|
@ -106,6 +106,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
|
|||
//}
|
||||
$monitors[$row['Id']] = $row;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
$range_sql = "select min(E.StartTime) as MinTime, max(E.EndTime) as MaxTime from Events as E inner join Monitors as M on (E.MonitorId = M.Id) where not isnull(E.StartTime) and not isnull(E.EndTime)";
|
||||
$events_sql = "select E.Id,E.Name,E.StartTime,E.EndTime,E.Length,E.Frames,E.MaxScore,E.Cause,E.Notes,E.Archived,E.MonitorId from Events as E inner join Monitors as M on (E.MonitorId = M.Id) where not isnull(StartTime)";
|
||||
|
@ -198,6 +199,7 @@ else
|
|||
if ( !($result = mysql_query( $range_sql )) )
|
||||
die( mysql_error() );
|
||||
$row = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( !isset($min_time) )
|
||||
$min_time = $row['MinTime'];
|
||||
|
@ -400,9 +402,11 @@ while( $event = mysql_fetch_assoc( $event_result ) )
|
|||
$chart['data']['y']['hi'] = $frame['Score'];
|
||||
}
|
||||
}
|
||||
mysql_free_result( $frame_result );
|
||||
}
|
||||
}
|
||||
}
|
||||
mysql_free_result( $event_result );
|
||||
|
||||
ksort($monitor_ids,SORT_NUMERIC);
|
||||
ksort($mon_event_slots,SORT_NUMERIC);
|
||||
|
@ -426,6 +430,7 @@ foreach( array_keys($mon_frame_slots) as $monitor_id )
|
|||
if ( !($frame_result = mysql_query( $frames_sql )) )
|
||||
die( mysql_error() );
|
||||
$curr_frame_slots[$i]['frame'] = mysql_fetch_assoc( $frame_result );
|
||||
mysql_free_result( $frame_result );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ if ( !($db_user = mysql_fetch_assoc( $result )) )
|
|||
$db_user['Username'] = $zmSlangNewUser;
|
||||
$db_user['Enabled'] = 1;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
$new_user = $db_user;
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ $result = mysql_query( $sql );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$event = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( !isset( $rate ) )
|
||||
$rate = reScale( RATE_SCALE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE );
|
||||
|
|
|
@ -27,6 +27,7 @@ $result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( !isset($scale) )
|
||||
$scale = reScale( SCALE_SCALE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
|
|
|
@ -46,6 +46,7 @@ $result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
@ -158,6 +159,7 @@ while( $event = mysql_fetch_assoc( $result ) )
|
|||
</tr>
|
||||
<?php
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
?>
|
||||
</table></td></tr>
|
||||
</table></td>
|
||||
|
|
|
@ -37,6 +37,7 @@ $result = mysql_query( $sql );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( !isset( $scale ) )
|
||||
$scale = reScale( SCALE_SCALE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
|
|
|
@ -36,6 +36,7 @@ $result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( !isset( $scale ) )
|
||||
$scale = $monitor['DefaultScale'] * ZM_WEB_DEFAULT_SCALE;
|
||||
|
|
|
@ -49,11 +49,13 @@ while ( $preset = mysql_fetch_assoc( $result ) )
|
|||
$preset_names[$preset['Id']] = $preset['Name'];
|
||||
$presets[] = $preset;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$min_x = 0;
|
||||
$max_x = $monitor['Width']-1;
|
||||
|
@ -68,6 +70,7 @@ if ( !isset($new_zone) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$zone = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -31,6 +31,7 @@ $result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$result = mysql_query( "select * from Zones where MonitorId = '$mid' order by Area desc" );
|
||||
if ( !$result )
|
||||
|
@ -44,6 +45,7 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
$zones[] = $row;
|
||||
}
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
$image = $monitor['Name']."-Zones.jpg";
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
if ( $max_height < $row['Height'] ) $max_height = $row['Height'];
|
||||
}
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
?>
|
||||
<wml>
|
||||
<card id="zmConsole" title="<?= ZM_WEB_TITLE_PREFIX ?> - <?= $zmSlangConsole ?>" ontimer="<?= $PHP_SELF ?>?view=<?= $view ?>">
|
||||
|
|
|
@ -22,6 +22,7 @@ $result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$browser = array();
|
||||
$browser['Width'] = 100;
|
||||
$browser['Height'] = 80;
|
||||
|
|
|
@ -26,6 +26,7 @@ $result = mysql_query( $sql );
|
|||
if ( !$result )
|
||||
echo mysql_error();
|
||||
$group = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$db_now = strftime( "%Y-%m-%d %H:%M:%S" );
|
||||
$sql = "select M.*, count(if(E.StartTime>'$db_now' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if((to_days(E.StartTime)=to_days('$db_now')) && E.Archived = 0,1,NULL)) as TodayEventCount from Monitors as M left join Events as E on E.MonitorId = M.Id group by M.Id order by M.Id";
|
||||
|
@ -53,6 +54,7 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
if ( !$result2 )
|
||||
echo mysql_error();
|
||||
$row2 = mysql_fetch_assoc( $result2 );
|
||||
mysql_free_result( $result2 );
|
||||
$monitors[] = array_merge( $row, $row2 );
|
||||
if ( $row['Function'] != 'None' )
|
||||
{
|
||||
|
@ -61,6 +63,7 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
if ( $max_height < $row['Height'] ) $max_height = $row['Height'];
|
||||
}
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
|
|
|
@ -43,6 +43,7 @@ $result = mysql_query( $sql );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$event = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( $fid )
|
||||
{
|
||||
|
@ -50,6 +51,7 @@ if ( $fid )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$frame = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
elseif ( isset( $fid ) )
|
||||
{
|
||||
|
@ -57,6 +59,7 @@ elseif ( isset( $fid ) )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$frame = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$fid = $frame['FrameId'];
|
||||
}
|
||||
|
||||
|
@ -75,6 +78,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
|
|||
break;
|
||||
}
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sort_column ".($sort_order=='asc'?'>=':'<=')." '".$event[$sort_field]."'$filter_sql$mid_sql order by $sort_column $sort_order";
|
||||
$result = mysql_query( $sql );
|
||||
|
@ -88,6 +92,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
|
|||
break;
|
||||
}
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
$frames_per_page = 15;
|
||||
$frames_per_line = 3;
|
||||
|
@ -228,6 +233,7 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
$alarm_frames[$row['FrameId']] = $row;
|
||||
}
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
?>
|
||||
<table>
|
||||
<?php
|
||||
|
|
|
@ -27,11 +27,13 @@ $result = mysql_query( "select E.*,M.Name as MonitorName,M.Width,M.Height from E
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$event = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$result = mysql_query( "select * from Frames where EventID = '$eid' and Score = '".$event['MaxScore']."'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$frame = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$fid = $frame['FrameId'];
|
||||
|
||||
$device_width = (isset($device)&&!empty($device['width']))?$device['width']:DEVICE_WIDTH;
|
||||
|
|
|
@ -31,6 +31,7 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
{
|
||||
$monitors[$row[Id]] = $row;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( $filter_name )
|
||||
{
|
||||
|
@ -38,6 +39,7 @@ if ( $filter_name )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$filter_data = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( !empty($filter_data) )
|
||||
{
|
||||
|
@ -111,6 +113,7 @@ elseif ( !empty( $limit ) )
|
|||
if ( !($result = mysql_query( $count_sql )) )
|
||||
die( mysql_error() );
|
||||
$row = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$n_events = $row['EventCount'];
|
||||
if ( !empty($limit) && $n_events > $limit )
|
||||
{
|
||||
|
@ -250,6 +253,7 @@ if ( !empty($limit) && $n_events > $limit )
|
|||
</tr>
|
||||
<?php
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
?>
|
||||
</table>
|
||||
</body>
|
||||
|
|
|
@ -31,6 +31,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
|
|||
{
|
||||
$filter_names[$row['Name']] = $row['Name'];
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<html>
|
||||
|
|
|
@ -28,6 +28,7 @@ $result = mysql_query( $sql );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$event = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( $fid )
|
||||
{
|
||||
|
@ -35,6 +36,7 @@ if ( $fid )
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$frame = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -42,6 +44,7 @@ else
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$frame = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
$fid = $frame['FrameId'];
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ $result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<html>
|
||||
|
|
|
@ -23,6 +23,7 @@ $result = mysql_query( $sql );
|
|||
if ( !$result )
|
||||
echo mysql_error();
|
||||
$group = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$result = mysql_query( "select * from Monitors where Function != 'None' order by Sequence" );
|
||||
$monitors = array();
|
||||
|
@ -43,6 +44,7 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
if ( $max_height < $row['Height'] ) $max_height = $row['Height'];
|
||||
$monitors[] = $row;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<html>
|
||||
|
|
|
@ -32,6 +32,7 @@ while( $state = mysql_fetch_assoc( $result ) )
|
|||
{
|
||||
$states[] = $state;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
?>
|
||||
<html>
|
||||
|
|
|
@ -37,6 +37,7 @@ $result = mysql_query( $sql );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$event = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$device_width = (isset($device)&&!empty($device['width']))?$device['width']:DEVICE_WIDTH;
|
||||
$device_height = (isset($device)&&!empty($device['height']))?$device['height']:DEVICE_HEIGHT;
|
||||
|
|
|
@ -27,6 +27,7 @@ $result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
if ( !isset($scale) )
|
||||
$scale = ZM_WEB_DEFAULT_SCALE;
|
||||
|
@ -79,6 +80,8 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
if ( $max_height < $row['Height'] ) $max_height = $row['Height'];
|
||||
$monitors[] = $row;
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
//$monitor = $monitors[$mon_idx];
|
||||
$next_mid = $mon_idx==(count($monitors)-1)?$monitors[0]['Id']:$monitors[$mon_idx+1]['Id'];
|
||||
$prev_mid = $mon_idx==0?$mon_index[(count($monitors)-1)]['Id']:$monitors[$mon_idx-1]['Id'];
|
||||
|
|
Loading…
Reference in New Issue