echo "<br>"; echo "<br>"; } // *************************************************************************** // *** Menu Screen $GB_current_url = "collection"; // *** // *************************************************************************** if ($GB_url == $GB_current_url) { echo '<h2>Collection</h2><p>'; echo '<b>Collection information:</b><br> Note that this information only updates at the begin of a cycle. So it is alway 1 cycle behind.'; echo '<br>'; echo '<table class="sofT" cellspacing="0">'; echo "<tr>"; $GBccount = GB_LoadCcount(); $GB_CollectionList = GB_GetCollectionList(); if (!$GB_CollectionList) { echo $GB_file_error . "<br><br>(Collection list file missing)"; return; } foreach ($GB_CollectionList as $value) { echo '<td class="helpLeft">' . $value['name'] . "</td>"; $GB_amount_Coll = count($value['collectable']); $i = 0; while ($i < $GB_amount_Coll) { $unit = Units_GetUnitByCode($value['collectable'][$i]); $Amount_in_Collection = GB_GetColInfo($value['collectable'][$i], $GBccount); $BG_color = " class=\"lime\""; if ($Amount_in_Collection == "10") { $BG_color = " class=\"lgreen\""; }
function GB_DetectCollections() { $GB_CollectionList = GB_GetCollectionList(); if (!$GB_CollectionList) { AddLog2("GiftBox: Error - Collection List Missing"); return; } foreach ($GB_CollectionList as $value) { $GB_amount_Coll = count($value['collectable']); $i = 0; while ($i < $GB_amount_Coll) { $code = $value['collectable'][$i]; $this->GB_SQL_updAction("_collection", $code, 'Y'); $i++; } } }
function GB_CollAmount() { $GB_CollectionList = GB_GetCollectionList(); if (!$GB_CollectionList) { return false; } $GB_CollCompl = 0; $GBccount = array(); $GBccount = GB_LoadCcount(); if (!$GBccount) { return false; } foreach ($GB_CollectionList as $value) { // walk all collections $GB_amount_Coll = count($value['collectable']); $i = 0; $GB_ThisCollCompl = 0; $GB_ThisCollVal = array(); while ($i < $GB_amount_Coll) { // each collection $Amount_in_Collection = GB_GetColInfo($value['collectable'][$i], $GBccount); $GB_ThisCollVal[] = $Amount_in_Collection; $i++; } $GB_ThisCollCompl = min($GB_ThisCollVal); $GB_CollCompl = $GB_CollCompl + $GB_ThisCollCompl; } return $GB_CollCompl; //return total completed }