<?php

/*
# ---------------------------------------------------------
# REMOVED ORPHANED RECURRING ENTRIES FROM CANCELLED PACKAGES
# FROM A BUG FIXED ON 3.0.0
# ---------------------------------------------------------
*/

$query = "SELECT r.id, r.appliestoid, r.customerid FROM recurringfee r LEFT JOIN domains d ON r.appliestoid = d.id WHERE d.status = 3";
$result = $this->db->query($query);
while ($row = $result->fetch()) {
    $query2 = "DELETE FROM recurringfee WHERE id=?";
    $this->db->query($query2, $row['id']);
}

?>
