function epl_check_token($v = null, $forec_check = false)
{
    if (epl_user_is_admin()) {
        return true;
    }
    if (epl_get_regis_setting('epl_regis_add_url_token') != 10) {
        return true;
    }
    if (!isset($_GET['epl_token'])) {
        return false;
    }
    return $_GET['epl_token'] == epl_get_token($v);
}
 function get_user_list_dd($regis_id = null, $user_id = null)
 {
     $show_user_list_dd = apply_filters('epl_erm__get_user_list_dd__show_user_list_dd', true);
     if (!$show_user_list_dd) {
         return null;
     }
     if (epl_is_waitlist_flow()) {
         return null;
     }
     if (epl_um_is_enabled() && epl_user_is_admin() && $this->mode == 'edit') {
         $user_id = $this->edbm->find_user_id_for_regis($regis_id, $user_id);
         $users = get_users('orderby=email');
         $user_dd_options = array();
         foreach ($users as $user) {
             if ($user->user_email == '') {
                 continue;
             }
             $user_dd_options[$user->ID] = $user->user_email . " ({$user->first_name} {$user->last_name})";
         }
         $params = array('input_type' => 'select', 'input_name' => 'user_id', 'id' => 'user_id', 'label' => epl__('User'), 'options' => $user_dd_options, 'style' => 'width:100%', 'empty_row' => true, 'description' => epl__('You can assign this registration to a member of your website.'), 'value' => $user_id);
         $params += (array) $this->overview_trigger;
         $data['user_list_dd'] = $this->epl_util->create_element($params);
         $r = $this->epl->load_view('admin/user-regis-manager/user-list-dd', $data, true);
         return $r;
     }
 }
 function delete_checkin_record()
 {
     global $wpdb;
     if (epl_user_is_admin()) {
         $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->epl_attendance} WHERE id=%d", $_POST['att_id']));
     }
 }
 function get_registration_details($post_id = null)
 {
     global $epl_current_step, $regis_details, $event_details;
     $epl_current_step = 'thank_you_page';
     $post_id = epl_nz($post_id, get_the_ID());
     $regis_meta = $this->setup_regis_details(get_the_ID());
     if (!epl_user_is_admin() && epl_check_token() === false) {
         @header('HTTP/1.0 404 Not Found');
         return "<div class='epl_error'>" . epl__('You have reached this page in error.') . "</div>";
     }
     $event_id = key((array) $regis_meta['_epl_events']);
     $event_meta = $this->setup_event_details($event_id);
     //$earm = $this->epl->load_model( 'epl-regis-admin-model' );
     $erm = $this->epl->load_model('epl-registration-model');
     $ercm = $this->epl->load_model('epl-recurrence-model');
     $data['event_id'] = $event_id;
     $regis_id = $regis_details['__epl']['_regis_id'];
     epl_do_messages($regis_details['__epl'][$regis_id]['_events']);
     $data['regis_status_id'] = get_the_regis_status(null, true);
     $erm->set_mode('overview')->setup_current_data($regis_meta);
     $data['cart_data'] = $erm->show_cart();
     $data['cart_data'] = $this->epl->load_view('front/registration/regis-cart-section', $data, true);
     $data['cart_totals'] = $erm->calculate_cart_totals();
     $redirect_to = apply_filters('epl_ecm__get_registration_details__redirect_to', '');
     if ($redirect_to != '') {
         wp_redirect($redirect_to, 301);
         die;
     }
     // $data['cart_totals'] = $this->epl->load_view( 'front/registration/regis-totals-section', $data, true );
     $payment_method_id = EPL_registration_model::get_instance()->get_payment_profile_id();
     if (!epl_is_free_event()) {
         $data['gateway_info'] = $this->get_post_meta_all($payment_method_id);
     }
     $data['payment_instructions'] = $this->epl->load_view('front/registration/regis-payment-instr', $data, true);
     $data['payment_details'] = $this->epl->load_view('front/registration/regis-payment-details', $data, true);
     //registration form
     $data['regis_form'] = $erm->regis_form(null, 'front/registration/');
     /* $ercm->hide_past = false;
        $d = $ercm->recurrence_dates_from_dates_section( );
        echo $this->epl_util->construct_calendar( $d ); */
     //the list of events
     $params = array('input_type' => 'select', 'input_name' => 'event_list_id', 'id' => 'event_list_id', 'label' => epl__('Event'), 'options' => $this->get_all_events());
     //echo "<pre class='prettyprint'>" . print_r($params, true). "</pre>";
     $data['fields'][] = $this->epl_util->create_element($params);
     $r = $this->epl->load_view('front/registration/regis-thank-you-page', $data, true);
     return $r;
 }
