<?php
if (!defined('ABSPATH')) {
    die;
} // Cannot access pages directly.

/**
 * This is the Shortcode For Display The City List of The Event
 */
add_shortcode('event-city-list', 'mep_event_city_list_shortcode_func');
function mep_event_city_list_shortcode_func($atts, $content = null)
{
    ob_start();
     echo mep_event_get_event_city_list();
    return ob_get_clean();
}


/**
 * This is the Shortcode For Display Event Calendar
 */
add_shortcode('event-calendar', 'mep_cal_func');
function mep_cal_func($atts, $content = null)
{
    ob_start();
    echo mep_event_calender();
    return ob_get_clean();
}

function mep_event_calender()
{
?>
    <div class="event-calendar"></div>
    <script>
        jQuery(document).ready(function() {
            const myEvents = [
                <?php
                // $loop       = mep_event_query('all',-1);
                $args = array(
                    'post_type'         => array('mep_events'),
                    'posts_per_page'    => -1,
                    'order'             => 'ASC',
                    'orderby'           => 'meta_value',
                    'meta_key'          => 'event_start_datetime'
                );
                $loop = new WP_Query($args);
                $i          = 1;
                $count      = $loop->post_count - 1;
                while ($loop->have_posts()) {
                    $loop->the_post();
                    $event_meta = get_post_custom(get_the_id());
$event_dates = mep_get_event_dates_arr(get_the_id());

foreach ($event_dates as $_dates) {
    ?>
{
                        start: '<?php echo date_i18n('Y-m-d H:i', strtotime($_dates['start'])); ?>',
                        end: '<?php echo date_i18n('Y-m-d H:i', strtotime($_dates['end'])); ?>',
                        title: '<?php the_title(); ?>',
                        url: '<?php the_permalink(); ?>',
                        class: '',
                        color: '#000',
                        data: {}
                    },
    <?php
}


                    }
                    $i++;
                
                wp_reset_postdata(); ?>
            ]

            jQuery('.event-calendar').equinox({
                events: myEvents
            });
        });
    </script>
<?php
}

/** 
 * The Magical & The Main Event Listing Shortcode is Here, You can check the details with demo here https://wordpress.org/plugins/mage-eventpress/
 */
