Initial commit

This commit is contained in:
Porawit Dongwang
2026-09-16 23:20:08 +07:00
commit 0041668dbb
32577 changed files with 3687927 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
<?php
// config/db.php
// Centralized Database Connection Configuration
// Database 1: HOSxP (External)
$host1 = "10.0.250.250";
$username1 = "dmstele";
$password1 = "dmstele10742";
$db1 = "hos";
// Database 2: Local Web Service
$host2 = "localhost";
$username2 = "root";
$password2 = "@Samui@1074200";
$db2 = "hosxp_webservice";
// Disable MySQLi exceptions to maintain compatibility with legacy code that checks for false
mysqli_report(MYSQLI_REPORT_OFF);
try {
// Create connection to HOSxP Database
$conn1 = new mysqli($host1, $username1, $password1, $db1);
$conn1->set_charset("utf8");
// Create connection to Local Web Service Database
$conn2 = new mysqli($host2, $username2, $password2, $db2);
$conn2->set_charset("utf8");
} catch (mysqli_sql_exception $e) {
// Log the error securely and show a generic message
error_log("Database Connection Error: " . $e->getMessage());
die("ไม่สามารถเชื่อมต่อฐานข้อมูลได้ในขณะนี้ กรุณาติดต่อผู้ดูแลระบบ");
}
// Application Security Key for AES Encryption
if (!defined('APP_KEY')) {
define('APP_KEY', 'HOSxP_Web_Service_Secret_Key_2026!');
}
?>