INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(452, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:06:52'),
(453, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:06:52'),
(454, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:06:52'),
(455, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:06:53'),
(456, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:06:53'),
(457, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-28\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-28\'\r\nand FARETAX.date =\'2021-07-28\' group by FGT.id', '2021-07-15 11:06:56'),
(458, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:07:11'),
(459, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:07:13'),
(460, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:07:14'),
(461, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-26\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-26\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-26\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-26\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:07:17'),
(462, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-26\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-26\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-26\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-26\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:07:17'),
(463, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:07:17'),
(464, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:07:17'),
(465, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:07:17'),
(466, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:07:18'),
(467, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:07:18'),
(468, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-26\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-26\'\r\nand FARETAX.date =\'2021-07-26\' group by FGT.id', '2021-07-15 11:07:23'),
(469, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:09:50'),
(470, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:10:32'),
(471, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:10:42'),
(472, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:10:50'),
(473, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:10:52'),
(474, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:10:56'),
(475, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:10:56'),
(476, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:10:57'),
(477, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:10:57'),
(478, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:10:57'),
(479, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:10:57'),
(480, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:10:57');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(481, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-21\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-21\'\r\nand FARETAX.date =\'2021-07-21\' group by FGT.id', '2021-07-15 11:11:10'),
(482, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:11:25'),
(483, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:11:51'),
(484, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:11:52'),
(485, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-29\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:11:55'),
(486, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-29\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:11:55'),
(487, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:11:55'),
(488, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:11:55'),
(489, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:11:55'),
(490, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:11:56'),
(491, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-29\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:12:10'),
(492, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:12:11'),
(493, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:12:11'),
(494, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:12:12'),
(495, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:12:12'),
(496, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:12:13'),
(497, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-29\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:12:20'),
(498, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:12:21'),
(499, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:12:22'),
(500, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:12:22'),
(501, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:12:23'),
(502, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:12:29'),
(503, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:12:42'),
(504, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:12:54'),
(505, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:12:55'),
(506, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-27\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-27\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-27\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-27\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:13:07'),
(507, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-27\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-27\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-27\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-27\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:13:07');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(508, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:13:07'),
(509, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:13:07'),
(510, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:13:08'),
(511, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:13:08'),
(512, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:13:08'),
(513, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-27\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-27\'\r\nand FARETAX.date =\'2021-07-27\' group by FGT.id', '2021-07-15 11:13:13'),
(514, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-09\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-09\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-09\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-09\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:17:01'),
(515, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:22:48'),
(516, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:22:48'),
(517, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:22:48'),
(518, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:22:48'),
(519, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:22:48'),
(520, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-27\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-27\'\r\nand FARETAX.date =\'2021-07-27\' group by FGT.id', '2021-07-15 11:22:53'),
(521, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:24:02'),
(522, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:24:15'),
(523, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:27:05'),
(524, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:27:35'),
(525, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:27:39'),
(526, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:27:40'),
(527, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:27:46'),
(528, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:27:46'),
(529, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:27:46'),
(530, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:27:46'),
(531, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:27:46'),
(532, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:27:46'),
(533, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:27:47'),
(534, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-17\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-17\'\r\nand FARETAX.date =\'2021-07-17\' group by FGT.id', '2021-07-15 11:27:52'),
(535, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:29:14'),
(536, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:29:22'),
(537, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:29:25'),
(538, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:29:27');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(539, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-20\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-20\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-20\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-20\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:29:33'),
(540, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-20\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-20\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-20\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-20\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:29:33'),
(541, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:29:34'),
(542, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:29:34'),
(543, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:29:34'),
(544, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:29:34'),
(545, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:29:35'),
(546, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-20\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-20\'\r\nand FARETAX.date =\'2021-07-20\' group by FGT.id', '2021-07-15 11:29:43'),
(547, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:30:26'),
(548, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:30:26'),
(549, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:30:26'),
(550, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:30:26'),
(551, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:30:26'),
(552, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-20\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-20\'\r\nand FARETAX.date =\'2021-07-20\' group by FGT.id', '2021-07-15 11:30:29'),
(553, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:30:52'),
(554, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:30:58'),
(555, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:31:04'),
(556, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:31:06'),
(557, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-20\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-20\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-20\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-20\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:31:10'),
(558, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-20\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-20\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-20\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-20\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:31:10'),
(559, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:31:10'),
(560, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:31:10'),
(561, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:31:11'),
(562, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:31:11'),
(563, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:31:11'),
(564, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-20\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-20\'\r\nand FARETAX.date =\'2021-07-20\' group by FGT.id', '2021-07-15 11:31:16'),
(565, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:32:31'),
(566, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:33:07'),
(567, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:33:09');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(568, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:33:12'),
(569, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:33:12'),
(570, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:33:13'),
(571, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:33:13'),
(572, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:33:13'),
(573, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:33:13'),
(574, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:33:13'),
(575, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:33:16'),
(576, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:33:17'),
(577, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:33:20'),
(578, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:33:22'),
(579, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:33:22'),
(580, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:33:23'),
(581, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:33:23'),
(582, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:33:34'),
(583, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:33:36'),
(584, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:33:37'),
(585, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-23\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-23\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-23\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-23\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:33:40'),
(586, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-23\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-23\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-23\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-23\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:33:40'),
(587, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:33:40'),
(588, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:33:41'),
(589, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:33:41'),
(590, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:33:41'),
(591, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:33:42'),
(592, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:33:59'),
(593, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:33:59'),
(594, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:34:00'),
(595, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:34:00'),
(596, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:34:00'),
(597, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:34:30'),
(598, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:34:30');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(599, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:34:31'),
(600, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:34:31'),
(601, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:34:31'),
(602, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:34:34'),
(603, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:34:52'),
(604, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:34:54'),
(605, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:34:55'),
(606, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:34:59'),
(607, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:34:59'),
(608, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:34:59'),
(609, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:34:59'),
(610, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:34:59'),
(611, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:35:00'),
(612, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:35:00'),
(613, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:35:07'),
(614, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:35:08'),
(615, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:35:10'),
(616, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:35:11'),
(617, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:35:12'),
(618, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:35:12'),
(619, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:35:13'),
(620, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-21\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-21\'\r\nand FARETAX.date =\'2021-07-21\' group by FGT.id', '2021-07-15 11:35:29'),
(621, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:36:00'),
(622, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:36:10'),
(623, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:36:12'),
(624, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:36:42'),
(625, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:36:49'),
(626, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:36:50'),
(627, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:36:54'),
(628, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:36:55'),
(629, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-22\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-22\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-22\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-22\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:36:58');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(630, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-22\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-22\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-22\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-22\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:36:58'),
(631, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:36:58'),
(632, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:36:58'),
(633, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:36:59'),
(634, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:36:59'),
(635, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:36:59'),
(636, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:41:54'),
(637, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:41:54'),
(638, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:41:54'),
(639, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:41:54'),
(640, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:41:54'),
(641, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-23\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-23\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-23\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-23\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:42:23'),
(642, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:42:23'),
(643, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:42:24'),
(644, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:42:25'),
(645, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:42:25'),
(646, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:42:27'),
(647, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:42:28'),
(648, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-23\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-23\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-23\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-23\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:42:29'),
(649, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:42:30'),
(650, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:42:31'),
(651, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:42:31'),
(652, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:42:32'),
(653, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-23\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-23\'\r\nand FARETAX.date =\'2021-07-23\' group by FGT.id', '2021-07-15 11:42:43'),
(654, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:47:40'),
(655, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:47:46'),
(656, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:47:47'),
(657, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-20\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-20\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-20\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-20\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:47:49'),
(658, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-20\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-20\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-20\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-20\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:47:49'),
(659, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:47:50');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(660, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:47:50'),
(661, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:47:50'),
(662, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:47:50'),
(663, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:47:51'),
(664, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-20\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-20\'\r\nand FARETAX.date =\'2021-07-20\' group by FGT.id', '2021-07-15 11:48:00'),
(665, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:48:05'),
(666, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:48:05'),
(667, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:48:05'),
(668, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:48:06'),
(669, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:48:06'),
(670, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-23\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-23\'\r\nand FARETAX.date =\'2021-07-23\' group by FGT.id', '2021-07-15 11:48:22'),
(671, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-20\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-20\'\r\nand FARETAX.date =\'2021-07-20\' group by FGT.id', '2021-07-15 11:48:24'),
(672, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:49:01'),
(673, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:49:03'),
(674, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:49:05'),
(675, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-22\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-22\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-22\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-22\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:49:11'),
(676, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-22\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-22\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-22\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-22\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:49:11'),
(677, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:49:11'),
(678, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 11:49:11'),
(679, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:49:11'),
(680, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:49:11'),
(681, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:49:12'),
(682, 'main_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = 1\r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-22\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-22\'\r\nand FARETAX.date =\'2021-07-22\' group by FGT.id', '2021-07-15 11:49:14'),
(683, 'front_frontGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:49:35'),
(684, 'front_frontGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-15 11:49:36'),
(685, 'main_one_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-29\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (8,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 11:49:40'),
(686, 'front_oneway_frontGetSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id =1\r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (8,10) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-29\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-29\'\r\nand FARETAX.date =\'2021-07-29\' group by FGT.id', '2021-07-15 11:49:49'),
(687, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 11:49:59');
