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,14 @@
CREATE TABLE IF NOT EXISTS officer_types (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL UNIQUE,
is_active BOOLEAN DEFAULT TRUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
INSERT IGNORE INTO officer_types (name, is_active) VALUES
('ข้าราชการ', 1),
('ลูกจ้างประจำ', 1),
('พนักงานราชการ', 1),
('พนักงานกระทรวงสาธารณสุข', 1),
('ลูกจ้างชั่วคราว', 1),
('ลูกจ้างรายวัน', 1);
@@ -0,0 +1,10 @@
<?php
try {
$db = new PDO("mysql:host=127.0.0.1;port=3306;dbname=ksh_payroll;charset=utf8mb4", "root", "@Samui@10742");
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = file_get_contents(__DIR__ . '/add_officer_types.sql');
$db->exec($sql);
echo "SQL executed successfully.\n";
} catch (\PDOException $e) {
echo "Error: " . $e->getMessage() . "\n";
}