diff --git a/getstatus.php b/getstatus.php new file mode 100644 index 0000000..c2cc6c7 --- /dev/null +++ b/getstatus.php @@ -0,0 +1,27 @@ +select($from, 'status_id', ['id' => $id])[0]; +} else { + sendError("Command only valid for assets."); +} + +if ($status == null) { + $status = 0; +} + +$list = $database->select('status_labels', ['id', 'name', 'notes']); +//array_unshift($list, ['id' => "0", name => "Other"]); + +die(json_encode(['status' => 'OK', 'itemstatus' => $status, 'list' => $list])); \ No newline at end of file diff --git a/updateitem.php b/updateitem.php index 53a155f..0366da3 100644 --- a/updateitem.php +++ b/updateitem.php @@ -11,7 +11,7 @@ if (is_empty($id)) { sendError('Missing item ID!'); } if ($from == 'assets') { - $database->update($from, ['name' => $_POST['name'], 'rtd_location_id' => $_POST['location'], 'order_number' => $_POST['order_number']], ['id' => $id]); + $database->update($from, ['name' => $_POST['name'], 'rtd_location_id' => $_POST['location'], 'order_number' => $_POST['order_number'], 'status_id' => $_POST['status']], ['id' => $id]); } else { $database->update($from, ['name' => $_POST['name'], 'location_id' => $_POST['location'], 'qty' => $_POST['qty'], 'order_number' => $_POST['order_number']], ['id' => $id]); }