Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jul 7, 2015
1 parent 31344f7 commit d3d97a7
Show file tree
Hide file tree
Showing 23 changed files with 136 additions and 112 deletions.
Empty file modified html/bootstrap/css/bootstrap-theme.css
100644 → 100755
Empty file.
Empty file modified html/bootstrap/css/bootstrap-theme.css.map
100644 → 100755
Empty file.
Empty file modified html/bootstrap/css/bootstrap-theme.min.css
100644 → 100755
Empty file.
Empty file modified html/bootstrap/css/bootstrap.css
100644 → 100755
Empty file.
Empty file modified html/bootstrap/css/bootstrap.css.map
100644 → 100755
Empty file.
Empty file modified html/bootstrap/css/bootstrap.min.css
100644 → 100755
Empty file.
Empty file modified html/bootstrap/fonts/glyphicons-halflings-regular.eot
100644 → 100755
Empty file.
Empty file modified html/bootstrap/fonts/glyphicons-halflings-regular.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified html/bootstrap/fonts/glyphicons-halflings-regular.ttf
100644 → 100755
Empty file.
Empty file modified html/bootstrap/fonts/glyphicons-halflings-regular.woff
100644 → 100755
Empty file.
Empty file modified html/bootstrap/fonts/glyphicons-halflings-regular.woff2
100644 → 100755
Empty file.
Empty file modified html/bootstrap/js/bootstrap.js
100644 → 100755
Empty file.
Empty file modified html/bootstrap/js/bootstrap.min.js
100644 → 100755
Empty file.
Empty file modified html/bootstrap/js/npm.js
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion html/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ body {
background-color: #f5f5f5;
}


26 changes: 18 additions & 8 deletions modules/gpio/html/gpio_function_num.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<h3 class="panel-title">GPIO function number</h3></class>

<?php
$tempnum = isset($_POST['tempnum']) ? $_POST['tempnum'] : '';
$set_tempnum = isset($_POST['set_tempnum']) ? $_POST['set_tempnum'] : '';
Expand All @@ -17,15 +15,27 @@
$result = $sth->fetchAll();
foreach ($result as $a) {
?>
<form action="" method="post">
<select name="tempnum" onchange="this.form.submit()">
<?php foreach (range(1, 10) as $num) { ?>

<form class="form-horizontal" action="" method="post">
<fieldset>
<div class="form-group">
<label class="col-md-2 control-label" for="selectbasic">Function number</label>
<div class="col-md-1">
<select id="selectbasic" name="tempnum" onchange="this.form.submit()" class="form-control input-sm">
<?php foreach (range(1, 10) as $num) { ?>
<option <?php echo $a['tempnum'] == "$num" ? 'selected="selected"' : ''; ?> value="<?php echo $num; ?>"><?php echo $num; ?></option>
<?php } ?>
</select>
<input type="hidden" name="set_tempnum" value="set_tempnum" />
<?php } ?>
</select>
</div>
</div>
</fieldset>
<input type="hidden" name="set_tempnum" value="set_tempnum" />
</form>





<?php
}
?>
6 changes: 5 additions & 1 deletion modules/gpio/html/gpio_temp.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@
<?php
if ($a['day_run'] == 'on') {
include('gpio_day_forms.php');

}
if ($a['week_run'] == 'on') {
include('gpio_week_forms.php');
}
include('gpio_temp_forms.php');

?>

<form action="" method="post" style=" display:inline!important;">
Expand All @@ -102,9 +104,11 @@
<button type="submit" class="btn btn-xs btn-danger">Exit</button>
</form>

<?php


<?php
include('gpio_function_num.php');

}
?>

73 changes: 20 additions & 53 deletions modules/notification/html/alarms.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
$tmp_id = isset($_POST['tmp_id']) ? $_POST['tmp_id'] : '';
$gpio_post = isset($_POST['gpio']) ? $_POST['gpio'] : '';
$tmp_min_new = isset($_POST['tmp_min_new']) ? $_POST['tmp_min_new'] : '';
$tmp_max_new = isset($_POST['tmp_max_new']) ? $_POST['tmp_max_new'] : '';
$add_alarm = isset($_POST['add_alarm']) ? $_POST['add_alarm'] : '';
$tmp_id = isset($_POST['tmp_id']) ? $_POST['tmp_id'] : '';
$del_alarm = isset($_POST['del_alarm']) ? $_POST['del_alarm'] : '';
$del_alarm1 = isset($_POST['del_alarm1']) ? $_POST['del_alarm1'] : '';
?>
<?php // SQLite - dodawania alarmu
if (!empty($add_alarm) && ($_POST['add_alarm1'] == "add_alarm2")){
Expand Down Expand Up @@ -32,73 +32,40 @@
header("location: " . $_SERVER['REQUEST_URI']);
exit();
}

