query($s); $r = $q->fetchArray(SQLITE3_ASSOC); $this->uid = $r["uid"]; $this->area = new K_Area($r["area"], $r["area_type"]); $this->stage = $r["stage"]; $this->time = $r["time"]; $this->score = $r["score"]; $this->rank = $r["rank"]; $s = " SELECT unit, k_unit, (SELECT count(id) FROM unit WHERE unit.id = record_party.unit) AS owned, leader, front FROM record_party WHERE uid = $uid AND area_type = $area_type AND area = $area ORDER BY front DESC, leader DESC; "; $q = $db->query($s); while ($r = $q->fetchArray(SQLITE3_ASSOC)){ if ($r["owned"] > 0){ array_push($this->party, new Unit($r["unit"], false)); } else{ array_push($this->party, new K_Unit($r["k_unit"], false)); } if ($r["leader"] == 1){ $this->leader = $r["unit"]; } if ($r["front"] == 1){ array_push($this->frontline, $r["unit"]); } } } } ?>