* @author Gabriele Droege, Patricia Kelbert (BGBM, GGBN/DNA Bank Network) * @version yii 2.0.3 * @package View * @var $this SearchController * @var $model SearchForm * @var $selectionLists - created in the controller * @var $form CActiveForm * @copyright Copyright © 2011 DNA Bank Network http://www.dnabank-network.org *
The contents of this file are subject to the Mozilla Public License Version 1.1 * @filesource * @license http://www.mozilla.org/MPL/ MPL */ use yii\helpers\Html; use yii\web\View; use yii\helpers\Url; $institution = urlencode($_GET['repository']); ?>

Data Usage Statistics for

request->baseUrl."/usagestats/details?repository=".$_GET['repository']."'>list of available reports!"; $QueryDate = "[]"; } else { $jsonfile = file_get_contents("https://api.bgbm.org/portals/v1/ggbn/report?institution=" . $institution . "&period=" . $start); $json_array = json_decode($jsonfile); if ($json_array->result->nbRecordsPreview > 0) { echo ""; echo ""; echo "
"; echo "Back to report listGet JSON

Report for " . date("F Y", strtotime($json_array->result->reportedPeriod)) . ", created on " . $json_array->result->reportCreated . "

"; ?>
result->nbSearches ?>
searches retrieved data from this resource
result->nbRecordsPreview ?>
records from this resource were previewed in the hitlist
result as $key1 => $list1) { // Countries if ($key1 == "query_countries") { $countryRequest = true; echo '

Query locations

'; // echo ""; echo '
'; // echo '
1
'; echo ''; ?>

Queries over time

'; echo '
'; $QueryDateDateTime = []; $daysOfMonth = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31']; foreach ($list1 as $key3 => $list3) { $day = date("d", strtotime($list3->query_date)); $QueryDateTime [] = "['" . $day . "', " . $list3->times . "]"; $Days [] = $day; // additional array for finding the gaps } foreach ($daysOfMonth as $dayOfMonth) { if (!in_array($dayOfMonth, $Days)) { $QueryDateTime [] .= "['" . $dayOfMonth . "', 0]"; } } sort($QueryDateTime); $QueryDate = "[" . implode(", ", $QueryDateTime) . "]"; echo ''; } // Query terms if ($key1 == "query_terms") { echo '

Query terms

'; echo "
CountryNumber of searches
"; foreach ($list1 as $key4 => $list4) { echo ""; } echo "
Query termNumber of records previewedNumber of searches
" . $list4->query_terms . "" . $list4->records . "" . $list4->times . "
"; echo "
Go to page

"; echo '
'; } } if (!$countryRequest) echo '

No query locations logged

'; } else { if ($onlineSince > $end . "-01") {echo "Back to report list"; echo "

Report for " . date("F Y", strtotime($_GET['period'])) . " not available for this institution. Institution started providing data on " . $onlineSince . "

"; } else { if ($start < "2017-06") {echo "Back to report list"; echo "

Report for " . date("F Y", strtotime($_GET['period'])) . " not available for this institution. Reports available from June 2017 onwards.

"; } else { if ($onlineSince < $end . "-01") echo "Back to report list"; echo "

Report for " . date("F Y", strtotime($_GET['period'])) . " not available for this institution. No queries or visits related to this institution were logged.

"; } } $QueryDate = "[]"; } } } else { $QueryDate = "[]"; if($coreTrue > 0 || $institution == "GGBN") { echo "Back to overview"; $jsonfileList = file_get_contents("https://api.bgbm.org/portals/v1/ggbn/report/list"); $json_arrayList = json_decode($jsonfileList, true); $institution = urldecode($institution); $data = $json_arrayList["result"][$institution]; $count = (isset($data)) ? $data["count"] : 'No reports avaiable for this institution.'; echo "

There are ".$count." reports available for this institution

"; echo '
'; arsort($data["reports"]); foreach($data["reports"] as $id => $reportdate){ echo '

'.$reportdate.'

'; } echo '
'; } else { echo "

This institution is not a core member.

";} } /*foreach ($characters->query_terms as $queryterm) { echo $queryterm->records;} */ ?>