A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 11

Filename: controllers/booking.php

Line Number: 305

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/choowap/public_html/system/libraries/Exceptions.php:166)

Filename: codeigniter/Common.php

Line Number: 356

Database Error

A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND a.aff_status = 1 AND ( ( s.season_date_end >' at line 18

SELECT * FROM ((SELECT h.addi_id, h.ht_id, h.ht_name,(h.url_en)as urlh_name, h.ht_addr, h.ht_teaser, a.ht_stprice,IF(MIN(rp.rp_price) = 0,a.ht_stprice,IFNULL(MIN(rp.rp_price),a.ht_stprice)) price,ar.ar_name, pv.pv_name,pv.country_id,a.zip_code,a.dir, MAX((rp.rp_cost * 100) / rp.rp_price) margin,img.IMAGEPATH,a.sel_data,a.promotion,a.hot,a.recomment,d.CATEGORYNAME,a.partner,h.ht_weight,a.ht_rating,a.addi_latitude,a.addi_longitude FROM tbl_hotel h JOIN tbl_hotel_addi a ON a.addi_id = h.addi_id JOIN tbl_location b ON b.loca_id = h.loca_id LEFT JOIN tbl_area ar ON ar.ar_id = h.ar_id LEFT JOIN tbl_province pv ON pv.pv_id = h.pv_id JOIN aff_seasons s ON s.addi_id = h.addi_id LEFT JOIN aff_room_price rp ON rp.season_id = s.season_id LEFT JOIN hotel_images img ON a.HOTELCODE = img.HOTELCODE LEFT JOIN hotels c ON a.HOTELCODE = c.HOTELCODE LEFT JOIN category_descriptions d ON c.CATEGORYCODE = d.CATEGORYCODE WHERE b.loca_id = '653' AND a.addi_id IN ( SELECT object_id FROM tbl_term_relationship WHERE term_category_id = ) AND a.aff_status = 1 AND ( ( s.season_date_end > 1516566304 ) ) AND a.ht_status = 1 AND (a.partner = 'TT' OR (a.partner = 'HTB' AND img.IMAGEPATH != '') OR a.partner = 'THH') GROUP BY h.addi_id ) UNION ALL (SELECT h.addi_id, h.ht_id, h.ht_name, (h.url_en)as urlh_name, h.ht_addr, h.ht_teaser, a.ht_stprice,IF(MIN(rp.rp_price) = 0,a.ht_stprice,IFNULL(MIN(rp.rp_price),a.ht_stprice)) price,ar.ar_name, pv.pv_name,pv.country_id,a.zip_code,a.dir, MAX((rp.rp_cost * 100) / rp.rp_price) margin,img.IMAGEPATH,a.sel_data,a.promotion,a.hot,a.recomment,d.CATEGORYNAME,a.partner,h.ht_weight,a.ht_rating,a.addi_latitude,a.addi_longitude FROM tbl_hotel h JOIN tbl_hotel_addi a ON a.addi_id = h.addi_id JOIN tbl_location b ON b.loca_id = h.loca_id LEFT JOIN tbl_area ar ON ar.ar_id = h.ar_id LEFT JOIN tbl_province pv ON pv.pv_id = h.pv_id LEFT JOIN aff_seasons s ON s.addi_id = h.addi_id LEFT JOIN aff_room_price rp ON rp.season_id = s.season_id LEFT JOIN hotel_images img ON a.HOTELCODE = img.HOTELCODE LEFT JOIN hotels c ON a.HOTELCODE = c.HOTELCODE LEFT JOIN category_descriptions d ON c.CATEGORYCODE = d.CATEGORYCODE WHERE b.loca_id = '653' AND a.addi_id IN ( SELECT object_id FROM tbl_term_relationship WHERE term_category_id = ) AND a.aff_status = 1 AND ( a.new_system = 1 OR (a.partner = 'HTB' AND img.IMAGEPATH != '') OR a.sel_price = 'HTB' OR a.sel_price = 'THH' OR pv.country_id != 1 ) AND a.ht_status = 1 AND (a.partner = 'TT' OR (a.partner = 'HTB' AND img.IMAGEPATH != '') OR a.partner = 'THH') GROUP BY h.addi_id )) h GROUP BY h.addi_id ORDER BY h.ht_weight desc,margin asc LIMIT 0,20