&1; echo $?'); if ($erg != 'Signature Verified' . "\n" . '0' . "\n") { print($erg); die(); } unlink($sig_file); unlink($msg_file); $result = $db->query('SELECT * FROM `computer_time` WHERE `name`="' . $key . '"'); $row = $result->fetchArray(); if (!$row) { print($key . ' is not known.'); die(); } $bis = strtotime($row['bis']); $von = strtotime($row['von']); $bis = $bis + 30*60*(floor(time()/60/60/24) - floor($von/60/60/24)); if ($row['aktiv']) { $von = time(); } $noch = $bis - $von; if ($noch < 0) { $noch = 0; } if ($noch > 4*60*60) { $noch = 4*60*60; } print($noch . "\n"); switch ($_POST['msg']) { case 'start': $aktiv = 1; break; ;; case 'stop': $aktiv = 0; break; ;; default: print($_POST['msg'] . ' unknown'); die(); ;; } if ($noch == 0) { $aktiv = 0; } $db -> exec( 'UPDATE `computer_time`' . ' SET `aktiv`=' . $aktiv . ',' . '`von`="' . date('Y-m-d H:i:s', time()) . '",' . '`bis`="' . date('Y-m-d H:i:s', time() + $noch) . '"' . ' WHERE `name`="' . $key . '"'); die(); } $result = $db->query('select * from `computer_time`'); ?>fetchArray()) { $bis = strtotime($row['bis']); $von = strtotime($row['von']); if ($row['aktiv']) { $von = time(); } $noch = $bis - $von; ?>