| 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 |
<div class="propertyhive-owner-properties"> |
| 18 |
|
| 19 |
<?php |
| 20 |
if ( !empty($properties) ) |
| 21 |
{ |
| 22 |
echo ' |
| 23 |
<table class="viewings-table upcoming-viewings-table" width="100%"> |
| 24 |
<tr> |
| 25 |
<th> </th> |
| 26 |
<th>' . esc_html(__( 'Address', 'propertyhive' )) . '</th> |
| 27 |
<th>' . esc_html(__( 'Price', 'propertyhive' )) . '</th> |
| 28 |
<th>' . esc_html(__( 'Status', 'propertyhive' )) . '</th> |
| 29 |
</tr> |
| 30 |
'; |
| 31 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable included through the account rendering helper scope. |
| 32 |
foreach ( $properties as $property ) |
| 33 |
{ |
| 34 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable included through the account rendering helper scope. |
| 35 |
$property_url = ( 'yes' === $property->on_market ) |
| 36 |
? get_permalink( $property->id ) |
| 37 |
: ''; |
| 38 |
|
| 39 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable included through the account rendering helper scope. |
| 40 |
$image = $property->get_main_photo_src(); |
| 41 |
|
| 42 |
echo '<tr>'; |
| 43 |
|
| 44 |
echo '<td>'; |
| 45 |
|
| 46 |
if ( false !== $image ) |
| 47 |
{ |
| 48 |
if ( $property_url ) |
| 49 |
{ |
| 50 |
echo '<a href="' . esc_url( $property_url ) . '">'; |
| 51 |
} |
| 52 |
|
| 53 |
echo '<img src="' . esc_url( $image ) . '" width="75" alt="' . esc_attr( get_the_title( $property->id ) ) . '">'; |
| 54 |
|
| 55 |
if ( $property_url ) |
| 56 |
{ |
| 57 |
echo '</a>'; |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
echo '</td>'; |
| 62 |
|
| 63 |
echo '<td>'; |
| 64 |
|
| 65 |
if ( $property_url ) |
| 66 |
{ |
| 67 |
echo '<a href="' . esc_url( $property_url ) . '">'; |
| 68 |
} |
| 69 |
|
| 70 |
echo esc_html( get_the_title( $property->id ) ); |
| 71 |
|
| 72 |
if ( $property_url ) |
| 73 |
{ |
| 74 |
echo '</a>'; |
| 75 |
} |
| 76 |
|
| 77 |
echo '</td>'; |
| 78 |
|
| 79 |
echo '<td>' . wp_kses_post( $property->get_formatted_price() ) . '</td>'; |
| 80 |
|
| 81 |
echo '<td>' . |
| 82 |
esc_html( $property->availability ) . |
| 83 |
'<br>' . |
| 84 |
( 'yes' === $property->on_market |
| 85 |
? esc_html__( 'On Market', 'propertyhive' ) |
| 86 |
: esc_html__( 'Not On Market', 'propertyhive' ) |
| 87 |
) . |
| 88 |
'</td>'; |
| 89 |
|
| 90 |
echo '</tr>'; |
| 91 |
} |
| 92 |
echo '</table>'; |
| 93 |
} |
| 94 |
else |
| 95 |
{ |
| 96 |
echo '<p class="propertyhive-info">' . esc_html(__( 'No properties found', 'propertyhive' )) . '</p>'; |
| 97 |
} |
| 98 |
?> |
| 99 |
|
| 100 |
</div> |
| 101 |
|