예제 #1
0
 function send_confirmation_email($data)
 {
     global $organization_details, $customer_email, $event_details;
     $data['eb'] = '';
     $default_email_body = $this->epl->load_view('front/registration/regis-confirm-email', $data, true);
     $_notif = epl_get_element('_epl_event_notification', $event_details);
     $_notif_data = array();
     if ($_notif && (!epl_is_empty_array($_notif) || $_notif != '')) {
         $id = is_array($_notif) ? current($_notif) : $_notif;
         $_notif_data = get_post($id, ARRAY_A) + (array) $this->ecm->get_post_meta_all($id);
         $data['eb'] = nl2br($this->notif_tags(stripslashes_deep(html_entity_decode($_notif_data['post_content'], ENT_QUOTES))));
     }
     if (epl_is_empty_array($_notif) || $_notif == '' || epl_get_element('_epl_notification_replace', $event_details, 0) == 0) {
         $email_body = $this->epl->load_view('front/registration/regis-confirm-email', $data, true);
     } else {
         $email_body = $data['eb'];
     }
     $email_body = preg_replace('/<div class=\'epl_(.*?)_message\'>(.*?)<\\/div>/', '', $email_body);
     $from_name = html_entity_decode(epl_get_element('_epl_email_from_name', $_notif_data, get_bloginfo('name')), ENT_QUOTES);
     $from_email = epl_get_element('_epl_from_email', $_notif_data, get_bloginfo('admin_email'));
     $subject = html_entity_decode(epl_get_element('_epl_email_subject', $_notif_data, epl__('Registration Confirmation')), ENT_QUOTES);
     $headers = "From: \"" . $from_name . "\" <{$from_email}> \r\n";
     $headers .= 'Reply-To: ' . $from_email . "\r\n";
     $headers .= 'X-Mailer: PHP/' . phpversion();
     $headers .= "MIME-Version: 1.0\r\n";
     $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
     if (isset($customer_email) && $customer_email != '') {
         @wp_mail($customer_email, $subject, $email_body, $headers);
     }
     //admin email
     $_email = epl_get_event_property('_epl_alt_admin_email');
     if ($_email == '') {
         $_email = epl_nz(epl_get_event_option('epl_default_notification_email'), get_bloginfo('admin_email'));
     }
     @wp_mail($_email, epl__('New Registration') . ': ' . get_the_event_title(), $default_email_body, $headers);
 }

