Initial commit - Shopfloor Dashboard
- Node.js Express server with MySQL integration - Real-time event dashboard with live updates - GE Aerospace branding and design - Auto-refresh every 10 seconds (AJAX) - Shows current and upcoming events (48 hour window) - Connection status monitoring - Optimized for TV display 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
33
db_config.php
Normal file
33
db_config.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Database Configuration for Shopfloor Dashboard
|
||||
* Connects to ShopDB MySQL database
|
||||
*/
|
||||
|
||||
// Database configuration
|
||||
define('DB_HOST', 'mysql'); // Docker container name
|
||||
define('DB_PORT', '3306');
|
||||
define('DB_NAME', 'shopdb');
|
||||
define('DB_USER', '570005354');
|
||||
define('DB_PASS', '570005354');
|
||||
|
||||
/**
|
||||
* Get database connection
|
||||
* @return PDO Database connection object
|
||||
*/
|
||||
function getDbConnection() {
|
||||
try {
|
||||
$dsn = "mysql:host=" . DB_HOST . ";port=" . DB_PORT . ";dbname=" . DB_NAME . ";charset=utf8mb4";
|
||||
$options = [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
PDO::ATTR_EMULATE_PREPARES => false,
|
||||
];
|
||||
|
||||
$pdo = new PDO($dsn, DB_USER, DB_PASS, $options);
|
||||
return $pdo;
|
||||
} catch (PDOException $e) {
|
||||
die("Database Connection Failed: " . htmlspecialchars($e->getMessage()));
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user