<?php

require_once '../core/api_bootstrap.php';

try {

$db = new Database();
$conn = $db->connect();

/* expire subscriptions */

$stmt = $conn->prepare("

UPDATE provider_subscriptions
SET status='expired'
WHERE expiry_date < CURDATE()
AND status='active'

");

$stmt->execute();

echo "Expired subscriptions updated";

}
catch(Exception $e){

Logger::log("cron.log",$e->getMessage());

}
