2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
|
|
|
if ( !canView( 'Monitors' ) )
|
|
|
|
{
|
|
|
|
$view = "error";
|
2003-07-14 22:14:34 +08:00
|
|
|
return;
|
2003-07-11 17:27:56 +08:00
|
|
|
}
|
|
|
|
chdir( ZM_DIR_IMAGES );
|
|
|
|
$status = exec( escapeshellcmd( ZMU_COMMAND." -m $mid -z" ) );
|
|
|
|
chdir( '..' );
|
|
|
|
|
|
|
|
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|
|
|
if ( !$result )
|
|
|
|
die( mysql_error() );
|
|
|
|
$monitor = mysql_fetch_assoc( $result );
|
|
|
|
|
|
|
|
$result = mysql_query( "select * from Zones where MonitorId = '$mid'" );
|
|
|
|
if ( !$result )
|
|
|
|
die( mysql_error() );
|
|
|
|
$zones = array();
|
|
|
|
while( $row = mysql_fetch_assoc( $result ) )
|
|
|
|
{
|
|
|
|
$zones[] = $row;
|
|
|
|
}
|
|
|
|
|
2004-01-08 18:09:35 +08:00
|
|
|
$image = $monitor['Name']."-Zones.jpg";
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
<html>
|
|
|
|
<head>
|
2004-01-08 18:09:35 +08:00
|
|
|
<title>ZM - <?= $monitor['Name'] ?> - <?= $zmSlangZones ?></title>
|
2003-07-11 17:27:56 +08:00
|
|
|
<link rel="stylesheet" href="zm_styles.css" type="text/css">
|
|
|
|
<script language="JavaScript">
|
|
|
|
window.focus();
|
|
|
|
function newWindow(Url,Name,Width,Height)
|
|
|
|
{
|
|
|
|
var Name = window.open(Url,Name,"resizable,scrollbars,width="+Width+",height="+Height);
|
|
|
|
}
|
|
|
|
function closeWindow()
|
|
|
|
{
|
|
|
|
window.close();
|
|
|
|
}
|
|
|
|
function configureButton(form,name)
|
|
|
|
{
|
|
|
|
var checked = false;
|
|
|
|
for (var i = 0; i < form.elements.length; i++)
|
|
|
|
{
|
|
|
|
if ( form.elements[i].name.indexOf(name) == 0)
|
|
|
|
{
|
|
|
|
if ( form.elements[i].checked )
|
|
|
|
{
|
|
|
|
checked = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
form.delete_btn.disabled = !checked;
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<map name="zonemap">
|
|
|
|
<?php
|
|
|
|
foreach( $zones as $zone )
|
|
|
|
{
|
2004-01-08 18:09:35 +08:00
|
|
|
if ( $zone['Units'] == 'Percent' )
|
2003-07-11 17:27:56 +08:00
|
|
|
{
|
|
|
|
?>
|
2004-01-08 18:09:35 +08:00
|
|
|
<area shape="rect" coords="<?= sprintf( "%d,%d,%d,%d", ($zone['LoX']*$monitor['Width'])/100, ($zone['LoY']*$monitor['Height'])/100, ($zone['HiX']*$monitor['Width'])/100, ($zone['HiY']*$monitor['Height'])/100 ) ?>" href="javascript: newWindow( '<?= $PHP_SELF ?>?view=zone&mid=<?= $mid ?>&zid=<?= $zone['Id'] ?>', 'zmZone', <?= $jws['zone']['w'] ?>, <?= $jws['zone']['h'] ?> );">
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
?>
|
2004-01-08 18:09:35 +08:00
|
|
|
<area shape="rect" coords="<?= $zone['LoX'].",".$zone['LoY'].",".$zone['HiX'].",".$zone['HiY'] ?>" href="javascript: newWindow( '<?= $PHP_SELF ?>?view=zone&mid=<?= $mid ?>&zid=<?= $zone['Id'] ?>', 'zmZone', <?= $jws['zone']['w'] ?>, <?= $jws['zone']['h'] ?> );">
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<area shape="default" nohref>
|
|
|
|
</map>
|
|
|
|
<table align="center" border="0" cellspacing="2" cellpadding="2" width="96%">
|
|
|
|
<tr>
|
|
|
|
<td width="33%" align="left" class="text"> </td>
|
2004-01-08 18:09:35 +08:00
|
|
|
<td width="34%" align="center" class="head"><strong><?= $monitor['Name'] ?> <?= $zmSlangZones ?></strong></td>
|
2004-01-07 20:57:07 +08:00
|
|
|
<td width="33%" align="right" class="text"><a href="javascript: closeWindow();"><?= $zmSlangClose ?></a></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
</tr>
|
2004-01-08 18:09:35 +08:00
|
|
|
<tr><td colspan="3" align="center"><img src="<?= ZM_DIR_IMAGES.'/'.$image ?>" usemap="#zonemap" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>" border="0"></td></tr>
|
2003-07-11 17:27:56 +08:00
|
|
|
</table>
|
|
|
|
<table align="center" border="0" cellspacing="0" cellpadding="0" width="96%">
|
|
|
|
<form name="zone_form" method="get" action="<?= $PHP_SELF ?>">
|
|
|
|
<input type="hidden" name="view" value="<?= $view ?>">
|
|
|
|
<input type="hidden" name="action" value="delete">
|
|
|
|
<input type="hidden" name="mid" value="<?= $mid ?>">
|
2004-01-07 20:57:07 +08:00
|
|
|
<tr><td align="center" class="smallhead"><?= $zmSlangId ?></td>
|
|
|
|
<td align="center" class="smallhead"><?= $zmSlangName ?></td>
|
|
|
|
<td align="center" class="smallhead"><?= $zmSlangType ?></td>
|
|
|
|
<td align="center" class="smallhead"><?= $zmSlangUnits ?></td>
|
|
|
|
<td align="center" class="smallhead"><?= $zmSlangDimensions ?></td>
|
|
|
|
<td align="center" class="smallhead"><?= $zmSlangMark ?></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
foreach( $zones as $zone )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<tr>
|
2004-01-08 18:09:35 +08:00
|
|
|
<td align="center" class="text"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=zone&mid=<?= $mid ?>&zid=<?= $zone['Id'] ?>', 'zmZone', <?= $jws['zone']['w'] ?>, <?= $jws['zone']['h'] ?> );"><?= $zone['Id'] ?>.</a></td>
|
|
|
|
<td align="center" class="text"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=zone&mid=<?= $mid ?>&zid=<?= $zone['Id'] ?>', 'zmZone', <?= $jws['zone']['w'] ?>, <?= $jws['zone']['h'] ?> );"><?= $zone['Name'] ?></a></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
<td align="center" class="text"><?= $zone['Type'] ?></td>
|
2004-01-08 18:09:35 +08:00
|
|
|
<td align="center" class="text"><?= $zone['Units'] ?></td>
|
|
|
|
<td align="center" class="text"><?= $zone['LoX'] ?>,<?= $zone['LoY'] ?>-<?= $zone['HiX'] ?>,<?= $zone['HiY']?></td>
|
|
|
|
<td align="center" class="text"><input type="checkbox" name="mark_zids[]" value="<?= $zone['Id'] ?>" onClick="configureButton( document.zone_form, 'mark_zids' );"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td align="center" class="text"> </td>
|
2004-01-07 20:57:07 +08:00
|
|
|
<td colspan="4" align="center"><input type="button" value="<?= $zmSlangAddNewZone ?>" class="form" onClick="javascript: newWindow( '<?= $PHP_SELF ?>?view=zone&mid=<?= $mid ?>&zid=-1', 'zmZone', <?= $jws['zone']['w'] ?>, <?= $jws['zone']['h'] ?> );"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>></td>
|
|
|
|
<td align="center"><input type="submit" name="delete_btn" value="<?= $zmSlangDelete ?>" class="form" disabled></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
</tr>
|
|
|
|
</form>
|
|
|
|
</table>
|
|
|
|
</body>
|
|
|
|
</html>
|