add_shortcode('event-list', 'mep_event_list');
function mep_event_list($atts, $content = null)
{
    $defaults = array(
        "cat"           => "0",
        "org"           => "0",
        "style"         => "grid",
        "column"        => 3,
        "cat-filter"    => "no",
        "org-filter"    => "no",
        "show"          => "-1",
        "pagination"    => "no",
        "city"          => "",
        "country"       => "",
        "carousal-nav"  => "no",
        "carousal-dots" => "yes",
        "carousal-id" => "102448",
        "timeline-mode" => "vertical",
        'sort'          => 'ASC',
        'status'          => 'upcoming'
    );
    $params         = shortcode_atts($defaults, $atts);
    $cat            = $params['cat'];
    $org            = $params['org'];
    $style          = $params['style'];
    $cat_f          = $params['cat-filter'];
    $org_f          = $params['org-filter'];
    $show           = $params['show'];
    $pagination     = $params['pagination'];
    $sort           = $params['sort'];
    $column         = $style != 'grid' ? 1 : $params['column'];
    $nav            = $params['carousal-nav'] == 'yes' ? 1 : 0;
    $dot            = $params['carousal-dots'] == 'yes' ? 1 : 0;
    $city           = $params['city'];
    $country        = $params['country'];
    $cid            = $params['carousal-id'];
    $status            = $params['status'];
    $main_div       = $pagination == 'carousal' ? '<div class="mage_grid_box owl-theme owl-carousel"  id="mep-carousel' . $cid . '">' : '<div class="mage_grid_box">';

    $time_line_div_start    = $style == 'timeline' ? '<div class="timeline"><div class="timeline__wrap"><div class="timeline__items">' : '';
    $time_line_div_end      = $style == 'timeline' ? '</div></div></div>' : '';

    $flex_column    = $column;
    $mage_div_count = 0;
    $event_expire_on = mep_get_option('mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime');
   $unq_id = 'abr'.uniqid();  
    ob_start();
?>
    <div class='mep_event_list'>
        <?php if ($cat_f == 'yes') {
            /**
             * This is the hook where category filter lists are fired from inc/template-parts/event_list_tax_name_list.php File
             */
            do_action('mep_event_list_cat_names',$cat,$unq_id);
        }
        if ($org_f == 'yes') {
            /**
             * This is the hook where Organization filter lists are fired from inc/template-parts/event_list_tax_name_list.php File
             */
            do_action('mep_event_list_org_names',$org,$unq_id);
        } ?>

        <div class="mep_event_list_sec" id='mep_event_list_<?php echo $unq_id; ?>'>
            <?php
            /**
             * The Main Query function mep_event_query is locet in inc/mep_query.php File
             */ 
            $loop =  mep_event_query($show, $sort, $cat, $org, $city, $country, $status);
            $total_post = $loop->post_count;
            echo $main_div;
            echo $time_line_div_start;
            while ($loop->have_posts()) {
                $loop->the_post();

                if ($style == 'grid' && (int)$column>0 && $pagination != 'carousal') {
	                $columnNumber='column_style';
	                $width=100/(int)$column;
                }elseif($pagination == 'carousal' && $style == 'grid'){
                    $columnNumber = 'grid';
                    $width=100;                    
                } else {
                    $columnNumber = 'one_column';
                    $width=100;
                }
                
                /**
                 * This is the hook where Event Loop List fired from inc/template-parts/event_loop_list.php File
                 */
               

                do_action('mep_event_list_shortcode', get_the_id(), $columnNumber, $style,$width,$unq_id);
            }
            wp_reset_postdata();
            echo $time_line_div_end;
            if ($pagination == 'yes') {
                /**
                 * The Pagination function mep_event_pagination is locet in inc/mep_query.php File
                 */
                mep_event_pagination($loop->max_num_pages);
            } ?>


        </div>
    </div>
    </div>
    <script>
        jQuery(document).ready(function() {
            var containerEl = document.querySelector('#mep_event_list_<?php echo $unq_id; ?>');
            var mixer = mixitup(containerEl);            
            <?php if ($pagination == 'carousal') { ?>
                jQuery('#mep-carousel<?php echo $cid; ?>').owlCarousel({
                    autoplay:  <?php echo mep_get_option('mep_autoplay_carousal', 'carousel_setting_sec', 'true'); ?>,
                    autoplayTimeout:<?php echo mep_get_option('mep_speed_carousal', 'carousel_setting_sec', '5000'); ?>,
                    autoplayHoverPause: true,
                    loop: <?php echo mep_get_option('mep_loop_carousal', 'carousel_setting_sec', 'true'); ?>,
                    margin: 20,
                    nav: <?php echo $nav; ?>,
                    dots: <?php echo $dot; ?>,
                    responsiveClass: true,
                    responsive: {
                        0: {
                            items: 1,
                        },
                        600: {
                            items: 2,
                        },
                        1000: {
                            items: <?php echo $column; ?>,
                        }
                    }
                });
            <?php } ?>
            <?php do_action('mep_event_shortcode_js_script', $params); ?>
        });
    </script>
<?php
    $content = ob_get_clean();
    return $content;
}





/**
 * This Is a Shortcode for display Expired Events, This will be depriciated in the version 4.0, because we added this feature into the main shortcode [event-list]. Just use [event-list status="expired"]
 */
