38 lines
1.3 KiB
PHP
38 lines
1.3 KiB
PHP
<?php
|
|
|
|
class Rentalform
|
|
{
|
|
|
|
public static function getRentalText($rental_data){
|
|
|
|
$address_property = $rental_data['address_property'];
|
|
$address_property = str_replace("\n",' ',$address_property);
|
|
$property_text = 'As per person`s met address of the property declared as '.$address_property.' ,'.$rental_data['city'].' ,'.$rental_data['state'].' - '.$rental_data['pincode'].'.';
|
|
|
|
$property_text .= $rental_data['validate_visited_address'] ? 'The visited property address is also save as above.': 'But The visited Property address is '.str_replace("\n",'',$rental_data['other_visited_address']);
|
|
|
|
$no_of_persons_showing_property = count($rental_data['person_met']) > 1 ? 'were' : 'was';
|
|
|
|
$name_of_persons_showing_property = null;
|
|
foreach($rental_data['person_met'] as $showed_person){
|
|
|
|
if($showed_person['id'] != 0)
|
|
{
|
|
$name_of_persons_showing_property .= $showed_person['name'].' ,';
|
|
}
|
|
else
|
|
{
|
|
$name_of_persons_showing_property .= $rental_data['other_person_met'];
|
|
}
|
|
}
|
|
|
|
$name_of_persons_showing_property = substr_replace($name_of_persons_showing_property,'and ',strrpos($name_of_persons_showing_property,','),1);
|
|
$property_text .= 'The property shown by '.$name_of_persons_showing_property;
|
|
|
|
echo $property_text;
|
|
|
|
die();
|
|
|
|
}
|
|
}
|
|
?>
|