-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvsa.php
44 lines (35 loc) · 888 Bytes
/
vsa.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
require_once "TimeTrack.class.php";
$tt = new TimeTrack();
function getTimes($tt) {
$tt->parseData();
$ld=$tt->getLastDay();
//print_r($ld);
echo((isset($ld['diff']) ? $ld['diff'] : 0)."\n");
echo((isset($ld['monthdiff']) ? $ld['monthdiff'] : 0)."\n");
echo((isset($ld['laststateIn']) ? (int)$ld['laststateIn'] : 0)."\n");
echo((isset($ld['start']) ? $ld['start'] : 0) ."\n");
echo((isset($ld['pause']) ? $ld['pause'] : 0) ."\n");
}
error_reporting(E_ALL);
ini_set("display_errors", 1);
$action=isset($_GET['a']) ? $_GET['a'] : '';
$hash=isset($_GET['h']) ? $_GET['h'] : '';
if (!$tt->login(null, null, $hash)) {
die('INVALID LOGIN');
}
$curmonth=date("Ym");
if (isset($_GET['m'])) {
$curmonth=$_GET['m'];
}
$tt->setMonth($curmonth);
if ($action=="times") {
getTimes($tt);
}
if ($action=="login") {
getTimes($tt);
}
if ($action=="logout") {
getTimes($tt);
}
?>