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,173 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once __DIR__ . '/config.php';
checkLogin();
$topbar_text = getSystemSetting('topbar_text', 'ระบบตรวจสอบข้อมูล HOSxP');
$footer_text = getSystemSetting('footer_text', 'หน่วยงานสุขภาพดิจิทัล โรงพยาบาลเกาะสมุย');
?>
<!DOCTYPE html>
<html lang="th">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>คู่มือการใช้งาน - <?php echo htmlspecialchars($topbar_text); ?></title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="icon" href="assets/img/logo.png" type="image/png">
<style>
body { font-family: 'Sarabun', sans-serif; }
.step-card:hover { transform: translateY(-5px); transition: transform 0.3s ease; }
</style>
</head>
<body class="bg-gray-50 flex flex-col min-h-screen">
<?php include 'topbar.php'; ?>
<div class="max-w-7xl mx-auto py-10 px-4 sm:px-6 lg:px-8">
<!-- Header -->
<div class="text-center mb-12">
<h1 class="text-3xl font-bold text-gray-900 mb-4">คู่มือการใช้งาน <?php echo htmlspecialchars($topbar_text); ?></h1>
<p class="text-lg text-gray-600 max-w-3xl mx-auto">ยินดีต้อนรับเข้าสู่ระบบ <?php echo htmlspecialchars($topbar_text); ?> ด้านล่างนี้คือขั้นตอนการใช้งานระบบตั้งแต่การเตรียมไฟล์ไปจนถึงการส่งออกข้อมูลที่ประมวลผลแล้ว</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<!-- Step 1 -->
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6 step-card relative overflow-hidden">
<div class="absolute top-0 right-0 -mt-4 -mr-4 w-24 h-24 bg-green-50 rounded-full z-0"></div>
<div class="relative z-10 flex items-start">
<div class="flex-shrink-0 mt-1">
<div class="flex items-center justify-center w-12 h-12 bg-green-100 rounded-full text-green-600 font-bold text-xl">1</div>
</div>
<div class="ml-5">
<h3 class="text-xl font-semibold text-gray-900 mb-2">การเข้าสู่ระบบ (Login)</h3>
<p class="text-gray-600 text-sm leading-relaxed">
ระบบนี้เชื่อมต่อกับฐานข้อมูลบุคลากร (HR) ของโรงพยาบาล คุณสามารถใช้ <b>ชื่อผู้ใช้งาน (Username)</b> และ <b>รหัสผ่าน (Password)</b> เดียวกันกับระบบ HR เพื่อเข้าใช้งานได้ทันที หากบัญชีถูกปิดการใช้งาน จะไม่สามารถเข้าสู่ระบบได้
</p>
</div>
</div>
</div>
<!-- Step 2 -->
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6 step-card relative overflow-hidden">
<div class="absolute top-0 right-0 -mt-4 -mr-4 w-24 h-24 bg-blue-50 rounded-full z-0"></div>
<div class="relative z-10 flex items-start">
<div class="flex-shrink-0 mt-1">
<div class="flex items-center justify-center w-12 h-12 bg-blue-100 rounded-full text-blue-600 font-bold text-xl">2</div>
</div>
<div class="ml-5">
<h3 class="text-xl font-semibold text-gray-900 mb-2">การเตรียมไฟล์ Excel</h3>
<p class="text-gray-600 text-sm leading-relaxed mb-3">
ไฟล์ที่จะนำเข้าต้องเป็นไฟล์ Excel นามสกุล <b>.xlsx</b> หรือ <b>.xls</b> เท่านั้น และมีข้อกำหนดสำคัญคือ:
</p>
<ul class="list-disc list-inside text-sm text-gray-600 space-y-1">
<li>ต้องมีคอลัมน์ที่ชื่อว่า <code class="bg-gray-100 px-2 py-1 rounded text-red-500 font-mono">pid</code> (พิมพ์เล็กหรือพิมพ์ใหญ่ก็ได้) อยู่ในแถวแรกของไฟล์</li>
<li>ข้อมูลรหัสบัตรประชาชน (หรือ Person ID) จะต้องอยู่ใต้คอลัมน์นี้</li>
<li>สามารถมีคอลัมน์อื่นๆ ปะปนอยู่ด้วยได้ ระบบจะดึงเฉพาะคอลัมน์ pid มาใช้งาน</li>
</ul>
</div>
</div>
</div>
<!-- Step 3 -->
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6 step-card relative overflow-hidden">
<div class="absolute top-0 right-0 -mt-4 -mr-4 w-24 h-24 bg-purple-50 rounded-full z-0"></div>
<div class="relative z-10 flex items-start">
<div class="flex-shrink-0 mt-1">
<div class="flex items-center justify-center w-12 h-12 bg-purple-100 rounded-full text-purple-600 font-bold text-xl">3</div>
</div>
<div class="ml-5">
<h3 class="text-xl font-semibold text-gray-900 mb-2">การนำเข้าและประมวลผล</h3>
<p class="text-gray-600 text-sm leading-relaxed mb-3">
ที่เมนู <b>"นำเข้าข้อมูล"</b> ให้คุณทำตามขั้นตอนดังนี้:
</p>
<ol class="list-decimal list-inside text-sm text-gray-600 space-y-1">
<li>คลิกที่ปุ่ม <span class="bg-gray-100 px-2 py-1 rounded border">Choose File</span> หรือ <span class="bg-gray-100 px-2 py-1 rounded border">เรียกดู</span> เพื่อเลือกไฟล์ Excel ที่เตรียมไว้</li>
<li>กดปุ่ม <span class="bg-blue-600 text-white px-2 py-1 rounded">อัปโหลดและประมวลผล</span></li>
<li>รอระบบทำงาน (ระยะเวลาขึ้นอยู่กับจำนวนข้อมูล) ระบบจะค้นหาข้อมูลจากฐานข้อมูล HOSxP ให้อัตโนมัติ</li>
</ol>
</div>
</div>
</div>
<!-- Step 4 -->
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6 step-card relative overflow-hidden">
<div class="absolute top-0 right-0 -mt-4 -mr-4 w-24 h-24 bg-yellow-50 rounded-full z-0"></div>
<div class="relative z-10 flex items-start">
<div class="flex-shrink-0 mt-1">
<div class="flex items-center justify-center w-12 h-12 bg-yellow-100 rounded-full text-yellow-600 font-bold text-xl">4</div>
</div>
<div class="ml-5">
<h3 class="text-xl font-semibold text-gray-900 mb-2">4. เมนูตั้งค่าระบบ (สำหรับผู้ดูแลระบบ)</h3>
<p class="text-gray-700 mb-4">
ผู้ดูแลระบบ (Admin) สามารถเข้าถึงเมนูตั้งค่าได้ โดยระบบจะแบ่งออกเป็น 4 ส่วนหลัก:
</p>
<ul class="list-disc pl-6 text-gray-700 space-y-2 mb-4">
<li><strong>ตั้งค่าทั่วไป:</strong> ใช้เปลี่ยนชื่อระบบที่แถบด้านบน (Topbar) และข้อความลิขสิทธิ์ด้านล่าง (Footer)</li>
<li><strong>จัดการผู้ดูแลระบบ:</strong> เพิ่มหรือลบสิทธิ์การเข้าถึงเมนูตั้งค่าด้วยหมายเลขบัตรประชาชน (CID)</li>
<li><strong>จัดการชุดข้อมูล (Export Profiles):</strong> สร้าง แก้ไข และลบชุดข้อมูลสำหรับใช้ในหน้าหลัก</li>
<li><strong>ประวัติการใช้งานระบบ (Logs):</strong> ตรวจสอบประวัติการ Export ข้อมูล, การแก้ไขการตั้งค่า และการเข้าสู่ระบบต่างๆ ของผู้ใช้ในระบบทั้งหมด</li>
</ul>
<p class="text-gray-600 text-sm leading-relaxed mb-3">
เมื่อต้องการนำข้อมูลไปใช้ต่อ ให้กดปุ่ม <span class="bg-green-600 text-white px-2 py-1 rounded">ส่งออกเป็น Excel</span>
</p>
<ul class="list-disc list-inside text-sm text-gray-600 space-y-1">
<li>ไฟล์ที่ได้จะมีชื่อเดียวกันกับไฟล์ที่คุณอัปโหลด และต่อท้ายด้วย <code>_ตรวจสอบแล้ว.xlsx</code></li>
</ul>
</div>
</div>
</div>
<!-- Step 5 -->
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6 step-card relative overflow-hidden md:col-span-2">
<div class="absolute top-0 right-0 -mt-4 -mr-4 w-24 h-24 bg-indigo-50 rounded-full z-0"></div>
<div class="relative z-10 flex items-start">
<div class="flex-shrink-0 mt-1">
<div class="flex items-center justify-center w-12 h-12 bg-indigo-100 rounded-full text-indigo-600 font-bold text-xl">5</div>
</div>
<div class="ml-5">
<h3 class="text-xl font-semibold text-gray-900 mb-2">ประวัติการทำงาน (Work History)</h3>
<p class="text-gray-600 text-sm leading-relaxed mb-3">
ทุกครั้งที่มีการอัปโหลดไฟล์และประมวลผลสำเร็จ ระบบจะบันทึกประวัติการทำงานไว้เป็นหลักฐาน คุณสามารถเข้าไปดูได้ที่เมนู <b>"ประวัติการทำงาน"</b> บนแถบเมนูด้านบน
</p>
<div class="bg-gray-50 p-4 rounded-lg border border-gray-100 mt-2">
<p class="text-sm text-gray-600">
<b>ข้อมูลที่ถูกบันทึกประกอบด้วย:</b> ชื่อชุดข้อมูลที่เลือกใช้, ชื่อผู้ใช้งาน, ชื่อไฟล์ต้นฉบับที่อัปโหลด, จำนวนข้อมูลที่อ่านได้จากไฟล์, จำนวนข้อมูลที่ค้นพบใน HOSxP, และ วัน-เวลาที่ทำการประมวลผล (รูปแบบ พ.ศ.)
</p>
</div>
</div>
</div>
</div>
<!-- Step 6 -->
<?php if (isset($_SESSION['is_admin']) && $_SESSION['is_admin'] === true): ?>
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6 step-card relative overflow-hidden md:col-span-2">
<div class="absolute top-0 right-0 -mt-4 -mr-4 w-24 h-24 bg-teal-50 rounded-full z-0"></div>
<div class="relative z-10 flex items-start">
<div class="flex-shrink-0 mt-1">
<div class="flex items-center justify-center w-12 h-12 bg-teal-100 rounded-full text-teal-600 font-bold text-xl">6</div>
</div>
<div class="ml-5">
<h3 class="text-xl font-semibold text-gray-900 mb-2">ประวัติการใช้งานระบบ (System Logs)</h3>
<p class="text-gray-600 text-sm leading-relaxed mb-3">
เมนู <b>"ประวัติการใช้งานระบบ"</b> (อยู่ในหน้าตั้งค่า) เป็นเมนูพิเศษสำหรับ <b>ผู้ดูแลระบบ (Admin)</b> เท่านั้น โดยจะมีความแตกต่างจาก "ประวัติการทำงาน" ทั่วไปคือ:
</p>
<div class="bg-gray-50 p-4 rounded-lg border border-gray-100 mt-2 space-y-2">
<p class="text-sm text-gray-600"><b>1. ประวัติการทำงาน (บน Topbar):</b> เก็บเฉพาะสถิติการอัปโหลดไฟล์และส่งออกข้อมูล (Export) เพื่อให้ทุกคนดูประวัติการดึงข้อมูลของตัวเองได้ง่ายๆ</p>
<p class="text-sm text-gray-600"><b>2. ประวัติการใช้งานระบบ (System Logs):</b> คือระบบ Audit Log ที่แอบบันทึกการกระทำ <b>"ทุกอย่าง"</b> ในระบบ เช่น ใคร Login เข้ามาตอนไหน, ใครแก้ไขหรือลบชุดข้อมูล, รวมถึงใครเพิ่ม/ลดสิทธิ์แอดมิน เพื่อความปลอดภัยสูงสุด</p>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
</div>
<?php include 'footer.php'; ?>
</body>
</html>