?>
<div class="panel panel-default">
<div class="panel-heading">Set the temperature range</div>
<div class="panel-body">
<div class="panel-heading">Set the temperature range
</div>
<table class="table table-striped">
<thead><tr><th></th><th>Name</th><th><img src="media/ico/temp_low.png" /> min <img src="media/ico/temp2-icon.png" />max</th><th>Remove</th></tr></thead>
<?php
$db1 = new PDO('sqlite:dbf/nettemp.db');
$sth = $db1->prepare("select * from sensors WHERE alarm='on'");
$sth->execute();
$result = $sth->fetchAll();
$result = $sth->fetchAll();
foreach ($result as $a) { ?>

<div class="row">

<form action="" method="post" style=" display:inline!important;">
<div class="col-md-1"><img src="media/ico/TO-220-icon.png" />
<?php echo $a['name']; ?></div>
<tr>
<form action="" method="post">
<td><img src="media/ico/TO-220-icon.png" /></td>
<td><?php echo $a['name']; ?></td>
<input type="hidden" name="tmp_id" value="<?php echo $a['id']; ?>" />
<div class="col-md-1"><input type="text" name="tmp_min_new" size="3" value="<?php echo $a['tmp_min']; ?>" placeholder="min"/></div>
<div class="col-md-1"><input type="text" name="tmp_max_new" size="3" value="<?php echo $a['tmp_max']; ?>" placeholder="max"/></div>
<div class="col-md-1"><button class="btn btn-xs btn-primary"><span class="glyphicon glyphicon-pencil"></span> </button></div>
<td><input type="text" name="tmp_min_new" size="3" value="<?php echo $a['tmp_min']; ?>" />
<input type="text" name="tmp_max_new" size="3" value="<?php echo $a['tmp_max']; ?>" />
<input type="hidden" name="ok" value="ok" />
<button class="btn btn-xs btn-primary"><span class="glyphicon glyphicon-pencil"></span> </button></td>
</form>

<form action="" method="post" style=" display:inline!important;">
<form action="" method="post">
<input type="hidden" name="del_alarm1" value="del_alarm2" />
<input type="hidden" name="del_alarm" value="<?php echo $a['name']; ?>" />
<div class="col-md-1"><button class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash"></span> </button></div>
</form>
<td><button class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash"></span> </button></td>
</form></tr>
<?php }

</div>

<?php
}
?>
</table>
</div>
</div>

<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-1"><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>



<?php include('free.php'); ?>

46 changes: 46 additions & 0 deletions modules/notification/html/free.php
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 modified modules/notification/html/triggers.php
100644 → 100755
Empty file.
67 changes: 30 additions & 37 deletions modules/notification/html/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,32 +46,27 @@
}
?>


<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
<div class="panel-heading">Users</div>

<div class="row">
<div class="col-sm-2">Name</div>
<div class="col-sm-2">Email</div>
<div class="col-sm-2">Telephone</div>
<div class="col-sm-1">Mail</div>
<div class="col-sm-1">SMS</div>
<div class="col-sm-1"></div>
</div>
<div class="table-responsive">
<table class="table table-striped">
<thead><tr><th></th><th>Name</th><th>Email</th><th>Telephone</th><th><img src="media/ico/message-icon.png"></th><th><img src="media/ico/phone-blue-glow-icon.png"></th><th>Add/Rem</th></tr></thead>

<div class="row">
<tr>
<form action="" method="post">
<div class="col-sm-2"><input type="text" name="notif_name" value="" class="form-control" required=""/></div>
<div class="col-sm-2"><input type="text" name="notif_mail" value="" class="form-control" required=""/></div>
<div class="col-sm-2"><input type="text" name="notif_tel" value="" class="form-control" required=""/></div>
<td></td>
<td><input type="text" name="notif_name" value="" class="form-control" required=""/></td>
<td><input type="text" name="notif_mail" value="" class="form-control" required=""/></td>
<td><input type="text" name="notif_tel" value="" class="form-control" required=""/></td>
<td><input type="checkbox" name="notif_mail_alarm" value="yes" /></td>
<td><input type="checkbox" name="notif_sms_alarm" value="yes" /></td>
<input type="hidden" name="notif_add1" value="notif_add2" />
<div class="col-sm-1"><input type="checkbox" name="notif_mail_alarm" value="yes" /></div>
<div class="col-sm-1"><input type="checkbox" name="notif_sms_alarm" value="yes" /></div>
<div class="col-sm-1"><button class="btn btn-xs btn-success"><span class="glyphicon glyphicon-plus"></span> </button></div>
<td><button class="btn btn-xs btn-success"><span class="glyphicon glyphicon-plus"></span> </button></td>
<td></td>
</form>
</div>
</tr>
<?php

