PluginProbe
Property Hive / 2.2.2
Property Hive v2.2.2
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / templates / account / owner-viewings.php

owner-viewings.php in Property Hive 2.2.2, at templates/account/owner-viewings.php

109 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Owner viewings page within My Account
4 *
5 * This template can be overridden by copying it to yourtheme/propertyhive/account/owner-viewings.php.
6 *
7 * @author PropertyHive
8 * @package PropertyHive/Templates
9 * @version 1.0.0
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit;
14 }
15
16 ?>
17
18 <div class="propertyhive-owner-viewings">
19
20 <h4>Upcoming Viewings</h4>
21
22 <?php
23 if ( !empty($upcoming_viewings) )
24 {
25 echo '
26 <table class="viewings-table upcoming-viewings-table" width="100%">
27 <tr>
28 <th>&nbsp;</th>
29 <th>' . esc_html(__( 'Viewing Date/Time', 'propertyhive' )) . '</th>
30 <th>' . esc_html(__( 'Property', 'propertyhive' )) . '</th>
31 </tr>
32 ';
33 foreach ($upcoming_viewings as $viewing)
34 {
35 $property = new PH_Property( (int)$viewing->property_id );
36
37 $link_prefix = ( ( $property->on_market == 'yes' ) ? '<a href="' . esc_url(get_permalink( $viewing->property_id )) . '">' : '' );
38 $link_suffix = ( ( $property->on_market == 'yes' ) ? '</a>' : '' );
39
40 $date_prefix = ( ( $viewing->status == 'cancelled' ) ? '<span style="text-decoration:line-through">' : '' );
41 $date_suffix = ( ( $viewing->status == 'cancelled' ) ? '</span> (' . esc_html(__( 'Cancelled', 'propertyhive' )) . ')' : '' );
42
43 if ( $viewing->status == 'cancelled' && $viewing->cancelled_reason_public == 'yes' && $viewing->cancelled_reason != '' )
44 {
45 $date_suffix .= '<br>' . esc_html(__( 'Reason Cancelled', 'propertyhive' )) . ':<br>' . nl2br(esc_html($viewing->cancelled_reason));
46 }
47
48 $image = $property->get_main_photo_src();
49
50 echo '<tr>
51 <td>' . ( ( $image !== false ) ? $link_prefix . '<img src="' . esc_url($image) . '" width="75" alt="' . esc_attr(get_the_title( $viewing->property_id )) . '">' : '' ) . $link_suffix . '</td>
52 <td>' . $date_prefix . esc_html(date( "H:i jS M Y", strtotime( $viewing->start_date_time ) )) . $date_suffix . '</td>
53 <td>' . $link_prefix . esc_html(get_the_title( $viewing->property_id )) . $link_suffix . '<br>' . $property->get_formatted_price() . '</td>
54 </tr>';
55 }
56 echo '</table>';
57 }
58 else
59 {
60 echo '<p class="propertyhive-info">' . esc_html(__( 'No upcoming viewings scheduled', 'propertyhive' )) . '</p>';
61 }
62 ?>
63
64 <h4>Past Viewings</h4>
65
66 <?php
67 if ( !empty($past_viewings) )
68 {
69 echo '
70 <table class="viewings-table upcoming-viewings-table" width="100%">
71 <tr>
72 <th>&nbsp;</th>
73 <th>' . esc_html(__( 'Viewing Date/Time', 'propertyhive' )) . '</th>
74 <th>' . esc_html(__( 'Property', 'propertyhive' )) . '</th>
75 </tr>
76 ';
77 foreach ($past_viewings as $viewing)
78 {
79 $property = new PH_Property( (int)$viewing->property_id );
80
81 $link_prefix = ( ( $property->on_market == 'yes' ) ? '<a href="' . esc_url(get_permalink( $viewing->property_id )) . '">' : '' );
82 $link_suffix = ( ( $property->on_market == 'yes' ) ? '</a>' : '' );
83
84 $date_prefix = ( ( $viewing->status == 'cancelled' ) ? '<span style="text-decoration:line-through">' : '' );
85 $date_suffix = ( ( $viewing->status == 'cancelled' ) ? '</span> (' . esc_html(__( 'Cancelled', 'propertyhive' )) . ')' : '' );
86
87 if ( $viewing->status == 'cancelled' && $viewing->cancelled_reason_public == 'yes' && $viewing->cancelled_reason != '' )
88 {
89 $date_suffix .= '<br>' . esc_html(__( 'Reason Cancelled', 'propertyhive' )) . ':<br>' . nl2br(esc_html($viewing->cancelled_reason));
90 }
91
92 $image = $property->get_main_photo_src();
93
94 echo '<tr>
95 <td>' . ( ( $image !== false ) ? $link_prefix . '<img src="' . esc_url($image) . '" width="75" alt="' . esc_attr(get_the_title( $viewing->property_id )) . '">' : '' ) . $link_suffix . '</td>
96 <td>' . $date_prefix . esc_html(date( "H:i jS M Y", strtotime( $viewing->start_date_time ) )) . $date_suffix . '</td>
97 <td>' . $link_prefix . esc_html(get_the_title( $viewing->property_id )) . $link_suffix . '<br>' . $property->get_formatted_price() . '</td>
98 </tr>';
99 }
100 echo '</table>';
101 }
102 else
103 {
104 echo '<p class="propertyhive-info">' . esc_html(__( 'No past viewings', 'propertyhive' )) . '</p>';
105 }
106 ?>
107
108 </div>
109