{"id":21,"date":"2025-08-05T10:00:04","date_gmt":"2025-08-05T03:00:04","guid":{"rendered":"https:\/\/ksd.ac.th\/web\/?page_id=21"},"modified":"2026-03-20T20:21:51","modified_gmt":"2026-03-20T13:21:51","slug":"%e0%b8%9a%e0%b8%b8%e0%b8%84%e0%b8%a5%e0%b8%b2%e0%b8%81%e0%b8%a3","status":"publish","type":"page","link":"https:\/\/ksd.ac.th\/web\/?page_id=21","title":{"rendered":"\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/\/ \u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 (\u0e1b\u0e23\u0e31\u0e1a\u0e43\u0e2b\u0e49\u0e15\u0e23\u0e07\u0e01\u0e31\u0e1a\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e08\u0e23\u0e34\u0e07\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13)\n$host = 'localhost';\n$dbname = 'ksdacth_lesson_plan_db';\n$username = 'ksdacth_admin';\n$password = 'Abc9988771';\n\ntry {\n    $pdo = new PDO(\"mysql:host=$host;dbname=$dbname;charset=utf8\", $username, $password);\n    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n} catch(PDOException $e) {\n    die(\"Error: \" . $e->getMessage());\n}\n\n\/\/ \u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23\u0e41\u0e22\u0e01\u0e15\u0e32\u0e21\u0e01\u0e25\u0e38\u0e48\u0e21\u0e2a\u0e32\u0e23\u0e30\/\u0e41\u0e1c\u0e19\u0e01\n$stmt = $pdo->query(\"SELECT * FROM users WHERE role IN ('admin', 'teacher') ORDER BY department ASC, id ASC\");\n$personnel = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\/\/ \u0e08\u0e31\u0e14\u0e01\u0e25\u0e38\u0e48\u0e21\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e15\u0e32\u0e21\u0e41\u0e1c\u0e19\u0e01\n$grouped = &#91;];\nforeach ($personnel as $p) {\n    $dept = $p&#91;'department'] ?: '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38\u0e01\u0e25\u0e38\u0e48\u0e21\u0e2a\u0e32\u0e23\u0e30';\n    $grouped&#91;$dept]&#91;] = $p;\n}\n?>\n\n&lt;!DOCTYPE html>\n&lt;html lang=\"th\">\n&lt;head>\n    &lt;meta charset=\"UTF-8\">\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    &lt;title>\u0e17\u0e33\u0e40\u0e19\u0e35\u0e22\u0e1a\u0e2a\u0e48\u0e27\u0e19\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23 | KSD System&lt;\/title>\n    &lt;link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.3.0\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\">\n    &lt;link href=\"https:\/\/fonts.googleapis.com\/css2?family=Sarabun:wght@300;400;600&amp;display=swap\" rel=\"stylesheet\">\n    &lt;style>\n        body { font-family: 'Sarabun', sans-serif; background-color: #f4f7f6; color: #444; }\n        .hero-section { background: linear-gradient(135deg, #4e73df 0%, #224abe 100%); color: white; padding: 60px 0; margin-bottom: 40px; text-align: center; }\n        .dept-title { border-left: 5px solid #4e73df; padding-left: 15px; margin-bottom: 30px; font-weight: 600; color: #2e59d9; }\n        .person-card { border: none; border-radius: 15px; transition: transform 0.3s ease, box-shadow 0.3s ease; background: white; text-align: center; padding: 20px; height: 100%; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }\n        .person-card:hover { transform: translateY(-10px); box-shadow: 0 12px 20px rgba(0,0,0,0.1); }\n        .profile-img { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; border: 5px solid #f8f9fc; margin-bottom: 15px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }\n        .name { font-size: 1.1rem; font-weight: 600; margin-bottom: 5px; color: #333; }\n        .position { font-size: 0.9rem; color: #4e73df; font-weight: 500; margin-bottom: 10px; }\n        .contact-info { font-size: 0.8rem; color: #888; border-top: 1px solid #eee; pt-2; }\n    &lt;\/style>\n&lt;\/head>\n&lt;body>\n\n&lt;div class=\"hero-section\">\n    &lt;div class=\"container\">\n        &lt;h1>\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23\u0e17\u0e32\u0e07\u0e01\u0e32\u0e23\u0e28\u0e36\u0e01\u0e29\u0e32&lt;\/h1>\n        &lt;p class=\"lead\">\u0e27\u0e34\u0e17\u0e22\u0e32\u0e25\u0e31\u0e22\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e2a\u0e32\u0e23\u0e20\u0e35 (KSD) - \u0e21\u0e38\u0e48\u0e07\u0e21\u0e31\u0e48\u0e19\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e2a\u0e23\u0e23\u0e04\u0e4c \u0e1e\u0e31\u0e12\u0e19\u0e32\u0e1d\u0e35\u0e21\u0e37\u0e2d&lt;\/p>\n    &lt;\/div>\n&lt;\/div>\n\n&lt;div class=\"container mb-5\">\n    &lt;?php foreach ($grouped as $deptName => $members): ?>\n        &lt;h3 class=\"dept-title mt-5\">&lt;?php echo htmlspecialchars($deptName); ?>&lt;\/h3>\n        &lt;div class=\"row g-4\">\n            &lt;?php foreach ($members as $m): ?>\n                &lt;div class=\"col-6 col-md-4 col-lg-3\">\n                    &lt;div class=\"person-card\">\n                        &lt;?php \n                            $img = $m&#91;'image_path'] ?: 'https:\/\/ui-avatars.com\/api\/?name=' . urlencode($m&#91;'full_name']) . '&amp;size=200&amp;background=4e73df&amp;color=fff';\n                        ?>\n                        &lt;img src=\"&lt;?php echo $img; ?>\" class=\"profile-img\" alt=\"Profile\">\n                        &lt;div class=\"name\">&lt;?php echo htmlspecialchars($m&#91;'full_name']); ?>&lt;\/div>\n                        &lt;div class=\"position\">&lt;?php echo htmlspecialchars($m&#91;'position']); ?>&lt;\/div>\n                        &lt;div class=\"contact-info mt-2\">\n                            &lt;div>&lt;i class=\"bi bi-envelope\">&lt;\/i> &lt;?php echo htmlspecialchars($m&#91;'email'] ?: '-'); ?>&lt;\/div>\n                        &lt;\/div>\n                    &lt;\/div>\n                &lt;\/div>\n            &lt;?php endforeach; ?>\n        &lt;\/div>\n    &lt;?php endforeach; ?>\n&lt;\/div>\n\n&lt;footer class=\"text-center py-4 bg-white border-top\">\n    &lt;p class=\"text-muted mb-0\">\u00a9 2026 Personnel Information System - KSD&lt;\/p>\n&lt;\/footer>\n\n&lt;\/body>\n&lt;\/html><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-21","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ksd.ac.th\/web\/index.php?rest_route=\/wp\/v2\/pages\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ksd.ac.th\/web\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ksd.ac.th\/web\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ksd.ac.th\/web\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ksd.ac.th\/web\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=21"}],"version-history":[{"count":3,"href":"https:\/\/ksd.ac.th\/web\/index.php?rest_route=\/wp\/v2\/pages\/21\/revisions"}],"predecessor-version":[{"id":90,"href":"https:\/\/ksd.ac.th\/web\/index.php?rest_route=\/wp\/v2\/pages\/21\/revisions\/90"}],"wp:attachment":[{"href":"https:\/\/ksd.ac.th\/web\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}