'', 'catid' => '', 'catname' => '', 'locid' => '', 'locname' => '', 'loccode' => '', 'code1' => '', 'code2' => '', 'text1' => '', 'text2' => '', 'text3' => '', 'qty' => 1, 'userid' => '']; $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]; } else { // item id is invalid, redirect to a page that won't cause an error when pressing Save header('Location: app.php?page=edititem'); } } ?>

"" . htmlspecialchars($itemdata['name']) . ""]); ?>