<?php
// Include your main library
include 'popupv2.php';

// Get the 'remark' from the JS call (default to 'website_visit')
$remark = isset($_GET['remark']) ? $_GET['remark'] : 'website_visit';

// Check if the user is allowed
$isAllowed = checkIpAccess($remark);

if ($isAllowed) {
    // If allowed, send a simple success message
    echo "ACCESS_GRANTED";
} else {
    // If denied (IN/BD), this function prints the HTML/CSS/JS for the popup
    showProxyPopup($remark);
}
?>