forked from sosprz/nettemp
-
Notifications
You must be signed in to change notification settings - Fork 1
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
root
committed
Jul 7, 2015
1 parent
31344f7
commit d3d97a7
Showing
23 changed files
with
136 additions
and
112 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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 |
---|---|---|
|
@@ -18,4 +18,3 @@ body { | |
background-color: #f5f5f5; | ||
} | ||
|
||
|
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
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
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
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,46 @@ | ||
<?php | ||
$gpio_post = isset($_POST['gpio']) ? $_POST['gpio'] : ''; | ||
$add_alarm = isset($_POST['add_alarm']) ? $_POST['add_alarm'] : ''; | ||
$add_alarm1 = isset($_POST['add_alarm1']) ? $_POST['add_alarm1'] : ''; | ||
|
||
?> | ||
<?php // SQLite - dodawania alarmu | ||
if (!empty($add_alarm) && ($_POST['add_alarm1'] == "add_alarm2")){ | ||
$db = new PDO('sqlite:dbf/nettemp.db'); | ||
$db->exec("UPDATE sensors SET alarm='on' WHERE id='$add_alarm'") or die ($db->lastErrorMsg()); | ||
header("location: " . $_SERVER['REQUEST_URI']); | ||
exit(); | ||
} | ||
?> | ||
|
||
<div class="panel panel-default"> | ||
<div class="panel-heading">Free sensors</div> | ||
<div class="panel-body"> | ||
<?php | ||
$db = new PDO('sqlite:dbf/nettemp.db'); | ||
$rows = $db->query("SELECT * FROM sensors WHERE alarm='off'"); | ||
$row = $rows->fetchAll(); | ||
$numRows = count($row); | ||
if ($numRows == 0 ) { echo "<span class=\"brak\"><img src=\"media/ico/Sign-Stop-icon.png\" /></span>"; } | ||
|
||
$sth = $db1->prepare("select * from sensors WHERE alarm='off'"); | ||
$sth->execute(); | ||
$result = $sth->fetchAll(); | ||
foreach ($result as $a) { ?> | ||
<div class="row"> | ||
<form action="" method="post"> | ||
<div class="col-sm-2"><img src="media/ico/TO-220-icon.png" /><?php echo $a['name']; ?></div> | ||
<input type="hidden" name="add_alarm" value="<?php echo $a['id']; ?>" /> | ||
<input type="hidden" name="add_alarm1" value="add_alarm2" /> | ||
<div class="col-sm-1"><button class="btn btn-xs btn-success"><span class="glyphicon glyphicon-plus"></span> </button></div> | ||
</form> | ||
</div> | ||
<?php } ?> | ||
|
||
|
||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
Empty file.
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
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
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