function update_tracking_code($Old_Tracking_Code, $New_Tracking_Code)
{
    global $db;
    global $DIA;
    $x = 0;
    $sql = 'select * from donations where Tracking_Code = "' . $Old_Tracking_Code . '" ';
    $R = $db->Execute($sql) or die($db->errorMsg());
    while (!$R->EOF) {
        $data['Tracking_Code'] = $New_Tracking_Code;
        $data['key'] = $R->Fields("donation_KEY");
        $DIA->save('donation', $data);
        $x++;
        $R->MoveNext();
    }
    sync_monsterpants_object_recent('supporter_action');
    echo $x . ' donations updated to ' . $New_Tracking_Code;
}
function groups_to_action($groups_KEY, $action_KEY)
{
    global $db;
    global $DIA;
    $x = 0;
    $sql = 'select * from supporter_groups where groups_KEY = "' . $groups_KEY . '"';
    $R = $db->Execute($sql) or die($db->errorMsg());
    while (!$R->EOF) {
        $data['Last_Modified'] = $R->Fields("Last_Modified");
        $data['Date_Created'] = $R->Fields("Last_Modified");
        $data['action_KEY'] = $action_KEY;
        $data['supporter_KEY'] = $R->Fields("supporter_KEY");
        $DIA->save('supporter_action', $data);
        $x++;
        $R->MoveNext();
    }
    echo $x . ' supporters added to action # ' . $action_KEY;
    sync_monsterpants_object_recent('supporter_action');
}