Add manufacturer field to components

master
Skylar Ittner 4 years ago
parent 966fde819f
commit 55c95c6a86

Binary file not shown.

@ -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;
}

@ -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");

Loading…
Cancel
Save