25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
680 B
PHP
29 lines
680 B
PHP
<?php
|
|
/**
|
|
* Get all status types.
|
|
*/
|
|
require 'required.php';
|
|
//require 'dieifnotloggedin.php';
|
|
|
|
$from = $_GET['from'];
|
|
require 'readfrom.php';
|
|
|
|
$id = $_GET['id'];
|
|
if (is_empty($id) || $id == 0 || $id == null) {
|
|
$status = '0';
|
|
} else {
|
|
if ($from == 'assets') {
|
|
$status = $database->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])); |