| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* The template for Element Bookings Prices table. |
| 5 |
* This is the template that elementor element table, listings |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
if (!defined('ABSPATH')) { |
| 10 |
exit; // Exit if accessed directly. |
| 11 |
} |
| 12 |
|
| 13 |
?> |
| 14 |
<div class="wdk-booking-element" id="wdk_el_<?php echo esc_html($id_element); ?>"> |
| 15 |
<div class="wdk-listing-related-listings-table"> |
| 16 |
|
| 17 |
<table class="wdk-table responsive"> |
| 18 |
<?php if (count($results) == 0) : ?> |
| 19 |
<tr class="no-items"> |
| 20 |
<td class="colspanchange" colspan="7"><?php echo esc_html__('Related listings not found', 'wpdirectorykit'); ?></td> |
| 21 |
</tr> |
| 22 |
<?php endif; ?> |
| 23 |
|
| 24 |
<?php foreach ($results as $key => $child_idlisting) : ?> |
| 25 |
<?php if (!wdk_field_value('is_activated', $child_idlisting) || !wdk_field_value('is_approved', $child_idlisting)) continue; ?> |
| 26 |
<tr class="wdk-sublistings-part"> |
| 27 |
<td> |
| 28 |
<img src="<?php echo esc_url(wdk_image_src($child_idlisting, 'full')); ?>" alt="<?php echo esc_attr(wmvc_show_data('post_title', $child_idlisting)); ?>" class="wdk-image"> |
| 29 |
</td> |
| 30 |
<?php foreach ($settings['related_fields_list'] as $field) : ?> |
| 31 |
<?php |
| 32 |
if (strpos($field['field'], '__') !== FALSE) { |
| 33 |
$field['field'] = substr($field['field'], strpos($field['field'], '__') + 2); |
| 34 |
} |
| 35 |
?> |
| 36 |
<td> |
| 37 |
<?php if ($field['is_link'] == 'yes') : ?> |
| 38 |
<a href="<?php echo get_permalink($child_idlisting); ?>" title="<?php echo esc_attr__('View', 'wpdirectorykit'); ?>" target="blank"> |
| 39 |
<?php else : ?> |
| 40 |
<span> |
| 41 |
<?php endif; ?> |
| 42 |
|
| 43 |
<?php if ($field['is_stars'] == 'yes') : ?> |
| 44 |
<?php $stars = round(floatval(wdk_field_value($field['field'], $child_idlisting)), 2); ?> |
| 45 |
<span class="stars-lst"> |
| 46 |
<?php for ($i = 1; $i <= 5; $i++) : ?> |
| 47 |
<?php if ($i <= $stars) : ?> |
| 48 |
<span><i class="fas fa-star star-active"></i></span> |
| 49 |
<?php elseif (abs($stars - $i) < 1) : ?> |
| 50 |
<span><i class="fas fa-star-half-alt"></i></span> |
| 51 |
<?php elseif (false) : ?> |
| 52 |
<span><i class="far fa-star innactive"></i></span> |
| 53 |
<?php endif; ?> |
| 54 |
<?php endfor; ?> |
| 55 |
</span> |
| 56 |
<?php else : ?> |
| 57 |
<?php echo esc_html($field['field_prefix']); ?> |
| 58 |
<?php echo esc_html(apply_filters('wpdirectorykit/listing/field/prefix', wdk_field_option($field['field'], 'prefix'), $field['field'])); ?> |
| 59 |
<?php echo esc_html(apply_filters('wpdirectorykit/listing/field/value', wdk_field_value_on_type($field['field'], $child_idlisting, '-'), $field['field'])); ?> |
| 60 |
<?php echo esc_html(apply_filters('wpdirectorykit/listing/field/suffix', wdk_field_option($field['field'], 'suffix'), $field['field'])); ?> |
| 61 |
<?php echo esc_html($field['field_suffix']); ?> |
| 62 |
<?php endif; ?> |
| 63 |
|
| 64 |
<?php if ($field['is_link'] == 'yes') : ?> |
| 65 |
</a> |
| 66 |
<?php else : ?> |
| 67 |
</span> |
| 68 |
<?php endif; ?> |
| 69 |
</td> |
| 70 |
<?php endforeach; ?> |
| 71 |
<td> |
| 72 |
<a href="<?php echo get_permalink($child_idlisting); ?>" class="wdk-btn"><?php echo esc_html__('More info', 'wpdirectorykit'); ?></a> |
| 73 |
</td> |
| 74 |
</tr> |
| 75 |
<?php endforeach; ?> |
| 76 |
</table> |
| 77 |
</div> |
| 78 |
</div> |