ชื่อ API: getCustomer

--- ### 📘 รายละเอียด API **Method:** `GET` **Endpoint:** `http://127.0.0.1/w6/getCustomer.php` --- ### 📩 Request Parameters | Parameter | Type | Description | | --------- | ------ | -------------------------------- | | cus_id | string | ใช้รหัสลูกค้าเพื่อดึงข้อมูลลูกค้า 1 ราย | --- ### 🧠 ตัวอย่าง Request ``` /w6/getCustomer.php?cus_id=CUS01 ``` --- ### ✅ ตัวอย่าง Response (สำเร็จ) ```json { "result": 1, "message": "success", "data": { "cus_no": 1, "cus_id": "CUS01", "cus_name": "Supawat Boondee", "cus_username": "supawat@rmuti.ac.th", "cus_password": "9999" } } ``` --- ### ⚠️ ตัวอย่าง Response (ไม่พบข้อมูล) ```json { "result": 0, "message": "Customer not found" } ``` --- ### ❌ ตัวอย่าง Response (Error) ```json { "error": "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'shop.customers' doesn't exist" } ``` --- ### 🔢 HTTP Codes | Code | Message | | ---- | ----------------------- | | 200 | OK | | 400 | Bad Request | | 404 | Not Found | | 500 | Internal Server Error | --- ### 📄 คำอธิบาย ใช้เพื่อดึงข้อมูลของลูกค้าเพียงรายเดียว โดยอ้างอิงจาก **รหัสลูกค้า (cus_id)** ระบบจะคืนค่าข้อมูลลูกค้าทั้งหมด เช่น ชื่อ–นามสกุล, ชื่อผู้ใช้, และรหัสผ่าน --- > 🖋️ **หมายเหตุ:** > เหมาะสำหรับหน้าแก้ไขข้อมูลลูกค้า (Edit Form)