/* Decoded by unphp.net */ goto jUjBV; hPmrl: $stmtSelectIPs->close(); goto lCZ1Q; td_Iy: $selectIPsQuery = "SELECT DISTINCT ip_address, country FROM user_hits WHERE projectUID = ? AND date = ? AND country = ?"; goto Ad0XO; uJKWH: $date = isset($_POST["date"]) ? $_POST["date"] : date("Y-m-d"); goto kg8Om; B9xPk: function getCountryFlagURL($countryCode) { $flagURL = "https://flagsapi.com/{$countryCode}/flat/64.png"; return $flagURL; } goto OEAeB; NLpjh: header("Content-Type: application/json"); goto irBgy; Ad0XO: $stmtSelectIPs = $mysql->prepare($selectIPsQuery); goto P8l0J; P8l0J: $stmtSelectIPs->bind_param("sss", $projectUID, $date, $country); goto rmTcl; rmTcl: $stmtSelectIPs->execute(); goto YWOed; Dqz5y: $cityData = array(); goto daT1V; PTrk3: if (empty($country)) { echo json_encode(array("error" => "Country parameter is missing."), JSON_PRETTY_PRINT); die; } goto td_Iy; OEAeB: $projectUID = isset($_POST["projectUID"]) ? $_POST["projectUID"] : "default_project_uid"; goto uJKWH; lCZ1Q: $mysql->close(); goto se_dc; kg8Om: $country = isset($_POST["country"]) ? $_POST["country"] : ''; goto PTrk3; se_dc: $cityData = array_filter($cityData, function ($entry) { return !empty($entry["city"]); }); goto PSern; irBgy: echo json_encode(array_values($cityData), JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); goto CGcIc; daT1V: while ($stmtSelectIPs->fetch()) { $city = getCityName($ipAddress); if (isset($cityData[$city])) { $cityData[$city]["users"]++; } else { $cityData[$city] = array("city" => $city, "users" => 1, "flag_url" => getCountryFlagURL($countryCode)); } } goto hPmrl; QJk2p: $stmtSelectIPs->bind_result($ipAddress, $countryCode); goto Dqz5y; Rt0VM: function getCityName($ip) { $tokens = array("7ea0764dd1d44a", "61f2e083d13617", "b9fd0ed34b2a61", "417c29079689ca", "28afe9e5faab16", "a4a0cc9f9cf43d", "073c3cb8c4a720", "c45dc150638ca3"); $randomToken = $tokens[array_rand($tokens)]; $url = "https://ipinfo.io/{$ip}/json?token={$randomToken}"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true); return $data["city"] ?? ''; } goto B9xPk; PSern: usort($cityData, function ($a, $b) { return $b["users"] - $a["users"]; }); goto NLpjh; jUjBV: require_once "connection.php"; goto Rt0VM; YWOed: $stmtSelectIPs->store_result(); goto QJk2p; CGcIc: