function AM_animalInBuilding($building) { $arr = array(); foreach ($building['contents'] as $animal) { $arr[GetNameByCode($animal['itemCode'])] = $animal['numItem']; } ksort($arr); return $arr; }
$TB_settings['TB_getEmptyPositionUseRandom'] = @$_POST['getEmptyPositionUseRandom']; $TB_settings['TB_sectionsUseSections'] = @$_POST['sectionsUseSections']; $TB_settings['TB_sectionsUseGiftBox'] = @$_POST['sectionsUseGiftBox']; $TB_settings['TB_sectionsUseGiftBoxDecoration'] = @$_POST['sectionsUseGiftBoxDecoration']; //flowermanager settings } elseif ($_POST['send'] == 'FM') { $show = 'FM'; $TB_settings['FM_action'] = @$_POST['action']; $TB_settings['FM_replaceSource'] = @$_POST['replaceSource']; $TB_settings['FM_replaceSame'] = @$_POST['replaceSame']; $shed = array(); $shed = FM_loadFlowershed(); unset($TB_settings['FM_actionP']['place']); if (!empty($shed['contents'])) { foreach ($shed['contents'] as $arr) { $itemName = GetNameByCode($arr['itemCode']); if (isset($_POST['place_' . $itemName])) { if ($_POST['place_' . $itemName] > 0) { $TB_settings['FM_actionP']['place'][$itemName] = $_POST['place_' . $itemName]; if ($TB_settings['FM_actionP']['place'][$itemName] > $arr['numItem']) { $TB_settings['FM_actionP']['place'][$itemName] = $arr['numItem']; } } } } } //animalmanager settings } elseif ($_POST['send'] == 'AM') { $show = 'AM'; $TB_settings['AM_move'] = @$_POST['move']; $TB_settings['AM_direction'] = @$_POST['direction'];
function FM_buildTable() { global $TB_settings; $shed = array(); $shed = FM_loadFlowershed(); $c = 1; @ksort($shed); if (!empty($shed['contents'])) { foreach ($shed['contents'] as $arr) { if ($arr['numItem'] == 0) { continue; } $itemName = GetNameByCode($arr['itemCode']); echo '<tr>'; //name echo '<td>'; echo '» ' . GetNameByItem($itemName); echo '</td>'; // anzahl echo '<td align="center">'; echo $arr['numItem']; echo '</td>'; // FM place echo '<td>'; if (isset($TB_settings['FM_actionP']['place'][$itemName])) { $count = $TB_settings['FM_actionP']['place'][$itemName]; } else { $count = 0; } echo "<input type='text' name='place_" . $itemName . "' value='" . $count . "' size='2'>"; echo '</td>'; echo '</tr>'; if ($c % 5 == 0) { echo '<tr>'; echo '<td> </td>'; echo '</tr>'; } $c++; } } }