diff --git a/database.mwb b/database.mwb index 79264d0..d1bf12b 100644 Binary files a/database.mwb and b/database.mwb differ diff --git a/lib/Component.lib.php b/lib/Component.lib.php index a6ad7cb..fef9f10 100644 --- a/lib/Component.lib.php +++ b/lib/Component.lib.php @@ -15,7 +15,7 @@ class Component { $this->componentid = $componentid; if (Component::exists($componentid)) { $this->exists = true; - $this->component = $database->get("components", ["machineid", "serial", "typeid", "tested", "capacity", "model", "price", "publicnotes", "privatenotes"], ["compid" => $componentid]); + $this->component = $database->get("components", ["machineid", "serial", "typeid", "tested", "capacity", "model", "price", "manufacturer", "publicnotes", "privatenotes"], ["compid" => $componentid]); } } @@ -108,6 +108,13 @@ class Component { return 0.0; } + public function getManufacturer(): string { + if (!empty($this->component["manufacturer"])) { + return $this->component["manufacturer"]; + } + return ""; + } + public function getPublicNotes(): string { if (!empty($this->component["publicnotes"])) { return $this->component["publicnotes"]; @@ -139,7 +146,7 @@ class Component { public function setTestedDate(string $tested) { $this->component["tested"] = date("Y-m-d H:i:s", strtotime($tested)); } - + public function clearTestedDate() { $this->component["tested"] = null; } @@ -156,6 +163,10 @@ class Component { $this->component["price"] = $price; } + public function setManufacturer(string $manufacturer) { + $this->component["manufacturer"] = $manufacturer; + } + public function setPrivateNotes(string $notes) { $this->component["privatenotes"] = $notes; } diff --git a/pages/editcomponent.php b/pages/editcomponent.php index 073caa4..df5ec1c 100644 --- a/pages/editcomponent.php +++ b/pages/editcomponent.php @@ -74,6 +74,7 @@ $form->addInput("date", $date, "date", false, null, null, "Tested Date", "fas fa $form->addInput("time", $time, "time", false, null, null, "Tested Time", "fas fa-clock"); $form->addInput("capacity", $component->getCapacity(), "text", false, null, null, "Capacity", "fas fa-database", 4, 0, 200); $form->addInput("model", $component->getModel(), "text", false, null, null, "Model", "fas fa-hashtag", 4, 0, 200); +$form->addInput("manufacturer", $component->getManufacturer(), "text", false, null, null, "Manufacturer", "fas fa-industry", 4, 0, 200); $form->addInput("price", $component->getPrice(), "number", false, null, null, "Price", "fas fa-money-bill-wave"); $form->addInput("privatenotes", $component->getPrivateNotes(), "textarea", false, null, null, "Private Notes", "fas fa-comment-dots"); $form->addInput("publicnotes", $component->getPublicNotes(), "textarea", false, null, null, "Public Notes", "far fa-comment-dots");