Created
September 13, 2021 09:46
-
-
Save propertyhive/108c2b8ed156c4bfb9f588919b222a9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$floor_units = $property->floor_units; | |
if ( isset($floor_units->floor_unit) ) | |
{ | |
echo '<h4>Available Area</h4>'; // WILL BECOME DESCRIPTION TITLE | |
$total_size = 0; | |
// INSTEAD OF ECHO'ING SHOULD BE STORED AS DESCRIPTION TEXT/CONTENT | |
echo '<table>'; | |
echo '<thead><tr><th>Name/Floor</th><th>Sq ft</th><th>Availability</th></tr></thead><tbody></tbody>'; | |
foreach ( $floor_units->floor_unit as $floor_unit ) | |
{ | |
echo '<tr> | |
<td>' . (string)$floor_unit->floorunit . '</td> | |
<td>' . (string)$floor_unit->size . '</td> | |
<td>' . (string)$floor_unit->status . '</td> | |
</tr>'; | |
$total_size += (string)$floor_unit->size; | |
} | |
echo '<tr> | |
<td>Total</td> | |
<td>' . $total_size . '</td> | |
</tr>'; | |
echo '</table>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment