diff --git a/pages/edititem.php b/pages/edititem.php index 6214083..eeed64f 100644 --- a/pages/edititem.php +++ b/pages/edititem.php @@ -24,32 +24,32 @@ $editing = false; if (!is_empty($VARS['id'])) { if ($database->has('items', ['itemid' => $VARS['id']])) { - $editing = true; - $itemdata = $database->select( - 'items', [ - '[>]categories' => [ - 'catid' => 'catid' - ], - '[>]locations' => [ - 'locid' => 'locid' - ] - ], [ - 'name', - 'code1', - 'code2', - 'text1', - 'text2', - 'text3', - 'items.catid', - 'catname', - 'items.locid', - 'locname', - 'loccode', - 'qty', - 'userid' - ], [ - 'itemid' => $VARS['id'] - ])[0]; + $editing = true; + $itemdata = $database->select( + 'items', [ + '[>]categories' => [ + 'catid' => 'catid' + ], + '[>]locations' => [ + 'locid' => 'locid' + ] + ], [ + 'name', + 'code1', + 'code2', + 'text1', + 'text2', + 'text3', + 'items.catid', + 'catname', + 'items.locid', + 'locname', + 'loccode', + 'qty', + 'userid' + ], [ + 'itemid' => $VARS['id'] + ])[0]; } else { // item id is invalid, redirect to a page that won't cause an error when pressing Save header('Location: app.php?page=edititem'); @@ -101,13 +101,23 @@ if (!is_empty($VARS['id'])) {