<?php
/** One-shot: schedule reminders for existing future bookings */
require_once dirname(__DIR__) . '/lib/reminders.php';
$rows = db()->query(
    "SELECT id FROM bookings WHERE status NOT IN ('cancelled','completed') AND starts_at > NOW()"
)->fetchAll();
$n = 0;
foreach ($rows as $r) {
    reminder_schedule_for_booking((int) $r['id']);
    $n++;
}
echo "Scheduled reminders for {$n} future bookings\n";
$c = db()->query('SELECT COUNT(*) FROM booking_reminders')->fetchColumn();
echo "Total reminder rows: {$c}\n";
