-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.php
More file actions
executable file
·31 lines (31 loc) · 973 Bytes
/
Copy pathcheck.php
File metadata and controls
executable file
·31 lines (31 loc) · 973 Bytes
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
<?php
exec ( "gpio -g read 4", $status );
foreach ($status as $value){
if ($value == 1){
$data = "Off";
$color = "purple";
$toggle_to = "on";
$toggle_opp = "On";
}else{
$data = "On";
$color = "green";
$toggle_to = "off";
$toggle_opp = "Off";
}
}
?>
<br/>
<span style="color: #fff;font-family:Arial;font-size: 2em;">
Outdoor Lighting
<br>
Status: <?php echo $data; ?>
</span>
<br/>
<br/>
<form action="submit.php" method="get" onsubmit="return false;">
<span id="<?php echo $toggle_to;?>" name="<?php echo $toggle_to;?>" class="w3-btn w3-<?php echo $color; ?> w3-xlarge" onclick="getData('<?php echo $toggle_to;?>') " class='btn'>
Turn <?php
echo $toggle_opp;
?>
</span>
</form>