<?php
require_once '../db/config.php';

$now = date("Y-m-d H:i:s");
$query = "UPDATE users 
          SET package = 'Free', package_expiry = NULL 
          WHERE package_expiry IS NOT NULL AND package_expiry < ?";
$stmt = $con->prepare($query);
$stmt->bind_param("s", $now);
$stmt->execute();

echo "✅ Expired subscriptions updated.";


?>