P${i}
";
}
}
if (!empty($property->no_of_basement)) {
for ($i = $property->no_of_basement; $i > 0; $i--) {
$building_suite .= "B${i}
";
}
}
$floor_count = 1;
$total_rentable_sf = 0;
$total_rentable_count = 0;
$total_vacent_sf = 0;
$total_vacent_count = 0;
$total_occupied_sf = 0;
$total_occupied_count = 0;
$total_income = 0;
$total_vacent_sf_percentage = 0;
$total_occupied_sf_percentage = 0;
$average_rent_per_sf = 0;
$avg_rent = [];
if (!empty($property->floors)) {
foreach ($property->floors as $floor) {
$total_floor_rentable_sf = 0;
$total_floor_vacent_sf = 0;
$total_floor_occupied_sf = 0;
if ($floor->floor_type == 'Parking') {
$building_suite .= "PARKING
";
} else {
$suite_template = "";
if (!empty($property->suites)) {
foreach ($property->suites as $suite) {
if ($suite->floor_id == $floor->id) {
$status = 'vacant';
if ($suite->lease_status == 'Expiring Soon') {
$status = 'occupied';
} else if ($suite->lease_status == 'Available') {
$status = 'vacant';
} else if ($suite->lease_status == 'Booked') {
$status = 'common';
} else if ($suite->lease_status == 'Occupied') {
$status = 'occupied';
}
$total_floor_rentable_sf += (int) $suite->total_rentable_sf;
$total_rentable_count += 1;
if ($status === 'available' || $status == 'vacant') {
$total_floor_vacent_sf += (int) $suite->total_rentable_sf;
$total_vacent_count += 1;
} else {
$total_floor_occupied_sf += (int) $suite->total_rentable_sf;
$total_occupied_count += 1;
}
if (!empty($suite->annual_base_rent)) {
$total_income += (int) $suite->annual_base_rent;
array_push($avg_rent, (int) $suite->rate_per_sf);
}
$suite_template .= '
Suite ' . $suite->suite_no . '
' . $suite->tenant_name . '
' . formatIfNumber($suite->total_rentable_sf) . ' sf | ' . (!empty($suite->lease_exp_date) ? ('Ex on: ' . formatDateString($suite->lease_exp_date)) : 'N/A') . '
';
}
}
}
$building_suite .= '' . formatIfNumber($suite->total_rentable_sf) . ' sf | ' . (!empty($suite->lease_exp_date) ? ('Ex on: ' . formatDateString($suite->lease_exp_date)) : 'N/A') . '
' . $suite_template . '
';
$floor_arrow .= '