diff options
author | Jannik Schönartz | 2016-12-05 18:56:44 +0100 |
---|---|---|
committer | Jannik Schönartz | 2016-12-05 18:56:44 +0100 |
commit | a86d0225dc7768a629ce59c325a1dcc739122ef9 (patch) | |
tree | 3dcfbd03ea58d97a09515d7a4783a8aef761ff26 /modules-available/locationinfo/inc | |
parent | frontend: changed to backend changes, use media querrys, changed free seats f... (diff) | |
download | slx-admin-a86d0225dc7768a629ce59c325a1dcc739122ef9.tar.gz slx-admin-a86d0225dc7768a629ce59c325a1dcc739122ef9.tar.xz slx-admin-a86d0225dc7768a629ce59c325a1dcc739122ef9.zip |
Locationinfo: Added Servertable
Diffstat (limited to 'modules-available/locationinfo/inc')
-rw-r--r-- | modules-available/locationinfo/inc/locationinfo.inc.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/modules-available/locationinfo/inc/locationinfo.inc.php b/modules-available/locationinfo/inc/locationinfo.inc.php new file mode 100644 index 00000000..4f26519d --- /dev/null +++ b/modules-available/locationinfo/inc/locationinfo.inc.php @@ -0,0 +1,28 @@ +<?php + +class LocationInfo +{ + //TODO TEST WITH NEWER DB + public function getPcState($logintime, $lastseen) { + /* pcState: + * [0] = IDLE (NOT IN USE) + * [1] = OCCUPIED (IN USE) + * [2] = OFF + * [3] = 10 days offline (BROKEN?) + */ + + $NOW = time(); + + + if ($NOW - $lastseen > 864000) { + return 3; + } elseif ($NOW - $lastseen > 610) { + return 2; + } elseif ($logintime == 0) { + return 0; + } elseif ($logintime > 0) { + return 1; + } + return -1; + } +} |