Simple PHP api for SnipeIT app. Not maintained anymore; check out BinStack instead: https://source.netsyms.com/Business/BinStack and https://netsyms.biz/binstack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getstatus.php 680B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Get all status types.
  4. */
  5. require 'required.php';
  6. //require 'dieifnotloggedin.php';
  7. $from = $_GET['from'];
  8. require 'readfrom.php';
  9. $id = $_GET['id'];
  10. if (is_empty($id) || $id == 0 || $id == null) {
  11. $status = '0';
  12. } else {
  13. if ($from == 'assets') {
  14. $status = $database->select($from, 'status_id', ['id' => $id])[0];
  15. } else {
  16. sendError("Command only valid for assets.");
  17. }
  18. if ($status == null) {
  19. $status = 0;
  20. }
  21. }
  22. $list = $database->select('status_labels', ['id', 'name', 'notes']);
  23. //array_unshift($list, ['id' => "0", name => "Other"]);
  24. die(json_encode(['status' => 'OK', 'itemstatus' => $status, 'list' => $list]));