/** * 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; $swimmeet = new SwimMeet(); $swimmeet->PurgeSwimMeets(); $this->set_action_message(html_div(sprintf('ft-%s-msg', $swimmeet->getAffectedRows() == 0 ? 'warning' : 'note'), sprintf('%d record%s purged from Swim Meets database.', $swimmeet->getAffectedRows(), $swimmeet->getAffectedRows() == 1 ? '' : 's'))); unset($swimmeet); return $success; }