<?php 
global $event_details;
foreach ($table_data as $event_id => $date_data) {
    setup_event_details($event_id);
    ?>
    <table class="epl_dates_times_prices_table" >
        <tr class="">
            <td><h2><?php 
    echo epl_format_string($event_details['post_title']);
    ?>
</h2></td>
            <td class="epl_w200">
                <?php 
    if (!epl_is_multi_location() && epl_get_event_property('_epl_event_location', true) > 0) {
        ?>
                    <div class="">

                        <?php 
        echo get_the_location_name();
        ?>
<br />
                        <?php 
        echo get_the_location_address();
        ?>
 <?php 
        echo get_the_location_address2();
        ?>
<br />
                        <?php 
                <?php 
    epl_e('Multiple locations');
    ?>

            <?php 
}
?>


        </div>


        <?php 
//organization id is stored in $event_details['_epl_event_organization']
if (epl_get_event_property('_epl_event_organization') != '') {
    ?>
            <div class ="event_organization">
                <span class="heading">Hosted By</span>
                <a href="<?php 
    echo get_permalink($event_details['_epl_event_organization']);
    ?>
" title="<?php 
    echo get_the_organization_name();
    ?>
"><?php 
    echo get_the_organization_name();
    ?>
</a><br />
                <?php 
    echo get_the_organization_address();
" href="<?php 
        echo $event['register_link'];
        ?>
">
                            <?php 
        echo $event['title'];
        ?>
                        </a>
                        <span style="display:none;" class="event_details_hidden"><?php 
        echo strip_tags($event['description'], '<img>');
        ?>
</span>
                    </div>

                    <?php 
        if (!is_null($loc_id = epl_get_element_m($event['date_id'], '_epl_date_location', $event_details, epl_get_event_property('_epl_event_location', true) > 0))) {
            ?>
                        <div class="location_details" style="text-align: right;">
                            <div class="event_location">
                                <?php 
            the_location_details($loc_id);
            echo get_the_location_name();
            ?>
                                <br />
                                <?php 
            echo get_the_location_address();
            ?>
<br />
                                <?php 
            echo get_the_location_address2() != '' ? get_the_location_address2() . '<br />' : '';
            ?>
 /**
  * Display the cart for the user or the admin to select the dates, times and prices
  *
  * long description
  *
  * @since 1.0.0
  * @param int $var
  * @return string
  */
 function show_cart($values = null)
 {
     //echo "<pre class='prettyprint'>" . print_r( $_SESSION, true ) . "</pre>";
     $this->_refresh_data();
     if (is_null($values)) {
         $events_in_cart = $this->get_cart_values('_events');
     } else {
         $events_in_cart = $values['_events'];
     }
     if (empty($events_in_cart)) {
         return $this->epl_util->epl_invoke_error(20);
     }
     $events_in_cart = $this->epl_util->clean_output($events_in_cart);
     global $event_details, $multi_time, $multi_price, $capacity, $current_att_count;
     $r = array();
     foreach ($events_in_cart as $event_id => $event_date) {
         if ($event_id != '') {
             $this->ecm->setup_event_details($event_id);
             $this->set_event_capacity_info();
             //if ( $event_details['_epl_event_available_space_display'] )
             if (epl_get_event_property('_epl_event_available_space_display') != 0) {
                 $r['available_spaces'][$event_id] = $this->capacity_table();
             }
             $multi_time = isset($event_details['_epl_multi_time_select']) && $event_details['_epl_multi_time_select'] == 10;
             $multi_price = isset($event_details['_epl_multi_price_select']) && $event_details['_epl_multi_price_select'] == 10;
             $r['cart_items'][$event_id]['title'] = $event_details['post_title'];
             $r['cart_items'][$event_id]['event_dates'] = $this->get_the_dates();
             //= $this->epl_util->create_element( $epl_fields );
             $r['cart_items'][$event_id]['event_time_and_prices'] = $this->get_time_and_prices_for_cart();
         }
     }
     if (epl_is_free_event()) {
         $r['free_event'] = 1;
         $r['cart_totals'] = null;
         $r['pay_options'] = null;
     } else {
         $r['cart_totals'] = $this->get_the_totals();
         $r['pay_options'] = $this->get_payment_options();
     }
     $r['view_mode'] = $this->mode;
     return $r;
 }
        ?>
                    <?php 
        echo get_the_attendee_list_link();
        ?>



                </div>



                <div class="clearfix"></div>

                <?php 
        //the more expandable box
        $d = epl_get_event_property('_epl_date_display_type', true);
        if ($d != 0) {
            ?>


                    <div class="expand_box_wrapper">
                        <div class="expand_trigger"><?php 
            epl_e('More');
            ?>
</div>
                        <div class="toggle_container">

                            <?php 
            $alt_text = epl_get_element('_epl_dates_alt_text', $event_details, '');
            if ($alt_text == '') {
                if ($d == 5) {
 $event_tooltip = '';
 if ($event_excerpt !== '') {
     $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>';
예제 #8
0
 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);
 }
예제 #9
0
            ?>
 <?php 
            echo get_the_location_zip();
            ?>
<br />
                            <?php 
            echo get_the_location_phone();
            ?>
<br />
                        </div>


                        <?php 
        }
        //organization id is stored in $event_details['_epl_event_organization']
        if (epl_nz(epl_get_event_property('_epl_display_org_info'), 10) != 0) {
            ?>

                        <div class ="event_organization">
                            <span class="heading">Hosted By</span>
                            <a href="<?php 
            echo get_permalink($event_details['_epl_event_organization']);
            ?>
" title="<?php 
            echo get_the_organization_name();
            ?>
"><?php 
            echo get_the_organization_name();
            ?>
</a><br />
                            <?php