ERP Inventory

connect_error) { die("Connection failed: " . $conn->connect_error); } // Function to retrieve all items from ERP_Inventory function getInventoryItems($conn) { $sql = "SELECT * FROM ERP_Inventory"; $result = $conn->query($sql); $items = []; if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $items[] = $row; } } return $items; } // Retrieve and display all items $inventoryItems = getInventoryItems($conn); if (empty($inventoryItems)) { echo ''; } else { echo '
'; foreach ($inventoryItems as $item) { echo ''; } echo '
ID Item Description On Hand On Order Committed To Order In Transit Location Item Type Stock Unit Sale Unit Last Updated
' . htmlspecialchars($item['id']) . ' ' . htmlspecialchars($item['item']) . ' ' . htmlspecialchars($item['description']) . ' ' . htmlspecialchars($item['on_hand']) . ' ' . htmlspecialchars($item['on_order']) . ' ' . htmlspecialchars($item['committed']) . ' ' . htmlspecialchars($item['to_order']) . ' ' . htmlspecialchars($item['in_transit']) . ' ' . htmlspecialchars($item['location']) . ' ' . htmlspecialchars($item['item_type']) . ' ' . htmlspecialchars($item['stock_unit_units']) . ' ' . htmlspecialchars($item['sale_unit_units']) . ' ' . htmlspecialchars($item['timestamp']) . '
'; } // Close the database connection $conn->close(); ?>