get_currency($applicant_profile['currency']);
if ( $selected_currency !== false )
{
// 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.
$currency = $selected_currency['currency_symbol'];
}
}
echo '
' . esc_html( __('Applicant Requirements', 'propertyhive') ) . '
';
// 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.
$requirements = array();
if (
isset($applicant_profile['department']) &&
( $applicant_profile['department'] == 'residential-sales' || ph_get_custom_department_based_on($applicant_profile['department']) == 'residential-sales' ) &&
isset($applicant_profile['max_price_actual']) &&
$applicant_profile['max_price_actual'] != '' &&
$applicant_profile['max_price_actual'] != 0
)
{
// 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.
$requirements[] = array(
'label' => __( 'Maximum Price', 'propertyhive' ),
'value' => $currency . esc_html( ph_display_price_field($applicant_profile['max_price']) ),
);
}
if (
isset($applicant_profile['department']) &&
( $applicant_profile['department'] == 'residential-sales' || ph_get_custom_department_based_on($applicant_profile['department']) == 'residential-sales'
)
)
{
if ( $percentage_lower != '' && $percentage_higher != '' )
{
// 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.
$match_price_range_lower = '';
// 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.
$match_price_range_lower_display = '';
if (
!isset($applicant_profile['match_price_range_lower_actual']) ||
( isset($applicant_profile['match_price_range_lower_actual']) && $applicant_profile['match_price_range_lower_actual'] == '' )
)
{
if ( isset($applicant_profile['max_price']) && $applicant_profile['max_price'] != '' )
{
// 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.
$match_price_range_lower = (float) $applicant_profile['max_price'] - ( (float) $applicant_profile['max_price'] * ( (float) $percentage_lower / 100 ) );
}
}
else
{
// 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.
$match_price_range_lower = $applicant_profile['match_price_range_lower'];
}
// 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.
$match_price_range_higher = '';
if (
!isset($applicant_profile['match_price_range_higher_actual']) ||
( isset($applicant_profile['match_price_range_higher_actual']) && $applicant_profile['match_price_range_higher_actual'] == '' )
)
{
if ( isset($applicant_profile['max_price']) && $applicant_profile['max_price'] != '' )
{
// 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.
$match_price_range_higher = (float) $applicant_profile['max_price'] + ( (float) $applicant_profile['max_price'] * ( (float) $percentage_higher / 100 ) );
}
}
else
{
// 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.
$match_price_range_higher = $applicant_profile['match_price_range_higher'];
}
if (
$match_price_range_lower != '' && $match_price_range_higher != ''
)
{
// 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.
$requirements[] = array(
'label' => __( 'Match Price Range', 'propertyhive' ),
'value' => $currency . esc_html( ph_display_price_field($match_price_range_lower) ) . ' to ' . $currency . esc_html( ph_display_price_field($match_price_range_higher) ),
);
}
}
}
if (
isset($applicant_profile['department']) && ( $applicant_profile['department'] == 'residential-lettings' || ph_get_custom_department_based_on($applicant_profile['department']) == 'residential-lettings' ) &&
isset($applicant_profile['max_price_actual']) && $applicant_profile['max_price_actual'] != '' && $applicant_profile['max_price_actual'] != 0
)
{
// 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.
$requirements[] = array(
'label' => __( 'Maximum Rent', 'propertyhive' ),
'value' => $currency . esc_html( ph_display_price_field($applicant_profile['max_rent']) ) . ' ' . esc_html( $applicant_profile['rent_frequency'] ),
);
}
if (
isset($applicant_profile['department']) &&
(
$applicant_profile['department'] == 'residential-sales' ||
$applicant_profile['department'] == 'residential-lettings' ||
ph_get_custom_department_based_on($applicant_profile['department']) == 'residential-sales' ||
ph_get_custom_department_based_on($applicant_profile['department']) == 'residential-lettings'
)
)
{
if ( isset($applicant_profile['min_beds']) && $applicant_profile['min_beds'] != '' && $applicant_profile['min_beds'] != 0 )
{
// 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.
$requirements[] = array(
'label' => __( 'Minimum Beds', 'propertyhive' ),
'value' => esc_html( $applicant_profile['min_beds'] ),
);
}
if ( isset($applicant_profile['property_types']) && is_array($applicant_profile['property_types']) && !empty($applicant_profile['property_types']) )
{
// 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.
$terms = get_terms( array_merge( wp_parse_args( array('hide_empty' => false, 'fields' => 'names', 'include' => $applicant_profile['property_types']) ), array( 'taxonomy' => 'property_type' ) ) );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) )
{
// 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.
$sliced_terms = array_slice( $terms, 0, 2 );
// 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.
$requirements[] = array(
'label' => __( 'Property Types', 'propertyhive' ),
'value' => esc_html( implode(", ", $sliced_terms) ) . ( (count($terms) > 2) ? '
+ ' . (count($terms) - 2) . ' more' : '' ),
);
}
}
}
if (
isset($applicant_profile['department']) &&
( $applicant_profile['department'] == 'commercial' || ph_get_custom_department_based_on($applicant_profile['department']) == 'commercial' )
)
{
if ( isset($applicant_profile['available_as']) && is_array($applicant_profile['available_as']) && !empty($applicant_profile['available_as']) )
{
// 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.
$available_as = array();
if ( in_array('sale', $applicant_profile['available_as']) )
{
// 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.
$available_as[] = 'For Sale';
}
if ( in_array('rent', $applicant_profile['available_as']) )
{
// 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.
$available_as[] = 'To Rent';
}
// 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.
$requirements[] = array(
'label' => __( 'Available As', 'propertyhive' ),
'value' => implode(", ", $available_as),
);
}
if (
(isset($applicant_profile['min_floor_area_actual']) && $applicant_profile['min_floor_area_actual'] != '')
||
(isset($applicant_profile['max_floor_area_actual']) && $applicant_profile['max_floor_area_actual'] != '')
)
{
// 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.
$sizes = array('min' => '', 'max' => '');
// 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.
$value = '';
if ( isset($applicant_profile['min_floor_area_actual']) && $applicant_profile['min_floor_area_actual'] != '' )
{
// 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.
$sizes['min'] = $applicant_profile['min_floor_area_actual'];
}
if ( isset($applicant_profile['max_floor_area_actual']) && $applicant_profile['max_floor_area_actual'] != '' )
{
// 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.
$sizes['max'] = $applicant_profile['max_floor_area_actual'];
}
if ( $sizes['min'] != '' && $sizes['max'] != '' )
{
// 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.
$value = number_format( (float) $sizes['min'] ) . ' - ' . number_format( (float) $sizes['max'] ) . ' Sq Ft';
}
if ( $sizes['min'] != '' && $sizes['max'] == '' )
{
// 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.
$value = 'From ' . number_format( (float) $sizes['min'] ) . ' Sq Ft';
}
if ( $sizes['min'] == '' && $sizes['max'] != '' )
{
// 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.
$value = 'Up To ' . number_format( (float) $sizes['max'] ) . ' Sq Ft';
}
if ( $value != '' )
{
// 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.
$requirements[] = array(
'label' => __( 'Floor Area', 'propertyhive' ),
'value' => $value,
);
}
}
if ( isset($applicant_profile['commercial_property_types']) && is_array($applicant_profile['commercial_property_types']) && !empty($applicant_profile['commercial_property_types']) )
{
// 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.
$terms = get_terms( array_merge( wp_parse_args( array('hide_empty' => false, 'fields' => 'names', 'include' => $applicant_profile['commercial_property_types']) ), array( 'taxonomy' => 'commercial_property_type' ) ) );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) )
{
// 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.
$sliced_terms = array_slice( $terms, 0, 2 );
// 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.
$requirements[] = array(
'label' => __( 'Property Types', 'propertyhive' ),
'value' => esc_html( implode(", ", $sliced_terms) ) . ( (count($terms) > 2) ? '
+ ' . (count($terms) - 2) . ' more' : '' ),
);
}
}
}
if ( get_option('propertyhive_applicant_locations_type') != 'text' )
{
if ( isset($applicant_profile['locations']) && is_array($applicant_profile['locations']) && !empty($applicant_profile['locations']) )
{
// 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.
$terms = get_terms( array_merge( wp_parse_args( array('hide_empty' => false, 'fields' => 'names', 'include' => $applicant_profile['locations']) ), array( 'taxonomy' => 'location' ) ) );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) )
{
// 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.
$sliced_terms = array_slice( $terms, 0, 2 );
// 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.
$requirements[] = array(
'label' => __( 'Locations', 'propertyhive' ),
'value' => esc_html( implode(", ", $sliced_terms) ) . ( (count($terms) > 2) ? '
+ ' . (count($terms) - 2) . ' more' : '' ),
);
}
}
}
else
{
if ( isset($applicant_profile['location_text']) && trim($applicant_profile['location_text']) != '' )
{
// 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.
$location_value = trim($applicant_profile['location_text']);
if ( isset($applicant_profile['location_radius']) && $applicant_profile['location_radius'] != '' )
{
// 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.
$location_value .= ' (Within '. $applicant_profile['location_radius'] .' Miles)';
}
// 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.
$requirements[] = array(
'label' => __( 'Location', 'propertyhive' ),
'value' => esc_html( $location_value ),
);
}
}
// 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.
$requirements = apply_filters( 'propertyhive_applicant_requirements_display', $requirements, $contact_id, $applicant_profile );
if ( !empty($requirements) )
{
// 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.
foreach ( $requirements as $requirement )
{
echo '
' . esc_html( $requirement['label'] ) . ':
';
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Core requirement values escape stored text/attributes above; preserve trusted HTML supplied by propertyhive_applicant_requirements_display and currency-symbol filters.
echo $requirement['value'];
echo '
';
}
}
if ( isset($applicant_profile['notes']) && $applicant_profile['notes'] != '' )
{
echo '
Additional Requirement Notes:
' . nl2br( esc_html( wp_strip_all_tags( $applicant_profile['notes'] ) ) ) . '
';
}
echo '
';
?>
__( 'Email', 'propertyhive' ),
'not_interested' => __( 'Not Suitable', 'propertyhive' )
);
// 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.
$select_all_actions = apply_filters( 'propertyhive_matching_select_all_actions', $select_all_actions );
?>
id]) && is_array($applicant_profile_match_history[$property->id]) && !empty($applicant_profile_match_history[$property->id]) )
{
// 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.
$previously_sent = $applicant_profile_match_history[$property->id];
}
// 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.
$on_market_change_date = $property->_on_market_change_date;
// 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.
$price_change_date = $property->_price_change_date;
echo '