search(Yii::$app->request->queryParams); $dataProvider->query->orWhere(['not', ['onlineSince' => null]]) ->orWhere(['like', 'institutionShort', 'GGBN']) ->orderBy('institutionFullName ASC'); return $this->render('index', [ 'SearchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); } public function actionDetails() { set_time_limit(60); //Abfrage Webservice in Model auslagern $fullName = explode(",", $_GET['repository']); $institution = $fullName[0]; $connection = new \yii\db\Connection ( Yii::$app->db ); $connection->open (); $query = $connection->createCommand ( 'SELECT parentInstitutionID, onlineSince from parentInstitution where institutionShort = "'.$institution.'" and onlineSince IS NOT NULL' )->queryAll (); $onlineSince = ""; foreach ( $query as $row ) { $onlineSince = $row ['onlineSince']; } $connection->close (); $CoreTrue = count($query); return $this->render('details', [ 'coreTrue' => $CoreTrue, 'repository' => $_GET['repository'], 'period' => "", 'onlineSince' => $onlineSince ]); } public function actionJson() { $institution = $_GET['repository']; $start = $_GET['period']; $end = date('Y-m', strtotime("+1 month", strtotime($start))); $today = date("Y-m-d"); if ($today < $end or $today < $start) { echo "Report requested for a future time. Please check the list of available reports!"; $QueryDate = "[]"; } else { Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; $jsonfile = json_decode(file_get_contents("https://api.bgbm.org/portals/v1/ggbn/report?institution=" . urlencode($institution) . "&period=" . $start)); return $jsonfile; } } }