trim($_POST['name']), 'group' => trim($_POST['group']), 'type' => trim($_POST['type']), 'url' => trim($_POST['url']), 'module' => trim($_POST['module']), 'hidden' => isset($_POST['hidden']) ? 1 : 0, ]; $success = ProductModel::updateProduct($id, $data); if ($success) { header("Location: dashboard.php?module=product&action=edit&id=$id&updated=1"); } else { header("Location: dashboard.php?module=product&action=edit&id=$id&updated=0"); } exit; } else { header("Location: dashboard.php?module=product&action=list"); exit; }