setIdentifier($currentRepositoryID); // fill the object up with data (it will connect to db and populate vars) $repositories[$i]->getRepositoryData(); // find out the name of the repository (the IRs object will tell us) $name = $repositories[$i]->getName(); $irNames[$i] = $name; // and store it in the names array // Get some facts like first collected date, last collected date, num of weeks etc $currentIRsummary = $repositories[$i]->returnIRFacts(); $IRsummary[$i] = $currentIRsummary; // get data back from IR object, an array hosting date->num_of_records $dateRecordList = $repositories[$i]->returnRecords(); $dateRecordLists[$i] = $dateRecordList; // add these dates to the list of dates for all respositories $allDates = createAllDateList ($dateRecordList, $allDates); $numOfRepositories = $i; // set the number of IRs to i, will be overwritten if we loop again } // get some facts about this group of repositories. $repositoriesFacts = getRepositoryFacts($repositories); //////////////////////////////////////////////////////////////// // Page Title // set the title, depends how many IRs there are. if ($numOfRepositories == "1") { $pagetitle = $irNames['1'] . " Repository Details"; } elseif ($numOfRepositories == "2") { $pagetitle = $irNames['1'] . " & " . $irNames['2'] . " Details"; } elseif ($numOfRepositories == "3") { $pagetitle = $irNames['1'] . ", " . $irNames['2'] . " & " . $irNames['3'] . " Details"; } else { $pagetitle = "Repository Details for " . $irNames['1'] . " and others... "; } ////////////////////////// // print html header. printhtmlhead ($pagetitle); echo "

$pagetitle

\n"; ////////////////////////////////////////////////////////// // Chart // get the url for the chart google chart image printprocessingtime("starting chart"); $charturl = returnGoogleChartURL($repositories, $allDates, $numOfRepositories); echo "Google Chart\n

"; echo "
"; if ($debug) { $debugText .= "charturl $charturl\n" . "chart url length: " . strlen($charturl) . " \n"; } ////////////////////////// // don't get crushed by the table on the right echo "
"; ////////////////////////////////////////////////////////////////// // list repository names and give option to remove each one. echo "\n"; /////////////////////////////////////////////////////// // summary for all repositories shown if ($numOfRepositories > 1) { $highestNumRecords = $repositoriesFacts['highestNumRecords']; $firstCollectedDate = $repositoriesFacts['firstCollectedDate']; $lastCollectedDate = $repositoriesFacts['lastCollectedDate']; $numOfWeeks = $repositoriesFacts['num_of_weeks']; //////////////////////////////////////////////// // display some summary stuff on screen echo "

SummaryHighest number of records for one repoistory: " . number_format($highestNumRecords) . "
\n"; echo "Data first collected: $firstCollectedDate
\n"; echo "Data last collected: $lastCollectedDate
\n"; echo "Number of weeks data collected: $numOfWeeks

\n"; } //////////////////////////// // IR details- get stuff from the array (which we got from the archive's object above). $i = 1; while ($i <= $numOfRepositories) { $currentrecords = $IRsummary[$i]['current_records']; $firstCollectedDate = $IRsummary[$i]['firstCollectedDate']; $firstCollectedRecordCount = $dateRecordList["$firstCollectedDate"]; $lastCollectedDate =$IRsummary[$i]['lastCollectedDate']; $lastCollectedRecordCount = $dateRecordList["$lastCollectedDate"]; $numOfWeeks = $IRsummary[$i]['num_of_weeks']; //////////////////////////////////////////////// // display some summary stuff on screen echo "

Summary for $irNames[$i]Total records: " . number_format($currentrecords) . "
\n"; echo "Data first collected: $firstCollectedDate (" . number_format($firstCollectedRecordCount) . " records)
\n"; echo "Data last collected: $lastCollectedDate (" . number_format($lastCollectedRecordCount) ." records)
\n"; echo "Number of weeks data collected: $numOfWeeks
\n"; $recordincrease = $lastCollectedRecordCount - $firstCollectedRecordCount; $average_increase = $recordincrease / $numOfWeeks; $average_increase = round($average_increase, 2); echo "Average record increase per week: $average_increase"; echo "
(" . number_format($recordincrease) . " added records divided by $numOfWeeks weeks)

"; $i++; } ////////////////////////////////////////////////////////// // give option to compare with another archive $static_querystring = "country=$country"; $countryname = getCountryName($country); printprocessingtime(); echo "

Compare $currentarchivename with a repository from $countryname

\n"; $RepositoryDropList = repositoryListMenu ($ircount_table, $static_querystring, $country, ""); echo "$RepositoryDropList"; echo "

Compare another repository from around the world

\n"; $RepositoryDropList = repositoryListMenu ($ircount_table, $static_querystring, "all", ""); echo "$RepositoryDropList"; printprocessingtime(); echo "
\n"; // close div of left hand content. echo "
"; ///////////////////////////////////////////////////////// // print table krsort($allDates); // sort by key, descending printWeeklyTable ($repositories, $allDates, $dateRecordLists, $numOfRepositories); if ($debug) { echo "
debug \n $debugText 
"; } printhtmlfooter(); ?>