function epl_column_data($column_name, $post_ID) { global $epl_fields, $event_details, $event_snapshot; $this->ecm->setup_event_details($post_ID); $this->erm->event_snapshot($post_ID); switch ($column_name) { case 'id': echo $post_ID; break; case 'location': echo get_the_location_name(); break; case 'status': $s = epl_get_event_status(true); $class = 'status_' . key($s); echo "<span class='status {$class}'>" . current($s) . '</span>'; break; /* case 'epl_categories': foreach ( wp_get_object_terms( $id, 'epl_categories' ) as $tax ) $r[] = $tax->name; echo!is_array( $r ) ? '' : implode( ", ", $r ); break; */ /* case 'epl_categories': foreach ( wp_get_object_terms( $id, 'epl_categories' ) as $tax ) $r[] = $tax->name; echo!is_array( $r ) ? '' : implode( ", ", $r ); break; */ case 'start_date': $base_url = epl_get_url(); $event_regis_data = current($event_snapshot); $table_link_arr = array('epl_action' => 'view_names', 'epl_download_trigger' => 1, 'table_view' => 1, 'epl_controller' => 'epl_report_manager', 'event_id' => $event_id); $csv_link_arr = array('epl_action' => 'epl_attendee_list', 'epl_download_trigger' => 1, 'epl_controller' => 'epl_registration', 'event_id' => $event_id); if (epl_is_empty_array($event_regis_data)) { break; } $counter = 1; foreach ($event_regis_data as $date_id => $date_data) { $last_day = end($event_details['_epl_start_date']); if ($last_day > EPL_DATE && ($event_details['_epl_event_status'] == 1 && $date_data['date']['timestamp'] < EPL_DATE) || $counter > 1) { continue; } $counter++; $date = $date_data['date']['disp']; $date_capacity = epl_get_element_m($date_id, '_epl_date_capacity', $event_details); $times = $date_data['time']; ?> <table id="event_snapshot_table" class="event_snapshot_sorting"> <thead> <tr> <th><?php epl_e('Date'); ?> </th> <th><?php epl_e('Time'); ?> </th> <th><?php epl_e('Attendees'); ?> </th> <th></th> </tr> </thead> <?php foreach ($times as $time_id => $time_data) { if (epl_is_date_level_time() && !epl_is_empty_array($date_specifc_time) && (!isset($date_specifc_time[$time_id]) || !isset($date_specifc_time[$time_id][$date_id]))) { continue; } $time_capacity = epl_get_element_m($time_id, '_epl_time_capacity', $event_details); $capacity = $time_capacity ? $time_capacity : ($date_capacity ? $date_capacity : epl_get_element_m($date_id, '_epl_date_per_time_capacity', $event_details)); $dt_array = array('date_id' => $date_id, 'time_id' => $time_id, 'event_id' => $post_ID); $table_link_arr = array_merge($table_link_arr, $dt_array); $csv_link_arr += $dt_array; ?> <tr class="epl_date_time"> <td><?php echo date_i18n('D M d, Y', epl_get_date_timestamp(epl_get_element($date_id, $event_details['_epl_start_date']))); ?> </td> <?php if (epl_is_time_optonal()) { ?> <td colspan="1"> - </td> <?php } else { ?> <td><?php echo $time_data['disp']; ?> </td> <?php } ?> <td><?php echo $time_data['regis']; ?> / <?php echo $capacity ? $capacity : '∞'; ?> </td> <td> <?php echo epl_anchor(add_query_arg(array_merge($table_link_arr, $dt_array) + array('names_only' => 1), $base_url), epl__('View Attendees'), null, 'class="epl_view_attendee_list_table button-secondary"'); $table_link_arr['epl_action'] = 'epl_attendee_list'; $table_link_arr['epl_controller'] = 'epl_registration'; echo epl_anchor(add_query_arg($table_link_arr, $base_url), epl__('View Full Data'), null, 'class="epl_view_attendee_list_table button-secondary"'); echo epl_anchor(add_query_arg(array_merge($csv_link_arr, $dt_array), $base_url), epl__('Export CSV'), null, 'class="button-secondary"'); //echo epl_anchor( $_SERVER['PHP_SELF'] . '&epl_action=epl_event_snapshot&event_id=' . $post->ID, epl__( 'Snapshot' ), '_blank', "class='epl_event_snapshot' data-event_id = '" . $post->ID . "'" ); ?> </td> </tr> <?php } } ?> </table> <?php break; default: break; case 'actions': $url_vars = array('epl_action' => 'duplicate_event', 'event_id' => $post_ID); $url = add_query_arg($url_vars, epl_get_url()); echo " <a href='epl_action=duplicate_event&event_id={$post_ID}'><img src='" . EPL_FULL_URL . "images/status_online.png' title='" . epl__('Attendees') . "' alt='" . epl__('Attendees') . "' /></a>"; echo " <a href='epl_action=duplicate_event&event_id={$post_ID}'><img src='" . EPL_FULL_URL . "images/doc_excel_csv.png' title='" . epl__('Attendees') . "' alt='" . epl__('Attendees') . "' /></a>"; break; } // end switch }
//location id is stored in $event_details['_epl_event_location'] ?> <?php if ($event_details['_epl_event_location']) { ?> <div class ="event_location"> <h4>Location</h4> <a href="<?php echo get_permalink($event_details['_epl_event_location']); ?> " title="<?php echo get_the_location_name(); ?> "> <?php echo get_the_location_name(); ?> </a><br /> <?php echo get_the_location_address(); ?> <br /> <?php echo get_the_location_city(); ?> <br> <?php echo get_the_location_state(); ?> <br> <?php echo get_the_location_zip();
$event_tooltip = " <span class='tip event_tooltip' title='" . $event_excerpt . "'>i</span>"; } $event_title = "<a href =" . get_the_register_button($event_id, true) . ' title="' . get_the_title() . '">' . get_the_title() . "</a>"; if ($event_details['_epl_title_link_destination'] == 0) { $event_title = '<a href =' . get_permalink() . ' title="' . get_the_title() . '">' . get_the_title() . '</a>'; } $event_categories = strip_tags(get_the_term_list($event_id, 'epl_event_categories', '', ',', '')); $event_participation = $event_details['_epl_participation']; $event_ages = epl_get_element('_epl_ages', $event_details, array()); $event_dow = date_i18n("D", $date); $event_dom = date_i18n("m/j/Y", $date); $end_time = $event_details['_epl_end_time'][$time_id]; $event_venue_title = get_the_location_name(); $loc_id = epl_get_element_m($date_id, '_epl_date_location', $event_details, epl_get_event_property('_epl_event_location', true) > 0); the_location_details($loc_id); $event_venue_title = get_the_location_name() . ' ' . get_the_location_gmap_icon('See Map'); $time_capacity = epl_get_element_m($time_id, '_epl_time_capacity', $event_details); $capacity = $time_capacity ? $time_capacity : ($date_capacity ? $date_capacity : epl_get_element_m($date_id, '_epl_date_per_time_capacity', $event_details)); $counts_day_key = $event_id . "_date_{$date_id}"; $num_regis = epl_get_element('_total_att_' . $counts_day_key, $counts, 0); $counts_time_key = $event_id . "_time_{$date_id}_{$time_id}"; //if ( $capacity !== false && isset( $counts['_total_att_' . $counts_time_key] ) ) { $num_regis = epl_get_element('_total_att_' . $counts_time_key, $counts, 0); //} $avail = $capacity - $num_regis; $regis_button_args = array('_date_id' => $date_id, '_time_id' => $time_id, 'event_id' => $event_id); $temp_table_row = array(); $temp_table_row['title'] = '<td>' . $event_title . '</td>'; $temp_table_row['day_of_week'] = '<td>' . $event_dow . '</td>'; $temp_table_row['date'] = '<td>' . $event_dom . '</td>'; $temp_table_row['time'] = '<td>' . $time . epl_prefix('-', $end_time) . '</td>';
<?php } ?> </div> <div class="epl_date_extra"> <?php if (epl_get_element('_epl_date_location', $event_details) && $event_details['_epl_date_location'][$date_id] != '') { ?> <?php the_location_details($event_details['_epl_date_location'][$date_id]); //sets up the location info $map_text = apply_filters('epl_get_the_location_gmap_icon_text_cart_dates', epl__('See Map')); echo epl__('Location') . ': ' . get_the_location_name() . ' ' . get_the_location_address() . ' ' . get_the_location_city() . ' ' . get_the_location_state() . ' ' . get_the_location_zip(); ?> <?php } ?> </div> <?php if (isset($time[$date_id])) { ?> <div class="epl_ind_time_wrapper"> <?php epl_e('Time'); ?> <?php echo $time[$date_id];
continue; } $event_excerpt = get_the_excerpt(); $event_tooltip = ''; if ($event_excerpt !== '') { $event_tooltip = " <span class='tip event_tooltip' title='" . $event_excerpt . "'>i</span>"; } //$event_title = epl_anchor($event_details['_epl_link'],get_the_title(),'_self','class="event_link"'); $event_title = get_the_title(); $event_categories = strip_tags(get_the_term_list($event_id, 'epl_event_categories', '', ',', '')); $event_participation = $event_details['_epl_participation']; $event_ages = epl_get_element('_epl_ages', $event_details, array()); $event_dow = date_i18n("D", $date); $event_dom = date_i18n("m/j/Y", $date); $end_time = $event_details['_epl_end_time'][$time_id]; $event_venue_title = get_the_location_name(); $boat_number = "Boat " . epl_get_element('_epl_boat_no', $event_details); $event_personnel_name = "Leland"; //$event_ages_range = ageRange2( $event_ages ); $time_capacity = epl_get_element_m($time_id, '_epl_time_capacity', $event_details); $capacity = $time_capacity ? $time_capacity : ($date_capacity ? $date_capacity : epl_get_element_m($date_id, '_epl_date_per_time_capacity', $event_details)); $num_regis = 0; $counts_day_key = $event_id . "_time_{$date_id}"; $counts_time_key = $event_id . "_time_{$date_id}_{$time_id}"; if (isset($counts['_total_att_' . $counts_time_key])) { $num_regis = epl_get_element('_total_att_' . $counts_time_key, $counts, 0); } $money_total = epl_get_formatted_curr(epl_get_element('_money_total_' . $counts_time_key, $money_totals, 0.0)); $avail -= $num_regis; if ($avail <= 0) { $open_spots = "<span class='spots_closed'>Sold Out</span>";
</span> <?php } ?> </div> <div class="epl_date_extra"> <?php if (epl_get_setting('epl_event_options', 'epl_date_note_enable') == 10) { echo epl_get_element($date_id, epl_get_element('_epl_date_note', $event_details)); } if (epl_get_element('_epl_date_location', $event_details) && $event_details['_epl_date_location'][$date_id] != '') { the_location_details($event_details['_epl_date_location'][$date_id]); //sets up the location info $map_text = apply_filters('epl_get_the_location_gmap_icon_text_cart_dates', epl__('See Map')); echo epl__('Location') . ': ' . get_the_location_name() . ' ' . get_the_location_address() . ' ' . get_the_location_city() . ' ' . get_the_location_state() . ' ' . get_the_location_zip() . ' ' . get_the_location_gmap_icon($map_text); } ?> </div> <?php if (isset($time[$date_id])) { ?> <div class="epl_ind_time_wrapper"> <?php epl_e('Time'); ?> <?php echo $time[$date_id]; ?> </div>
function notif_tags($email_body, $data) { global $event_details, $system_email_tags, $email_regis_form; if ($this->regis_id == '') { return null; } $email_body = nl2br(stripslashes_deep(html_entity_decode($email_body, ENT_QUOTES))); $regis_meta = $this->ecm->setup_regis_details($this->regis_id); $reigs_id = $regis_meta['__epl']['_regis_id']; $event_id = key($regis_meta['__epl'][$reigs_id]['_events']); //find the list of all forms $available_forms = $this->ecm->get_list_of_available_forms(); $available_fields = $this->ecm->get_list_of_available_fields(); $attendee_info = $regis_meta['__epl'][$reigs_id]['_attendee_info']; $_attendee_info = array(); foreach ($attendee_info as $_f_id => $_att_data) { if (!isset($available_fields[$_f_id])) { continue; } //$_attendee_info[$_f_id] = epl_get_element( 0, epl_get_element( $event_id, $_att_data ) ); $value = epl_get_element(0, $_att_data, false); if (!$value) { $value = epl_get_element(0, epl_get_element($event_id, $_att_data)); } $input_type = epl_get_element('input_type', $available_fields[$_f_id]); if ($input_type == 'select' || $input_type == 'radio') { $field_choice_text = epl_get_element($value, $available_fields[$_f_id]['epl_field_choice_text'], null); $value = $field_choice_text && $field_choice_text != '' ? $field_choice_text : $value; } elseif ($input_type == 'checkbox') { $value = implode(',', (array) $value); } else { //TODO - eek, find a better way $value = html_entity_decode(htmlspecialchars_decode($value, ENT_QUOTES)); } $_attendee_info[$_f_id] = $value; } $event_ticket_buyer_forms = array_flip((array) $event_details['_epl_primary_regis_forms']); $gateway_info = array(); if (!epl_is_free_event()) { $gw_id = $this->erm->get_payment_profile_id(); $gateway_info = $this->ecm->get_post_meta_all($gw_id); } $data['payment_instructions'] = $this->epl->load_view('front/registration/regis-payment-instr', array('gateway_info' => $gateway_info), true); $data['payment_details'] = $this->epl->load_view('front/registration/regis-payment-details', $data, true); $registration_detail_link = add_query_arg(array('epl_token' => epl_get_token()), get_permalink($this->regis_id)); $_system_email_tags = array('registration_id' => get_the_regis_id(), 'registration_detail_link' => '<a href="' . $registration_detail_link . '" target="_blank" alt="' . epl__('Registration Detail Link') . '">' . epl__('Click here') . '</a>', 'event_name' => get_the_title($event_id), 'registration_details' => str_replace('class="epl_dates_times_prices_table"', 'style="clear:both;width:100%;margin:10px auto;border:1px solid #eee"', get_the_regis_dates_times_prices($data['post_ID'])), 'registration_form_data' => $email_regis_form, 'payment_details' => str_replace('class="epl_payment_details_table"', 'style="clear:both;width:100%;margin:10px auto;border:1px solid #eee"', $data['payment_details']), 'waitlist_approved_link' => epl_anchor(epl_get_waitlist_approved_url(), epl__('Register')), 'waitlist_approved_until' => epl_waitlist_approved_until(), 'event_details_link' => epl_anchor(get_permalink($event_details['ID']), get_the_title($event_details['ID'])), 'location_details' => !epl_is_multi_location() && epl_get_event_property('_epl_event_location', true) > 0 ? epl_suffix(', ', get_the_location_name()) . epl_suffix(', ', get_the_location_address() . ' ' . get_the_location_address2()) . get_the_location_city() . ' ' . get_the_location_state() . ' ' . get_the_location_zip() : '', 'location_map_link' => get_the_location_gmap_icon(epl__('Click here'), true)); $_system_email_tags = apply_filters('epl_system_email_tags', $_system_email_tags); //isolate the forms that are selected inside the event // $ticket_buyer_forms = array_intersect_key( $available_forms, $event_ticket_buyer_forms ); /* $tickey_buyer_fields = array( ); foreach ( $ticket_buyer_forms as $_form_id => $_form_info ) $tickey_buyer_fields += $_form_info['epl_form_fields']; */ preg_match_all('/(?<=\\{)(.*?)(?=\\})/', $email_body, $matches); $_tags_in_body = array_flip(epl_get_element(0, $matches, array())); $_field_input_tags = array(); foreach ($available_fields as $f_id => $f_data) { $_field_input_tags[$f_data['input_slug']] = $f_id; } $tagss = array_intersect_key($_field_input_tags, $_tags_in_body); $final_tags = array(); foreach ($tagss as $k => $v) { $final_tags[$k] = epl_get_element($v, $_attendee_info); } $final_tags += $_system_email_tags; $find = array_keys($final_tags); array_walk($find, create_function('&$val', '$val = "{".$val."}";')); $replace = array_values($final_tags); return str_ireplace($find, $replace, $email_body); }