getProfileVillages($session->uid); // SUM GLOBAL RESURSE $woodSUM = 0; $claySUM = 0; $ironSUM = 0; $cropSUM = 0; foreach ($varray as $vil) { $vid = $vil['wref']; // date sat (1 singur apel SQL) $vdata = $database->getVillage($vid); // comercianți $totalmerchants = $building->getTypeLevel(17, $vid); $usedmerchants = $database->totalMerchantUsed($vid); $availmerchants = $totalmerchants - $usedmerchants; // ========================================================== // RESURSE (LIMITARE LA STORAGE) // ========================================================== $wood = ($vdata['wood'] > $vdata['maxstore']) ? $vdata['maxstore'] : $vdata['wood']; $clay = ($vdata['clay'] > $vdata['maxstore']) ? $vdata['maxstore'] : $vdata['clay']; $iron = ($vdata['iron'] > $vdata['maxstore']) ? $vdata['maxstore'] : $vdata['iron']; $crop = ($vdata['crop'] > $vdata['maxcrop']) ? $vdata['maxcrop'] : $vdata['crop']; // highlight sat curent $class = ($vid == $village->wid) ? 'hl' : ''; // ========================================================== // OUTPUT ROW // ========================================================== echo ' '; // ========================================================== // SUME GLOBALE // ========================================================== $woodSUM += $wood; $claySUM += $clay; $ironSUM += $iron; $cropSUM += $crop; } ?>
'.$vdata['name'].' '.number_format(round($wood)).' '.number_format(round($clay)).' '.number_format(round($iron)).' '.number_format(round($crop)).' '.($totalmerchants > 0 ? '' : '').' '.$availmerchants.'/'.$totalmerchants.'