prepare( "UPDATE products SET status = :status, stock = :stock WHERE id = :id" ); $stmt->bindValue(':status', $status); $stmt->bindValue(':stock', $stock, PDO::PARAM_INT); $stmt->bindValue(':id', $productId, PDO::PARAM_INT); $stmt->execute(); flash_set('success', 'Product updated.'); } else { flash_set('error', 'Product not found.'); } header('Location: /product.php?id=' . $productId); exit; } $product = $productId ? get_product($productId) : null; if (!$product) { render_header('Product not found'); ?>
SKU = h($product['sku']) ?>
Store: = h($product['store_name']) ?>
Price
= h($product['currency']) ?> = h(number_format((float)$product['price'], 2)) ?>
Stock on hand
= h((string)$product['stock']) ?>
Status
= h(ucfirst($product['status'])) ?>Use this for quick stock corrections before orders are fulfilled.