Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0066186
commit 087bb63
Showing
5 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
session_start(); | ||
|
||
if (empty($_SESSION['loggedin'])) { | ||
header('Location: index.php'); | ||
exit; | ||
} | ||
|
||
if (empty($_SESSION['house_id'])) { | ||
die('You have no house.'); | ||
} | ||
|
||
require_once '../shared/util.php'; | ||
require_once '../shared/floodlights.php'; | ||
db_connect(); | ||
|
||
$lights = FloodlightsRecord::load($_SESSION['house_id']); | ||
|
||
require 'tpl/floodlights.tpl'; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
session_start(); | ||
|
||
if (empty($_SESSION['loggedin'])) { | ||
header('Location: index.php'); | ||
exit; | ||
} | ||
|
||
if (empty($_SESSION['house_id'])) { | ||
die('You have no house.'); | ||
} | ||
|
||
require_once '../shared/util.php'; | ||
require_once '../shared/lights.php'; | ||
db_connect(); | ||
|
||
$lights = LightsRecord::load($_SESSION['house_id']); | ||
|
||
require 'tpl/lights.tpl'; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php require 'header.tpl'; ?> | ||
<div data-role="page" id="lights"> | ||
<div data-role="header"> | ||
<a href="home.php" data-icon="home" | ||
data-iconpos="notext" data-direction="reverse">Home</a> | ||
<h3>Floodlights</h3> | ||
</div> | ||
<div data-role="content"> | ||
<?php if (!empty($floodlights)) { ?> | ||
<ul data-role="listview"> | ||
<?php foreach($floodlights as $light) { ?> | ||
<li> | ||
<?php echo $light->getTimestamp(); ?> - | ||
Device: <?php echo $lights->getDevice(); ?> - | ||
State: <?php echo $lights->getState() ? 'On' : 'Off'; ?> | ||
</li> | ||
<?php } ?> | ||
</ul> | ||
<?php } else { ?> | ||
You don't have any light events yet. Don't worry, they'll come soon! | ||
<?php } ?> | ||
</div> | ||
<div data-theme="a" data-role="footer" data-position="fixed"> | ||
<h3>HOMOS Home Monitoring System</h3> | ||
</div> | ||
</div> | ||
<?php require 'footer.tpl'; ?> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php require 'header.tpl'; ?> | ||
<div data-role="page" id="lights"> | ||
<div data-role="header"> | ||
<a href="home.php" data-icon="home" | ||
data-iconpos="notext" data-direction="reverse">Home</a> | ||
<h3>Lights</h3> | ||
</div> | ||
<div data-role="content"> | ||
<?php if (!empty($lights)) { ?> | ||
<ul data-role="listview"> | ||
<?php foreach($lights as $light) { ?> | ||
<li> | ||
<?php echo $light->getTimestamp(); ?> - | ||
Device: <?php echo $lights->getDevice(); ?> - | ||
State: <?php echo $lights->getState() ? 'On' : 'Off'; ?> | ||
</li> | ||
<?php } ?> | ||
</ul> | ||
<?php } else { ?> | ||
You don't have any light events yet. Don't worry, they'll come soon! | ||
<?php } ?> | ||
</div> | ||
<div data-theme="a" data-role="footer" data-position="fixed"> | ||
<h3>HOMOS Home Monitoring System</h3> | ||
</div> | ||
</div> | ||
<?php require 'footer.tpl'; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters