Bug 782 - The Hairdresser Booking Read show all the booking record instead of itself booking record
Summary: The Hairdresser Booking Read show all the booking record instead of itself bo...
Status: RESOLVED FIXED
Alias: None
Product: CS3343 Salon Booking System
Classification: Unclassified
Component: hairdresser.booking.Read (show other bugs)
Version: 2.0
Hardware: PC Mac OS
: --- enhancement
Assignee: Samuel
URL:
Depends on:
Blocks:
 
Reported: 2023-11-17 12:46 HKT by Ng Ming Chak
Modified: 2023-11-17 12:48 HKT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ng Ming Chak 2023-11-17 12:46:18 HKT
Description:
The Hairdresser Booking Read show all the booking record instead of itself booking record.

Step to Reproduce:
1. Hairdress login
2. Select “My booking”
3. The List show all the record.

Actual Result:
The list show all the record.

Expected Result:
The list should show the record for the hairdresser id only.
Comment 1 Ng Ming Chak 2023-11-17 12:48:15 HKT
The bug was caused by the incorrect SQL statement. It select all the record.

sql = "SELECT booking_id, booking_customer_id, C.user_name, booking_hairdresser_id, H.user_name, booking_date, booking_time, " +
            "booking_duration, booking_services, booking_subtotal, booking_discount, booking_grandtotal, booking_status " +  
            "FROM bookings B, users C, users H WHERE " + 
            "B.booking_customer_id = C.user_id AND " +
            "B.booking_hairdresser_id = H.user_id AND " + 
            "B.booking_date LIKE '" + selectedYear + "-" + selectedMonth + "%' AND ";



i add "B.booking_hairdresser_id = " + UserInfo.userID in the function read to fix the problem.