예제 #1
0
            foreach ($geoArr as $name => $data) {
                $specCnt = $data['CountryCount'];
                $geoRefCnt = $data['GeorefSpecimensPerCountry'];
                $IDCnt = $data['IDSpecimensPerCountry'];
                $IDGeoRefCnt = $data['IDGeorefSpecimensPerCountry'];
                $geoRefPerc = $data['GeorefSpecimensPerCountry'] ? round(100 * ($data['GeorefSpecimensPerCountry'] / $data['CountryCount'])) : 0;
                $IDPerc = $data['IDSpecimensPerCountry'] ? round(100 * ($data['IDSpecimensPerCountry'] / $data['CountryCount'])) : 0;
                $IDgeoRefPerc = $data['IDGeorefSpecimensPerCountry'] ? round(100 * ($data['IDGeorefSpecimensPerCountry'] / $data['CountryCount'])) : 0;
                array_push($outputArr, array($name, $specCnt, $geoRefCnt, $IDCnt, $IDGeoRefCnt, $geoRefPerc, $IDPerc, $IDgeoRefPerc));
            }
        }
    }
}
if ($action == 'Download CSV') {
    $fileName = 'year_stats.csv';
    $headerArr = $collManager->getYearStatsHeaderArr($collId);
    $dataArr = $collManager->getYearStatsDataArr($collId);
}
if ($action == 'Download Stats per Coll') {
    $header = array('Collection', 'Specimens', 'Georeferenced', 'Species ID', 'Families', 'Genera', 'Species', 'Total Taxa', 'Types');
    $fileName = 'stats_per_coll.csv';
    $resultsTemp = $collManager->runStatistics($collId);
    if ($resultsTemp) {
        unset($resultsTemp['familycnt']);
        unset($resultsTemp['genuscnt']);
        unset($resultsTemp['speciescnt']);
        unset($resultsTemp['TotalTaxaCount']);
        ksort($resultsTemp);
        $i = 0;
        foreach ($resultsTemp as $k => $collArr) {
            $dynPropTempArr = array();