__construct(); } function __construct(){ $this->conn = db_connect(); } public function getList($division = NULL){ if ($division != NULL){ $condition = "AND p.division_id = $division"; }else { $condition = ""; } $sql = "SELECT d.id AS divId, d.name AS divName, p.id AS positionId, p.name AS positionName " . "FROM din_position p, din_division d " . "WHERE p.division_id = d.id " . "$condition" . "ORDER BY d.name ASC"; $result =& $this->conn->query($sql); if (DB::isError($result) != true){ return $result; } else { error("Positions: " . $result->toString()); return false; } } public function getPositionsAsArray(){ if ($list = $this->getPositions()){ $pos = Array(); while ($row =& $list->fetchRow(DB_FETCHMODE_ASSOC)){ $div = $row['divId']; $pos[] = Array("id" => $row['positionId'], "title" => $row['positionName'], "parent" => $row['positionDivId']); } return $pos; } } public function displayList($division){ $sql = "SELECT p.id FROM din_position p, din_division d " . "WHERE p.division_id = d.id " . "AND p.division_id = $division " . "ORDER BY d.name ASC"; $result =& $this->conn->query($sql); if (DB::isError($result) != true){ if($result->numRows() > 0){ ?>
| forening | stilling | ||
|---|---|---|---|
Ingen stillingsbeskrivelser er registrert ennå.
toString()); } } } ?>