Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jul 6, 2015
1 parent 72381db commit 546b0c8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 45 deletions.
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include("modules/login/login.php");
ob_start();
$id = isset($_GET['id']) ? $_GET['id'] : '';
$art=isset($_GET['type']) ? $_GET['type'] : '';
$dbfile='dbf/nettemp.db';
if ( '' == file_get_contents( $dbfile ) ) {
header("Location: html/errors/no_db.php");
Expand Down
18 changes: 8 additions & 10 deletions modules/devices/html/devices.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@
}
?>
<p>
<a href="index.php?id=devices&type=scan" ><button class="btn <?php if (!file_exists('tmp/scan')) { echo "btn-danger"; } else { echo "btn-default"; } ?> ">Device scan</button></a>
<a href="index.php?id=devices&type=sensors" ><button class="btn btn-default">Devices</button></a>
<a href="index.php?id=devices&type=scan" ><button class="btn <?php if (!file_exists('tmp/scan')) { echo "btn-danger"; } else { echo $art == 'scan' ? 'btn-info' : 'btn-default'; } ?> ">Device scan</button></a>
<a href="index.php?id=devices&type=sensors" ><button class="btn <?php echo $art == 'sensors' ? 'btn-info' : 'btn-default'; ?>">Devices</button></a>
<?php if ( $gpio == 'on' ) { ?>
<a href="index.php?id=devices&type=gpio" ><button class="btn btn-default">GPIO</button></a>
<a href="index.php?id=devices&type=gpio" ><button class="btn <?php echo $art == 'gpio' ? 'btn-info' : 'btn-default'; ?>">GPIO</button></a>
<?php } ?>
<a href="index.php?id=devices&type=snmp" ><button class="btn btn-default">SNMP</button></a>
<a href="index.php?id=devices&type=ups" ><button class="btn btn-default">UPS</button></a>
<a href="index.php?id=devices&type=hosts" ><button class="btn btn-default">Host monitoring</button></a>
<a href="index.php?id=devices&type=ipcam" ><button class="btn btn-default">IP Cam</button></a>
<a href="index.php?id=devices&type=snmp" ><button class="btn <?php echo $art == 'snmp' ? 'btn-info' : 'btn-default'; ?>">SNMP</button></a>
<a href="index.php?id=devices&type=ups" ><button class="btn <?php echo $art == 'ups' ? 'btn-info' : 'btn-default'; ?>">UPS</button></a>
<a href="index.php?id=devices&type=hosts" ><button class="btn <?php echo $art == 'hosts' ? 'btn-info' : 'btn-default'; ?>">Host monitoring</button></a>
<a href="index.php?id=devices&type=ipcam" ><button class="btn <?php echo $art == 'ipcam' ? 'btn-info' : 'btn-default'; ?>">IP Cam</button></a>
</[>

<?php
$art=isset($_GET['type']) ? $_GET['type'] : '';
?>

<?php
switch ($art)
{
Expand Down
11 changes: 4 additions & 7 deletions modules/notification/html/notification.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<?php if(!isset($_SESSION['user'])){ header("Location: denied"); } ?>
<p>
<a href="index.php?id=notification&type=users" ><button class="btn btn-default">Users</button></a>
<a href="index.php?id=notification&type=sensors" ><button class="btn btn-default">Alarms</button></a>
<a href="index.php?id=notification&type=triggers" ><button class="btn btn-default">Triggers</button></a>
<a href="index.php?id=notification&type=other" ><button class="btn btn-default">Other</button></a>
<a href="index.php?id=notification&type=users" ><button class="btn <?php echo $art == 'users' ? 'btn-info' : 'btn-default'; ?>">Users</button></a>
<a href="index.php?id=notification&type=sensors" ><button class="btn <?php echo $art == 'sensors' ? 'btn-info' : 'btn-default'; ?>">Alarms</button></a>
<a href="index.php?id=notification&type=triggers" ><button class="btn <?php echo $art == 'triggers' ? 'btn-info' : 'btn-default'; ?>">Triggers</button></a>
<a href="index.php?id=notification&type=other" ><button class="btn <?php echo $art == 'other' ? 'btn-info' : 'btn-default'; ?>">Other</button></a>

</p>
<?php
$art = isset($_GET['type']) ? $_GET['type'] : '';
?>
<?php
switch ($art)
{
Expand Down
9 changes: 3 additions & 6 deletions modules/security/html/security.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<?php if(!isset($_SESSION['user'])){ header("Location: denied"); } ?>

<p>
<a href="index.php?id=security&type=fw" ><button class="btn btn-default">Firewall</button></a>
<a href="index.php?id=security&type=vpn" ><button class="btn btn-default">VPN</button></a>
<a href="index.php?id=security&type=authmod" ><button class="btn btn-default">WWW authmod</button></a>
<a href="index.php?id=security&type=fw" ><button class="btn <?php echo $art == 'fw' ? 'btn-info' : 'btn-default'; ?>">Firewall</button></a>
<a href="index.php?id=security&type=vpn" ><button class="btn <?php echo $art == 'vpn' ? 'btn-info' : 'btn-default'; ?>">VPN</button></a>
<a href="index.php?id=security&type=authmod" ><button class="btn <?php echo $art == 'authmod' ? 'btn-info' : 'btn-default'; ?>">WWW authmod</button></a>
</p>
<?php
$art = isset($_GET['type']) ? $_GET['type'] : '';
?>
<?php
switch ($art)
{
Expand Down
17 changes: 7 additions & 10 deletions modules/settings/settings.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<?php if(!isset($_SESSION['user'])){ header("Location: denied"); } ?>

<p>
<a href="index.php?id=settings&type=mail" ><button class="btn btn-default">Mail</button></a>
<a href="index.php?id=settings&type=sms" ><button class="btn btn-default">SMS</button></a>
<a href="index.php?id=settings&type=gpio" ><button class="btn btn-default">GPIO</button></a>
<a href="index.php?id=settings&type=1wire" ><button class="btn btn-default">1wire</button></a>
<a href="index.php?id=settings&type=time" ><button class="btn btn-default">Time</button></a>
<a href="index.php?id=settings&type=snmpd" ><button class="btn btn-default">SNMPD</button></a>
<a href="index.php?id=settings&type=lcd" ><button class="btn btn-default">LCD</button></a>
<a href="index.php?id=settings&type=mail" ><button class="btn <?php echo $art == 'mail' ? 'btn-info' : 'btn-default'; ?>">Mail</button></a>
<a href="index.php?id=settings&type=sms" ><button class="btn <?php echo $art == 'sms' ? 'btn-info' : 'btn-default'; ?>">SMS</button></a>
<a href="index.php?id=settings&type=gpio" ><button class="btn <?php echo $art == 'gpio' ? 'btn-info' : 'btn-default'; ?>">GPIO</button></a>
<a href="index.php?id=settings&type=1wire" ><button class="btn <?php echo $art == '1wire' ? 'btn-info' : 'btn-default'; ?>">1wire</button></a>
<a href="index.php?id=settings&type=time" ><button class="btn <?php echo $art == 'time' ? 'btn-info' : 'btn-default'; ?>">Time</button></a>
<a href="index.php?id=settings&type=snmpd" ><button class="btn <?php echo $art == 'snmpd' ? 'btn-info' : 'btn-default'; ?>">SNMPD</button></a>
<a href="index.php?id=settings&type=lcd" ><button class="btn <?php echo $art == 'lcd' ? 'btn-info' : 'btn-default'; ?>">LCD</button></a>
</p>
<?php
$art = isset($_GET['type']) ? $_GET['type'] : '';
?>
<?php
switch ($art)
{
Expand Down
21 changes: 9 additions & 12 deletions modules/tools/html/tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,18 @@
}
?>
<p>
<a href="index.php?id=tools&type=file_check" ><button class="btn btn-default">File check</button></a>
<a href="index.php?id=tools&type=password" ><button class="btn btn-default">Password</button></a>
<a href="index.php?id=tools&type=update" ><button class="btn btn-default">Update</button></a>
<a href="index.php?id=tools&type=reset" ><button class="btn btn-default">Reset to default</button></a>
<a href="index.php?id=tools&type=reboot" ><button class="btn btn-default">Reboot</button></a>
<a href="index.php?id=tools&type=log" ><button class="btn btn-default">Logging</button></a>
<a href="index.php?id=tools&type=file_check" ><button class="btn <?php echo $art == 'file_check' ? 'btn-info' : 'btn-default'; ?>">File check</button></a>
<a href="index.php?id=tools&type=password" ><button class="btn <?php echo $art == 'password' ? 'btn-info' : 'btn-default'; ?>">Password</button></a>
<a href="index.php?id=tools&type=update" ><button class="btn <?php echo $art == 'update' ? 'btn-info' : 'btn-default'; ?>">Update</button></a>
<a href="index.php?id=tools&type=reset" ><button class="btn <?php echo $art == 'reset' ? 'btn-info' : 'btn-default'; ?>">Reset to default</button></a>
<a href="index.php?id=tools&type=reboot" ><button class="btn <?php echo $art == 'reboot' ? 'btn-info' : 'btn-default'; ?>">Reboot</button></a>
<a href="index.php?id=tools&type=log" ><button class="btn <?php echo $art == 'log' ? 'btn-info' : 'btn-default'; ?>">Logging</button></a>
<?php if ( $gpio == 'on' ) { ?>
<a href="index.php?id=tools&type=gpio" ><button class="btn btn-default">GPIO</button></a>
<a href="index.php?id=tools&type=gpio" ><button class="btn <?php echo $art == 'gpio' ? 'btn-info' : 'btn-default'; ?>">GPIO</button></a>
<?php } ?>
<a href="index.php?id=tools&type=backup" ><button class="btn btn-default">Backup/Restore</button></a>
<a href="index.php?id=tools&type=espupload" ><button class="btn btn-default">ESPupload</button></a>
<a href="index.php?id=tools&type=backup" ><button class="btn <?php echo $art == 'backup' ? 'btn-info' : 'btn-default'; ?>">Backup/Restore</button></a>
<a href="index.php?id=tools&type=espupload" ><button class="btn <?php echo $art == 'espupload' ? 'btn-info' : 'btn-default'; ?>">ESPupload</button></a>
</p>
<?php
$art = isset($_GET['type']) ? $_GET['type'] : '';
?>
<?php
switch ($art)
{
Expand Down

0 comments on commit 546b0c8

Please sign in to comment.