/** * This method is called ONLY after ALL validation has * passed. This is the method that allows you to * do something with the data, say insert/update records * in the DB. */ function form_action() { $success = true; $swimteam = new SwimTeam(); $swimteam->PurgeSwimTeams(); $this->set_action_message(html_div(sprintf('ft-%s-msg', $swimteam->getAffectedRows() == 0 ? 'warning' : 'note'), sprintf('%d record%s purged from Swim Teams database.', $swimteam->getAffectedRows(), $swimteam->getAffectedRows() == 1 ? '' : 's'))); unset($swimteam); return $success; }