<?php

/**
 * Single Event Template
 * A single event. This displays the event title, description, meta, and
 * optionally, the Google map for the event.
 *
 * Override this template in your own theme by creating a file at [your-theme]/tribe-events/single-event.php
 *
 * @package TribeEventsCalendar
 * @version  4.3
 *
 */


if (!defined('ABSPATH')) {
    die('-1');
}

$events_label_singular = tribe_get_event_label_singular();
$events_label_plural = tribe_get_event_label_plural();
$event_id = get_the_ID();
$purchase_ticket_url = get_post_meta(get_the_ID(), 'purchase_ticket_url');
?>
<div class="content-wrap">
    <div id="tribe-events-content" class="tribe-events-single">
        <div class="col-md-8 col-sm-7">
            <div class="event-single-content">
                <?php while (have_posts()) :  the_post(); ?>
                    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                        <!-- Event featured image, but exclude link -->
                        <div class="single-event-featured-image">
                            <?php echo tribe_event_featured_image($event_id, 'full', false); ?>
                        </div>
                        <!-- featured image-->
                        <div class="content-wrapper">
                            <?php the_title('<h1 class="tribe-events-single-event-title">', '</h1>'); ?>

                            <!-- Event content -->
                            <?php do_action('tribe_events_single_event_before_the_content') ?>

                            <div class="tribe-events-single-event-description tribe-events-content">
                                <?php the_content(); ?>
                            </div>
                            <!--Event speaker-->
                            <?php do_action('edumodo-event-speaker-list'); ?>

                            <?php do_action('tribe_events_single_event_after_the_content') ?>
                            <?php do_action('tribe_events_single_event_after_the_meta') ?>

                        </div>

                        <!-- container-->
                    </div>
                    <!-- #post-x -->

                    <?php if (get_post_type() == Tribe__Events__Main::POSTTYPE && tribe_get_option('showComments', false)) comments_template() ?>
                <?php endwhile; ?>
            </div>

        </div>
        <div class="col-md-4 col-sm-5">
            <div class="event-single-sidebar">
                <ul>
                    <li><span><i class="fa fa-credit-card"></i><?php esc_html_e('Price', 'edumodo'); ?></span>
                        <p class="float-right"><?php echo esc_html__(tribe_get_cost(null, true)); ?></p>
                    </li>
                    <li><span><i class="fa fa-calendar"></i><?php esc_html_e('Start Date', 'edumodo'); ?></span>
                        <p class="float-right"><?php echo esc_html__(tribe_get_start_date($event_id, false)); ?></p>
                    </li>
                    <li><span><i class="fa fa-clock-o"></i><?php esc_html_e('Start Time', 'edumodo'); ?></span>
                        <p class="float-right"><?php echo esc_html__(tribe_get_start_time($event_id)); ?></p>
                    </li>
                    <li><span><i class="fa fa-calendar"></i> <?php esc_html_e('End Date', 'edumodo'); ?></span>
                        <p class="float-right"><?php echo esc_html__(tribe_get_end_date($event_id, false)); ?></p>
                    </li>
                </ul>
                <?php do_action('edumodo-event-organizers'); ?>
                <div class="event-book-btn">
                    <?php if (!empty($purchase_ticket_url)) : ?>
                        <a class="tribe-events-cost" href="<?php echo esc_url($purchase_ticket_url[0]); ?>">
                            <span><?php esc_html_e('Book Now', 'edumodo'); ?></span>
                        </a>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div><!-- #tribe-events-content -->
</div>