ID; global $post; if($post and $post->post_type == $this->get_main_post_type()) $translated_event_id = $post->ID; else $translated_event_id = $event_id; $tickets = isset($event->data->tickets) ? $event->data->tickets : []; $dates = isset($event->dates) ? $event->dates : array($event->date); if(isset($settings['booking_start_from_first_upcoming_date']) && $settings['booking_start_from_first_upcoming_date']) { $maximum_dates = isset($settings['booking_maximum_dates']) && trim($settings['booking_maximum_dates']) ? $settings['booking_maximum_dates'] : 12; list($occurrence, $occurrence_time) = $this->get_start_date_to_get_event_dates($event_id, current_time('Y-m-d')); $dates = $this->getRender()->dates($event_id, $event->data, $maximum_dates, ($occurrence_time ? date('Y-m-d H:i:s', $occurrence_time) : $occurrence)); $dates = $this->adjust_event_dates_for_booking($event, $dates); } $booking_options = get_post_meta($event_id, 'mec_booking', true); if(!is_array($booking_options)) $booking_options = []; // WC System $WC_status = (isset($settings['wc_status']) and $settings['wc_status'] and class_exists('WooCommerce')); $WC_booking_form = (isset($settings['wc_booking_form']) and $settings['wc_booking_form']); if($ticket_id) { $new_tickets = []; foreach($tickets as $t_id => $ticket) { if((int) $t_id === (int) $ticket_id) { $new_tickets[$t_id] = $ticket; } } if(count($new_tickets)) $tickets = $new_tickets; } $occurrence_time = $dates[0]['start']['timestamp'] ?? strtotime($dates[0]['start']['date']); $default_ticket_number = 0; if(count($tickets) == 1) $default_ticket_number = 1; $book = $this->getBook(); $availability = $book->get_tickets_availability($event_id, $occurrence_time); $date_format = (isset($ml_settings['booking_date_format1']) and trim($ml_settings['booking_date_format1'])) ? $ml_settings['booking_date_format1'] : 'Y-m-d'; if(isset($event->data->meta['mec_repeat_type']) and $event->data->meta['mec_repeat_type'] === 'custom_days') $date_format .= ' '.get_option('time_format'); $midnight_event = $this->is_midnight_event($event); $book_all_occurrences = 0; if(isset($event->data) and isset($event->data->meta) and isset($event->data->meta['mec_booking']) and isset($event->data->meta['mec_booking']['bookings_all_occurrences'])) $book_all_occurrences = (int) $event->data->meta['mec_booking']['bookings_all_occurrences']; // User Booking Limits list($user_ticket_limit, $user_ticket_unlimited) = $book->get_user_booking_limit($event_id); // Show Booking Form Interval $show_booking_form_interval = (isset($settings['show_booking_form_interval'])) ? $settings['show_booking_form_interval'] : 0; if(isset($booking_options['show_booking_form_interval']) and trim($booking_options['show_booking_form_interval']) != '') $show_booking_form_interval = $booking_options['show_booking_form_interval']; if($show_booking_form_interval) { $filtered_dates = []; foreach($dates as $date) { $date_diff = $this->date_diff(date('Y-m-d h:i a', current_time('timestamp')), date('Y-m-d h:i a', $date['start']['timestamp'])); if(isset($date_diff->days) and !$date_diff->invert) { $minute = $date_diff->days * 24 * 60; $minute += $date_diff->h * 60; $minute += $date_diff->i; if($minute > $show_booking_form_interval) continue; } $filtered_dates[] = $date; } $dates = $filtered_dates; } $available_spots = 0; $total_spots = -1; foreach($availability as $ticket_id=>$count) { if(!is_numeric($ticket_id)) { $total_spots = $count; continue; } if($count != '-1') $available_spots += $count; else { $available_spots = -1; break; } } if($total_spots > 0) $available_spots = min($available_spots, $total_spots); // Date Selection Method $date_selection = (isset($settings['booking_date_selection']) and trim($settings['booking_date_selection'])) ? $settings['booking_date_selection'] : 'dropdown'; if(isset($settings['booking_date_selection_per_event']) and $settings['booking_date_selection_per_event'] and isset($booking_options['bookings_date_selection']) and trim($booking_options['bookings_date_selection']) and $booking_options['bookings_date_selection'] !== 'global') { $date_selection = $booking_options['bookings_date_selection']; } // Omit End Dates $omit_end_dates = isset($settings['booking_omit_end_date']) && $settings['booking_omit_end_date']; // Modal Booking $modal_booking = isset($_GET['method']) && sanitize_text_field($_GET['method']) === 'mec-booking-modal'; wp_enqueue_script('mec-niceselect-script'); ?>

data->post->post_title : esc_html__('Book Event', 'modern-events-calendar-lite')); ?>

1): ?>
timestamp($dates[0]['start'], $dates[0]['end']); $default_selected_datetime_ex = explode(':', $default_selected_datetime); ?>
*
svg('form/calendar-icon'); ?> date_i18n($date_format, $default_selected_datetime_ex[0]); ?> svg('form/up-icon'); ?> svg('form/down-icon'); ?>
display_calendar($event, $uniqueid, $dates[0]['start']['date'], $default_selected_datetime); ?>
*
display_calendar($event, $uniqueid, $dates[0]['start']['date'], $default_selected_datetime); ?>
date_label($dates[0]['start'], $dates[0]['end'], $date_format, ' - ', false, ($dates[0]['allday'] ?? 0))); ?>
svg('form/calendar-icon'); ?>
date_label($date['start'], $date['end'], $date_format, ' - ', false))."
"; ?>
'.MEC_kses::element($this->date_label($dates[0]['start'], $dates[0]['end'], $date_format, ' - ', false)).''; ?>
$ticket): ?> 0) { $maximum_purchase = (int) $ticket['maximum_ticket']; } $ticket_limit = $availability[$ticket_id] ?? -1; if($ticket_limit === '0' and count($dates) <= 1) continue; ?>
svg('form/ticket-icon'); ?>
get_ticket_price_label($ticket, current_time('Y-m-d'), $event_id, $occurrence_time) : ''; $price_label = apply_filters('mec_filter_price_label', $price_label, $ticket, $event_id, $book); ?>

m('tickets', esc_html__('Tickets', 'modern-events-calendar-lite')), (($ticket['unlimited'] and $ticket_limit == '-1') ? ''.esc_html__('Unlimited', 'modern-events-calendar-lite').'' : ($ticket_limit != '-1' ? ''.$ticket_limit.'' : ''.esc_html__('Unlimited', 'modern-events-calendar-lite').''))); ?>

"'.esc_html($ticket['name']).'"' : ''; $ticket_message_sales = $stop_selling_message ? sprintf($stop_selling_message, $str_replace) : sprintf(esc_html__('The %s ticket sales has ended!', 'modern-events-calendar-lite'), $str_replace); $ticket_message_sold_out = sprintf(esc_html__('The %s ticket is sold out. You can try another ticket or another date.', 'modern-events-calendar-lite'), $str_replace); $ticket_message_sold_out_multiple = sprintf(esc_html__('The %s ticket is sold out or not available for some of dates. You can try another ticket or another date.', 'modern-events-calendar-lite'), $str_replace); ?>
1)) && $this->getCaptcha()->status('booking')) echo $this->getCaptcha()->field(); ?> '.((!$user_ticket_unlimited and $user_ticket_limit == 1 and count($tickets) == 1) ? 1 : 0).''); ?>