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
@@ -0,0 +1,38 @@
<?php
// File: includes/db_assessment.php
// สำหรับเชื่อมต่อฐานข้อมูลของระบบแบบประเมิน (Local/ระบบนี้)
$host = 'localhost'; // แก้ไขเป็น Host ของระบบแบบประเมิน
$db = 'it_assessment'; // แก้ไขเป็นชื่อฐานข้อมูลของระบบนี้
$user = 'root'; // แก้ไขเป็น Username ของคุณ
$pass = '@Samui@10742'; // แก้ไขเป็น Password ของคุณ
$charset = 'utf8mb4';
// เลขบัตรประชาชนของ Super Admin ที่เข้าจัดการระบบได้
$super_admins = [
'1840400002613',
'3840400171314',
'3800500016451'
];
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
];
try {
$pdo_assess = new PDO($dsn, $user, $pass, $options);
} catch (\PDOException $e) {
throw new \PDOException($e->getMessage(), (int)$e->getCode());
}
// ฟังก์ชันบันทึกประวัติการปรับปรุง
function logAdminAction($pdo, $admin_cid, $admin_name, $action_type, $action_detail) {
try {
$stmt = $pdo->prepare("INSERT INTO it_logs (admin_cid, admin_name, action_type, action_detail) VALUES (?, ?, ?, ?)");
$stmt->execute([$admin_cid, $admin_name, $action_type, $action_detail]);
} catch (PDOException $e) {
// เงียบไว้ถ้าบันทึก log ไม่ได้
}
}
@@ -0,0 +1,20 @@
<?php
// File: includes/db_hosoffice.php
$host = '10.0.250.115'; // แก้ไขเป็น Host ของคุณ
$db = 'hosoffice_2566'; // แก้ไขเป็นชื่อฐานข้อมูลของคุณ
$user = 'hosoffice'; // แก้ไขเป็น Username ของคุณ
$pass = 'hosoffice10742'; // แก้ไขเป็น Password ของคุณ
$charset = 'utf8mb4';
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
];
try {
$pdo_hos = new PDO($dsn, $user, $pass, $options);
} catch (\PDOException $e) {
throw new \PDOException($e->getMessage(), (int)$e->getCode());
}