query($s); $r = $q->fetchArray(SQLITE3_ASSOC); $this->uid = $r["uid"]; $this->id = $r["id"]; $this->name = HTML::e($r["name"]); $this->description = HTML::e($r["description"]); $this->area = new K_Area($r["area"], $r["area_type"]); $this->stage = $r["stage"]; if ($complete){ $s = " SELECT unit, leader, front FROM team_unit WHERE team = '$id' ORDER BY front DESC, leader DESC; "; $q = $db->query($s); while ($r = $q->fetchArray(SQLITE3_ASSOC)){ array_push($this->unit, new Unit($r["unit"], false)); if ($r["leader"] == 1){ $this->leader = $r["unit"]; } if ($r["front"] == 1){ array_push($this->frontline, $r["unit"]); } } } } } ?>