Console Button to Active External Alarm

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
dimiz
Posts: 17
Joined: Sat Oct 06, 2007 1:06 pm

Console Button to Active External Alarm

Post by dimiz »

Hi to all!! Im not so good developer in HTML/PHP i need to create a button on console view page to active an external alarm.
i have add a line like this:
---
<input class="form" onClick="javascript: (<?php AlarmOn)?>) "type="submit" value="AlarmOn"/>
---
in zm_html_view_console.php

and a function call AlarmOn in zm_funcs.php
----
function AlarmOn()
{
$status=shell_exec( '/var/www/cgi-bin/relay.pl 1' );
$status="On";
return($status);
}
----

in this mode if i saw some strange allarm from my office a can start my external alarm.

Only problem this code work only when i load the page but not i push the button...
Please help many thanks
Post Reply