Use Monitor object
This commit is contained in:
parent
22554603b1
commit
0ab6e27259
|
@ -25,13 +25,12 @@ if ( !canView( 'Monitors' ) )
|
|||
}
|
||||
|
||||
$mid = validInt($_REQUEST['mid']);
|
||||
$Monitor = new Monitor( $mid );
|
||||
$wd = getcwd();
|
||||
chdir( ZM_DIR_IMAGES );
|
||||
$status = exec( escapeshellcmd( getZmuCommand( " -m ".$mid." -z" ) ) );
|
||||
chdir( $wd );
|
||||
|
||||
$monitor = dbFetchMonitor( $mid );
|
||||
|
||||
$image = ZM_DIR_IMAGES.'/'.'Zones'.$Monitor->Id().'.jpg';
|
||||
$zones = array();
|
||||
foreach( dbFetchAll( 'select * from Zones where MonitorId = ? order by Area desc', NULL, array($mid) ) as $row )
|
||||
{
|
||||
|
@ -42,7 +41,6 @@ foreach( dbFetchAll( 'select * from Zones where MonitorId = ? order by Area desc
|
|||
}
|
||||
}
|
||||
|
||||
$image = 'Zones'.$monitor['Id'].'.jpg';
|
||||
|
||||
xhtmlHeaders(__FILE__, translate('Zones') );
|
||||
?>
|
||||
|
@ -58,13 +56,13 @@ xhtmlHeaders(__FILE__, translate('Zones') );
|
|||
foreach( array_reverse($zones) as $zone )
|
||||
{
|
||||
?>
|
||||
<area shape="poly" alt="<?php echo htmlspecialchars($zone['Name']) ?>" coords="<?php echo $zone['AreaCoords'] ?>" href="#" onclick="createPopup( '?view=zone&mid=<?php echo $mid ?>&zid=<?php echo $zone['Id'] ?>', 'zmZone', 'zone', <?php echo $monitor['Width'] ?>, <?php echo $monitor['Height'] ?> ); return( false );"/>
|
||||
<area shape="poly" alt="<?php echo htmlspecialchars($zone['Name']) ?>" coords="<?php echo $zone['AreaCoords'] ?>" href="#" onclick="createPopup( '?view=zone&mid=<?php echo $mid ?>&zid=<?php echo $zone['Id'] ?>', 'zmZone', 'zone', <?php echo $Monitor->Width ?>, <?php echo $Monitor->Height ?> ); return( false );"/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<!--<area shape="default" nohref>-->
|
||||
</map>
|
||||
<img src="<?php echo ZM_DIR_IMAGES.'/'.$image ?>" alt="zones" usemap="#zoneMap" width="<?php echo $monitor['Width'] ?>" height="<?php echo $monitor['Height'] ?>" border="0"/>
|
||||
<img src="<?php echo $image ?>" alt="zones" usemap="#zoneMap" width="<?php echo $Monitor->Width ?>" height="<?php echo $Monitor->Height ?>" border="0"/>
|
||||
<form name="contentForm" id="contentForm" method="get" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
||||
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
||||
<input type="hidden" name="action" value="delete"/>
|
||||
|
@ -84,9 +82,9 @@ foreach( $zones as $zone )
|
|||
{
|
||||
?>
|
||||
<tr>
|
||||
<td class="colName"><a href="#" onclick="createPopup( '?view=zone&mid=<?php echo $mid ?>&zid=<?php echo $zone['Id'] ?>', 'zmZone', 'zone', <?php echo $monitor['Width'] ?>, <?php echo $monitor['Height'] ?> ); return( false );"><?php echo $zone['Name'] ?></a></td>
|
||||
<td class="colName"><a href="#" onclick="createPopup( '?view=zone&mid=<?php echo $mid ?>&zid=<?php echo $zone['Id'] ?>', 'zmZone', 'zone', <?php echo $Monitor->Width ?>, <?php echo $Monitor->Height ?> ); return( false );"><?php echo $zone['Name'] ?></a></td>
|
||||
<td class="colType"><?php echo $zone['Type'] ?></td>
|
||||
<td class="colUnits"><?php echo $zone['Area'] ?> / <?php echo sprintf( "%.2f", ($zone['Area']*100)/($monitor['Width']*$monitor['Height']) ) ?></td>
|
||||
<td class="colUnits"><?php echo $zone['Area'] ?> / <?php echo sprintf( "%.2f", ($zone['Area']*100)/($Monitor->Width*$Monitor->Height) ) ?></td>
|
||||
<td class="colMark"><input type="checkbox" name="markZids[]" value="<?php echo $zone['Id'] ?>" onclick="configureDeleteButton( this );"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
@ -95,7 +93,7 @@ foreach( $zones as $zone )
|
|||
</tbody>
|
||||
</table>
|
||||
<div id="contentButtons">
|
||||
<input type="button" value="<?php echo translate('AddNewZone') ?>" onclick="createPopup( '?view=zone&mid=<?php echo $mid ?>&zid=0', 'zmZone', 'zone', <?php echo $monitor['Width'] ?>, <?php echo $monitor['Height'] ?> );"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/>
|
||||
<input type="button" value="<?php echo translate('AddNewZone') ?>" onclick="createPopup( '?view=zone&mid=<?php echo $mid ?>&zid=0', 'zmZone', 'zone', <?php echo $Monitor->Width ?>, <?php echo $Monitor->Height ?> );"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/>
|
||||
<input type="submit" name="deleteBtn" value="<?php echo translate('Delete') ?>" disabled="disabled"/>
|
||||
</div>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue