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