$db = new PDO('sqlite:dbf/nettemp.db');
Expand All @@ -80,29 +75,27 @@
$result = $sth->fetchAll();
foreach ($result as $a) {
?>
<p>
<div class="row">
<div class="col-sm-2"><?php echo $a["name"];?></div>
<div class="col-sm-2"><?php echo $a["mail"];?></div>
<div class="col-sm-2"><?php echo $a["tel"]; ?></div>
<tr>
<td><img src="media/ico/User-Preppy-Blue-icon.png"></td>
<td><?php echo $a["name"];?></td>
<td><?php echo $a["mail"];?></td>
<td><?php echo $a["tel"]; ?></td>

<form action="" method="post">
<div class="col-sm-1"><input data-toggle="toggle" data-size="mini" onchange="this.form.submit()" type="checkbox" name="notif_update_mail" value="yes" <?php echo $a["mail_alarm"] == 'yes' ? 'checked="checked"' : ''; ?> /></div>
<div class="col-sm-1"><input data-toggle="toggle" data-size="mini" onchange="this.form.submit()" type="checkbox" name="notif_update_sms" value="yes" <?php echo $a["sms_alarm"] == 'yes' ? 'checked="checked"' : ''; ?> /></div>
<input type="hidden" name="notif_update1" value="notif_update2" />
<form action="" method="post">
<input type="hidden" name="notif_update" value="<?php echo $a["id"]; ?>" />
<td><input data-size="mini" onchange="this.form.submit()" type="checkbox" name="notif_update_mail" value="yes" <?php echo $a["mail_alarm"] == 'yes' ? 'checked="checked"' : ''; ?> /></td>
<td><input data-size="mini" onchange="this.form.submit()" type="checkbox" name="notif_update_sms" value="yes" <?php echo $a["sms_alarm"] == 'yes' ? 'checked="checked"' : ''; ?> /></td>
<input type="hidden" name="notif_update1" value="notif_update2" />
</form>

<form action="" method="post">
<form action="" method="post">
<input type="hidden" name="notif_del" value="<?php echo $a["id"]; ?>" />
<input type="hidden" type="submit" name="notif_del1" value="notif_del2" />
<div class="col-sm-1"><button class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash"></span></button></div>
<td><button class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash"></span> </button></td>
</form>
</div>
</p>
<?php
}
</tr>
<?php }
?>

</table>
</div>
</div>
3 changes: 3 additions & 0 deletions modules/security/fw/fw
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ if [ "$onoff" == "on" ] && [ -n "$2" ] && [ -n "$3" ] && [ -n "$4" ] && [ -n "$5
fi
if [ -n "$ext" ];then
sudo iptables -A INPUT -s $ext -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -s $ext -p tcp --dport 443 -j ACCEPT
sudo iptables -A INPUT -s $ext -m limit --limit 1/second -p tcp --dport 22 -j ACCEPT
sudo iptables -A INPUT -s $ext -p icmp --icmp-type echo-request -j ACCEPT
fi
if [ "$vpn" == "on" ]; then
sudo iptables -A INPUT -p udp --dport 1194 -j ACCEPT
Expand Down
26 changes: 14 additions & 12 deletions modules/sensors/html/sensors_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
?>
<thead>
<tr>
<th></th>
<th>Name</th>
<th>id</th>
<th>Size</th>
Expand All @@ -35,22 +34,25 @@

?>
<tr>
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
<td><img src="media/ico/TO-220-icon.png" /></td>
<td><input type="text" name="name_new" size="12" maxlength="30" value="<?php echo $a["name"]."\t"; ?>" />
<input type="hidden" name="name_id" value="<?php echo $a["id"]."\t"; ?>" />
<input type="hidden" name="id_name2" value="id_name3"/>
<button class="btn btn-xs btn-primary"><span class="glyphicon glyphicon-pencil"></span> </button></td>
</form>


<td><?php echo $a["rom"] ;?></td>
<form action="" method="post">
<td>
<img src="media/ico/TO-220-icon.png" />
<input type="text" name="name_new" size="12" maxlength="30" value="<?php echo $a["name"]; ?>" />
<button class="btn btn-xs btn-primary"><span class="glyphicon glyphicon-pencil"></span> </button>
</td>
<input type="hidden" name="name_id" value="<?php echo $a["id"]; ?>" />
<input type="hidden" name="id_name2" value="id_name3"/>
</form>
<td>
<?php echo $a["rom"] ;?>
</td>
<?php
$id_rom3 = str_replace(" ", "_", $a["rom"]);
$id_rom2 = "$id_rom3.sql";
$file3 = "db/$id_rom2";
if (file_exists($file3) && ( 0 != filesize($file3)))
{?>
{
?>
<td><?php $filesize = (filesize("$file3") * .0009765625) * .0009765625; echo round($filesize, 3) ?>MB</td>
<td><button class="btn btn-xs btn-success"><span class="glyphicon glyphicon-ok"></span> </button></td>
</form>
Expand Down

0 comments on commit d3d97a7

Please sign in to comment.