[ "qwikclock" => "QwikClock", "punch in" => "Punch in", "punch out" => "Punch out" ] ]); $APPS["qwikclock_inout"]["i18n"] = TRUE; $APPS["qwikclock_inout"]["title"] = "qwikclock"; $APPS["qwikclock_inout"]["icon"] = "clock-o"; $APPS["qwikclock_inout"]["type"] = "blue"; $content = ""; if (!is_empty($_GET['qwikclock']) && ($_GET['qwikclock'] === "punchin" || $_GET['qwikclock'] === "punchout")) { try { $client = new GuzzleHttp\Client(); $response = $client->request('POST', QWIKCLOCK_API, ['form_params' => [ 'action' => $_GET['qwikclock'], 'username' => $_SESSION['username'], 'password' => $_SESSION['password'] ]]); $resp = json_decode($response->getBody(), TRUE); if ($resp['status'] == "OK") { $content = "
" . $resp['msg'] . "
"; } else { $content = "
" . $resp['msg'] . "
"; } } catch (Exception $e) { $content = "
" . lang("error loading widget", false) . " " . $e->getMessage() . "
"; } } $lang_punchin = lang("punch in", false); $lang_punchout = lang("punch out", false); $content .= << $lang_punchin $lang_punchout END; $content .= '
' . lang("open app", false) . '  '; $APPS["qwikclock_inout"]["content"] = $content; ?>