function __construct($name, $value, $valueTable, $valueField = 'nefub_id', array $where = array(), $orderBy = 'name', $direction = 'ASC', $limit = null) { parent::__construct($name, (int) $value); $rows = Database::select_rows($valueTable, $where, $orderBy, $limit, $direction); $this->addOption('Geen', 0); foreach ($rows as $row) { $this->addOption($row['name'], $row[$valueField]); } }
function __construct($name, $value, $min = 0, $max = 99) { parent::__construct($name, $value); $this->addOption('Geen', 0); for ($i = 0; $i <= $max; $i++) { $this->addOption($i, $i); } $this->addAttributes(array('class' => 'numeric')); }
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, $fieldType) { parent::__construct($name, $value); $enumValues = substr($fieldType, 4, strlen($fieldType) - 4); eval('$values = array' . $enumValues . ';'); foreach ($values as $value) { $this->addOption($value, $value); } $this->addAttributes(array('class' => 'numeric')); }
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']); } }
function __construct($name, $value, Game $oGame) { parent::__construct($name, $value); $this->addOption($oGame->getTeam1()->name . '-' . $oGame->getTeam2()->name, $value); }