function event_notification_form_tags_meta_box($post, $values)
 {
     echo "<div class='epl_warning'>" . epl__('Currently only data from the Ticket Buyer forms can be displayed using these tags.') . "</div>";
     $fields = $this->ecm->get_list_of_available_fields();
     //echo "<pre class='prettyprint'>" . print_r($fields, true). "</pre>";
     $tmpl = array('table_open' => '<table cellpadding="0" cellspacing="0" class="epl_form_data_table">');
     $this->epl->epl_table->set_template($tmpl);
     $this->epl_table->set_heading('Slug', 'field');
     foreach ($fields as $field_id => $field_data) {
         if ($field_data['input_slug'] == '') {
             $m = epl__("Please use the form manager to add a slug for this field");
         } else {
             $m = $field_data['input_slug'];
         }
         $this->epl_table->add_row('{' . $m . '}', epl_trunc($field_data['label'], 1));
     }
     echo $this->epl_table->generate();
     echo "<div class='epl_info'> More options coming.</div>";
     return;
     /*        $this->fields_to_display = array_keys( $this->fields['epl_location'] );
     
               $data['epl_location_fields'] = $this->epl_util->render_fields( $this->fields['epl_location'], $this->fields_to_display, array( '_view' => 3, '_type' => 'row', 'value' => &$this->data['values'] ) );
     
               $this->epl->load_view( 'admin/registrations/registration-attendee-meta-box', $data ); */
 }
$payment_data = epl_get_regis_payments();
foreach ($payment_data as $t => $p) {
    if ($p['_epl_payment_amount'] == 0) {
        continue;
    }
    ?>
            <tr style="border-top:1px solid #d7d7d7;">
                <td><?php 
    echo epl_formatted_date($p['_epl_payment_date']);
    ?>
</td>
                <td><?php 
    echo epl_get_formatted_curr($p['_epl_payment_amount'], null, true);
    ?>
                    <span style="float: right;"><?php 
    echo epl_trunc(epl_get_element($p['_epl_payment_method'], $epl_fields['epl_regis_payment_fields']['_epl_payment_method']['options'], ''), 10);
    ?>
</span>
                </td>              
            </tr>
        <?php 
}
?>

        <tr>
            <td colspan="2">

                <span class="epl_font_small"><?php 
