/** * Eens in de zoveel tijd moet de volledige personenlijst geŸpdatet worden * @return bool */ protected function getCompetionListUpdateNeeded() { $oLastLog = RetrieveLog::getLast(array('type' => 'COMPETITION', 'finished' => 1, 'successfully' => 1)); if ($oLastLog) { if ($oLastLog->getAgeInDays() < $this->competition_retrieve_frequency) { // het zou niet hoeven, maar wel als er te weinig competities of poules zijn $countCompetitions = Database::select_count('Competition'); if ($countCompetitions < 7) { return true; } $countPoules = Database::select_count('Poule'); if ($countPoules < 10) { return true; } return false; } return true; } return true; }
/** * * Enter description here ... * @return bool */ public function exists() { $count = Database::select_count($this->getTable(), array('id' => $this->getId())); return $count > 0; }
protected function showDashboard() { $tables = Database::getTables(); foreach ($tables as $table) { $tableDescription = Database::getTableStructure($table); $where = array(); if ($tableDescription['season_nefub_id']) { $where = array('season_nefub_id' => Season::getInstance()->nefub_id); } $this->assign('count' . $table, Database::select_count($table, $where)); } $lastLogs = RetrieveLog::getAll(null, 'id', 'desc', 1); $oLastLog = $lastLogs[0]; $this->assign('oLastLog', $oLastLog); $availableAPI = false; if ($return = @get_headers(NEFUB_API . '/season.php?id=' . Season::getInstance()->nefub_id)) { if (substr($return[0], 9, 3) == '200') { $availableAPI = true; } } $this->assign('availableAPI', $availableAPI); $this->template = '/dashboard.tpl'; $this->showOutput(); }