_e('EDIT', 'trav'); ?> </a> </div> </figure> <div class="details"> <div class="feedback"> <div data-placement="bottom" data-toggle="tooltip" class="five-stars-container" title="<?php echo esc_attr($review . ' ' . __('stars', 'trav')); ?> "><span style="width: <?php echo esc_attr($review / 5 * 100); ?> %;" class="five-stars"></span></div> <span class="review"><?php echo esc_html(trav_get_review_count($booking_data['accommodation_id']) . ' ' . __('reviews', 'trav')); ?> </span> </div> <div class="constant-column-3 timing clearfix"> <div class="check-in"> <label><?php _e('Check in', 'trav'); ?> </label> <span><?php echo date("M j, Y", trav_strtotime($booking_data['date_from'])); ?> <br /><?php $date_from_time = get_post_meta($booking_data['accommodation_id'], 'trav_accommodation_check_in', true); if (isset($date_from_time)) {
?> </span> </span> <?php } ?> <div class="feedback clearfix"> <div title="<?php echo esc_attr($acc_review . ' ' . __('stars', 'trav')); ?> " class="five-stars-container" data-toggle="tooltip" data-placement="bottom"><span class="five-stars" style="width: <?php echo esc_attr($acc_review / 5 * 100); ?> %;"></span></div> <span class="review pull-right"><?php echo esc_html(trav_get_review_count($acc_id) . ' ' . __('reviews', 'trav')); ?> </span> </div> <p class="description"> <?php if (isset($acc_meta['trav_accommodation_brief'])) { echo esc_html($acc_meta['trav_accommodation_brief'][0]); } else { $brief_content = apply_filters('the_content', get_post_field('post_content', $acc_id)); echo wp_kses_post(wp_trim_words($brief_content, 20, '')); } ?> </p> <?php if (is_user_logged_in()) {
function trav_acc_get_acc_list_sigle($acc_id, $list_style, $before_article = '', $after_article = '', $show_badge = false, $animation = '') { echo wp_kses_post($before_article); // $acc_id = trav_acc_clang_id( $acc_id ); $avg_price = get_post_meta($acc_id, 'trav_accommodation_avg_price', true); $review = get_post_meta($acc_id, 'review', true); $review = !empty($review) ? round($review, 1) : 0; $brief = get_post_meta($acc_id, 'trav_accommodation_brief', true); if (empty($brief)) { $brief = apply_filters('the_content', get_post_field('post_content', $acc_id)); $brief = wp_trim_words($brief, 20, ''); } $loc = get_post_meta($acc_id, 'trav_accommodation_loc', true); $discount_rate = get_post_meta($acc_id, 'trav_accommodation_discount_rate', true); if ($list_style == "style1" || $list_style == "style2") { ?> <article class="box"> <figure <?php echo wp_kses_post($animation); ?> > <a href="#" data-post_id="<?php echo esc_attr($acc_id); ?> " class="hover-effect popup-gallery"><?php echo get_the_post_thumbnail($acc_id, 'biggallery-thumb'); ?> </a> <?php if ($show_badge && !empty($discount_rate)) { ?> <span class="discount"><span class="discount-text"><?php echo esc_html($discount_rate . '%' . ' ' . __('Discount', 'trav')); ?> </span></span> <?php } ?> </figure> <div class="details"> <?php if ($list_style == "style1") { if (!empty($avg_price) && is_numeric($avg_price)) { ?> <span class="price"><small><?php _e('avg/night', 'trav'); ?> </small><?php echo esc_html(trav_get_price_field($avg_price)); ?> </span> <?php } ?> <h4 class="box-title"> <a href="<?php echo esc_url(get_permalink($acc_id)); ?> "><?php echo esc_html(get_the_title($acc_id)); ?> </a> <small><?php echo esc_html(trav_acc_get_city($acc_id) . ' ' . trav_acc_get_country($acc_id)); ?> </small> </h4> <div class="feedback"> <div data-placement="bottom" data-toggle="tooltip" class="five-stars-container" title="<?php echo esc_attr($review . ' ' . __('stars', 'trav')); ?> "><span style="width: <?php echo esc_attr($review / 5 * 100); ?> %;" class="five-stars"></span></div> <span class="review"><?php echo esc_html(trav_get_review_count($acc_id) . ' ' . __('reviews', 'trav')); ?> </span> </div> <p class="description"><?php echo wp_kses_post($brief); ?> </p> <div class="action clearfix"> <?php if (!empty($loc)) { ?> <a class="button btn-small" href="<?php echo esc_url(get_permalink($acc_id)); ?> "><?php _e('SELECT', 'trav'); ?> </a> <a class="button btn-small yellow popup-map" href="#" data-box="<?php echo esc_attr($loc); ?> "><?php _e('VIEW ON MAP', 'trav'); ?> </a> <?php } else { ?> <a class="button btn-small full-width" href="<?php echo esc_url(get_permalink($acc_id)); ?> "><?php _e('SELECT', 'trav'); ?> </a> <?php } ?> </div> <?php } elseif ($list_style == "style2") { ?> <a title="View all" href="<?php echo esc_url(get_permalink($acc_id)); ?> " class="pull-right button uppercase"><?php _e('select', 'trav'); ?> </a> <h4 class="box-title"><a href="<?php echo esc_url(get_permalink($acc_id)); ?> "><?php echo esc_html(get_the_title($acc_id)); ?> </a></h4> <?php if (!empty($avg_price) && is_numeric($avg_price)) { ?> <label class="price-wrapper"> <span class="price-per-unit"><?php echo esc_html(trav_get_price_field($avg_price)); ?> </span><?php _e('avg/night', 'trav'); ?> </label> <?php } } ?> </div> </article> <?php } elseif ($list_style == "style3") { ?> <article class="box"> <figure class="col-sm-5 col-md-4"> <a href="#" data-post_id="<?php echo esc_attr($acc_id); ?> " class="hover-effect popup-gallery"><?php echo get_the_post_thumbnail($acc_id, 'biggallery-thumb'); ?> </a> <?php if ($show_badge && !empty($discount_rate)) { ?> <span class="discount"><span class="discount-text"><?php echo esc_html($discount_rate . '%' . ' ' . __('Discount', 'trav')); ?> </span></span> <?php } ?> </figure> <div class="details col-xs-12 col-sm-7 col-md-8"> <div> <div> <h4 class="box-title"><a href="<?php echo esc_url(get_permalink($acc_id)); ?> "><?php echo esc_html(get_the_title($acc_id)); ?> </a><small><i class="soap-icon-departure yellow-color"></i> <?php echo esc_html(trav_acc_get_city($acc_id) . ' ' . trav_acc_get_country($acc_id)); ?> </small></h4> </div> <div> <div class="five-stars-container"> <span class="five-stars" style="width: <?php echo esc_attr($review / 5 * 100); ?> %;"></span> </div> <span class="review"><?php echo esc_html(trav_get_review_count($acc_id) . ' ' . __('reviews', 'trav')); ?> </span> </div> </div> <div> <p><?php echo wp_kses_post($brief); ?> </p> <div> <span class="price"><small><?php _e('avg/night', 'trav'); ?> </small><?php echo esc_html(trav_get_price_field($avg_price)); ?> </span> <a class="button btn-small full-width text-center" title="<?php _e('select', 'trav'); ?> " href="<?php echo esc_url(get_permalink($acc_id)); ?> "><?php _e('SELECT', 'trav'); ?> </a> </div> </div> </div> </article> <?php } elseif ($list_style == "style4") { ?> <div class="row"> <div class="col-xs-2"> <a href="<?php echo esc_url(get_permalink($acc_id)); ?> " class="badge-container"> <?php if ($show_badge && !empty($discount_rate)) { ?> <span class="badge-content"><?php echo __('save', 'trav') . '<br />' . esc_html($discount_rate) . '%'; ?> </span> <?php } ?> <?php echo get_the_post_thumbnail($acc_id, 'widget-thumb'); ?> </a> </div> <div class="col-xs-8"> <h5 class="box-title"><a href="<?php echo esc_url(get_permalink($acc_id)); ?> "><?php echo esc_html(get_the_title($acc_id)); ?> </a><small><?php echo esc_html(trav_acc_get_city($acc_id) . ' ' . trav_acc_get_country($acc_id)); ?> </small></h5> <p class="no-margin"><?php echo wp_kses_post($brief); ?> </p> </div> <div class="col-xs-2"> <span class="price"><small><?php _e('avg/night', 'trav'); ?> </small><?php echo esc_html(trav_get_price_field($avg_price)); ?> </span> <br /><br /> <a class="button green-bg pull-right" href="<?php echo esc_url(get_permalink($acc_id)); ?> "><?php _e('SELECT', 'trav'); ?> </a> </div> </div> <?php } echo wp_kses_post($after_article); }