echo $waitlist_email_time != '' ? $waitlist_email_time : '';
?>
</span>
 function get_days_for_widget($for = 0, $args = array())
 {
     //echo "<pre class='prettyprint'>" . __LINE__ . "> " . print_r($args, true). "</pre>";
     //$for = 3 = fullcalendar
     global $wpdb;
     $defined_widgets = array(0 => 'widget_epl_upcoming_events_widget', 1 => 'widget_epl_advanced_cal_widget');
     $defined_widgets = apply_filters('epl_defined_widgets', $defined_widgets);
     $widget_options = !epl_is_empty_array($args) ? $args : $this->get_widget_options(epl_get_element($for, $defined_widgets));
     $c_year = isset($_REQUEST['c_year']) ? (int) $_REQUEST['c_year'] : date_i18n("Y");
     $c_month = isset($_REQUEST['c_month']) ? (int) $_REQUEST['c_month'] : date_i18n("m");
     $l_d = $this->epl->epl_calendar->get_total_days($c_month, $c_year);
     $day = 1;
     $from = "{$c_year}-{$c_month}-01";
     $to = "{$c_year}-{$c_month}-{$l_d}";
     $exclude_past_events = false;
     $content_to_show = epl_get_element('content_to_show', $args, 'content');
     $num_words_to_show = epl_get_element('num_words_to_show', $args, 60);
     switch ($for) {
         case 0:
             $from = EPL_DATE;
             $days_to_show = epl_get_element('days_to_show', $widget_options, 60);
             $content_to_show = epl_get_element('content_to_show', $widget_options, 'content');
             $num_words_to_show = epl_get_element('num_words_to_show', $widget_options, 60);
             $taxonomy = epl_get_element('tax_filter', $widget_options, array());
             if (!epl_is_empty_array($taxonomy)) {
                 $args['taxonomy'] = $taxonomy;
             }
             //$to = $from . " + $days_to_show days";
             $to = $from + $days_to_show * 60 * 60 * 24;
             break;
         case 1:
             $exclude_past_events = epl_get_element('exclude_past_events', $widget_options) == 'on';
             break;
         case 0:
         case 3:
             //these will work with ajax method of event retrieval
             //$from = intval( epl_get_element( 'start', $_REQUEST, null ) );
             //$to = intval( epl_get_element( 'end', $_REQUEST, null ) );
             $to = "2100-01-01";
             //TODO - Urgent, why has this been like this all this time?
             $exclude_past_events = true;
             break;
     }
     $from = epl_get_date_timestamp($from);
     $to = epl_get_date_timestamp($to);
     $qry_args = array('post_type' => 'epl_event', 'post_status' => 'publish', 'posts_per_page' => -1, 'orderby' => 'meta_value_num', 'order' => 'ASC', 'meta_key' => '_q__epl_start_date');
     //for the ongoing events
     if (epl_get_element('show_past', $args) == 1) {
         //unset( $qry_args['post__in'] );
         //unset( $qry_args['p'] );
         unset($qry_args['meta_key']);
         $exclude_past_events = false;
     }
     if ($event_id = epl_get_element('event_id', $args, null)) {
         if (strpos($event_id, ',') !== false) {
             $qry_args['post__in'] = explode(',', $event_id);
         } else {
             $qry_args['p'] = intval(epl_get_element('event_id', $args));
         }
     } else {
         $WHERE = "AND pm2.meta_key = '_q__epl_start_date' AND CAST(pm2.meta_value AS SIGNED) >= " . $from . "\n                AND pm2.meta_key = '_q__epl_start_date' AND CAST(pm2.meta_value AS SIGNED) <= " . $to . "";
         if ($exclude_past_events == false && $for > 0) {
             $WHERE = '';
         }
         $post_ids = $wpdb->get_col("\n            SELECT pm.post_id\n            FROM {$wpdb->postmeta} pm\n            INNER JOIN {$wpdb->postmeta} pm2 ON (pm.post_id = pm2.post_id)\n            WHERE\n                ((pm.meta_key = '_epl_event_status' AND CAST(pm.meta_value AS SIGNED) = '1' {$WHERE})\n            OR\n                (pm.meta_key = '_epl_event_status' AND CAST(pm.meta_value AS SIGNED) = '3'))\n            GROUP BY pm.post_id\n\n        ");
         $post_ids = $post_ids;
         $qry_args['post__in'] = $post_ids;
     }
     if (epl_get_element('location', $args) != '') {
         $_l = $args['location'];
         $qry_args['meta_query'][] = array('key' => '_epl_event_location', 'value' => $_l, 'type' => 'NUMERIC', 'compare' => '=');
     }
     if (epl_get_element('org', $args) != '') {
         $_l = $args['org'];
         $qry_args['meta_query'][] = array('key' => '_epl_event_organization', 'value' => $_l, 'type' => 'NUMERIC', 'compare' => '=');
     }
     $qry_args['tax_query'] = array();
     if (($_t = epl_get_element_m('taxonomy', 'shortcode_atts', $args)) == '') {
         $_t = epl_get_element('taxonomy', $args, '');
     }
     if ($_t != '') {
         if (!is_array($_t) && strpos($_t, ',') !== false) {
             $_t = array();
             $_t = explode(',', $args['taxonomy']);
         }
         $qry_args['tax_query'] = array(array('taxonomy' => 'epl_event_categories', 'field' => 'slug', 'terms' => $_t));
     }
     if (($_te = epl_get_element_m('taxonomy_exclude', 'shortcode_atts', $args, '')) == '') {
         $_te = epl_get_element('taxonomy_exclude', $args, '');
     }
     if ($_te != '') {
         if (!is_array($_te) && strpos($_te, ',') !== false) {
             $_t = array();
             $_te = explode(',', $_te);
         }
         $qry_args['tax_query'] += array(array('taxonomy' => 'epl_event_categories', 'terms' => $_te, 'field' => 'slug', 'operator' => 'NOT IN'));
     }
     /* if ( epl_get_element( 'show_past', $args ) == 1 ) {
        //unset( $qry_args['post__in'] );
        //unset( $qry_args['p'] );
        $exclude_past_events = false;
        }
        /* elseif ( epl_is_empty_array( $qry_args['post__in'] ) ) {
        //$meta_query['relation'] = 'AND';
        $qry_args['meta_query'][] = array(
        'key' => '_epl_event_status',
        'value' => 1,
        'type' => 'NUMERIC',
        'compare' => '='
        );
        } */
     $exclude_event_ids = explode(',', epl_get_element('exclude_event_ids', $args));
     global $event_details;
     $d = array();
     $q = new WP_Query($qry_args);
     $new = true;
     while ($q->have_posts()) {
         $q->the_post();
         $s = array();
         $t = get_the_title();
         setup_event_details(get_the_ID());
         $e = $event_details['_epl_end_date'];
         $alt_regis_url = $event_details['_epl_alt_regis_url'] != '' ? 1 : 0;
         $event_status = $event_details['_epl_event_status'];
         $event_type = $event_details['_epl_event_type'];
         $event_rec_frequency = $event_details['_epl_recurrence_frequency'];
         //if class and upcoming widget or fullcalendar
         if ($event_type == 10 && ($for == 0 || $for == 3)) {
             //if there is recurrence formula
             if ($event_rec_frequency != '0') {
                 $this->rm->hide_past = $exclude_past_events;
                 $s = $this->rm->recurrence_dates_from_db($event_details);
                 $s = $this->rm->construct_table_array($s, true);
                 $e = $s['_epl_end_date'];
                 $s = $s['_epl_start_date'];
             } elseif (!epl_is_empty_array($event_details['_epl_class_session_date'])) {
                 $s = $event_details['_epl_class_session_date'];
             }
         }
         if (empty($s) || epl_get_element('class_display_type', $widget_options, 2) == 1 && epl_get_element('class_display_type', $args, 0) == 1) {
             $s = $event_details['_epl_start_date'];
         }
         if (epl_is_empty_array($s) || in_array(get_the_ID(), $exclude_event_ids) || $event_status == 2) {
             continue;
         }
         $d = $this->make_cal_day_array(array('event_id' => get_the_ID(), 'event_status' => $event_status, 'event_type' => epl_get_element('_epl_event_type', $event_details), 'start_dates' => $s, 'end_dates' => $e, 'event_times' => array('start' => $event_details['_epl_start_time'], 'end' => $event_details['_epl_end_time']), 'description' => epl_trunc($content_to_show == 'content' ? do_shortcode(get_the_content()) : get_the_excerpt(), $num_words_to_show), 'register_link_type' => $alt_regis_url == 1 ? $alt_regis_url : epl_get_element('_epl_cal_link_destination', $event_details, 0), 'register_link' => epl_get_element('_epl_cal_link_destination', $event_details, 0) == 0 ? $this->get_the_register_button(get_the_ID(), true, array('for' => $for)) : get_permalink(), 'title' => $t, 'current_month' => $c_month, 'from' => $from, 'to' => $to, 'to' => $to, 'exclude_past_events' => $exclude_past_events, 'term_list' => substr(array_reduce((array) epl_object_to_array(get_the_terms(get_the_ID(), 'epl_event_categories')), create_function('$t,$_terms', '$t .= "{$_terms["slug"]},"; return $t;')), 0, -1)), $for, $d);
         $new = false;
         //echo "<pre class='prettyprint'>" . __LINE__ . "> " . print_r($d, true). "</pre>";
     }
     wp_reset_query();
     ksort($d);
     $num_events_to_show = epl_get_element('num_events_to_show', $args, '');
     if ($num_events_to_show != '' && $for == 0) {
         $d = array_slice($d, 0, $num_events_to_show);
     }
     return $d;
 }