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 : array(); $dates = isset($event->dates) ? $event->dates : array($event->date); $booking_options = get_post_meta($event_id, 'mec_booking', true); if(!is_array($booking_options)) $booking_options = array(); // WC System $WC_status = (isset($settings['wc_status']) and $settings['wc_status'] and class_exists('WooCommerce')) ? true : false; $WC_booking_form = (isset($settings['wc_booking_form']) and $settings['wc_booking_form']) ? true : false; if($ticket_id) { $new_tickets = array(); 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 = isset($dates[0]['start']['timestamp']) ? $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 = array(); foreach($dates as $date) { $date_diff = $this->date_diff(date('Y-m-d h:i a', current_time('timestamp', 0)), 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'; // Modal Booking $modal_booking = (isset($_GET['method']) and sanitize_text_field($_GET['method']) === 'mec-booking-modal'); wp_enqueue_script('mec-nice-select', $this->asset('js/jquery.nice-select.min.js')); ?>

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

1): ?>
display_calendar($event, $uniqueid); ?>
date_label($dates[0]['start'], $dates[0]['end'], $date_format, ' - ', false, (isset($dates[0]['allday']) ? $dates[0]['allday'] : 0)); ?>

date_label($date['start'], $date['end'], $date_format, ' - ', false)."
"; ?>

$ticket): $stop_selling = isset($availability['stop_selling_'.$ticket_id]) ? $availability['stop_selling_'.$ticket_id] : false; $ticket_limit = isset($availability[$ticket_id]) ? $availability[$ticket_id] : -1; if($ticket_limit === '0' and count($dates) <= 1) continue; ?>
get_ticket_price($ticket, current_time('Y-m-d'), $event_id) : ''); echo (isset($ticket['price_label']) ? $book->get_ticket_price_label($ticket, current_time('Y-m-d'), $event_id) : ''); ?>

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

%s', 'modern-events-calendar-lite'), $this->m('tickets', __('Tickets', 'modern-events-calendar-lite')), (($ticket['unlimited'] and $ticket_limit == '-1') ? __('Unlimited', 'modern-events-calendar-lite') : ($ticket_limit != '-1' ? $ticket_limit : __('Unlimited', 'modern-events-calendar-lite')))); ?>
'.$ticket['name'].'' : ''; $ticket_message_sales = sprintf(__('The %s ticket sales has ended!', 'modern-events-calendar-lite'), $str_replace); $ticket_message_sold_out = sprintf(__('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(__('The %s ticket is sold out for some of dates. You can try another ticket or another date.', 'modern-events-calendar-lite'), $str_replace); ?>
1)) and $this->get_recaptcha_status('booking')): ?>