__construct(); } function __construct(){ $this->conn = db_connect(); } public function getList(){ $sql = "SELECT p.id, p.title " . "FROM din_product d"; $result =& $this->conn->query($sql); if (DB::isError($result) != true){ return $result; } else { error("Products: " . $result->toString()); } } public function display(){ $sql = "SELECT id FROM din_product ORDER BY title ASC"; $result =& $this->conn->query($sql); if (DB::isError($result) != true){ while ($row =& $result->fetchRow(DB_FETCHMODE_ASSOC)){ displayOptionsMenu($row['id'], "product"); $product = new Product($row['id']); $product->display(); } }else { error("Products: " . $result->toString()); } } public function displayList(){ $sql = "SELECT id FROM din_product ORDER BY display_in_shop DESC, title ASC"; $result =& $this->conn->query($sql); if (DB::isError($result) != true){?> fetchRow(DB_FETCHMODE_ASSOC)){ $product = new Product($row['id']); $product->displayList(); } print("
produktnavn beskrivelse pris aktiv solgt nye
"); } else { error("Products: " . $result->toString()); } } public function displayShopProducts(){ $sql = "SELECT id FROM din_product WHERE display_in_shop = 1 ORDER BY id DESC"; $result =& $this->conn->query($sql); if (DB::isError($result) != true){?>

Produkter tilgjengelig for kjøp:

displayListShop(); } else { $product = new Product(12); $product->displayListShop(); } // List opp produkter while ($row =& $result->fetchRow(DB_FETCHMODE_ASSOC)){ $product = new Product($row['id']); $product->displayListShop(); } ?>
toString()); } } } ?>