<?php include_once $_SERVER['DOCUMENT_ROOT'] . "/topmenu.php"; include_once $_SERVER['DOCUMENT_ROOT'] . "/classes/User.php"; include_once $_SERVER['DOCUMENT_ROOT'] . "/classes/RealEstate.php"; $incrementRealEstatePercentage = 0.1; function realEstateIsLocked($re, $playerLevel) { if ($re->getMinLevel() == $playerLevel + 1) { return true; } return false; } $realEstateIDsToRealEstates = RealEstate::getRealEstateIDsToRealEstatesVisibleInShop($playerLevel); $num = count($realEstateIDsToRealEstates); if ($num == 0) { echo "No real estate available."; } else { $userRealEstateIDsToQuantity = User::getUsersRealEstateIDsToQuantity($_SESSION['userID']); foreach ($realEstateIDsToRealEstates as $realEstateID => $realEstate) { if (realEstateIsLocked($realEstate, $playerLevel)) { print "<b>LOCKED</b> <br>"; } print "real estate: " . $realEstate->getName() . "<br>"; $quantity = 0; if ($userRealEstateIDsToQuantity && array_key_exists($realEstateID, $userRealEstateIDsToQuantity)) { $quantity = $userRealEstateIDsToQuantity[$realEstate->getID()]; } $realEstatePrice = $realEstate->getPrice() + $incrementRealEstatePercentage * $realEstate->getPrice() * $quantity; ?>