add_shortcode('expire-event-list', 'mep_expire_event_list');
function mep_expire_event_list($atts, $content = null)
{
    $defaults = array(
        "cat"           => "0",
        "org"           => "0",
        "style"         => "grid",
        "column"        => 3,
        "cat-filter"    => "no",
        "org-filter"    => "no",
        "show"          => "-1",
        "pagination"    => "no",
        "city"          => "",
        "country"       => "",
        "carousal-nav"  => "no",
        "carousal-dots" => "yes",
        "carousal-id" => "102448",
        "timeline-mode" => "vertical",
        'sort'          => 'ASC'
    );
    
    $params         = shortcode_atts($defaults, $atts);
    $cat            = $params['cat'];
    $org            = $params['org'];
    $style          = $params['style'];
    $cat_f          = $params['cat-filter'];
    $org_f          = $params['org-filter'];
    $show           = $params['show'];
    $pagination     = $params['pagination'];
    $sort           = $params['sort'];
    $column         = $style != 'grid' ? 1 : $params['column'];
    $nav            = $params['carousal-nav'] == 'yes' ? 1 : 0;
    $dot            = $params['carousal-dots'] == 'yes' ? 1 : 0;
    $city           = $params['city'];
    $country        = $params['country'];
    $cid            = $params['carousal-id'];
    $main_div       =  $pagination == 'carousal' ? '<div class="mage_grid_box owl-theme owl-carousel"  id="mep-carousel' . $cid . '">' : '<div class="mage_grid_box">';

    $time_line_div_start    = $style == 'timeline' ? '<div class="timeline"><div class="timeline__wrap"><div class="timeline__items">' : '';
    $time_line_div_end      = $style == 'timeline' ? '</div></div></div>' : '';

    $flex_column    = $column;
    $mage_div_count = 0;
    $event_expire_on = mep_get_option('mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime');
    ob_start();
?>
    <div class='mep_event_list'>
        <?php if ($cat_f == 'yes') {
            /**
             * This is the hook where category filter lists are fired from inc/template-parts/event_list_tax_name_list.php File
             */
            do_action('mep_event_list_cat_names',$cat);
        }
        if ($org_f == 'yes') {
            /**
             * This is the hook where Organization filter lists are fired from inc/template-parts/event_list_tax_name_list.php File
             */
            do_action('mep_event_list_org_names',$org);
        } ?>
        <div class="mep_event_list_sec">
            <?php
            /**
             * The Main Query function mep_event_query is locet in inc/mep_query.php File
             */
            $loop =  mep_event_query($show, $sort, $cat, $org, $city, $country, 'expired');
            $total_post =    $loop->post_count;
            echo $main_div;
            while ($loop->have_posts()) {
                $loop->the_post();
	            if ($style == 'grid' && (int)$column>0) {
		            $columnNumber='column_style';
					if($pagination == 'carousal'){
						$width=100;
					}else{
						$width=100/(int)$column;						
					}
	            }else {
		            $columnNumber = 'one_column';
		            $width=100;
	            }
                /**
                 * This is the hook where Event Loop List fired from inc/template-parts/event_loop_list.php File
                 */
                do_action('mep_event_list_shortcode', get_the_id(), $columnNumber, $style,$width);
            }
            wp_reset_postdata();
            echo '</div>';
            if ($pagination == 'yes') {
                /**
                 * The Pagination function mep_event_pagination is locet in inc/mep_query.php File
                 */
                mep_event_pagination($loop->max_num_pages);
            }elseif($pagination == 'carousal'){
			?>			
			<script>
			jQuery(function(){
				jQuery("<?php echo '#mep-carousel'.$cid; ?>").owlCarousel({
                    autoplay:  <?php echo mep_get_option('mep_autoplay_carousal', 'carousel_setting_sec', 'true'); ?>,
                    autoplayTimeout:<?php echo mep_get_option('mep_speed_carousal', 'carousel_setting_sec', '5000'); ?>,
                    autoplayHoverPause: true,
                    loop: <?php echo mep_get_option('mep_loop_carousal', 'carousel_setting_sec', 'true'); ?>,
					margin:20,
					nav:<?php echo $nav; ?>,
					dots:<?php echo $dot; ?>,
					navText: ["<i class='fas fa-chevron-left'></i>","<i class='fas fa-chevron-right'></i>"],
					responsive:{
						0:{
							items:1
						},
						600:{
							items:<?php echo $column; ?>
						},
						1000:{
							items:<?php echo $column; ?>
						}
					}
				});
			});
			</script>
			<?php	
			}
			?>
        </div>
    </div>
    <script>
        jQuery(document).ready(function() {
            var containerEl = document.querySelector('.mep_event_list_sec');
            var mixer = mixitup(containerEl);
        });
    </script>
<?php
    $content = ob_get_clean();
    return $content;
}


add_shortcode('event-add-cart-section', 'mep_event_add_to_cart_section');
function mep_event_add_to_cart_section($atts, $content = null)
{
    $defaults = array(
        "event" => "0",
        "cart-btn-label" => "Register For This Event",
        "ticket-label" => "Ticket Type",
        "extra-service-label" => "Extra Service"
    );
    $params = shortcode_atts($defaults, $atts);
    $event = $params['event'];   
    ob_start();
    if($event > 0){
       echo mep_shortcode_add_cart_section_html($event,$params);     
       do_action('mep_after_event_cart_shortcode',$event);       
    }
    return ob_get_clean();
}



