function gGetCreatureMax($id) { global $db, $gdCreatureMaxIncrement; $sql = "SELECT buildings.level, buildings.value, buildings.root, buildings.name, buildings.id FROM accbuildings, buildings WHERE buildings.type = '2' AND accbuildings.building = buildings.id AND accbuildings.account = '{$id}'"; $result = $db->query($sql); while ($newrow = $db->fetch_array($result, MYSQL_ASSOC)) { $array[count($array)] = $newrow; } $rooted = gRootArray($array); $children = gGetChildrenArray($rooted); return $children[0]["value"] + $gdCreatureMaxIncrement; }
$forest = $acc["forest"]; $death = $acc["death"]; $air = $acc["air"]; $earth = $acc["earth"]; $sql = "SELECT b.name, b.id, b.root, b.type FROM accbuildings AS ab, buildings AS b WHERE ab.building = b.id AND ab.account = '{$acc['id']}' GROUP BY b.id ORDER BY b.name ASC"; $result = $db->query($sql); $numrows = $db->num_rows($result); if ($numrows == 0) { echo 'You haven\'t built any item buildings yet, so you can\'t summon any items.'; } else { unset($array); while ($row = $db->fetch_array($result)) { $array[count($array)] = $row; } $rooted = gRootArray($array); $children = gGetChildrenArray($rooted); $sorted = gSortArray($children, "name", "ASC"); echo 'Select a building from the list below to see all its items.<br><br>'; tBegin(); $switch = FALSE; for ($m = 0; $m < count($sorted); $m++) { $row = $sorted[$m]; if ($row["type"] == 1) { if (!$switch) { echo '<tr>'; } echo ' <td width="50%" align="center"> <a href="index.php?page=spellbook&action=building&path=', $row["path"], '">', $row["name"], '</a> </td> ';