function regis_form($values = null, $primary_only = false, $show_cc_form = true, $show_new_user_form = true, $meta = array()) { global $event_details, $epl_error, $email_regis_form; $email_regis_form = ''; if (epl_is_empty_array($event_details)) { $this->ecm->setup_event_details((int) $_REQUEST['event_id']); } $data = array(); $data['forms'] = ''; $action = epl_get_element('epl_action', $_GET); if ($this->mode == 'edit') { //not overview $_data = apply_filters('epl_regis_form_edit_mode', $_REQUEST); $this->_set_relevant_data(); $this->set_event_capacity_info(); // $this->ok_to_proceed(); //Are there available spaces for the dates, times, prices in the cart? $this->event_snapshot(); } if (epl_regis_flow() == 2 && $action == 'regis_form' || $this->mode == 'overview' && $action == 'show_cart_overview' || $action == 'payment_page') { //overview mode comes after user enters their info in the fields and submits if ($_GET['epl_action'] != 'payment_page') { //$this->_set_relevant_data( '_attendee_info', $_POST ); //from the regis form, add to session //$this->add_registration_to_db( $this->current_data ); //create the record } $data['cc_form'] = ''; if ($this->has_selected_cc_payment() && $show_cc_form && !epl_is_zero_total() && !epl_is_waitlist_flow()) { $_f = epl_cc_billing_fields(); $gateway_info = $this->get_gateway_info(); $accepted_cards = (array) $gateway_info['_epl_accepted_cards']; //Temp solution foreach ($_f['epl_cc_billing_fields']['_epl_cc_card_type']['options'] as $k => $v) { if (!in_array($k, $accepted_cards)) { unset($_f['epl_cc_billing_fields']['_epl_cc_card_type']['options'][$k]); } } $_field_args = array('section' => $_f['epl_cc_billing_fields'], 'fields_to_display' => array_keys($_f['epl_cc_billing_fields']), 'meta' => array('_view' => 0, '_type' => 'ind', 'value' => $_POST)); $data['_f'] = $this->epl_util->render_fields($_field_args); if ($this->has_selected_cc_payment(null, true) == '_stripe') { $egm = $this->epl->load_model('epl-gateway-model'); $data['cc_form'] = $egm->setup_stripe_form(); } else { $data['cc_form'] = $this->epl->load_view($this->dest . '/registration/regis-cc-form', $data, true); } } } $this->num_events_in_cart = 0; if (is_null($values)) { $values = $this->get_cart_values('_events'); } else { $values = $values['_events']; } if (empty($values)) { return $this->epl_util->epl_invoke_error(20); } $r = ''; $data['forms'] .= $this->get_user_list_dd(); //$events = array_keys( $values['_epl_start_date'] ); //if ( epl_sc_is_enabled() && epl_get_num_events_in_cart() > 1 ) { $is_waitlist = !empty($meta['waitlist_flow']) || epl_is_waitlist_flow(); if (version_compare(epl_regis_plugin_version(), '1.4', '>=') && epl_sc_is_enabled() && epl_get_setting('epl_sc_options', 'epl_sc_forms_to_use') == 1) { if (!$primary_pulled) { $data['forms'] .= $this->get_registration_forms(array('scope' => $is_waitlist ? 'waitlist' : 'ticket_buyer', 'process' => 'esc', 'forms' => 'epl_sc_primary_regis_forms', 'price_name' => '', 'date_display' => '', 'price_id' => null)); $data['forms'] .= $this->get_new_user_form($show_new_user_form); $primary_pulled = true; } $_cart = $this->get_cart_values('_dates'); $attendee_forms = epl_get_setting('epl_sc_options', 'epl_sc_addit_regis_forms'); if (!epl_is_empty_array($attendee_forms) && !epl_is_waitlist_flow()) { foreach ((array) $_cart['_att_quantity'] as $event_id => $quantities) { if (!isset($values[$event_id])) { continue; } setup_event_details($event_id); $reset_count = true; foreach ($quantities as $price_id => $qty) { $attendee_qty = is_array($qty) ? array_sum($qty) : $qty; if ($attendee_qty > 0) { $data['forms'] .= $this->get_registration_forms(array('scope' => 'regis_forms', 'event_id' => $event_id, 'process' => 'esc', 'forms' => 'epl_sc_addit_regis_forms', 'attendee_qty' => $attendee_qty, 'price_id' => $price_id, 'date_display' => '', 'reset_count' => $reset_count, 'price_name' => $event_details['_epl_price_name'][$price_id])); $reset_count = false; } } } } } else { $primary_pulled = false; $_cart = $this->get_cart_values('_dates'); $this->pulling_forms = 'pri'; $this->num_events_in_cart = count($values); foreach ($values as $event_id => $event_dates) { if (!empty($meta['event_id']) && $meta['event_id'] != $event_id) { continue; } setup_event_details($event_id); //display the ticket purchaser form. //we need to combine primary forms so the info is only displayed once. if (!$primary_pulled) { $data['forms'] .= $this->get_registration_forms(array('scope' => $is_waitlist ? 'waitlist' : 'ticket_buyer', 'event_id' => $event_id, 'process' => 'non_esc', 'forms' => '_epl_primary_regis_forms', 'price_name' => '', 'date_display' => '', 'price_id' => null)); //$primary_pulled = true; } } $data['forms'] .= $this->get_new_user_form($show_new_user_form); $this->pulling_forms = 'att'; //if ( !$primary_only ) { if (!epl_is_waitlist_flow()) { foreach ($values as $event_id => $event_dates) { //if ( epl_is_empty_array( epl_get_element( '_epl_addit_regis_forms', $event_details ) ) ) // continue; setup_event_details($event_id); foreach ((array) $_cart['_att_quantity'][$event_id] as $price_id => $qty) { $attendee_qty = is_array($qty) ? array_sum($qty) : $qty; if ($attendee_qty > 0) { $data['forms'] .= $this->get_registration_forms(array('scope' => 'regis_forms', 'event_id' => $event_id, 'process' => 'non_esc', 'forms' => '_epl_addit_regis_forms', 'attendee_qty' => $attendee_qty, 'price_id' => $price_id, 'date_display' => '', 'price_name' => $event_details['_epl_price_name'][$price_id])); } } } //$data['forms'] .= $this->get_registration_forms( array( 'scope' => 'regis_forms', 'event_id' => $event_id, 'forms' => '_epl_addit_regis_forms', 'attendee_qty' => $attendee_qty ) ); //$r .= $thiis->epl->load_view( 'front/registration/regis-page', $data, true ); } } //TODO - temp solution $egm = $this->epl->load_model('epl-gateway-model'); $data['redirect_form_data'] = $egm->get_redirect_form_data(); $r = $this->epl->load_view($this->dest . '/registration/regis-page', $data, true); return $r; }
<?php $_style = 'style="clear:both;width:100%;margin:10px auto;border:1px solid #eee"'; $_t = get_the_regis_dates_times_prices(); echo str_replace('class="epl_dates_times_prices_table"', $_style, $_t); ?> </div> </div> <div class="" style="margin:10px auto;border:1px solid #eee;padding: 10px;"> <?php if (isset($payment_details) && $payment_details != '' && !epl_is_free_event() && !epl_is_zero_total()) { echo $payment_details; } ?> <?php global $email_regis_form; echo $email_regis_form; ?> </div> </td> </tr>
<strong style="float:right">On <?php echo $regis_date; ?> </strong> <div class="clear"></div> <?php $r = get_the_regis_dates_times_prices($regis_post_id); echo $r; ?> <table class="epl_payment_details_table"> <tbody> <?php if ($payment_instructions != '' && !epl_is_zero_total() && !epl_is_free_event()) { echo $payment_instructions; } ?> <tr> <td><?php epl_e('Total'); ?> </td> <td><?php echo get_the_regis_total_amount(); ?> </td> </tr>
<?php if ($mode != 'overview' && epl_get_regis_setting('epl_enable_donation') == 10 || $mode == 'overview' && epl_get_element_m('donation_amount', 'money_totals', $cart_data['cart_totals'], 0) > 0) { ?> <div id="epl_donation_wrapper" class="epl_section epl_ov_a epl_ta_r"> <?php echo epl__('Donation') . ": " . $cart_data['donation_field']; ?> </div> <?php } ?> <?php if (!epl_is_zero_total()) { ?> <div id="epl_cart_totals_wrapper" class=""> <div> <?php echo $cart_data['cart_grand_totals']; ?> </div> <?php if ($mode != 'overview') { ?> <a href="#" id="calculate_total_due" class="epl_button_small epl_fr"><?php epl_e('Update Total'); ?>
function set_next_step_vars($current_step = null) { //$bt = debug_backtrace(); //echo "<pre class='prettyprint'>" . __LINE__ . "> " . print_r($bt[0]['line'], true). "</pre>"; //echo "<pre class='prettyprint'>" . __LINE__ . "> " . print_r($bt[0]['function'], true). "</pre>"; /* * - if on regis form and offline or free, thank you * - if regis form and cc or pp, overview * - if overview and cc, show card form, complete * - if overview and pp, continue * - if overview and offline, complete * * - if epl_regis_flow() and regis form -> payment -> complete * - if epl_regis_flow() and regis form and free of offline -> complete */ global $epl_current_step; $regis_flow_steps = array(1 => 'show_cart', 5 => 'regis_form', 10 => 'show_cart_overview', 30 => 'redirect', 100 => 'thank_you_page'); $this->steps = array('show_cart' => array(1 => array('next' => 'regis_form', 'next_label' => epl__('Attendee Information')), 2 => array('next' => 'regis_form', 'next_label' => epl__('Attendee Information'))), 'regis_form' => array(1 => array('prev' => 'show_cart', 'next' => 'show_cart_overview', 'next_label' => epl__('Overview')), 2 => array('prev' => 'show_cart', 'next' => 'thank_you_page', 'next_label' => epl__('Confirm and Complete')), 10 => array('next' => 'thank_you_page', 'next_label' => epl__('Confirm and Complete'))), 'show_cart_overview' => array(1 => array('prev' => 'regis_form', 'next' => 'thank_you_page', 'next_label' => epl__('Confirm and Complete')), 2 => array('prev' => 'regis_form', 'next' => 'show_cart_overview', 'next_label' => epl__('Confirm and Complete')), 10 => array('prev' => 'show_cart', 'next' => 'thank_you_page')), 'payment_page' => array(1 => array('prev' => 'regis_form', 'next' => 'payment_page', 'next_label' => epl__('Overview')), 2 => array('prev' => 'regis_form', 'next' => 'payment_page', 'next_label' => epl__('Confirm and Complete')), 10 => array('next' => 'thank_you_page', 'next_label' => epl__('Confirm and Complete')))); $flow = epl_regis_flow(); $this->step_data = array(); $gateway_info = $this->erm->get_gateway_info(); $url_vars_next = $url_vars_prev = array('epl_action' => $this->steps[$current_step][$flow]['next'], 'cart_action' => false, '_date_id' => false); $url_vars_prev['epl_action'] = epl_get_element('prev', $this->steps[$current_step][$flow]); $this->step_data['form_action'] = add_query_arg($url_vars_next, $this->url); $gw_check = false; if ($flow == 1 && $epl_current_step == 'show_cart_overview') { $gw_check = true; } elseif (($flow == 2 || $flow == 10) && $epl_current_step == 'regis_form') { $gw_check = true; } if ($epl_current_step != 'process_cart_action' && $epl_current_step != 'show_cart') { $this->step_data['prev_step_url'] = add_query_arg($url_vars_prev, $this->url); } $this->step_data['next_step'] = $this->steps[$current_step][$flow]['next']; $this->step_data['next_step_label'] = $this->steps[$current_step][$flow]['next_label']; if (epl_is_free_event() || epl_regis_flow() < 10 && epl_is_zero_total() || $this->erm->has_selected_offline_payment() || epl_is_waitlist_flow() && !epl_is_waitlist_approved()) { $this->step_data['next_step_label'] = apply_filters('epl_show_cart_overview_free_next_step_label', $this->steps[$current_step][$flow]['next_label']); } elseif (epl_get_element('_epl_pay_type', $gateway_info) == '_pp_exp' && $gw_check) { $url_vars_next = array('epl_action' => 'payment_page', 'cart_action' => false, '_date_id' => false); $url_vars_prev['epl_action'] = $this->steps[$current_step][$flow]['prev']; $this->step_data['form_action'] = add_query_arg($url_vars_next, $this->url); $this->step_data['next_step_label'] = apply_filters('epl_show_cart_overview_pp_exp_next_step_label', epl__('Confirm and Continue to PayPal')); } elseif (epl_get_element('_epl_pay_type', $gateway_info) == '_payson' && $gw_check) { $url_vars_next = array('epl_action' => 'payment_page', 'cart_action' => false, '_date_id' => false); $url_vars_prev['epl_action'] = $this->steps[$current_step][$flow]['prev']; $this->step_data['form_action'] = add_query_arg($url_vars_next, $this->url); $this->step_data['next_step_label'] = apply_filters('epl_show_cart_overview_pp_exp_next_step_label', epl__('Continue to Pay')); } elseif (epl_get_element('_epl_pay_type', $gateway_info) == '_moneris' && $gw_check) { $this->step_data['next_step_label'] = apply_filters('epl_show_cart_overview_pp_exp_next_step_label', epl__('Continue to Pay')); $us_version = epl_get_element('_epl_moneris_country', $gateway_info, 'ca') == 'usa'; $this->step_data['form_action'] = 'https://www3.moneris.com/HPPDP/index.php'; if ($gateway_info['_epl_sandbox'] == 10) { $this->step_data['form_action'] = 'https://esqa.moneris.com/HPPDP/index.php'; } if ($us_version) { $this->step_data['form_action'] = 'https://esplus.moneris.com/DPHPP/index.php'; if ($gateway_info['_epl_sandbox'] == 10) { $this->step_data['form_action'] = 'https://esplusqa.moneris.com/DPHPP/index.php'; } $this->egm->setup_moneris_form_USA(); } else { $this->egm->setup_moneris_form(); } } elseif (epl_get_element('_epl_pay_type', $gateway_info) == '_auth_net_sim' && $gw_check) { $this->step_data['next_step_label'] = apply_filters('epl_show_cart_overview_pp_exp_next_step_label', epl__('Continue to Pay')); $this->step_data['form_action'] = 'https://secure.authorize.net/gateway/transact.dll'; if ($gateway_info['_epl_sandbox'] == 10) { $this->step_data['form_action'] = 'https://test.authorize.net/gateway/transact.dll'; } $this->egm->setup_authnet_sim_form(); } elseif ($this->erm->has_selected_cc_payment() && ($gw_check || $this->error)) { $url_vars_next = array('epl_action' => 'payment_page', 'cart_action' => false, '_date_id' => false); $this->step_data['form_action'] = add_query_arg($url_vars_next, $this->url); $this->step_data['next_step_label'] = apply_filters('epl_show_cart_overview_cc_next_step_label', $this->steps[$current_step][$flow]['next_label']); } $this->step_data = apply_filters('epl_front__set_next_step_vars__final', $this->step_data, $flow); return $this->step_data; }
<?php echo epl_get_formatted_curr($balance, null, true); $show_pay_now = epl_get_setting('epl_registration_options', '_epl_enable_pay_now_link', 10) == 10; $show_pay_now = apply_filters('epl_show_pay_now_link', $show_pay_now); if ($balance > 0 && $show_pay_now) { echo ' ' . epl_anchor(epl_get_waitlist_approved_url(true, 'p'), epl__('Pay Now'), null); } ?> </td> </tr> <?php $payment_data = epl_get_regis_payments(); if (!empty($payment_data) && !epl_is_zero_total()) { if (count($payment_data) > 0) { ?> <tr> <td colspan="2" style="text-align: center;font-weight: bold;"><?php epl_e('Completed Payments'); ?> </td> </tr> <?php } $total_paid = 0; foreach ($payment_data as $time => $p) { $payment_display = epl_format_string(get_post_meta($p['_epl_payment_method'], '_epl_pay_display', true)); $total_paid += $p['_epl_payment_amount'];