0 && $seat_plan_visible ==2 &&$new_registration_system_sp=='on'){ // do_action('mpwem_new_registration_system_sp',$event_id); // }else{ $saved_user_role = get_post_meta($event_id, 'mep_member_only_user_role', true) ? get_post_meta($event_id, 'mep_member_only_user_role', true) : []; $event_member_type = get_post_meta($event_id, 'mep_member_only_event', true) ? get_post_meta($event_id, 'mep_member_only_event', true) : 'for_all'; $cart_btn_label = array_key_exists('cart-btn-label',$params) ? esc_html($params['cart-btn-label']) : mep_get_label($event_id, 'mep_cart_btn_text', esc_html__('Register For This Event','mage-eventpress')); $ticket_type_label = array_key_exists('ticket-label',$params) ? esc_html($params['ticket-label']) : mep_get_label($event_id, 'mep_event_ticket_type_text', esc_html__('Ticket Type:','mage-eventpress')); $extra_service_label = array_key_exists('extra-service-label',$params) ? esc_html($params['extra-service-label']) : mep_get_label($event_id, 'mep_event_extra_service_text', esc_html__('Extra Service:','mage-eventpress')); $select_date_label = array_key_exists('select-date-label',$params) ? esc_html($params['select-date-label']) : mep_get_option('mep_event_rec_select_event_date_text', 'label_setting_sec', __('Select Event Date:', 'mage-eventpress')); $total_book = 0; $post_id = $event_id ? $event_id : get_the_id(); $event_meta = get_post_custom($post_id); $event_expire_on_old = mep_get_option('mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime'); $event_expire_on = $event_expire_on_old == 'event_end_datetime' ? esc_html('event_expire_datetime') : $event_expire_on_old; $event_expire_date = $event_meta[$event_expire_on][0]; // $event_sqi = array_key_exists('mep_sqi',$event_meta) ? $event_meta['mep_sqi'][0] : ''; //========== $mep_full_name = array_key_exists('mep_full_name',$event_meta) && $event_meta['mep_full_name'][0] ?MP_Global_Function::data_sanitize($event_meta['mep_full_name'][0]):''; $mep_reg_email = array_key_exists('mep_reg_email',$event_meta) && $event_meta['mep_reg_email'][0] ?MP_Global_Function::data_sanitize($event_meta['mep_reg_email'][0]):''; $mep_reg_phone = array_key_exists('mep_reg_phone',$event_meta) && $event_meta['mep_reg_phone'][0] ?MP_Global_Function::data_sanitize($event_meta['mep_reg_phone'][0]):''; $mep_reg_address = array_key_exists('mep_reg_address',$event_meta) && $event_meta['mep_reg_address'][0] ?MP_Global_Function::data_sanitize($event_meta['mep_reg_address'][0]):''; $mep_reg_designation = array_key_exists('mep_reg_designation',$event_meta) && $event_meta['mep_reg_designation'][0] ?MP_Global_Function::data_sanitize($event_meta['mep_reg_designation'][0]):''; $mep_reg_website = array_key_exists('mep_reg_website',$event_meta) && $event_meta['mep_reg_website'][0] ?MP_Global_Function::data_sanitize($event_meta['mep_reg_website'][0]):''; $mep_reg_veg = array_key_exists('mep_reg_veg',$event_meta) && $event_meta['mep_reg_veg'][0] ?MP_Global_Function::data_sanitize($event_meta['mep_reg_veg'][0]):''; $mep_reg_company = array_key_exists('mep_reg_company',$event_meta) && $event_meta['mep_reg_company'][0] ?MP_Global_Function::data_sanitize($event_meta['mep_reg_company'][0]):''; $mep_reg_gender = array_key_exists('mep_reg_gender',$event_meta) && $event_meta['mep_reg_gender'][0] ?MP_Global_Function::data_sanitize($event_meta['mep_reg_gender'][0]):''; $mep_reg_tshirtsize = array_key_exists('mep_reg_tshirtsize',$event_meta) && $event_meta['mep_reg_tshirtsize'][0] ?MP_Global_Function::data_sanitize($event_meta['mep_reg_tshirtsize'][0]):''; //========== $time = strtotime($event_expire_date); $newformat = date('Y-m-d H:i:s', $time); $datetime1 = new DateTime(); $datetime2 = new DateTime($newformat); $interval = $datetime1->diff($datetime2); $mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array(); $total_seat = apply_filters('mep_event_total_seat_counts', mep_event_total_seat($post_id, 'total'), $post_id); $total_resv = apply_filters('mep_event_total_resv_seat_count', mep_event_total_seat($post_id, 'resv'), $post_id); $recurring = get_post_meta($post_id, 'mep_enable_recurring', true) ? get_post_meta($post_id, 'mep_enable_recurring', true) : 'no'; $_upcoming_date = !empty(mep_get_event_upcoming_date($post_id)) ? mep_get_event_upcoming_date($post_id) : ''; $upcoming_date = $recurring == 'no' ? '' : $_upcoming_date; $total_sold = mep_get_event_total_seat_left($post_id, $upcoming_date); $total_left = $total_seat - ($total_sold + $total_resv); $total_left = $recurring == 'no' ? $total_left : 1; $reg_status = get_post_meta($event_id,'mep_reg_status',true) ? get_post_meta($event_id,'mep_reg_status',true) : ''; $seat_left = apply_filters('mep_event_total_seat_left_count', $total_left, $post_id); $current = current_time('Y-m-d H:i:s'); $time = strtotime($event_expire_date); $newformat = date('Y-m-d H:i:s', $time); if ($recurring == 'yes') { $event_more_dates = get_post_meta($post_id, 'mep_event_more_date', true) ? get_post_meta($post_id, 'mep_event_more_date', true) : array(); $md = end($event_more_dates); $more_date = $md['event_more_start_date'] . ' ' . $md['event_more_start_time']; $newformat = empty($event_more_dates) ? $newformat : date('Y-m-d H:i:s', strtotime($more_date)); } // $default_timezone_val = get_option('timezone_string') ? get_option('timezone_string') : 'UTC'; // date_default_timezone_set($default_timezone_val); $datetime1 = new DateTime($newformat); $datetime2 = new DateTime($current); $interval = date_diff($datetime2, $datetime1); $mep_available_seat = get_post_meta($event_id,'mep_available_seat',true) ? get_post_meta($event_id,'mep_available_seat',true) : 'on'; //array_key_exists('mep_available_seat', $event_meta) ? $event_meta['mep_available_seat'][0] : 'on'; $leftt = apply_filters('mep_event_total_seat_count', $total_left, $post_id); $days = $interval->d; $hours = $interval->h; $minutes = $interval->i; $dd = $days > 0 ? $days . " days " : ''; $hh = $hours > 0 ? $hours . " hours " : ''; $mm = $minutes > 0 ? $minutes . " minutes " : ''; // $qty_typec = array_key_exists('qty_box_type',$event_meta) ? $event_meta['qty_box_type'][0] : ''; $cart_product_id = get_post_meta($post_id, 'link_wc_product', true) ? esc_attr(get_post_meta($post_id, 'link_wc_product', true)) : esc_attr($post_id); $not_in_the_cart = apply_filters('mep_check_product_into_cart',true,$cart_product_id); /** * First Checking If the registration status enable or disable */ if ($reg_status != 'off') { /** * Then Checking If the event date already gone or not */ if (strtotime(current_time('Y-m-d H:i:s')) > strtotime(apply_filters('mep_event_expire_datetime_val',$newformat,$post_id))) { /** * If The event expired then it fire below Hook, The event expire texts arein the inc/template-parts/event_labels.php file */ do_action('mep_event_expire_text'); /** * If the event is not expired then Its checking the available seat status */ } elseif ($seat_left <= 0) { /** * If All the seats are booked then it fire the below hooks, The event no seat texts are in the inc/template-parts/event_labels.php file */ do_action('mep_event_no_seat_text',$post_id); do_action('mep_after_no_seat_notice',$post_id); } else { /** * If everything is fine then its go on .... */ if( $event_member_type == 'for_all' || ($event_member_type != 'for_all' && is_user_logged_in() && ( in_array(wp_get_current_user()->roles[0],$saved_user_role) || in_array('all',$saved_user_role) ) )){ ?>