| 1 |
<?php |
| 2 |
/** |
| 3 |
* Applicant viewings page within My Account |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/propertyhive/account/applicant-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-applicant-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> </th> |
| 29 |
<th>' . __( 'Viewing Date/Time', 'propertyhive' ) . '</th> |
| 30 |
<th>' . __( '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="' . get_permalink( $viewing->property_id ) . '">' : '' ); |
| 38 |
$link_suffix = ( ( $property->on_market == 'yes' ) ? '</a>' : '' ); |
| 39 |
|
| 40 |
$image = $property->get_main_photo_src(); |
| 41 |
|
| 42 |
echo '<tr> |
| 43 |
<td>' . ( ( $image !== false ) ? $link_prefix . '<img src="' . $image . '" width="75" alt="' . get_the_title( $viewing->property_id ) . '">' : '' ) . $link_suffix . '</td> |
| 44 |
<td>' . date( "H:i jS M Y", strtotime( $viewing->start_date_time ) ) . '</td> |
| 45 |
<td>' . $link_prefix . get_the_title( $viewing->property_id ) . $link_suffix . '<br>' . $property->get_formatted_price() . '</td> |
| 46 |
</tr>'; |
| 47 |
} |
| 48 |
echo '</table>'; |
| 49 |
} |
| 50 |
else |
| 51 |
{ |
| 52 |
'<p class="propertyhive-info">' . _e( 'No upcoming viewings scheduled', 'propertyhive' ) . '</p>'; |
| 53 |
} |
| 54 |
?> |
| 55 |
|
| 56 |
<h4>Past Viewings</h4> |
| 57 |
|
| 58 |
<?php |
| 59 |
if ( !empty($past_viewings) ) |
| 60 |
{ |
| 61 |
echo ' |
| 62 |
<table class="viewings-table upcoming-viewings-table" width="100%"> |
| 63 |
<tr> |
| 64 |
<th> </th> |
| 65 |
<th>' . __( 'Viewing Date/Time', 'propertyhive' ) . '</th> |
| 66 |
<th>' . __( 'Property', 'propertyhive' ) . '</th> |
| 67 |
</tr> |
| 68 |
'; |
| 69 |
foreach ($past_viewings as $viewing) |
| 70 |
{ |
| 71 |
$property = new PH_Property( (int)$viewing->property_id ); |
| 72 |
|
| 73 |
$link_prefix = ( ( $property->on_market == 'yes' ) ? '<a href="' . get_permalink( $viewing->property_id ) . '">' : '' ); |
| 74 |
$link_suffix = ( ( $property->on_market == 'yes' ) ? '</a>' : '' ); |
| 75 |
|
| 76 |
$image = $property->get_main_photo_src(); |
| 77 |
|
| 78 |
echo '<tr> |
| 79 |
<td>' . ( ( $image !== false ) ? $link_prefix . '<img src="' . $image . '" width="75" alt="' . get_the_title( $viewing->property_id ) . '">' : '' ) . $link_suffix . '</td> |
| 80 |
<td>' . date( "H:i jS M Y", strtotime( $viewing->start_date_time ) ) . '</td> |
| 81 |
<td>' . $link_prefix . get_the_title( $viewing->property_id ) . $link_suffix . '<br>' . $property->get_formatted_price() . '</td> |
| 82 |
</tr>'; |
| 83 |
} |
| 84 |
echo '</table>'; |
| 85 |
} |
| 86 |
else |
| 87 |
{ |
| 88 |
'<p class="propertyhive-info">' . _e( 'No past viewings', 'propertyhive' ) . '</p>'; |
| 89 |
} |
| 90 |
?> |
| 91 |
|
| 92 |
</div> |
| 93 |
|