query("SHOW TABLES LIKE 'assets'"); if ($result->rowCount() == 0) { $sql = file_get_contents('db/migrations/001_create_assets_table.sql'); $pdo->exec($sql); } $stmt = $pdo->query('SELECT * FROM assets ORDER BY created_at DESC'); return $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { // In a real app, you'd log this error and show a user-friendly message. // For this initial setup, we'll just display the error. return ['error' => 'Database error: ' . $e->getMessage()]; } } $assets = get_assets(); function getStatusClass($status) { switch (strtolower($status)) { case 'in service': return 'status-in-service'; case 'under repair': return 'status-under-repair'; case 'retired': return 'status-retired'; default: return ''; } } ?> IC-Inventory

Asset Dashboard

Add New Asset
Asset successfully added!
Asset successfully updated!
Asset successfully deleted!
You do not have permission to access that page.

No assets found.

Get started by adding your first company asset.

Add Asset
Name Asset Tag Status Location Manufacturer Model Purchase Date Actions
Edit Delete