$legislation->summary(get_param('summary')); $legislation->discussion(get_param('discussion')); $legislation->question(get_param('question')); $date_introduced = set_date_parts(get_param('intro_month'), get_param('intro_day'), get_param('intro_year')); $date_heard = set_date_parts(get_param('heard_month'), get_param('heard_day'), get_param('heard_year')); $legislation->date_introduced($date_introduced); $legislation->date_heard($date_heard); if ($id) { $legislation->update(); } else { $id = $legislation->insert(); } // sponsor IDs next $sponsor_ids = get_param('sponsor_ids'); if (!empty($sponsor_ids)) { $legislation->associate_sponsors($sponsor_ids); } // tags next $tag_list = get_param('tag_list'); $tags = explode('|', $tag_list); if (!empty($tags)) { $legislation->associate_tags($tags); } else { $legislation->disassociate_tags(); } redirect('legislation'); } $html = new HTML('admin'); $html->set_title('Edit this legislative legislation'); $html->use_style('admin/tag.css'); $html->use_style('dp/themes/base/ui.all.css');