0) { $logoImg = $result[0]["img"]; if ($logoImg != '') { $img = base64_decode($logoImg); $php_img = imagecreatefromstring($img); imagesavealpha($php_img, true); $color = imagecolorallocatealpha($php_img, 0, 0, 0, 127); imagepng($php_img, NULL); imagecolordeallocate( $color ); imagedestroy($php_img); return; } } self::outputEmptyImage(); } public static function checkLastOsAccess($pdo) { $timezone = self::getTimeZone($pdo); date_default_timezone_set($timezone); $sql = "SELECT date FROM %gueststatus% WHERE item=?"; $result = DbUtils::fetchSqlAll($pdo, $sql, array('lastosaccess')); if (count($result) == 0) { $msg = "0"; } else { $lastaccess = $result[0]["date"]; $date = new DateTime(); $currentTimeStamp = $date->getTimestamp(); if (($currentTimeStamp - $lastaccess) > 60) { $msg = 0; } else { $msg = 1; } } return array("status" => "OK","msg" => $msg); } public static function getTimeZone($pdo) { $sql = "select value from %ossystem% where item=?"; $result = DbUtils::fetchSqlAll($pdo, $sql, array("timezone")); if (count($result) == 1) { return $result[0]["value"]; } else { return "Europe/Berlin"; } } } if (isset($_GET["command"])) { $command = $_GET["command"]; $pdo = DbUtils::openDbAndReturnPdoStatic(); switch ($command) { case "getlastosaccess": $ret = OsSystem::checkLastOsAccess($pdo); echo json_encode($ret); break; case "getlogo": OsSystem::getlogo($pdo); break; case "getprodimage": OsSystem::getprodimage($pdo,$_GET["prodid"]); break; default: break; } }