'https://api.dmgameapi.com/api/webapi/GetNoaverageEmerdList', 'bigdaddygame.cc' => 'https://api.bigdaddygame.cc/api/webapi/GetNoaverageEmerdList', '91clubapi.com' => 'https://91clubapi.com/api/webapi/GetNoaverageEmerdList', 'rtgreh5erh4.com' => 'https://api.rtgreh5erh4.com/api/webapi/GetNoaverageEmerdList', 'dogeclubgamesapi.com' => 'https://dogeclubgamesapi.com/api/webapi/GetNoaverageEmerdList' ]; // Determine API URL $api_url = $api_map[$domain] ?? "https://$domain/api/webapi/GetNoaverageEmerdList"; // Generate secret code (e.g., hash of game name + timestamp) $secret_code = md5($game_name . time()); // Insert into database $insert_query = "INSERT INTO game_trend_apis (game_name, api_url, secret_code, is_active) VALUES ('$game_name', '$api_url', '$secret_code', '0')"; if (mysqli_query($conn, $insert_query)) { echo ''; } else { echo ''; } } // Handle trend switch if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['game_id'])) { $game_id = mysqli_real_escape_string($conn, $_POST['game_id']); // Reset all trends to inactive $reset_query = "UPDATE game_trend_apis SET is_active = '0'"; mysqli_query($conn, $reset_query); // If "none" is not selected, activate the chosen trend and empty tables // if ($game_id !== "none") { // $update_query = "UPDATE game_trend_apis SET is_active = '1' WHERE id = '$game_id'"; // if (mysqli_query($conn, $update_query)) { // // Empty the specified tables // $tables_to_empty = [ // 'gelluonduhogu', // 'gelluonduhogu_drei', // 'gelluonduhogu_funf', // 'gelluonduhogu_zehn' // ]; // foreach ($tables_to_empty as $table) { // $empty_query = "TRUNCATE TABLE `$table`"; // mysqli_query($conn, $empty_query); // } // echo ''; // } else { // echo ''; // } // } else { // echo ''; // } // } ?> Same Trend Switch

Same Trend Switch

Add New Game
Select Trend
/>
/>