public static function generate_fields()
 {
     global $a;
     $a = AC::load_current_activity();
     if (!$a) {
         return false;
     }
     $fields = array('number_of_registrants' => array('label' => 'Registrants', 'type' => 'select', 'default' => 1, 'options' => array(), 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'terms' => array('label' => 'You must agree to the terms to continue', 'type' => 'radio', 'options' => array('agree' => 'I agree'), 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'gratuity' => array('label' => 'Gratuity', 'type' => 'select', 'options' => AC::get_gratuity_array(), 'filter' => 'trim|sanitize_string', 'validate' => 'min_numeric,0'), 'donation' => array('label' => 'Donation to Vetri Foundation', 'type' => 'text', 'validate' => 'integer|min_numeric,0', 'filter' => 'trim|sanitize_string'), 'registrant_1_first_name' => array('label' => 'Primary Registrant First Name', 'type' => 'text', 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'registrant_1_last_name' => array('label' => 'Primary Registrant Last Name', 'type' => 'text', 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'registrant_1_email' => array('label' => 'Primary Registrant Email', 'type' => 'text', 'validate' => 'required|valid_email', 'filter' => 'trim|sanitize_string'), 'billing_first_name' => array('label' => 'First Name', 'type' => 'text', 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'billing_last_name' => array('label' => 'Last Name', 'type' => 'text', 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'billing_address' => array('label' => 'Address', 'type' => 'text', 'validate' => 'required|street_address', 'filter' => 'trim|sanitize_string'), 'billing_phone_1' => array('label' => 'Phone Number', 'type' => 'text', 'validate' => 'required|exact_len,3|numeric', 'filter' => 'trim|sanitize_string'), 'billing_phone_2' => array('label' => 'Phone Number', 'type' => 'text', 'validate' => 'required|exact_len,3|numeric', 'filter' => 'trim|sanitize_string'), 'billing_phone_3' => array('label' => 'Phone Number', 'type' => 'text', 'validate' => 'required|exact_len,4|numeric', 'filter' => 'trim|sanitize_string'), 'billing_city' => array('label' => 'City', 'type' => 'text', 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'billing_state' => array('label' => 'State', 'type' => 'select', 'options' => AC::$states, 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'billing_zip' => array('label' => 'ZIP Code', 'type' => 'text', 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'cc_name' => array('label' => 'Name on Card', 'type' => 'text', 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'cc_exp_month' => array('label' => 'Exp. Month', 'type' => 'select', 'options' => AC::get_exp_month_array(), 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'cc_exp_year' => array('label' => 'Exp. Year', 'type' => 'select', 'options' => AC::get_exp_year_array(), 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'cc_number' => array('label' => 'Number', 'type' => 'text', 'validate' => 'required|valid_cc', 'filter' => 'trim|sanitize_string'), 'cc_ccv' => array('label' => 'CCV', 'type' => 'text', 'validate' => 'required', 'filter' => 'trim|sanitize_string'), 'optin' => array('label' => activity_stock_get_option('optin_text'), 'type' => 'radio', 'options' => array('yes' => 'Yes', 'no' => 'No'), 'default' => 'yes', 'validate' => 'required', 'filter' => 'trim|sanitize_string', 'desc' => activity_stock_get_option('optin_desc')));
     if (AC::load_saved_data('number_of_registrants')) {
         //add any additiona registrant groups, if needed
         for ($i = 2; $i <= AC::load_saved_data('number_of_registrants'); $i++) {
             $fields['registrant_' . $i . '_first_name'] = array('label' => 'Registrant #' . $i . ' First Name', 'type' => 'text', 'filter' => 'trim|sanitize_string');
             $fields['registrant_' . $i . '_last_name'] = array('label' => 'Registrant #' . $i . ' Last Name', 'type' => 'text', 'filter' => 'trim|sanitize_string');
             $fields['registrant_' . $i . '_email'] = array('label' => 'Registrant #' . $i . ' Email', 'type' => 'text', 'validate' => 'valid_email', 'filter' => 'trim|sanitize_string');
         }
     }
     $addon_quantities = array(0 => 'No, thanks');
     for ($i = 1; $i <= AC::load_saved_data('number_of_registrants'); $i++) {
         $addon_quantities[$i] = $i;
     }
     if ($a->has_addons) {
         for ($i = 0; $i < count($a->addon_group); $i++) {
             $fields['addon_' . $i] = array('label' => $a->addon_group[$i]['title'] . ' - $' . $a->addon_group[$i]['cost'], 'type' => 'select', 'options' => $addon_quantities, 'validate' => 'required', 'default' => 'yes', 'filter' => 'trim|sanitize_string');
         }
     }
     AC::$fields = $fields;
 }