add_shortcode('event-speaker-list', 'mep_event_speaker_list_shortcode_section');
function mep_event_speaker_list_shortcode_section($atts, $content = null)
{
    $defaults = array(
        "event" => "0"
    );
    $params = shortcode_atts($defaults, $atts);
    $event = $params['event'];
    ob_start();
    if($event > 0){
        echo mep_shortcode_speaker_list_html($event);              
    }else{
        echo mep_shortcode_all_speaker_list_html();              
    }
    return ob_get_clean();
}



add_shortcode('event-list-onepage', 'mep_event_onepage_list');
function mep_event_onepage_list($atts, $content = null)
{
    $defaults = array(
        "cat"           => "0",
        "org"           => "0",
        "style"         => "grid",
        "column"        => 3,
        "cat-filter"    => "no",
        "org-filter"    => "no",
        "show"          => "-1",
        "pagination"    => "no",
        "city"          => "",
        "country"       => "",
        "carousal-nav"  => "no",
        "carousal-dots" => "yes",
        "carousal-id" => "102448",
        "timeline-mode" => "vertical",
        'sort'          => 'ASC',
        'status'          => 'upcoming'
    );
    $params         = shortcode_atts($defaults, $atts);
    $cat            = $params['cat'];
    $org            = $params['org'];
    $style          = $params['style'];
    $cat_f          = $params['cat-filter'];
    $org_f          = $params['org-filter'];
    $show           = $params['show'];
    $pagination     = $params['pagination'];
    $sort           = $params['sort'];
    $column         = $style != 'grid' ? 1 : $params['column'];
    $nav            = $params['carousal-nav'] == 'yes' ? 1 : 0;
    $dot            = $params['carousal-dots'] == 'yes' ? 1 : 0;
    $city           = $params['city'];
    $country        = $params['country'];
    $cid            = $params['carousal-id'];
    $status            = $params['status'];
    $main_div       = $pagination == 'carousal' ? '<div class="mage_grid_box owl-theme owl-carousel"  id="mep-carousel' . $cid . '">' : '<div class="mage_grid_box">';

    $time_line_div_start    = $style == 'timeline' ? '<div class="timeline"><div class="timeline__wrap"><div class="timeline__items">' : '';
    $time_line_div_end      = $style == 'timeline' ? '</div></div></div>' : '';

    $flex_column    = $column;
    $mage_div_count = 0;
    $event_expire_on = mep_get_option('mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime');
   ob_start();
    do_action('woocommerce_before_single_product');
?>
    <div class='mep_event_list'>
        <?php if ($cat_f == 'yes') {
            /**
             * This is the hook where category filter lists are fired from inc/template-parts/event_list_tax_name_list.php File
             */
            do_action('mep_event_list_cat_names',$cat);
        }
        if ($org_f == 'yes') {
            /**
             * This is the hook where Organization filter lists are fired from inc/template-parts/event_list_tax_name_list.php File
             */
            do_action('mep_event_list_org_names',$org);
        } ?>

        <div class="mep_event_list_sec">
            <?php
            $now                = current_time('Y-m-d H:i:s');
            $show_price         = mep_get_option('mep_event_price_show', 'general_setting_sec', 'yes');
            $show_price_label   = mep_get_option('event-price-label', 'general_setting_sec', 'Price Starts from:');
            $paged              = get_query_var("paged") ? get_query_var("paged") : 1;



            ?>
            <div class="mep_event_list_sec">
                <?php

                /**
                 * The Main Query function mep_event_query is locet in inc/mep_query.php File
                 */
                $loop =  mep_event_query($show, $sort, $cat, $org, $city, $country, $status);
                $loop->the_post();


                $event_meta         = get_post_custom(get_the_id());
                $author_terms       = get_the_terms(get_the_id(), 'mep_org');
                $start_datetime     = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
                $time = strtotime($start_datetime);
                $newformat = date_i18n('Y-m-d H:i:s', $time);
                $tt = get_the_terms(get_the_id(), 'mep_cat');
                $torg = get_the_terms(get_the_id(), 'mep_org');
                $org_class = mep_get_term_as_class(get_the_id(), 'mep_org');
                $cat_class = mep_get_term_as_class(get_the_id(), 'mep_cat');
                $available_seat = mep_get_total_available_seat(get_the_id(), $event_meta);
                echo '<div class="mage_grid_box">';
                while ($loop->have_posts()) {
                    $loop->the_post();
	                if ($style == 'grid' && (int)$column>0) {
		                $columnNumber='column_style';
		                $width=100/(int)$column;
	                } else {
		                $columnNumber = 'one_column';
		                $width=100;
	                }
                    /**
                     * This is the hook where Event Loop List fired from inc/template-parts/event_loop_list.php File
                     */
                    do_action('mep_event_list_shortcode', get_the_id(), $columnNumber, $style,$width);

                    $currency_pos = get_option('woocommerce_currency_pos');
                    $mep_full_name = strip_tags($event_meta['mep_full_name'][0]);
                    $mep_reg_email = strip_tags($event_meta['mep_reg_email'][0]);
                    $mep_reg_phone = strip_tags($event_meta['mep_reg_phone'][0]);
                    $mep_reg_address = strip_tags($event_meta['mep_reg_address'][0]);
                    $mep_reg_designation = strip_tags($event_meta['mep_reg_designation'][0]);
                    $mep_reg_website = strip_tags($event_meta['mep_reg_website'][0]);
                    $mep_reg_veg = strip_tags($event_meta['mep_reg_veg'][0]);
                    $mep_reg_company = strip_tags($event_meta['mep_reg_company'][0]);
                    $mep_reg_gender = strip_tags($event_meta['mep_reg_gender'][0]);
                    $mep_reg_tshirtsize = strip_tags($event_meta['mep_reg_tshirtsize'][0]);
                    echo '<div class=event-cart-section-list>';
                    do_action('mep_add_to_cart_list');
                    echo '</div>';
                    get_event_list_js(get_the_id(), $event_meta, $currency_pos);
                }
                wp_reset_postdata();
                echo '</div>';
                if ($pagination == 'yes') {
                    /**
                     * The Pagination function mep_event_pagination is locet in inc/mep_query.php File
                     */
                    mep_event_pagination($loop->max_num_pages);
                } ?>
            </div>
        </div>
    </div>
<?php
    $content = ob_get_clean();
    return $content;
}




