Add serial and manufacturer columns, standardize on VARCHAR(255), add more component types
This commit is contained in:
parent
9aac47f516
commit
3a81c63dfe
BIN
database.mwb
BIN
database.mwb
Binary file not shown.
@ -11,7 +11,7 @@ class Machine {
|
|||||||
global $database;
|
global $database;
|
||||||
if ($database->has('machines', ['machineid' => $machineid])) {
|
if ($database->has('machines', ['machineid' => $machineid])) {
|
||||||
$this->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->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]);
|
$this->components = $database->select('components', ['[>]component_types' => 'typeid'], ['compid', 'serial', 'typename', 'tested', 'notes', 'capacity', 'model'], ['machineid' => $machineid]);
|
||||||
} else {
|
} else {
|
||||||
@ -38,6 +38,12 @@ class Machine {
|
|||||||
if (!empty($this->machine['os'])) {
|
if (!empty($this->machine['os'])) {
|
||||||
$info['os'] = $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'];
|
$info['notes'] = $this->machine['notes'];
|
||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,12 @@
|
|||||||
case "os":
|
case "os":
|
||||||
$echo = "Operating System: " . htmlspecialchars($val);
|
$echo = "Operating System: " . htmlspecialchars($val);
|
||||||
break;
|
break;
|
||||||
|
case "serial":
|
||||||
|
$echo = "Serial: " . htmlspecialchars($val);
|
||||||
|
break;
|
||||||
|
case "manufacturer":
|
||||||
|
$echo = "OEM: " . htmlspecialchars($val);
|
||||||
|
break;
|
||||||
case "notes":
|
case "notes":
|
||||||
$echo = "<div>" . htmlspecialchars($val) . "</div>";
|
$echo = "<div>" . htmlspecialchars($val) . "</div>";
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user