public function stewardsSeries() { if ($this->isSuper()) { return Series::allNames(); } $db = Database::getConnection(); $stmt = $db->prepare("SELECT series FROM series_stewards WHERE player = ?"); $stmt->bind_param("s", $this->name); $stmt->execute(); $series = array(); $stmt->bind_result($seriesname); while ($stmt->fetch()) { $series[] = $seriesname; } $stmt->close(); return $series; }
public static function dropMenu($series, $useall = 0, $limitTo = array()) { $allseries = array(); if (count($limitTo) == 0) { $allseries = Series::allNames(); } else { $allseries = $limitTo; } echo "<select name=\"series\">"; $title = $useall == 0 ? "- Series -" : "All"; echo "<option value=\"\">{$title}</option>"; foreach ($allseries as $thisSeries) { $selStr = strcmp($series, $thisSeries) == 0 ? "selected" : ""; echo "<option value=\"{$thisSeries}\" {$selStr}>{$thisSeries}</option>"; } echo "</select>"; }