Fix webgui inventory
This commit is contained in:
+15
-4
@@ -48,8 +48,13 @@ switch ($submit = form_get_action()) {
|
||||
$p[':invname'] = gpc_get_string($_POST, 'invname');
|
||||
$p[':number'] = gpc_get_int($_POST, 'number');
|
||||
$p[':conttype'] = gpc_get_string($_POST, 'conttype');
|
||||
$p[':sid'] = gpc_get_uint($_POST, 'sid', 0);
|
||||
$p[':boxid'] = gpc_get_uint($_POST, 'boxid', 0);
|
||||
if ($p[':conttype'] == 'storage') {
|
||||
$p[':sid'] = gpc_get_uint($_POST, 'sid', 0);
|
||||
$p[':boxid'] = NULL;
|
||||
} else {
|
||||
$p[':boxid'] = gpc_get_uint($_POST, 'boxid', 0);
|
||||
$p[':sid'] = NULL;
|
||||
}
|
||||
if ($p[':sid'] == NULL && $p[':boxid'] == NULL) {
|
||||
$p[':conttype'] = 'storage';
|
||||
$sid = db_get_default_storage($user->vid);
|
||||
@@ -69,8 +74,13 @@ switch ($submit = form_get_action()) {
|
||||
$p[':invname'] = gpc_get_string($_POST, 'invname');
|
||||
$p[':number'] = gpc_get_int($_POST, 'number');
|
||||
$p[':conttype'] = gpc_get_string($_POST, 'conttype');
|
||||
$p[':sid'] = gpc_get_uint($_POST, 'sid', 0);
|
||||
$p[':boxid'] = gpc_get_uint($_POST, 'boxid', 0);
|
||||
if ($p[':conttype'] == 'storage') {
|
||||
$p[':sid'] = gpc_get_uint($_POST, 'sid', NULL);
|
||||
$p[':boxid'] = NULL;
|
||||
} else {
|
||||
$p[':boxid'] = gpc_get_uint($_POST, 'boxid', NULL);
|
||||
$p[':sid'] = NULL;
|
||||
}
|
||||
if ($p[':sid'] == NULL && $p[':boxid'] == NULL) {
|
||||
$p[':conttype'] = 'storage';
|
||||
$sid = db_get_default_storage($user->vid);
|
||||
@@ -86,6 +96,7 @@ switch ($submit = form_get_action()) {
|
||||
$p[':invcond'] = gpc_get_string($_POST, 'invcond');
|
||||
$p[':remarks'] = gpc_get_string($_POST, 'remarks', 150);
|
||||
$p[':eid'] = gpc_get_int($_POST, 'eid');
|
||||
if ($p[':eid'] <= 0) $p[':eid'] = NULL;
|
||||
db_exec_update('inventory', $p, 'invid');
|
||||
$action = ACT_VIEW;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user