Пример #5
0
function epl_init_create_admin_menu($init)
{
    if (epl_is_addon_active('DASFERWEQREWE')) {
        $label = apply_filters('epl_my_registration_menu_label', epl__('My Registrations'));
        if (!epl_user_is_admin()) {
            add_menu_page($label, $label, 'read', 'epl_user_self_pages_manager', array($init, 'route'), EPL_FULL_URL . 'images/calendar.png');
        }
        add_submenu_page('edit.php?post_type=epl_event', epl__('User Check-in'), epl__('User Check-in'), 'manage_options', 'epl_user_regis_manager', array($init, 'route'));
    }
}
 function populate_db_tables($regis_id = null, $empty = true)
 {
     if (!epl_user_is_admin()) {
         return "Not Authorized";
     }
     $regis_id = is_null($regis_id) ? epl_get_element('regis_id', $_REQUEST, null) : null;
     $this->edbm->reset_tables();
     $this->edbm->populate_db_tables($regis_id);
     if (isset($_REQUEST['r'])) {
         update_option('_epl_last_table_refresh', current_time('mysql'));
         wp_redirect(admin_url('/edit.php?post_type=epl_event&page=epl_settings&tab=api-settings'));
     }
 }
/* custom event list loop */
if ($event_list->have_posts()) {
    while ($event_list->have_posts()) {
        $event_list->the_post();
        $event_id = get_the_ID();
        setup_event_details($event_id, false, true);
        $no_date = false;
        if (epl_is_empty_array($event_details['_epl_start_date'])) {
            $event_details['_epl_start_date'] = array(EPL_DATE);
            $no_date = true;
        }
        $ecm->get_current_att_count($event_id);
        $counts = $erptm->get_attendee_counts($event_id, true);
        $money_totals = $erptm->get_event_money_totals($event_id);
        $event_edit_link = '';
        if (epl_user_is_admin()) {
            $event_edit_link = epl_anchor(admin_url("post.php?post=" . get_the_ID() . "&action=edit"), get_the_title());
        }
        $date_specifc_time = epl_get_element('_epl_date_specific_time', $event_details, array());
        $_status = epl_get_event_status(true);
        $status_id = key($_status);
        $status = current($_status);
        $class = 'status_' . $status_id;
        $post_status = '';
        if ($event_details['post_status'] != 'publish') {
            $post_status = "<span class='epl_fr epl_font_bold epl_w50'>" . ucfirst($event_details['post_status']) . "</span>";
        }
        $formatted_status = "<span class='status {$class}'>&nbsp;&nbsp;</span>" . $post_status;
        foreach ($event_details['_epl_start_date'] as $date_id => $date) {
            $date = epl_get_date_timestamp($date);
            $temp_table_row = '';
<?php

if (!EPL_IS_ADMIN && EPL_DEBUG === true && epl_user_is_admin()) {
    ?>
    <pre id="epl_console" style=""></pre>
<?php 
}
?>
<div class="slide_down_box" id="slide_down_box">
    <div class="display">

    </div>
    <div class="incoming" style="display: none;"></div>
    <a href="#" id="dismiss_loader" class="epl_button_small" style=""><span class=""></span><?php 
epl_e('Close');
?>
</a>
</div>

<div id="epl_overlay" class="">
    <div></div>

</div>

<div id ="epl_loader">
    <img  src ="<?php 
echo EPL_FULL_URL;
?>
images/ajax-loader.gif" alt="loading..." />
</div>
<?php 
Пример #9
0
 function get_days_for_fc($args = array())
 {
     global $post;
     //page specific caching
     if (!epl_user_is_admin() && epl_get_setting('epl_fullcalendar_options', 'epl_fullcalendar_enable_cache', 10) == 10 && false !== ($fc_dates = get_transient('epl_transient__get_days_for_fc__' . $post->ID))) {
         // return $fc_dates;
     }
     $show_att_counts = intval(epl_get_setting('epl_fullcalendar_options', 'epl_fullcalendar_show_att_count', 0));
     if ($show_att_counts === 0) {
         $show_att_counts = epl_get_element('show_att_counts', $args) === true ? true : $show_att_counts;
     }
     if ($show_att_counts === 1 && !epl_user_is_admin()) {
         $show_att_counts = false;
     }
     if ($show_att_counts === 2 && !is_user_logged_in()) {
         $show_att_counts = false;
     }
     global $event_details;
     $events = $this->get_days_for_widget(3, $args);
     $show_first_date_only = apply_filters('epl__get_days_for_fc__', false);
     $event_bcg_color = epl_get_setting('epl_fullcalendar_options', 'epl_fullcalendar_tax_bcg_color');
     $event_font_color = epl_get_setting('epl_fullcalendar_options', 'epl_fullcalendar_tax_font_color');
     $r = array();
     $counter = 0;
     $date_sel_mode = false;
     //(epl_get_element( 'date_selector', $args, 0 ) == 1);
     foreach ($events as $date => $event_data) {
         $data['_event'] = $event_data;
         setup_event_details($event_data['event_id']);
         $c = $this->epl->load_view('front/tooltip/template-1', $data, true);
         $_t = explode(',', $event_data['term_list']);
         $bc = epl_get_element(current($_t), $event_bcg_color, '#ffffff');
         $tc = epl_get_element(current($_t), $event_font_color, 'blue');
         $_r = array('title' => $date_sel_mode ? 'Select' : $event_data['title'], 'raw_title' => $event_data['title'], 'description' => $date_sel_mode ? $this->erm->get_the_dates($event_data['date_id']) : $c, 'term_list' => $event_data['term_list'], 'start_timestamp' => $event_data['date'], 'start' => epl_formatted_date($event_data['date'], 'Y-m-d'), 'end_timestamp' => $event_data['end'], 'end' => epl_formatted_date($event_data['end'], 'Y-m-d'), 'url' => $date_sel_mode ? '' : $event_data['register_link'], 'edit_url' => get_edit_post_link(), 'backgroundColor' => $bc, 'borderColor' => $bc, 'textColor' => $tc, 'className' => $event_data['register_link_type'] == 1 ? 'epl-no-modal' : '', 'id' => $event_data['event_id']);
         $weekday = date('N', $event_data['date']);
         //if multiple times, display the event for each time.
         if (count($event_data['times']['start']) > 1 && !$date_sel_mode) {
             $_tmp_title = $_r['title'];
             $_tmp_url = $_r['url'];
             foreach ($event_data['times']['start'] as $time_id => $time) {
                 if ($time == '') {
                     continue;
                 }
                 if (epl_is_date_level_time()) {
                     if (epl_is_date_specific_time($time_id) && !isset($event_details['_epl_date_specific_time'][$time_id][$event_data['date_id']])) {
                         continue;
                     }
                 }
                 $weekday_specific = epl_get_element_m($time_id, '_epl_weekday_specific_time', $event_details, array());
                 if (!epl_is_empty_array($weekday_specific) && !isset($weekday_specific[$weekday])) {
                     continue;
                 }
                 //$_r['title'] = '<span class="epl_fc_title_time"> ' . $time . '</span>' . $_tmp_title;
                 $_r['title'] = $_tmp_title;
                 $_r['raw_title'] = $_tmp_title;
                 if ($show_att_counts) {
                     $_r['title'] .= ' ' . '<span style="background-color:red;color:#fff;padding:0 4px;white-space: nowrap;"> ' . epl_get_att_count(array('for' => 'time', 'date_id' => $event_data['date_id'], 'time_id' => $time_id, 'default' => 0));
                     $_r['title'] .= (epl_get_time_capacity($time_id) != '' ? ' / ' . epl_get_time_capacity($time_id) : '') . '</span>';
                     $_r['att_counts'] = epl_get_att_count(array('for' => 'time', 'date_id' => $event_data['date_id'], 'time_id' => $time_id, 'default' => 0));
                     $_r['att_counts'] .= epl_get_time_capacity($time_id) != '' ? ' / ' . epl_get_time_capacity($time_id) : '';
                 }
                 $_r['url'] = $date_sel_mode ? '' : add_query_arg(array('_time_id' => $time_id), $event_data['register_link']);
                 $tmp_key_for_sorting = strtotime($time, $event_data['date']);
                 if (isset($r[$tmp_key_for_sorting])) {
                     $tmp_key_for_sorting .= '.' . $counter;
                     $counter++;
                 }
                 $_r['start'] = epl_formatted_date(strtotime($time, $event_data['date']), 'Y-m-d H:i:s');
                 $_r['end'] = epl_formatted_date(strtotime($event_data['times']['end'][$time_id], $show_first_date_only ? $event_data['start'] : $event_data['end']), 'Y-m-d H:i:s');
                 //$_r['allDay'] = false;
                 $r[$tmp_key_for_sorting] = $_r;
                 //$r[] = $_r;
                 $counter++;
             }
             continue;
         } else {
             $time = current($event_data['times']['start']);
             //$_r['title'] = ($time != '' ? '<span class="epl_fc_title_time"> ' . $time . '</span>' : '') . $_r['title'];
             $_r['title'] = $_r['title'];
             if (epl_is_empty_array($event_data['times']['start'])) {
                 $_r['start'] = epl_formatted_date($event_data['date'] + 25200, 'Y-m-d H:i:s');
             } else {
                 $_r['start'] = epl_formatted_date(strtotime(current($event_data['times']['start']) . ' ', $event_data['date']), 'Y-m-d H:i:s');
             }
             if (epl_is_empty_array($event_data['times']['end'])) {
                 $_r['end'] = epl_formatted_date($event_data['end'] + 86399, 'Y-m-d H:i:s');
             } else {
                 $_r['end'] = epl_formatted_date(strtotime(current($event_data['times']['end']) . ' ', $show_first_date_only ? $event_data['start'] : $event_data['end']), 'Y-m-d H:i:s');
             }
             if ($show_att_counts) {
                 $_r['title'] .= ' ' . '<span style="background-color:red;color:#fff;padding:0 4px;white-space: nowrap;"> ' . epl_get_att_count(array('for' => 'date', 'date_id' => $event_data['date_id'], 'default' => 0));
                 $_r['title'] .= (epl_get_date_capacity($event_data['date_id']) != '' ? ' / ' . epl_get_date_capacity($event_data['date_id']) : '') . '</span>';
                 $_r['att_counts'] = epl_get_att_count(array('for' => 'date', 'date_id' => $event_data['date_id'], 'default' => 0));
                 $_r['att_counts'] .= epl_get_date_capacity($event_data['date_id']) != '' ? ' / ' . epl_get_date_capacity($event_data['date_id']) : '';
             }
         }
         $tmp_key_for_sorting = strtotime(current($event_data['times']['start']) . ' ', $event_data['date']);
         if (isset($r[$tmp_key_for_sorting])) {
             $tmp_key_for_sorting .= '.' . $counter;
             $counter++;
         }
         $_r['sort_time'] = $tmp_key_for_sorting;
         $r[$tmp_key_for_sorting] = $_r;
         //$_r = apply_filters( 'epl_get_cal_dates_response_loop', $r );
         $counter++;
     }
     $raw = apply_filters('epl_get_cal_dates_response', $r);
     ksort($raw);
     //@TODO - temp solution for showing cal in the month of first avail. event
     global $first_event_date;
     $first_event_date = key($raw);
     if (isset($args['raw'])) {
         return $raw;
     }
     //using array_values to get rid of temp keys, fullcalendar doesn't seem to like them :)
     $r = json_encode(array_values($r));
     if (!epl_user_is_admin()) {
         set_transient('epl_transient__get_days_for_fc__' . $post->ID, base64_encode($r), 60 * 60 * 4);
     }
     return $r;
 }
Пример #10
0
 function load_common_stylesheets()
 {
     wp_enqueue_style('events-planner-stylesheet-main', $this->epl->load_asset('css/style.css'));
     wp_enqueue_style('fullcalendar-stylesheet', $this->epl->load_asset('css/fullcalendar.css'));
     //wp_enqueue_style( 'widget-calendar-css', EPL_FULL_URL . 'css/calendar/widget-calendar-default.css' );
     wp_enqueue_style('small-calendar-css', $this->epl->load_asset('css/calendar/small-calendar.css'));
     if (EPL_IS_ADMIN || epl_user_is_admin()) {
         wp_enqueue_style('select2', $this->epl->load_asset('css/select2.css'));
     }
     wp_enqueue_style('jquery-dataTables', $this->epl->load_asset('css/jquery.dataTables.css'));
     do_action('epl_init_load_common_stylesheets', $this);
     return $this;
 }