probooking
    • ProBookingCenter
    • Data Dictionary
    • Database Diagram
    • Code Issues
    • Page
    • Plan
    • Online vs Source Code

    Online vs Source Code

    รายงานผลตรวจสอบระบบ Online vs Source Code#

    ระบบ: Pro Booking Center (PBC) - Office 3
    URL: https://office3.probookingcenter.com
    วันที่ตรวจ: 25 มีนาคม 2026
    ผู้ตรวจ: Claude Code (Automated Verification)
    Login ที่ใช้: User: Haru

    สรุปผลภาพรวม#

    หัวข้อผลลัพธ์
    หน้าที่ตรวจทั้งหมด21 หน้า
    หน้าที่ทำงานปกติ14 หน้า (ตรงกับ code)
    หน้าที่มี Bug1 หน้า (/bookings - 500 Error)
    หน้าที่เข้าไม่ได้ (Role)5 หน้า (user ไม่มีสิทธิ์)
    หน้าที่ต้อง 2FA1 หน้า (/admin)
    REST API4/4 endpoints ทำงานปกติ
    ปัญหาด้านความปลอดภัย1 รายการ (APP_DEBUG=true)

    1. หน้า Login#

    รายการตรวจCodeOnlineตรงกัน
    Page TitlePro Booking CenterPro Booking Centerตรง
    Form fields (email, password)มีมีตรง
    Hidden field (remember=1)มีมีตรง
    Logo URL (/images/logos/logo.png)มีมีตรง
    CSS (/static/css/admin-login.css)มีมีตรง
    Labels (Email or Username, Password)มีมีตรง
    Password toggle SVGมีมีตรง
    jQuery 3.3.1 + Bootstrap 4.3.1มีมีตรง
    Copyright (2022-2023)มีมีตรง
    ผลลัพธ์: ตรงกัน 100%

    2. หน้าหลักที่ทำงานปกติ (14 หน้า)#

    #หน้าURLHTTP StatusขนาดVue Componentsตรงกับ Code
    1Home/2005.7 KBไม่มี (static)ตรง - มี "เวอร์ชั่นเก่า" + "Dashboard"
    2Dashboard/dashboard20016.5 KB<sales-dashboard>ตรง
    3Sales Dashboard/sales/dashboard20016.5 KB<sales-old-dashboard>ตรง
    4Series Tour/series-tour20016.6 KB<series-list>ตรง
    5Period/period20016.4 KB<period-list>ตรง
    6Tours/tours200193 KBserver-renderedตรง
    7My Booking/my-booking2001.1 MB<booking-date-pickers>, <period-date-pickers>ตรง
    8Payment/payment20016.4 KB<payment-page>ตรง
    9Receipt/receipt200280 KBserver-renderedตรง
    10Invoices All/invoices/all20018.7 KB<page-invoice-lists>ตรง
    11Invoice/invoice200179 KB<custom-date-picker>ตรง
    12Ticket Series/ticket/series20016.3 KBserver-renderedตรง
    13Report Booking/report/booking200583 KBserver-renderedตรง
    14Setting/setting20023.2 KBserver-renderedตรง
    หมายเหตุ: ทุกหน้าที่ใช้ admin layout มี <layout-header>, <layout-sidebar>, <agency-modal> ตรงกับ Blade template

    3. ปัญหาที่พบ#

    3.1 CRITICAL: หน้า /bookings - 500 Server Error#

    URL: https://office3.probookingcenter.com/bookings
    HTTP Status: 500
    Error Type: Illuminate\Database\QueryException
    SQL Error:
    SQLSTATE[42000]: Syntax error or access violation: 1140
    Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns
    is illegal if there is no GROUP BY clause
    Query ที่มีปัญหา:
    ไฟล์ที่มี Bug:
    app/Http/Controllers/Operation/Booking/OperationBookingController.php บรรทัด 107-111
    สาเหตุ:
    ตัวแปร $forSummary ถูก clone มาจาก $sth ซึ่งมี ORDER BY book_id desc ติดมาด้วย เมื่อใช้ aggregate functions (SUM) โดยไม่มี GROUP BY clause ทำให้ MySQL strict mode reject query
    Code ที่มีปัญหา:
    วิธีแก้ไขที่แนะนำ:
    ผลกระทบ: หน้า All Bookings (Operation) ใช้งานไม่ได้เลย - ผู้ใช้ที่มี role operation จะไม่สามารถดูรายการ booking ทั้งหมดได้

    3.2 SECURITY: APP_DEBUG=true บน Production#

    ความรุนแรง: สูง
    รายละเอียด: เมื่อเกิด error (เช่น หน้า /bookings) ระบบแสดง full stack trace ซึ่งเปิดเผย:
    Server path: /var/www/html/probookingcenter/office3/
    Framework version: Laravel 8
    Database connection details
    PHP class structure
    ความเสี่ยง:
    ผู้ไม่หวังดีสามารถใช้ข้อมูลนี้วางแผนโจมตีได้
    เปิดเผยโครงสร้างภายในของระบบ
    วิธีแก้ไข:
    ตั้งค่า APP_DEBUG=false ในไฟล์ .env บน production server

    3.3 หน้าที่เข้าไม่ได้ (Role-Based Access)#

    User "Haru" ไม่มีสิทธิ์เข้าหน้าเหล่านี้ (redirect ไปหน้า login):
    หน้าURLRole ที่ต้องการ
    Ticket Pre-Sale/ticket/pre-saleticket
    Event/eventevent
    Incentive/incentiveต้องการ role เฉพาะ
    Agency/agencysettings
    Document/documentต้องการ role เฉพาะ
    หน้าที่ต้อง 2FA:
    หน้าURLเหตุผล
    Admin/Users/adminต้องยืนยัน Two-Factor Authentication
    หมายเหตุ: ไม่ถือว่าเป็นปัญหา - เป็นการทำงานที่ถูกต้องตาม RBAC ของระบบ ต้องทดสอบด้วย user ที่มี role ครบทุกสิทธิ์

    4. REST API Endpoints#

    #EndpointStatusResponseตรงกับ Code
    1GET /rest/period/getPeriodList200JSON - ข้อมูล Period พร้อม Series, Bus, Lockseatตรง
    2GET /rest/series/getSeriesList200JSON - ข้อมูล Series พร้อม Period, Booking infoตรง
    3GET /rest/dashboard/sales200JSON - Country list, Seat count, Booked countตรง
    4GET /rest/allbooking200JSON - Booking list พร้อม Status, Period, Amountตรง
    ผลลัพธ์: ทุก API ทำงานปกติ return JSON ถูกต้อง

    5. Git Diff Analysis - สิ่งที่เปลี่ยนแปลงใน Code (ยังไม่ deploy)#

    #ไฟล์การเปลี่ยนแปลงผลกระทบ
    1app/Models/LandOperation.phpเพิ่ม protected $connection = 'center'กำหนด database connection ให้ model - อาจแก้ bug ที่ query ไปผิด DB
    2Migration: withholding taxเพิ่ม check hasTable ก่อน run migrationป้องกัน error ถ้าตาราง invoice_full_payment_details ยังไม่มี
    33 Costing migrationsลบไฟล์ migration 3 ไฟล์ (costing_series_reports, type_lists, type_list_details)ตารางเหล่านี้อาจถูกย้ายไป DB อื่นหรือไม่ใช้แล้ว
    4admin-login.scssแก้ @import "_buttons" เป็น @import "buttons"แก้ SCSS import path
    5Dockerfileแก้ไข Docker build configไม่กระทบการทำงาน
    6docker-compose.ymlแก้ไข Docker orchestrationไม่กระทบการทำงาน
    7composer.lockอัพเดท dependenciesไม่กระทบการทำงาน

    6. Layout & Component Verification#

    Admin Layout (ใช้ในทุกหน้าที่ต้อง auth)#

    ComponentCode (Blade)Onlineตรงกัน
    Layout wrapper#layout-gridมีตรง
    Header<layout-header> via <x-admin.layout.header>มีตรง
    Sidebar<layout-sidebar> via <x-admin.layout.sidebar>มีตรง
    Agency Modal<agency-modal>มีตรง
    CSS/static/css/admin.cssมีตรง
    JS/static/js/admin.jsมีตรง

    Vue Component Mapping#

    Blade TemplateVue Component (Code)Vue Component (Online)ตรงกัน
    dashboard.blade.php<sales-dashboard><sales-dashboard>ตรง
    sales-dashboard.blade.php<sales-old-dashboard><sales-old-dashboard>ตรง
    series (list)<series-list><series-list>ตรง
    period (list)<period-list><period-list>ตรง
    payment/index.blade.php<payment-page><payment-page>ตรง
    invoice (all)<page-invoice-lists><page-invoice-lists>ตรง
    invoice (detail)<custom-date-picker><custom-date-picker>ตรง
    my-booking<booking-date-pickers><booking-date-pickers>ตรง

    7. สรุปและข้อเสนอแนะ#

    ผลการตรวจสอบ#

    ระบบ online ที่ https://office3.probookingcenter.com ตรงกับ source code ในส่วนใหญ่ โดยมี:
    14 จาก 21 หน้า ทำงานปกติและตรงกับ code
    REST API ทำงานถูกต้องทั้ง 4 endpoints ที่ทดสอบ
    Vue Components ตรงกับ Blade templates ทั้งหมด
    Layout (Header, Sidebar, Modal) ตรงกับ code

    สิ่งที่ต้องแก้ไขเร่งด่วน#

    ลำดับปัญหาความรุนแรงการดำเนินการ
    1/bookings 500 Error (SQL)Criticalแก้ไข OperationBookingController.php line 107 เพิ่ม ->reorder()
    2APP_DEBUG=trueHighตั้งค่า APP_DEBUG=false ใน .env บน production
    3Git changes ยังไม่ deployMediumReview และ deploy LandOperation.php + migration changes

    สิ่งที่แนะนำเพิ่มเติม#

    1.
    ทดสอบด้วย Admin account - ตรวจหน้าที่ user Haru เข้าไม่ได้ (ticket, event, incentive, agency, document, admin)
    2.
    ตรวจ 2FA - หน้า /admin ต้องการ 2FA ควรทดสอบว่าทำงานถูกต้อง
    3.
    Deploy pending changes - มีการเปลี่ยนแปลง 7 ไฟล์ที่ยังไม่ได้ deploy

    รายงานนี้สร้างโดย Claude Code (Automated Verification) เมื่อวันที่ 25 มีนาคม 2026
    Modified at 2026-03-25 09:23:45
    Previous
    Plan
    Built with