prepare($s); $statement->bindValue(':id', $id, SQLITE3_INTEGER); $statement->bindValue(':type', $type, SQLITE3_INTEGER); $r = $statement->execute()->fetchArray(SQLITE3_ASSOC); if ($r){ $this->type = $r["type"]; $this->id = $r["id"]; $this->name = HTML::e($r["name"]); $this->description = HTML::e($r["description"]); } } /** * Gets the path to the item image. The image must be in the * img/content/inventory/ directory, and its name must be the item id, * padded with '0' to 9 digites, and the extension must be '.png'. * * @return string Image URL, or a fixed unknown image. */ public function get_image(){ return APPLICATION::img("INVENTORY", $this->id); } } ?>