Add serial and manufacturer columns, standardize on VARCHAR(255), add more component types

master
Skylar Ittner 6 years ago
parent 9aac47f516
commit 3a81c63dfe

Binary file not shown.

@ -11,7 +11,7 @@ class Machine {
global $database;
if ($database->has('machines', ['machineid' => $machineid])) {
$this->machineid = $machineid;
$this->machine = $database->get('machines', ['machineid', 'notes', 'model', 'condition', 'price', 'os'], ['machineid' => $machineid]);
$this->machine = $database->get('machines', ['machineid', 'notes', 'model', 'condition', 'price', 'os', 'serial', 'manufacturer'], ['machineid' => $machineid]);
$this->history = $database->select('history', ['[>]event_types' => 'eventid'], ['historyid', 'date', 'eventname', 'notes'], ['machineid' => $machineid]);
$this->components = $database->select('components', ['[>]component_types' => 'typeid'], ['compid', 'serial', 'typename', 'tested', 'notes', 'capacity', 'model'], ['machineid' => $machineid]);
} else {
@ -38,6 +38,12 @@ class Machine {
if (!empty($this->machine['os'])) {
$info['os'] = $this->machine['os'];
}
if (!empty($this->machine['serial'])) {
$info['serial'] = $this->machine['serial'];
}
if (!empty($this->machine['manufacturer'])) {
$info['manufacturer'] = $this->machine['manufacturer'];
}
$info['notes'] = $this->machine['notes'];
return $info;
}

@ -59,6 +59,12 @@
case "os":
$echo = "Operating System: " . htmlspecialchars($val);
break;
case "serial":
$echo = "Serial: " . htmlspecialchars($val);
break;
case "manufacturer":
$echo = "OEM: " . htmlspecialchars($val);
break;
case "notes":
$echo = "<div>" . htmlspecialchars($val) . "</div>";
break;

Loading…
Cancel
Save