add_shortcode('event-list-search', 'mep_event_list_search');
function mep_event_list_search($attribute, $content = null){
    $defaults = array(
        'result-style' => '',
        'event-style' => 'list',
        'category-filter' => 'yes',
        'organizer-filter' => 'yes',
        'city-filter' => 'yes',
        'date-filter' => 'yes',
    );
    $parameter = shortcode_atts($defaults, $attribute);

    $search_result_style = $parameter['result-style'];
    $search_result_class = ($search_result_style == 'popup') ? 'search_result_dropdown' : '';

    $category_filter = $parameter['category-filter'] == 'yes' || '';
    $organizer_filter = $parameter['organizer-filter'] == 'yes' || '';
    $city_filter = $parameter['city-filter'] == 'yes' || '';
    $date_filter = $parameter['date-filter'] == 'yes' || '';

    ob_start();
    $args = array(
        'post_type' => 'mep_events',
        'posts_per_page' => -1
    );
    $loop = new WP_Query($args);
    ?>
    <div class="demo_search_short_code">
        <div class="search_sort_code_area">
            <div class="search_sort_code <?php echo $search_result_class; ?>">
                <div class="sort_code_search_box defaultLayout_xs">
                    <div class="flexEqual mp_event_search_box">
                        <?php
                        $category_lists = MPWEM_Helper::get_all_taxonomy('mep_cat');
                        if ($category_filter && $category_lists && sizeof($category_lists) > 0) {
                            ?>
                            <label>
                                <select class="formControl" name="search_with_category">
                                    <option selected value=""><?php _e('Select Category', 'mage-eventpress'); ?></option>
                                    <?php
                                    foreach ($category_lists as $category) {
                                        ?>
                                        <option value="<?php echo $category; ?>"><?php echo $category; ?></option>
                                        <?php
                                    }
                                    ?>
                                </select>
                            </label>
                        <?php } ?>
                        <?php
                        $organizer_lists = MPWEM_Helper::get_all_taxonomy('mep_org');
                        if ($organizer_filter && $organizer_lists && sizeof($organizer_lists) > 0) {
                            ?>
                            <label>
                                <select class="formControl" name="search_with_organizer">
                                    <option selected value=""><?php _e('Select Organizer', 'mage-eventpress'); ?></option>
                                    <?php
                                    foreach ($organizer_lists as $organizer) {
                                        ?>
                                        <option value="<?php echo $organizer; ?>"><?php echo $organizer; ?></option>
                                        <?php
                                    }
                                    ?>
                                </select>
                            </label>
                        <?php } ?>
                        <?php
                        $city_lists = MPWEM_Helper::get_all_city();
                        if ($city_filter && $city_lists && sizeof($city_lists) > 0) {
                            ?>
                            <label>
                                <select class="formControl" name="search_with_city">
                                    <option selected value=""><?php _e('Select City', 'mage-eventpress'); ?></option>
                                    <?php
                                    foreach ($city_lists as $city) {
                                        ?>
                                        <option value="<?php echo $city; ?>"><?php echo $city; ?></option>
                                        <?php
                                    }
                                    ?>
                                </select>
                            </label>
                        <?php } ?>
                        <?php if ($date_filter) { ?>
                            <label>
                                <input type="date" class="formControl search_with_start_date" value='' placeholder="<?php _e('Start date', 'mage-eventpress'); ?>"/>
                            </label>
                            <label>
                                <input type="date" class="formControl search_with_end_date" value='' placeholder="<?php _e('End date', 'mage-eventpress'); ?>"/>
                            </label>
                        <?php } ?>
                    </div>
                    <div class="mp_event_search_box">
                        <label>
                            <input name="mp_event_title" placeholder="<?php _e('Type Event Name here ....', 'mage-eventpress'); ?>" class="formControl mp_event_search"/>
                        </label>
                    </div>
                </div>
                <div class="all_event_list <?php echo MPWEM_Helper::search_short_code_style_class($parameter['event-style']); ?>">
                    <?php
                    foreach ($loop->posts as $post) {
                        $event_id = $post->ID;
                        $event_meta             = get_post_custom($event_id);
                        $time                   = strtotime($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);
                        $date              = date_i18n('Y-m-d H:i:s', $time);
                        //$date = MPWEM_Date::event_date($event_id);
                        if ($date) {
                            $taxonomy_category = MPWEM_Helper::all_taxonomy_as_text($event_id, 'mep_cat');
                            $taxonomy_organizer = MPWEM_Helper::all_taxonomy_as_text($event_id, 'mep_org');
                            ?>
                            <div
                                    class="event_item"
                                    data-event-id="<?php echo $event_id; ?>"
                                    data-event-title="<?php echo get_the_title($event_id); ?>"
                                    data-date-time="<?php echo get_mep_datetime($date, 'date'); ?>"
                                    data-city-name="<?php echo get_post_meta($event_id, 'mep_city', true); ?>"
                                    data-category="<?php echo $taxonomy_category; ?>"
                                    data-organizer="<?php echo $taxonomy_organizer; ?>"
                            >
                                <div class="event_item_img">
                                    <?php mep_get_list_thumbnail($event_id); ?>
                                </div>
                                <div class="event_item_details">
                                    <a href="<?php echo get_the_permalink($event_id); ?>">
                                        <h6><?php echo get_the_title($event_id); ?></h6>
                                    </a>
                                    <div class="alignCenter mt_xs">
                                        <span class="fa fa-calendar circleIcon_xs"></span>
                                        <span><?php echo get_mep_datetime($date, 'date-time'); ?></span>
                                    </div>
                                    <div class="alignCenter mt_xs">
                                        <span class="fa fa-location-arrow circleIcon_xs"></span>
                                        <span><?php echo MPWEM_Helper::get_event_location($event_id); ?></span>
                                    </div>
                                    <a class="defaultButton_xs deails_view" href="<?php echo get_the_permalink($event_id); ?>" target="_blank">
                                        <span><?php _e('Details View', 'mage-eventpress'); ?></span>
                                    </a>
                                </div>
                                <?php
                                $day = get_mep_datetime($date, 'day');
                                $month = get_mep_datetime($date, 'month-name');
                                ?>
                                <div class="item_date">
                                    <h4><?php echo apply_filters('mep_event_list_only_day_number', $day, $event_id); ?></h4>
                                    <hr/>
                                    <h4><?php echo apply_filters('mep_event_list_only_month_name', $month, $event_id); ?></h4>
                                </div>
                            </div>
                            <?php
                        }
                    }
                    wp_reset_postdata();
                    ?>
                </div>
                <div class="search_result_empty"><?php _e('No Match Event Found!', 'mage-eventpress') ?></div>
            </div>
        </div>
    </div>
    <?php
    return ob_get_clean();
}