Example #1
0
 function __construct($name, $value)
 {
     parent::__construct($name, (int) $value);
     $query = "SELECT Team.nefub_id, CONCAT(Team.name, ' (', Competition.name, ')') as name\r\n\t\t\t\t\tFROM Team\r\n\t\t\t\t\tLEFT JOIN Competition ON Team.competition_nefub_id = Competition.nefub_id\r\n\t\t\t\t\tORDER BY Team.name ASC, Competition.name ASC";
     $rows = Database::select_rows_by_query($query);
     $this->addOption('Geen', 0);
     foreach ($rows as $row) {
         $this->addOption($row['name'], $row['nefub_id']);
     }
 }
 function __construct($name, $value)
 {
     parent::__construct($name, (int) $value);
     $query = "SELECT Location.nefub_id, CONCAT(Location.name, ', ', Location.city) as name\r\n\t\t\t\t\tFROM Location\r\n\t\t\t\t\tORDER BY Location.name ASC, Location.city ASC";
     $rows = Database::select_rows_by_query($query);
     $this->addOption('Geen', 0);
     foreach ($rows as $row) {
         $this->addOption($row['name'], $row['nefub_id']);
     }
 }
 public function updateMissingPersons()
 {
     $query = "\tSELECT DISTINCT(TeamPerson.person_nefub_id)\n\t\t\t\t\tFROM TeamPerson\n\t\t\t\t\tWHERE TeamPerson.person_nefub_id NOT IN\n\t\t\t\t\t(\t\t\t\t\t\n\t\t\t\t\t\tSELECT DISTINCT(Person.nefub_id)\n\t\t\t\t\t\tFROM Person\n\t\t\t\t\t)";
     $missingTeamPersons = Database::select_rows_by_query($query);
     self::put(count($missingTeamPersons) . ' ontbrekende teamspelers gevonden');
     $query = "\tSELECT DISTINCT(GamePerson.person_nefub_id)\n\t\t\t\t\tFROM GamePerson\n\t\t\t\t\tWHERE GamePerson.person_nefub_id NOT IN\n\t\t\t\t\t(\t\t\t\t\t\n\t\t\t\t\t\tSELECT DISTINCT(Person.nefub_id)\n\t\t\t\t\t\tFROM Person\n\t\t\t\t\t)";
     $missingGamePersons = Database::select_rows_by_query($query);
     self::put(count($missingGamePersons) . ' ontbrekende wedstrijdspelers gevonden');
     $missingPersons = array_merge($missingTeamPersons, $missingGamePersons);
     foreach ($missingPersons as $missingPerson) {
         $nefubId = $missingPerson['person_nefub_id'];
         if ($this->retrievedPersonNefubIds[$nefubId] !== true) {
             $this->retrievePerson($nefubId);
             $this->retrievedPersonNefubIds[$nefubId] = true;
         }
     }
 }
Example #4
0
    protected function showLocations()
    {
        switch ($this->mode) {
            case 'bewerken':
                $oLocation = Location::getByNefubId($this->editId);
                $this->editObject($oLocation, '/bewerken.tpl');
                break;
            default:
                $query = 'SELECT DISTINCT(`city`)
								FROM `Location`
								ORDER BY `city` ASC';
                $cityRows = Database::select_rows_by_query($query);
                $cities = array();
                foreach ($cityRows as $cityRow) {
                    $name = $cityRow['city'];
                    if (!is_array($cities[$name])) {
                        $cities[$name] = array();
                    }
                    $cities[$name] = Location::getAll(array('city' => $name), 'name');
                }
                $this->assign('cities', $cities);
                $this->template = '/locaties.tpl';
                $this->showOutput();
        }
    }
Example #5
0
 public function hasRanking()
 {
     $query = "SELECT\n\t\t\t\t\t(COUNT(DISTINCT(ranking)) = COUNT(team_nefub_id) AND COUNT(team_nefub_id) !=0 ) AS hasRanking \n\t\t\t\t\tFROM PouleTeam\n\t\t\t\t\tWHERE poule_nefub_id = '" . $this->nefub_id . "'";
     $rows = Database::select_rows_by_query($query);
     return (bool) $rows[0]['hasRanking'];
 }
Example #6
0
 /**
  * 
  * @return array
  */
 public static function getPlannedGamesSorted(Season $oSeason, $limitDays = null)
 {
     $plannedGames = array();
     $query = "SELECT DISTINCT(Game.date)\n\t\t\t\t\tFROM Game\n\t\t\t\t\tWHERE Game.date >= CURDATE()\n\t\t\t\t\tAND Game.date IS NOT NULL\n\t\t\t\t\tAND Game.season_nefub_id = '" . $oSeason->nefub_id . "'";
     if ($limitDays) {
         $query .= " LIMIT " . $limitDays;
     }
     //
     $dateRows = Database::select_rows_by_query($query);
     if ($dateRows) {
         $dates = array();
         foreach ($dateRows as $dateRow) {
             $dates[] = "'" . $dateRow['date'] . "'";
         }
         $dates = implode(', ', $dates);
         $query = "SELECT Game.id\n\t\t\t\t\t\tFROM Game\n\t\t\t\t\t\tWHERE Game.date IN\n\t\t\t\t\t\t(" . $dates . ")\n\t\t\t\t\t\tAND Game.season_nefub_id = '" . $oSeason->nefub_id . "'\n\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\tGame.location_nefub_id,\n\t\t\t\t\t\t\tGame.competition_nefub_id\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\tGame.date ASC,\t\t\t\t\t\t\n\t\t\t\t\t\t\tGame.location_nefub_id ASC,\n\t\t\t\t\t\t\tGame.competition_nefub_id ASC\n\t\t\t\t\t\t";
         $plannedGames = self::getAllFromQuery($query);
     }
     return $plannedGames;
 }