function edgimo_register_activity_metabox()
{
    $prefix = '_activity_';
    $faculty = array(0 => '-- Select --');
    $locations = array(0 => '-- Select --');
    $activity_types = array(0 => '-- Select --');
    foreach (AC::get_faculty() as $p) {
        $faculty[$p->ID] = $p->post_title;
    }
    foreach (AC::get_locations() as $p) {
        $locations[$p->ID] = $p->post_title;
    }
    foreach (AC::get_activity_types() as $p) {
        $activity_types[$p->ID] = $p->post_title;
    }
    $cmb = new_cmb2_box(array('id' => $prefix . 'metabox', 'title' => __('Basic Activity Info', 'cmb2'), 'object_types' => array('activity'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
    $cmb->add_field(array('name' => __('Status', 'cmb2'), 'desc' => __('Override the automatic status', 'cmb2'), 'id' => $prefix . 'status', 'type' => 'radio_inline', 'default' => 'open', 'options' => array('open' => 'Open', 'closed' => 'Closed')));
    $cmb->add_field(array('name' => __('Activity Subtitle', 'cmb2'), 'desc' => __('Optional, 200 characters', 'cmb2'), 'id' => $prefix . 'subtitle', 'type' => 'text'));
    $cmb->add_field(array('name' => __('Short Description', 'cmb2'), 'desc' => __('Shown on activity summary page', 'cmb2'), 'id' => $prefix . 'desc_short', 'type' => 'textarea', 'attributes' => array('required' => 'required')));
    $cmb->add_field(array('name' => __('Long Description', 'cmb2'), 'desc' => __('Shown on activity detail page', 'cmb2'), 'id' => $prefix . 'desc_long', 'type' => 'wysiwyg', 'options' => array('textarea_rows' => 10, 'media_buttons' => false, 'teeny' => true, 'tinymce' => array('toolbar1' => 'bold,italic,underline,bullist,numlist,link,unlink,undo,redo')), 'attributes' => array('required' => 'required')));
    $cmb->add_field(array('name' => __('Activity Type', 'cmb2'), 'desc' => __('<a href="post-new.php?post_type=activity_type" target="_blank">Add a new Activity Type</a><br />You will need to save/reload this page to see any new additions', 'cmb2'), 'id' => $prefix . 'type', 'type' => 'select', 'options' => $activity_types));
    $cmb->add_field(array('name' => __('Activity Image', 'cmb2'), 'desc' => __('Optional', 'cmb2'), 'id' => $prefix . 'image', 'type' => 'file'));
    $cmb->add_field(array('name' => __('Activity Date', 'cmb2'), 'desc' => __('', 'cmb2'), 'id' => $prefix . 'date', 'type' => 'text_date_timestamp', 'attributes' => array('required' => 'required')));
    $cmb->add_field(array('name' => __('Start Time', 'cmb2'), 'desc' => __('', 'cmb2'), 'id' => $prefix . 'start_time', 'type' => 'text_time', 'default' => '06:30 PM', 'attributes' => array('required' => 'required')));
    $cmb->add_field(array('name' => __('End Time', 'cmb2'), 'desc' => __('', 'cmb2'), 'id' => $prefix . 'end_time', 'type' => 'text_time', 'default' => '10:00 PM'));
    $cmb->add_field(array('name' => __('Arrival Time', 'cmb2'), 'desc' => __('', 'cmb2'), 'id' => $prefix . 'arrival_time', 'type' => 'text_time', 'default' => '06:00 PM'));
    $cmb->add_field(array('name' => __('Faculty #1', 'cmb2'), 'desc' => __('<a href="post-new.php?post_type=faculty" target="_blank">Add new Faculty</a><br />You will need to save/reload this page to see any new additions', 'cmb2'), 'id' => $prefix . 'faculty', 'type' => 'select', 'options' => $faculty, 'attributes' => array('required' => 'required')));
    $cmb->add_field(array('name' => __('Faculty #2', 'cmb2'), 'desc' => __('Enter a second faculty member if applicable', 'cmb2'), 'id' => $prefix . 'faculty2', 'type' => 'select', 'options' => $faculty));
    $cmb->add_field(array('name' => __('Location', 'cmb2'), 'desc' => __('<a href="post-new.php?post_type=location" target="_blank">Add new Location</a><br />You will need to save/reload this page to see any new additions', 'cmb2'), 'id' => $prefix . 'location', 'type' => 'select', 'options' => $locations, 'attributes' => array('required' => 'required')));
    $cmb2 = new_cmb2_box(array('id' => $prefix . 'metabox2', 'title' => __('Registration Info', 'cmb2'), 'object_types' => array('activity'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
    $cmb2->add_field(array('name' => __('Capacity', 'cmb2'), 'desc' => __('', 'cmb2'), 'id' => $prefix . 'capacity', 'type' => 'select', 'options' => AC::get_capacity_array(), 'attributes' => array('required' => 'required')));
    $cmb2->add_field(array('name' => __('Registration Opens', 'cmb2'), 'desc' => __('<p>Set date & time that registration button should display for activity</p>', 'cmb2'), 'id' => $prefix . 'reg_opens', 'type' => 'text_datetime_timestamp', 'default' => '08:00 AM', 'attributes' => array('required' => 'required')));
    $cmb2->add_field(array('name' => __('Registration Closes', 'cmb2'), 'desc' => __('<p>Set date & time that registration closed should display for activity</p>', 'cmb2'), 'id' => $prefix . 'reg_closes', 'type' => 'text_datetime_timestamp', 'default' => '01:00 PM', 'attributes' => array('required' => 'required')));
    $cmb2->add_field(array('name' => __('Waitlist', 'cmb2'), 'desc' => __('If yes, <code>Waitlist</code> button displays when at capacity. If no, <code>Sold Out</code> button displays when at capacity.', 'cmb2'), 'id' => $prefix . 'waitlist', 'type' => 'radio_inline', 'options' => array('yes' => 'Yes', 'no' => 'No'), 'default' => 'yes', 'attributes' => array('required' => 'required')));
    $cmb3 = new_cmb2_box(array('id' => $prefix . 'metabox3', 'title' => __('Add-on Items', 'cmb2'), 'object_types' => array('activity'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
    $addon_group_id = $cmb3->add_field(array('id' => $prefix . 'addon_group', 'type' => 'group', 'description' => __('', 'cmb'), 'options' => array('group_title' => __('Add-on {#}', 'cmb'), 'add_button' => __('Add Another Add-on', 'cmb'), 'remove_button' => __('Remove Add-on', 'cmb'), 'sortable' => true)));
    $cmb3->add_group_field($addon_group_id, array('name' => 'Name', 'id' => 'title', 'type' => 'text'));
    $cmb3->add_group_field($addon_group_id, array('name' => 'Cost', 'id' => 'cost', 'type' => 'text_money'));
    $cmb3->add_group_field($addon_group_id, array('name' => 'Description', 'id' => 'desc', 'type' => 'textarea_small'));
    $cmb3->add_group_field($addon_group_id, array('name' => 'Taxable?', 'id' => 'taxable', 'type' => 'radio', 'options' => array('yes' => 'Yes', 'no' => 'No'), 'default' => 'no'));
    $cmb4 = new_cmb2_box(array('id' => $prefix . 'metabox4', 'title' => __('Tax, Fees, Etc.', 'cmb2'), 'object_types' => array('activity'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
    $cmb4->add_field(array('name' => __('Registration Fee', 'cmb2'), 'desc' => __('<p>Gratuity is included in this amount. Tax of 8% is added to this amount during registration.</p>', 'cmb2'), 'id' => $prefix . 'fee', 'type' => 'text_money', 'attributes' => array('required' => 'required')));
    $cmb4->add_field(array('name' => __('Registration Fee Description', 'cmb2'), 'desc' => __('Description of what is included in price (e.g., Includes tax and gratuity)', 'cmb2'), 'id' => $prefix . 'desc_fee', 'type' => 'textarea_small'));
    //Include Tax and Include Gratuity switch to hardoded yes and no
    //To revert to choices, comment out the hidden fields and uncomment the radio fields
    $cmb4->add_field(array('id' => $prefix . 'include_tax', 'type' => 'hidden', 'default' => 'yes', 'attributes' => array('value' => 'yes')));
    $cmb4->add_field(array('id' => $prefix . 'include_gratuity', 'type' => 'hidden', 'default' => 'no', 'attributes' => array('value' => 'no')));
    /*$cmb4->add_field( array(
    		'name'       => __( 'Include Tax on Total', 'cmb2' ),
    		'desc'       => __( 'If yes, automatically calculates tax at applicable percentage. Note if set to "no", this will override tax options on add-on items.', 'cmb2' ),
    		'id'         => $prefix . 'include_tax',
    		'type'       => 'radio_inline',
    		'options' => array('yes' => 'Yes', 'no' => 'No'),
    		'default' => 'yes'
    	) );*/
    /*$cmb4->add_field( array(
    		'name'       => __( 'Include Gratuity Option', 'cmb2' ),
    		'desc'       => __( 'If yes, displays dropdown menu with percentages for customer', 'cmb2' ),
    		'id'         => $prefix . 'include_gratuity',
    		'type'       => 'radio_inline',
    		'options' => array('yes' => 'Yes', 'no' => 'No'),
    		'default' => 'no',
    		'attributes' => array('required' => 'required')	
    	) );*/
    $cmb4->add_field(array('name' => __('Include Donation Option', 'cmb2'), 'desc' => __('If yes, displays donation to Vetri Foundation dropdown option', 'cmb2'), 'id' => $prefix . 'include_donation', 'type' => 'radio_inline', 'options' => array('yes' => 'Yes', 'no' => 'No'), 'default' => 'yes', 'attributes' => array('required' => 'required')));
    $cmb5 = new_cmb2_box(array('id' => $prefix . 'metabox5', 'title' => __('Stock Copy', 'cmb2'), 'object_types' => array('activity'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
    $cmb5->add_field(array('name' => __('Cancellation/Terms', 'cmb2'), 'desc' => __('', 'cmb2'), 'id' => $prefix . 'cancellation_terms', 'type' => 'textarea', 'default' => activity_stock_get_option('cancellation_terms')));
    $cmb5->add_field(array('name' => __('Confirmation Email Subject', 'cmb2'), 'desc' => __('', 'cmb2'), 'id' => $prefix . 'confirmation_subject', 'default' => activity_stock_get_option('confirmation_subject'), 'type' => 'text'));
    $cmb5->add_field(array('name' => __('Confirmation Email Message', 'cmb2'), 'desc' => __('', 'cmb2'), 'id' => $prefix . 'confirmation_copy', 'default' => activity_stock_get_option('confirmation_copy'), 'type' => 'textarea'));
    $cmb5->add_field(array('name' => __('Registrant Service Contact E-mail', 'cmb2'), 'desc' => __('', 'cmb2'), 'id' => $prefix . 'service_email', 'default' => activity_stock_get_option('service_email'), 'type' => 'text'));
    $cmb5->add_field(array('name' => __('Waitlist Terms', 'cmb2'), 'desc' => __('', 'cmb2'), 'id' => $prefix . 'waitlist_terms', 'default' => activity_stock_get_option('waitlist_terms'), 'type' => 'textarea'));
    $cmb5->add_field(array('name' => __('Waitlist Email Subject', 'cmb2'), 'desc' => __('', 'cmb2'), 'id' => $prefix . 'waitlist_subject', 'default' => activity_stock_get_option('waitlist_subject'), 'type' => 'text'));
    $cmb5->add_field(array('name' => __('Waitlist Email Message', 'cmb2'), 'desc' => __('', 'cmb2'), 'id' => $prefix . 'waitlist_copy', 'default' => activity_stock_get_option('waitlist_copy'), 'type' => 'textarea'));
}
 public static function send_admin_waitlist_email($w_id)
 {
     global $a;
     global $w;
     $w = AC::load_waitlist_meta($w_id);
     $subject = 'New Waitlist: ' . $w->name . ' (' . $w->desired_seats . ') ' . $a->title;
     $values = array('Activity' => $a->title, 'Activity ID' => $a->ID, 'Activity Date' => $a->formatted_date, 'Name' => $w->name, 'Timestamp' => $w->formatted_created, 'Desired Seats' => $w->desired_seats, 'Email' => $w->email, 'Waitlist ID' => $w->ID, 'Code' => $w->code, 'Reg Link' => '<a href="' . $w->reg_link . '">' . $w->reg_link . '</a>');
     $body = '';
     foreach ($values as $k => $v) {
         $body .= '<strong>' . $k . ':</strong> ' . $v . '<br />';
     }
     $mail = new PHPMailer();
     $mail->setFrom('*****@*****.**');
     $mail->addReplyTo('*****@*****.**');
     $mail->addAddress($a->service_email);
     foreach (activity_stock_get_option('admin_emails') as $address) {
         $mail->addCC($address);
     }
     $mail->Subject = $subject;
     $mail->msgHTML($body);
     $mail->Send();
 }
        ?>
							    	<?php 
        AC::output_field('cc_ccv');
        ?>
							    </div>
							</div>
						</div>
						<div class="form-group">
							<h2>Vetri Mailing List</h2>
							<div class="row">
								<div class="col-sm-12">
									<?php 
        AC::output_label('optin');
        ?>
									<p class="desc"><?php 
        echo nl2br(activity_stock_get_option('optin_desc'));
        ?>
</p>
							    	<?php 
        AC::output_field('optin');
        ?>
								</div>
							</div>
						</div>

						<div class="row">
						    <div class="col-md-12">
								<input type="submit" value="Go Back" name="activity-center-back" class="btn btn-back">
								<input type="submit" value="Submit Reservation" name="activity-center-submit" class="btn btn-submit">
								<input type="hidden" value="3" name="step">
							</div>