prepare(" SELECT uid, id, name, description, area_type, area, stage, difficulty, score FROM team WHERE id = :id; "); $statement->bindValue(':id', $id, SQLITE3_TEXT); $r = $statement->execute()->fetchArray(SQLITE3_ASSOC); if ($r){ $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"]; $this->score = $r["score"]; if ($complete){ $statement = $db->prepare(" SELECT unit, leader, front FROM team_unit WHERE team = :team ORDER BY front DESC, leader DESC; "); $statement->bindValue(':team', $this->id, SQLITE3_TEXT); $q = $statement->execute(); 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"]); } } } } } } ?>