| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
?> |
| 6 |
|
| 7 |
<div class="wrap propertyhive"> |
| 8 |
|
| 9 |
<h1>Matching Applicants For <?php echo esc_html($property->get_formatted_full_address()); ?> (<?php echo count($applicants); ?>)</h1> |
| 10 |
|
| 11 |
<form method="post" id="mainform" action="" enctype="multipart/form-data"> |
| 12 |
|
| 13 |
<div id="poststuff"> |
| 14 |
|
| 15 |
<?php |
| 16 |
if ( !empty($applicants) ) |
| 17 |
{ |
| 18 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 19 |
$select_all_actions = array( |
| 20 |
'email' => __( 'Email', 'propertyhive' ), |
| 21 |
'not_interested' => __( 'Not Suitable', 'propertyhive' ) |
| 22 |
); |
| 23 |
|
| 24 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 25 |
$select_all_actions = apply_filters( 'propertyhive_matching_select_all_actions', $select_all_actions ); |
| 26 |
?> |
| 27 |
<div class="select-actions" style="padding-bottom:15px"> |
| 28 |
<span style="display:inline-block; vertical-align:middle;"><?php echo esc_html(__( 'Select', 'propertyhive' )); ?>:</span> <?php |
| 29 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 30 |
foreach ( $select_all_actions as $key => $value ) |
| 31 |
{ |
| 32 |
echo '<a href="javascript:;" class="button" id="select_all_' . esc_attr(sanitize_title($key)) . '" style="display:inline-block; vertical-align:middle;">All - ' . esc_html($value) . '</a> '; |
| 33 |
} |
| 34 |
?> |
| 35 |
<a href="javascript:;" class="button" id="select_none" style="display:inline-block; vertical-align:middle;">None</a> |
| 36 |
</div> |
| 37 |
<?php |
| 38 |
echo '<table width="100%">'; |
| 39 |
|
| 40 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 41 |
$columns = array( |
| 42 |
'name' => 'Name', |
| 43 |
'contact_details' => 'Contact Details', |
| 44 |
'requirements' => 'Requirements' |
| 45 |
); |
| 46 |
|
| 47 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 48 |
$columns = apply_filters( 'propertyhive_matching_applicants_row_headings', $columns ); |
| 49 |
|
| 50 |
echo '<thead> |
| 51 |
<tr>'; |
| 52 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 53 |
foreach ( $columns as $key => $column ) |
| 54 |
{ |
| 55 |
echo '<th style="text-align:left">' . esc_html($column) . '</th>'; |
| 56 |
} |
| 57 |
echo ' |
| 58 |
<th style="text-align:left">Actions</th> |
| 59 |
</tr> |
| 60 |
</thead> |
| 61 |
<tbody> |
| 62 |
'; |
| 63 |
|
| 64 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 65 |
$percentage_lower = get_option( 'propertyhive_applicant_match_price_range_percentage_lower', '' ); |
| 66 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 67 |
$percentage_higher = get_option( 'propertyhive_applicant_match_price_range_percentage_higher', '' ); |
| 68 |
|
| 69 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 70 |
foreach ( $applicants as $applicant ) |
| 71 |
{ |
| 72 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 73 |
$previously_sent = array(); |
| 74 |
|
| 75 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 76 |
$currency = '£'; |
| 77 |
if ( isset($applicant['applicant_profile']['currency']) && !empty($applicant['applicant_profile']['currency']) ) |
| 78 |
{ |
| 79 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 80 |
$PH_Countries = new PH_Countries(); |
| 81 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 82 |
$selected_currency = $PH_Countries->get_currency($applicant['applicant_profile']['currency']); |
| 83 |
if ( $selected_currency !== false ) |
| 84 |
{ |
| 85 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 86 |
$currency = $selected_currency['currency_symbol']; |
| 87 |
} |
| 88 |
} |
| 89 |
|
| 90 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 91 |
$applicant_profile_match_history = get_post_meta( $applicant['contact_id'], '_applicant_profile_' . $applicant['applicant_profile']['applicant_profile_id'] . '_match_history', TRUE ); |
| 92 |
if ( isset($applicant_profile_match_history[$property->id]) && is_array($applicant_profile_match_history[$property->id]) && !empty($applicant_profile_match_history[$property->id]) ) |
| 93 |
{ |
| 94 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 95 |
$previously_sent = $applicant_profile_match_history[$property->id]; |
| 96 |
} |
| 97 |
|
| 98 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 99 |
$email_address = get_post_meta( $applicant['contact_id'], '_email_address', TRUE ); |
| 100 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 101 |
$forbidden_contact_methods = get_post_meta( $applicant['contact_id'], '_forbidden_contact_methods', TRUE ); |
| 102 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 103 |
$do_not_email = false; |
| 104 |
if ( is_array($forbidden_contact_methods) && in_array('email', $forbidden_contact_methods) ) |
| 105 |
{ |
| 106 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 107 |
$do_not_email = true; |
| 108 |
} |
| 109 |
|
| 110 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 111 |
$requirements = array(); |
| 112 |
if ( |
| 113 |
isset($applicant['applicant_profile']['department']) && |
| 114 |
( $applicant['applicant_profile']['department'] == 'residential-sales' || ph_get_custom_department_based_on($applicant['applicant_profile']['department']) == 'residential-sales' |
| 115 |
) |
| 116 |
) |
| 117 |
{ |
| 118 |
if ( isset($applicant['applicant_profile']['max_price']) && $applicant['applicant_profile']['max_price'] != '' ) |
| 119 |
{ |
| 120 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 121 |
$requirements[] = array( |
| 122 |
'label' => __( 'Maximum Price', 'propertyhive' ), |
| 123 |
'value' => $currency . esc_html( ph_display_price_field($applicant['applicant_profile']['max_price']) ), |
| 124 |
); |
| 125 |
} |
| 126 |
if ( $percentage_lower != '' && $percentage_higher != '' ) |
| 127 |
{ |
| 128 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 129 |
$match_price_range_lower = ''; |
| 130 |
if ( |
| 131 |
!isset($applicant['applicant_profile']['match_price_range_lower_actual']) || |
| 132 |
( isset($applicant['applicant_profile']['match_price_range_lower_actual']) && $applicant['applicant_profile']['match_price_range_lower_actual'] == '' ) |
| 133 |
) |
| 134 |
{ |
| 135 |
if ( isset($applicant['applicant_profile']['max_price']) && $applicant['applicant_profile']['max_price'] != '' ) |
| 136 |
{ |
| 137 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 138 |
$match_price_range_lower = (float) $applicant['applicant_profile']['max_price'] - ( (float) $applicant['applicant_profile']['max_price'] * ( (float) $percentage_lower / 100 ) ); |
| 139 |
} |
| 140 |
} |
| 141 |
else |
| 142 |
{ |
| 143 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 144 |
$match_price_range_lower = $applicant['applicant_profile']['match_price_range_lower']; |
| 145 |
} |
| 146 |
|
| 147 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 148 |
$match_price_range_higher = ''; |
| 149 |
if ( |
| 150 |
!isset($applicant['applicant_profile']['match_price_range_higher_actual']) || |
| 151 |
( isset($applicant['applicant_profile']['match_price_range_higher_actual']) && $applicant['applicant_profile']['match_price_range_higher_actual'] == '' ) |
| 152 |
) |
| 153 |
{ |
| 154 |
if ( isset($applicant['applicant_profile']['max_price']) && $applicant['applicant_profile']['max_price'] != '' ) |
| 155 |
{ |
| 156 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 157 |
$match_price_range_higher = (float) $applicant['applicant_profile']['max_price'] + ( (float) $applicant['applicant_profile']['max_price'] * ( (float) $percentage_higher / 100 ) ); |
| 158 |
} |
| 159 |
} |
| 160 |
else |
| 161 |
{ |
| 162 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 163 |
$match_price_range_higher = $applicant['applicant_profile']['match_price_range_higher']; |
| 164 |
} |
| 165 |
|
| 166 |
if ( |
| 167 |
$match_price_range_lower != '' && $match_price_range_higher != '' |
| 168 |
) |
| 169 |
{ |
| 170 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 171 |
$requirements[] = array( |
| 172 |
'label' => __( 'Maximum Price Range', 'propertyhive' ), |
| 173 |
'value' => $currency . esc_html( ph_display_price_field($match_price_range_lower) ) . ' to ' . $currency . esc_html( ph_display_price_field($match_price_range_higher) ), |
| 174 |
); |
| 175 |
} |
| 176 |
} |
| 177 |
} |
| 178 |
|
| 179 |
if ( |
| 180 |
isset($applicant['applicant_profile']['department']) && |
| 181 |
( $applicant['applicant_profile']['department'] == 'residential-lettings' || ph_get_custom_department_based_on($applicant['applicant_profile']['department']) == 'residential-lettings' |
| 182 |
) |
| 183 |
) |
| 184 |
{ |
| 185 |
if ( isset($applicant['applicant_profile']['max_rent']) && $applicant['applicant_profile']['max_rent'] != '' ) |
| 186 |
{ |
| 187 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 188 |
$requirements[] = array( |
| 189 |
'label' => __( 'Maximum Rent', 'propertyhive' ), |
| 190 |
'value' => $currency . esc_html( ph_display_price_field($applicant['applicant_profile']['max_rent']) ) . ' ' . esc_html( $applicant['applicant_profile']['rent_frequency'] ) |
| 191 |
); |
| 192 |
} |
| 193 |
} |
| 194 |
|
| 195 |
if ( isset($applicant['applicant_profile']['min_beds']) && $applicant['applicant_profile']['min_beds'] != '' ) |
| 196 |
{ |
| 197 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 198 |
$requirements[] = array( |
| 199 |
'label' => __( 'Minimum Beds', 'propertyhive' ), |
| 200 |
'value' => esc_html( $applicant['applicant_profile']['min_beds'] ), |
| 201 |
); |
| 202 |
} |
| 203 |
|
| 204 |
if ( isset($applicant['applicant_profile']['property_types']) && is_array($applicant['applicant_profile']['property_types']) && !empty($applicant['applicant_profile']['property_types']) ) |
| 205 |
{ |
| 206 |
//$requirements[] = 'Max Price: ' . $applicant['applicant_profile']['max_price']; |
| 207 |
} |
| 208 |
|
| 209 |
if ( get_option('propertyhive_applicant_locations_type') == 'text' && isset($applicant['applicant_profile']['location_text']) && $applicant['applicant_profile']['location_text'] != '') |
| 210 |
{ |
| 211 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 212 |
$location_value = $applicant['applicant_profile']['location_text']; |
| 213 |
|
| 214 |
if ( isset($applicant['applicant_profile']['location_radius']) && $applicant['applicant_profile']['location_radius'] != '' ) |
| 215 |
{ |
| 216 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 217 |
$location_value .= ' (Within '. $applicant['applicant_profile']['location_radius'] .' Miles)'; |
| 218 |
} |
| 219 |
|
| 220 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 221 |
$requirements[] = array( |
| 222 |
'label' => __( 'Location', 'propertyhive' ), |
| 223 |
'value' => esc_html( $location_value ), |
| 224 |
); |
| 225 |
} |
| 226 |
|
| 227 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 228 |
$requirements = apply_filters( 'propertyhive_applicant_requirements_display', $requirements, $applicant['contact_id'], $applicant['applicant_profile'] ); |
| 229 |
|
| 230 |
if ( isset($applicant['applicant_profile']['notes']) && $applicant['applicant_profile']['notes'] != '' ) |
| 231 |
{ |
| 232 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 233 |
$requirements[] = array( |
| 234 |
'label' => __( 'Notes', 'propertyhive' ), |
| 235 |
'value' => nl2br( esc_html( wp_strip_all_tags($applicant['applicant_profile']['notes']) ) ), |
| 236 |
); |
| 237 |
} |
| 238 |
|
| 239 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 240 |
$requirements_output = ''; |
| 241 |
if ( empty($requirements) ) |
| 242 |
{ |
| 243 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 244 |
$requirements_output = '-'; |
| 245 |
} |
| 246 |
else |
| 247 |
{ |
| 248 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 249 |
foreach ( $requirements as $requirement ) |
| 250 |
{ |
| 251 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 252 |
$requirements_output .= esc_html( $requirement['label'] ) . ': ' . $requirement['value'] . '<br>'; |
| 253 |
} |
| 254 |
} |
| 255 |
|
| 256 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 257 |
$columns = array( |
| 258 |
'name' => '<strong><a href="' . esc_url(get_edit_post_link($applicant['contact_id'])) . '" target="_blank">' . esc_html(get_the_title($applicant['contact_id'])) . '</a>' . ( ( isset($applicant['applicant_profile']['grading']) && $applicant['applicant_profile']['grading'] == 'hot' ) ? '<br><span style="color:#C00;">('. esc_html(__( 'Hot Applicant', 'propertyhive' )) . ')</span>' : '' ) . '</strong>', |
| 259 |
'contact_details' => 'T: ' . esc_html(get_post_meta( $applicant['contact_id'], '_telephone_number', TRUE )) . '<br>E: ' . esc_html($email_address), |
| 260 |
'requirements' => $requirements_output, |
| 261 |
); |
| 262 |
|
| 263 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 264 |
$columns = apply_filters( 'propertyhive_matching_applicants_row_data', $columns, $applicant, $property->id ); |
| 265 |
|
| 266 |
echo '<tr id="matching_contact_' . (int)$applicant['contact_id'] . '_applicant_profile_' . (int)$applicant['applicant_profile']['applicant_profile_id'] . '">'; |
| 267 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 268 |
foreach ( $columns as $key => $column ) |
| 269 |
{ |
| 270 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Built-in row text and requirement labels/values are escaped above; preserve trusted currency, requirement and propertyhive_matching_applicants_row_data HTML filters. |
| 271 |
echo '<td style="border-bottom:1px solid #CCC; padding:5px 0;">' . $column . '</td>'; |
| 272 |
} |
| 273 |
echo '<td style="border-bottom:1px solid #CCC; padding:5px 0;">'; |
| 274 |
|
| 275 |
echo '<label><input type="checkbox" name="email_contact_applicant_profile_id[]" value="' . (int)$applicant['contact_id'] . '|' . (int)$applicant['applicant_profile']['applicant_profile_id'] . '" '; |
| 276 |
|
| 277 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 278 |
$post_tip = ''; |
| 279 |
if ( strpos($email_address, '@') === FALSE ) |
| 280 |
{ |
| 281 |
echo ' disabled title="Invalid email address: ' . esc_attr($email_address) . '"'; |
| 282 |
//$post_tip = 'Invalid email address: ' . $email_address; |
| 283 |
} |
| 284 |
elseif ( $do_not_email ) |
| 285 |
{ |
| 286 |
echo ' disabled title="Contact via email not permitted - Set under contact details"'; |
| 287 |
//$post_tip = 'Contact via email not permitted - Set under contact details'; |
| 288 |
} |
| 289 |
else |
| 290 |
{ |
| 291 |
if ( !empty($previously_sent) ) |
| 292 |
{ |
| 293 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 294 |
$post_tip = 'Sent previously via ' . $previously_sent[count($previously_sent) - 1]['method'] . ' on ' . gmdate("jS F Y", strtotime($previously_sent[count($previously_sent) - 1]['date'])); |
| 295 |
|
| 296 |
if ( |
| 297 |
$on_market_change_date > $previously_sent[count($previously_sent) - 1]['date'] || |
| 298 |
$price_change_date > $previously_sent[count($previously_sent) - 1]['date'] |
| 299 |
) |
| 300 |
{ |
| 301 |
if ( $price_change_date > $previously_sent[count($previously_sent) - 1]['date'] ) |
| 302 |
{ |
| 303 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 304 |
$post_tip .= ', however a price change occurred on ' . gmdate("jS F Y", strtotime($price_change_date)); |
| 305 |
} |
| 306 |
elseif ( $on_market_change_date > $previously_sent[count($previously_sent) - 1]['date'] ) |
| 307 |
{ |
| 308 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. |
| 309 |
$post_tip .= ', however a change to the on market status occurred on ' . gmdate("jS F Y", strtotime($on_market_change_date)); |
| 310 |
} |
| 311 |
echo ' checked'; |
| 312 |
} |
| 313 |
} |
| 314 |
else |
| 315 |
{ |
| 316 |
echo ' checked'; |
| 317 |
} |
| 318 |
} |
| 319 |
|
| 320 |
echo '> Email Property To Applicant<span style="font-weight:400;">' . ( ($post_tip != '') ? ' - ' . esc_html($post_tip) : '' ) . '</span></label> |
| 321 |
|
| 322 |
<br>'; |
| 323 |
|
| 324 |
do_action( 'propertyhive_property_match_send_methods', $applicant['contact_id'], $applicant['applicant_profile']['applicant_profile_id'], $property->id ); |
| 325 |
|
| 326 |
echo '<label><input type="checkbox" name="not_interested_contact_applicant_profile_id[]" value="' . (int)$applicant['contact_id'] . '|' . (int)$applicant['applicant_profile']['applicant_profile_id'] . '"> Property Not Suitable</label>'; |
| 327 |
|
| 328 |
echo '</td>'; |
| 329 |
echo '</tr>'; |
| 330 |
} |
| 331 |
|
| 332 |
echo ' |
| 333 |
</tbody> |
| 334 |
</table> |
| 335 |
'; |
| 336 |
} |
| 337 |
else |
| 338 |
{ |
| 339 |
echo esc_html__( 'No matching applicants found', 'propertyhive' ); |
| 340 |
} |
| 341 |
?> |
| 342 |
|
| 343 |
<p class="submit"> |
| 344 |
|
| 345 |
<input name="save" class="button-primary" type="submit" value="<?php echo esc_html(__( 'Continue', 'propertyhive' )); ?>" /> |
| 346 |
|
| 347 |
<a href="<?php echo esc_url(get_edit_post_link( (int) $property_id )); ?>" class="button"><?php echo esc_html(__( 'Cancel', 'propertyhive' )); ?></a> |
| 348 |
|
| 349 |
<input type="hidden" name="step" value="one" /> |
| 350 |
<?php wp_nonce_field( 'propertyhive-matching-applicants' ); ?> |
| 351 |
|
| 352 |
</p> |
| 353 |
|
| 354 |
<p> |
| 355 |
<?php echo esc_html(__( "If you've opted to email any of the applicants you'll have the ability to edit the contents of the email in the next step.", 'propertyhive' )); ?> |
| 356 |
</p> |
| 357 |
|
| 358 |
</div> |
| 359 |
|
| 360 |
</form> |
| 361 |
|
| 362 |
</div> |
| 363 |
|
| 364 |
<script> |
| 365 |
|
| 366 |
jQuery(document).ready(function() |
| 367 |
{ |
| 368 |
jQuery('body').on('change', 'input[name=\'not_interested_contact_applicant_profile_id[]\']', function() |
| 369 |
{ |
| 370 |
var applicant_contact_profile_id = jQuery(this).val(); |
| 371 |
var applicant_contact_profile_id_split = applicant_contact_profile_id.split('|'); |
| 372 |
|
| 373 |
jQuery('input[name=\'email_contact_applicant_profile_id[]\'][value=\'' + applicant_contact_profile_id + '\']').attr('checked', false); |
| 374 |
|
| 375 |
opacity = 0.4; |
| 376 |
if ( !jQuery(this).is(':checked') ) |
| 377 |
{ |
| 378 |
opacity = 1; |
| 379 |
} |
| 380 |
jQuery('#matching_contact_' + applicant_contact_profile_id_split[0] + '_applicant_profile_' + applicant_contact_profile_id_split[1]).animate({ |
| 381 |
opacity: opacity |
| 382 |
}, |
| 383 |
{ |
| 384 |
duration: 250 |
| 385 |
}); |
| 386 |
|
| 387 |
return false; |
| 388 |
}); |
| 389 |
|
| 390 |
jQuery('.select-actions a').click(function(e) |
| 391 |
{ |
| 392 |
e.preventDefault(); |
| 393 |
|
| 394 |
var id = jQuery(this).attr('id').replace("select_all_", ""); |
| 395 |
|
| 396 |
jQuery('input[name$=\'_contact_applicant_profile_id[]\']').prop('checked', false); |
| 397 |
|
| 398 |
if ( id != 'select_none' ) |
| 399 |
{ |
| 400 |
jQuery('input[name=\'' + id + '_contact_applicant_profile_id[]\']').prop('checked', 'checked'); |
| 401 |
} |
| 402 |
}); |
| 403 |
}); |
| 404 |
|
| 405 |
</script> |