-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfunc_status.php
63 lines (63 loc) · 2.24 KB
/
func_status.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
$header = 'Status';
if ( ! isset($pioneer) )
require_once(dirname(__FILE__).'/Z8Config.php');
require_once(dirname(__FILE__).'/PioneerRebel/pioneer.lib.php');
$prState = array(
'Input Source' => pvRebel_getSource($pioneer),
'Volume Level' => pvRebel_getVolPct($pioneer).'%'
);
//print_r($prState,false);
ob_start();
?>
<table style="padding: 0px; margin: 0px; margin-left: 24px; margin-bottom: 16px;" width="59%" border="1" cellspacing="1" cellpadding="4">
<tr><td><h3>Environment</h3></td></tr>
<tr><td>
<p><strong>Current Working Directory:</strong><br />
<?php system('pwd'); ?></p>
</td></tr>
<tr><td>
<input style="margin-bottom: 8pt;" type="button" name="Open PHP Info Window" value="Open PHP Info Window" onclick="javascript:window.open('phpinfo.php', '_blank', 'width=1024, height=768, top=32, left=32');" />
</td></tr>
</table>
<table style="padding: 0px; margin: 0px; margin-left: 24px; margin-bottom: 16px;" width="59%" border="1" cellspacing="1" cellpadding="4">
<tr><td colspan="2"><h3>Pioneer VSX-1022-K</h3></td></tr>
<?php
foreach ($prState as $key=>$value) {
echo('<tr>');
echo('<td width="35%" style="padding-left: 9px;"><p><strong>'.$key.'</strong></p></td>');
echo('<td width="65%" style="padding-left: 9px;"><p>'.$value.'</p></td>');
echo('</tr>');
}
?>
</table>
<table style="padding: 0px; margin: 0px; margin-left: 24px; margin-bottom: 16px;" width="59%" border="1" cellspacing="1" cellpadding="4">
<tr><td colspan="2"><h3>APC Backup Battery</h3></td></tr>
<?php
$command = rtrim(`which apcaccess`);
if (strlen(trim($command))<1&&file_exists('/sbin/apcaccess')&&is_readable('/sbin/apcaccess'))
$command = '/sbin/apcaccess';
if (strlen(rtrim($command))) {
if ($apcupsd!==false) {
if ($apcupsd!==true) {
$command .= " status {$apcupsd}";
}
$results = explode("\n",trim(`$command`));
foreach ($results as $aResult) {
$keyVals = explode(':',$aResult,2);
$k = trim($keyVals[0]);
$v = trim($keyVals[1]);
echo("<tr><td width=\"25%\"><p>{$k}</p></td><td width=\"75%\"><p>{$v}</p></td></tr>");
}
} else {
echo('<tr><td colspan="2"><p><em>APCUPSD is not enabled!</em></p></td></tr>');
}
} else {
echo('<tr><td colspan="2"><p><em>APCUPSD is not found!</em></p></td></tr>');
}
?>
</table>
<?php
$body = ob_get_contents();
ob_end_clean();
?>