view = $path["view"] . "catalog.php"; $s = "SELECT id, " . " element, " . " name, " . " img, " . " img_aw, " . " stars, " . " awakeable, " . " ( " . " SELECT count(id) > 0 " . " FROM monster_collection " . " WHERE monster = monster.id " . " ) AS owned " . "FROM monster " . "ORDER BY " . " element, " . " stars, " . " awakeable "; $q = $this->db->query($s); error_log($s); while ($r = $q->fetchArray(SQLITE3_ASSOC)){ $mon = [ "id" => $r["id"], "element" => $r["element"], "name" => $r["name"], "image" => $path["img"]["monster"] . $r["img"], "image_aw" => $path["img"]["monster"] . $r["img_aw"], "stars" => $r["stars"], "awakeable" => $r["awakeable"], "owned" => $r["owned"], ]; array_push($this->entry, $mon); } $this->title = "Catalog - SWDB"; $this->name = "SWDB"; $this->description = "Catalog of all monsters"; $this->favicon = ""; $this->icon = ""; $this->canonical = $root . "/catalog/"; $this->author = $root; } } ?>