Ejemplo n.º 1
0
function process_request()
{
    $item_id = isset($_GET['id']) ? intval($_GET['id']) : false;
    if (!$item_id || $item_id <= 0) {
        include 'templates/404.php';
        return;
    }
    $_VIEW['item'] = pdb_get_item($item_id);
    if (!$_VIEW['item']) {
        include 'templates/404.php';
        return;
    }
    include 'templates/edit_item.php';
}
Ejemplo n.º 2
0
function process_request()
{
    $id = isset($_GET['item_id']) ? intval($_GET['item_id']) : false;
    if ($id !== false) {
        if ($id <= 0) {
            api_wrong_args();
            return;
        }
        $item = pdb_get_item($id);
        if ($item) {
            api_echo_as_json($item, 'item');
        } else {
            api_echo_as_json('item not found', 'error', RESPONSE_STATUS_FAIL);
        }
    } else {
        api_wrong_args();
    }
}