SnipeITAPI/getitem.php

17 lines
379 B
PHP
Raw Permalink Normal View History

2016-05-16 15:43:49 -06:00
<?php
2016-05-19 00:41:51 -06:00
/**
* Dump a database row for a given asset/accessory/consumable
*/
2016-05-16 15:43:49 -06:00
require 'required.php';
require 'dieifnotloggedin.php';
$from = $_GET['from'];
2016-05-16 15:43:49 -06:00
require 'readfrom.php';
$id = $_GET['id'];
if (is_empty($id)) {
sendError('Missing item ID!');
}
$results = $database->select($from, '*', ['id' => $id])[0];
die(json_encode(['status' => 'OK', 'results' => $results]));