INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(688, '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:59'),
(689, '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:59'),
(690, '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:59'),
(691, '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:59'),
(692, '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:50:05'),
(693, '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:50:23'),
(694, '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:50:40'),
(695, '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:50:45'),
(696, '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:50:46'),
(697, '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 = 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:50:49'),
(698, '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 = 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:50:49'),
(699, '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:50:49'),
(700, '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:50:49'),
(701, '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:50:49'),
(702, '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:50:49'),
(703, '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:50:50'),
(704, '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:50:51'),
(705, '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:50:52'),
(706, '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:50:54'),
(707, '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:50:55'),
(708, '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:50:56'),
(709, '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:50:56'),
(710, '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:50:57'),
(711, '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:50:58'),
(712, '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:50:59'),
(713, '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 = 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:51:00'),
(714, '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:51:01'),
(715, '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:51:02'),
(716, '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:51:02'),
(717, '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:51:03');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(718, '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-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:51:03'),
(719, '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:51:31'),
(720, '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:51:39'),
(721, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 11:51:56'),
(722, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 11:51:56'),
(723, '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:51:59'),
(724, '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:51:59'),
(725, '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:51:59'),
(726, '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:51:59'),
(727, '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:52:00'),
(728, '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:52:02'),
(729, '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:54:47'),
(730, '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:54:51'),
(731, '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:55:16'),
(732, '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:55:18'),
(733, '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 = 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:55:20'),
(734, '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:55:22'),
(735, '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:55:23'),
(736, '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-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  (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:55:26'),
(737, '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-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  (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:55:26'),
(738, '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:55:27'),
(739, '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:55:27'),
(740, '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:55:27'),
(741, '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:55:27'),
(742, '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:55:28'),
(743, '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-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:55:31'),
(744, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 11:56:05'),
(745, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 11:56:05'),
(746, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 11:56:08'),
(747, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 11:56:08'),
(748, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 11:56:33'),
(749, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 11:56:33'),
(750, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 11:56:38'),
(751, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 11:56:38');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(752, '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:58:26'),
(753, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 11:59:04'),
(754, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 11:59:04'),
(755, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 12:09:15'),
(756, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 12:09:23'),
(757, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 12:09:52'),
(758, '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=3  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 = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-15 12:09:55'),
(759, '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 = 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 (3,2) ORDER BY PWSA.flight_date ASC', '2021-07-15 12:09:57'),
(760, '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-28\',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 (3,2) \r\n                            and SINVEN.id IN  (11,8)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-28\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-28\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-28\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 12:10:00'),
(761, '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=1\r\nand FGT.user_id IN (3,2) \r\nand SINVEN.id IN  (11,8) \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 12:10:03'),
(762, '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=1\r\nand FGT.user_id IN (3,2) \r\nand SINVEN.id IN  (11,8) \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 12:10:03'),
(763, '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=1\r\nand FGT.user_id IN (3,2) \r\nand SINVEN.id IN  (11,8) \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 12:10:03'),
(764, '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-28\',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 (3,2) \r\n                            and SINVEN.id IN  (11,8)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-28\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-28\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-28\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 12:10:09'),
(765, 'main_companyAccountDetails', 'select DATE_FORMAT(createdAt,\"%d-%m-%Y\")  as last_debited_date,amount as last_debited_amount,\r\navailable_balance as credit_limit,\r\n(SELECT company_name from users where id=3) as company_name,\r\n(select total_amount from flight_bookings where user_id=3 order by createdAt desc limit 0,1) as last_transaction_amount,\r\n(select DATE_FORMAT(createdAt,\"%d-%m-%Y\") from flight_bookings where user_id=3 order by createdAt desc limit 0,1) as  last_transaction_date \r\nfrom accounts where share_by_user_id=2 and share_to_user_id=3 order by createdAt DESC limit 0,1', '2021-07-15 12:11:12'),
(766, 'website_return_getSearchData', 'select DATE_FORMAT(createdAt,\"%d-%m-%Y\")  as last_debited_date,amount as last_debited_amount,\r\navailable_balance as credit_limit,\r\n(SELECT company_name from users where id=3) as company_name,\r\n(select total_amount from flight_bookings where user_id=3 order by createdAt desc limit 0,1) as last_transaction_amount,\r\n(select DATE_FORMAT(createdAt,\"%d-%m-%Y\") from flight_bookings where user_id=3 order by createdAt desc limit 0,1) as  last_transaction_date \r\nfrom accounts where share_by_user_id=2 and share_to_user_id=3 order by createdAt DESC limit 0,1', '2021-07-15 12:11:12'),
(767, '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 12:13:17'),
(768, '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 12:13:17'),
(769, '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 12:13:17'),
(770, '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 12:13:17'),
(771, '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 12:13:18'),
(772, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=2 and share_to_user_id=2 ', '2021-07-15 12:13:23'),
(773, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=2 and share_to_user_id=2 ', '2021-07-15 12:13:23'),
(774, '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 12:13:27'),
(775, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=2 and share_to_user_id=3 ', '2021-07-15 12:13:31'),
(776, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=2 and share_to_user_id=3 ', '2021-07-15 12:13:31'),
(777, '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 12:13:34'),
(778, '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 12:13:35'),
(779, '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 12:13:35'),
(780, '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 12:13:35'),
(781, '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 12:13:36'),
(782, '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 12:13:36'),
(783, '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 = 1\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 12:13:39'),
(784, '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 12:13:40');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(785, '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 12:13:41'),
(786, '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 = 297\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 12:13:41'),
(787, '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 12:13:42'),
(788, '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 12:13:42'),
(789, '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 = 297 \r\nand flights.arrival_city_id = 795\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 = 1\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 12:13:42'),
(790, '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 12:13:43'),
(791, 'main_getTicketReturnAvailableDate', 'select flights.trip_duration as return_in_days from flights as flights\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 297 \r\nand flights.arrival_city_id = 795\r\nAND flights.return_flight = 1\r\nand flights.status = 1 group by flights.trip_duration order by trip_duration ASC', '2021-07-15 12:13:44'),
(792, '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 12:13:45'),
(793, 'main_return_getSearchData', 'SELECT  (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,USER.company_name, USER.role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,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,(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.id as flight_id,FGT.user_id,FGT.flight_number,FGT.ret_dep_ter_no_id,FGT.ret_arv_ter_no_id,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_dep_time as return_dep_time,FGT.ret_arv_time as ret_arv_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.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 ,PSA.available_seats as total_available_seats,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,return_departure_city.name as return_departure_city_name,return_arrival_city.name as return_arrival_city_name,return_departure_airports.name as return_departure_airport_name,return_departure_airports.airport_code as return_departure_airport_code,return_arrival_airports.name as return_arrival_airport_name,return_arrival_airports.airport_code as return_arrival_airport_code FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\nINNER join cities as return_departure_city on return_departure_city.id = FGT.re_dep_city \r\nINNER join cities as  return_arrival_city on return_arrival_city.id = FGT.re_arr_city \r\nINNER join airports as  return_departure_airports on return_departure_airports.id = FGT.re_dep_airport_id\r\nINNER join airports as  return_arrival_airports on return_arrival_airports.id = FGT.re_arr_airport_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\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=1 \r\n                            and departure_city_id = 297\r\n                            and departure_airport_id=484\r\n                            and  arrival_city_id=795\r\n                            and arrival_airport_id=574\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\nand FPNR.available_seat > 0 \r\nand FPNR.date =\'2021-07-21\'\r\n and FPNR.return_dep_date=\'2021-07-24\'\r\n and SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FARETAX.date =\'2021-07-21\' \r\ngroup by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 12:13:48'),
(794, 'main_return_getSearchData', 'SELECT  (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,USER.company_name, USER.role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,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,(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.id as flight_id,FGT.user_id,FGT.flight_number,FGT.ret_dep_ter_no_id,FGT.ret_arv_ter_no_id,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_dep_time as return_dep_time,FGT.ret_arv_time as ret_arv_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.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 ,PSA.available_seats as total_available_seats,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,return_departure_city.name as return_departure_city_name,return_arrival_city.name as return_arrival_city_name,return_departure_airports.name as return_departure_airport_name,return_departure_airports.airport_code as return_departure_airport_code,return_arrival_airports.name as return_arrival_airport_name,return_arrival_airports.airport_code as return_arrival_airport_code FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\nINNER join cities as return_departure_city on return_departure_city.id = FGT.re_dep_city \r\nINNER join cities as  return_arrival_city on return_arrival_city.id = FGT.re_arr_city \r\nINNER join airports as  return_departure_airports on return_departure_airports.id = FGT.re_dep_airport_id\r\nINNER join airports as  return_arrival_airports on return_arrival_airports.id = FGT.re_arr_airport_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\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=1 \r\n                            and departure_city_id = 297\r\n                            and departure_airport_id=484\r\n                            and  arrival_city_id=795\r\n                            and arrival_airport_id=574\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\nand FPNR.available_seat > 0 \r\nand FPNR.date =\'2021-07-21\'\r\n and FPNR.return_dep_date=\'2021-07-24\'\r\n and SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FARETAX.date =\'2021-07-21\' \r\ngroup by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 12:13:48'),
(795, '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 = 297\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 12:13:48'),
(796, '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 = 1\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 12:13:48'),
(797, '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 = 297\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 12:13:48'),
(798, '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 = 297 \r\nand flights.arrival_city_id = 795\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 = 1\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 12:13:48'),
(799, '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 = 297 \r\nand flights.arrival_city_id = 795\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 = 1\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 12:13:49'),
(800, 'main_return_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, USER.company_name,USER.role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,FAS.payment_gatway_charges,FAS.amount,FAS.percentage,  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.return_dep_time as return_dep_time,FGT.ret_arv_time as ret_arv_time,FGT.name,FGT.airline_id,FGT.departure_city_id,FGT.ret_dep_ter_no_id,FGT.ret_arv_ter_no_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.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,arrival_airports.name as arrival_airport_name, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code ,PSA.available_seats as total_available_seats,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,return_departure_city.name as return_departure_city_name,return_arrival_city.name as return_arrival_city_name,return_departure_airports.name as return_departure_airport_name,return_departure_airports.airport_code as return_departure_airport_code,return_arrival_airports.name as return_arrival_airport_name,return_arrival_airports.airport_code as return_arrival_airport_code FROM flights as FGT\r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join cities as return_departure_city on return_departure_city.id = FGT.re_dep_city\r\nINNER join cities as  return_arrival_city on return_arrival_city.id = FGT.re_arr_city\r\nINNER join airports as  return_departure_airports on return_departure_airports.id = FGT.re_dep_airport_id\r\nINNER join airports as  return_arrival_airports on return_arrival_airports.id = FGT.re_arr_airport_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=1\r\nand FGT.id=3\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 FPNR.return_dep_date =\'2021-07-24\' \r\nand FARETAX.date =\'2021-07-21\' group by FGT.id', '2021-07-15 12:13:50'),
(801, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 12:13:59'),
(802, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 12:13:59'),
(803, '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 12:14:03'),
(804, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=2 and share_to_user_id=3 ', '2021-07-15 12:14:12'),
(805, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=2 and share_to_user_id=3 ', '2021-07-15 12:14:12'),
(806, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 12:17:35'),
(807, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 12:17:35'),
(808, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 12:20:00'),
(809, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 12:20:00'),
(810, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 12:20:37'),
(811, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-15 12:20:37'),
(812, '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 12:20:40'),
(813, '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 12:21:19'),
(814, '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 = 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 12:21:23'),
(815, '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 = 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 12:21:25'),
(816, '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 12:24:36'),
(817, '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 12:24:44'),
(818, '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 12:24:45'),
(819, '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 12:24:48'),
(820, '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 12:24:48'),
(821, '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 12:24:48');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(822, '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 12:24:48'),
(823, '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 12:24:49'),
(824, '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 12:24:49'),
(825, '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 12:24:49'),
(826, '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 12:24:59'),
(827, '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 12:24:59'),
(828, '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 12:25:00'),
(829, '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 12:25:01'),
(830, '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 12:25:01'),
(831, '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 12:25:06'),
(832, '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 12:25:07'),
(833, '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 = 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 12:25:10'),
(834, '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 12:25:11'),
(835, '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 12:25:12'),
(836, '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 12:25:12'),
(837, '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 12:25:13'),
(838, '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 12:26:12'),
(839, '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 12:26:15'),
(840, '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 12:26:16'),
(841, '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 12:26:19'),
(842, '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 12:26:19'),
(843, '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 12:26:20'),
(844, '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 12:26:20'),
(845, '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 12:26:20'),
(846, '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 12:26:20'),
(847, '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 12:26:21'),
(848, '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 12:26:26'),
(849, '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 12:26:27'),
(850, '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 12:26:30'),
(851, '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 12:26:31'),
(852, '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 12:26:32'),
(853, '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 12:26:32'),
(854, '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 12:26:33');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(855, '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=1\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 12:26:57'),
(856, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 12:30:31'),
(857, 'front_frontGetDepartureCities', '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 IN (select GROUP_CONCAT(id) from users where role_id=1)\r\nand  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 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 12:31:40'),
(858, '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 12:31:44'),
(859, '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 12:31:45'),
(860, '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-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  (8,10)  \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 12:31:48'),
(861, '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-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 12:32:00'),
(862, '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=1  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 12:33:11'),
(863, '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 12:33:26'),
(864, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 12:36:22'),
(865, '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 12:36:37'),
(866, '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 12:42:09'),
(867, '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 12:42:35'),
(868, '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 12:45:14'),
(869, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 12:45:27'),
(870, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 12:45:46'),
(871, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 12:48:12'),
(872, '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 13:00:09'),
(873, '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 13:00:11'),
(874, '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 13:00:19'),
(875, '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 13:24:40'),
(876, '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 13:25:58'),
(877, '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 13:26:18'),
(878, '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 13:26:22'),
(879, '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 = 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 13:26:27'),
(880, '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 = 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 13:26:28'),
(881, '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 13:27:23'),
(882, '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 13:27:43'),
(883, '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 13:27:50'),
(884, '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 13:28:16'),
(885, '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 13:28:41'),
(886, '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 13:28:48'),
(887, '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 13:28:57');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(888, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 13:36:14'),
(889, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-15 13:39:26'),
(890, '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 13:41:29'),
(891, '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-16 03:52:22'),
(892, '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-16 03:52:26'),
(893, '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-16 03:52:27'),
(894, '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-16 03:52:29'),
(895, '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-16 03:52:29'),
(896, '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-16 03:52:30'),
(897, '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-16 03:52:30'),
(898, '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-16 03:52:30'),
(899, '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-16 03:52:30'),
(900, '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-16 03:52:31'),
(901, '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-16 03:52:33'),
(902, '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-16 03:52:35'),
(903, '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-16 03:52:39'),
(904, '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-16 03:52:40'),
(905, '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-16 03:52:41'),
(906, '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-16 03:52:41'),
(907, '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-16 03:52:42'),
(908, '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-16 03:52:44'),
(909, '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-16 03:52:45'),
(910, '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-18\',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-18\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-18\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-18\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 03:52:52'),
(911, '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-16 03:52:53'),
(912, '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-16 03:52:54'),
(913, '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-16 03:52:54'),
(914, '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 = 1\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-16 03:52:55'),
(915, '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 = 1\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-16 03:52:55'),
(916, '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 = 297\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-16 03:52:56'),
(917, '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 = 297 \r\nand flights.arrival_city_id = 795\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 = 1\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-16 03:52:57'),
(918, '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 = 1\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-16 03:53:01'),
(919, '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 = 297\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-16 03:53:03'),
(920, '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 = 297 \r\nand flights.arrival_city_id = 795\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 = 1\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-16 03:53:04'),
(921, 'website_websiteGetTicketReturnAvailableDate', 'select flights.trip_duration as return_in_days from flights as flights\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 297 \r\nand flights.arrival_city_id = 795\r\nAND flights.return_flight = 1\r\nand flights.status = 1 group by flights.trip_duration order by trip_duration ASC', '2021-07-16 03:53:06');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(922, 'website_return_getSearchData', 'SELECT  (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,USER.company_name, USER.role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,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,(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.id as flight_id,FGT.user_id,FGT.flight_number,FGT.ret_dep_ter_no_id,FGT.ret_arv_ter_no_id,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_dep_time as return_dep_time,FGT.ret_arv_time as ret_arv_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.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 ,PSA.available_seats as total_available_seats,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,return_departure_city.name as return_departure_city_name,return_arrival_city.name as return_arrival_city_name,return_departure_airports.name as return_departure_airport_name,return_departure_airports.airport_code as return_departure_airport_code,return_arrival_airports.name as return_arrival_airport_name,return_arrival_airports.airport_code as return_arrival_airport_code FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\nINNER join cities as return_departure_city on return_departure_city.id = FGT.re_dep_city \r\nINNER join cities as  return_arrival_city on return_arrival_city.id = FGT.re_arr_city \r\nINNER join airports as  return_departure_airports on return_departure_airports.id = FGT.re_dep_airport_id\r\nINNER join airports as  return_arrival_airports on return_arrival_airports.id = FGT.re_arr_airport_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\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-18\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=1 \r\n                            and departure_city_id = 297\r\n                            and departure_airport_id=484\r\n                            and  arrival_city_id=795\r\n                            and arrival_airport_id=574\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-18\' \r\n and PSA.available_seats > 0\r\nand FPNR.available_seat > 0 \r\nand FPNR.date =\'2021-07-18\'\r\n and FPNR.return_dep_date=\'2021-07-21\'\r\n and SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FARETAX.date =\'2021-07-18\' \r\ngroup by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 03:53:10'),
(923, '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 = 297\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-16 03:53:11'),
(924, '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 = 297\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-16 03:53:11'),
(925, '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 = 297 \r\nand flights.arrival_city_id = 795\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 = 1\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-16 03:53:12'),
(926, '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 = 297 \r\nand flights.arrival_city_id = 795\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 = 1\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-16 03:53:12'),
(927, '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-16 03:53:56'),
(928, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 03:55:43'),
(929, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 03:55:43'),
(930, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 03:56:41'),
(931, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 03:56:41'),
(932, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:04:38'),
(933, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:04:38'),
(934, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:04:42'),
(935, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:04:42'),
(936, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:04:59'),
(937, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:04:59'),
(938, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:15:20'),
(939, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:15:20'),
(940, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:20:23'),
(941, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:20:23'),
(942, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:23:20'),
(943, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:23:20'),
(944, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:36:23'),
(945, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:36:23'),
(946, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:39:33'),
(947, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:39:33'),
(948, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:43:02'),
(949, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:43:02'),
(950, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:43:20'),
(951, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:43:20'),
(952, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:44:28'),
(953, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:44:28'),
(954, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:45:56'),
(955, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:45:56'),
(956, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:52:27'),
(957, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:52:27'),
(958, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:58:16'),
(959, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 04:58:16'),
(960, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 05:07:33'),
(961, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:12:38'),
(962, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:12:38'),
(963, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:18:16'),
(964, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:18:16'),
(965, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:20:57'),
(966, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:20:57'),
(967, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:24:28'),
(968, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:24:28'),
(969, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:25:29'),
(970, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:25:29'),
(971, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:25:42'),
(972, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:25:42'),
(973, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:28:25'),
(974, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:28:25'),
(975, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:35:56'),
(976, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:35:56'),
(977, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:36:35'),
(978, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:36:35'),
(979, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:40:59'),
(980, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:40:59'),
(981, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:54:10'),
(982, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:54:10'),
(983, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:55:16'),
(984, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 05:55:16'),
(985, '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-16 06:05:37'),
(986, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 06:07:48'),
(987, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 06:07:48'),
(988, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 06:07:57'),
(989, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 06:07:57'),
(990, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 06:22:52'),
(991, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 06:40:44'),
(992, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 06:40:44'),
(993, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 06:42:08'),
(994, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 06:42:08'),
(995, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 06:42:22'),
(996, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 06:42:22'),
(997, '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=3  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 (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 06:42:24'),
(998, '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-16 06:42:57'),
(999, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 06:46:22'),
(1000, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=1 and share_to_user_id=3 ', '2021-07-16 06:46:22'),
(1001, '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-16 06:46:50'),
(1002, '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-16 06:47:45'),
(1003, '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-16 06:47:46'),
(1004, '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-16 06:47:49'),
(1005, '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-16 06:47:49'),
(1006, '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-16 06:47:49'),
(1007, '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-16 06:47:49'),
(1008, '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-16 06:47:49'),
(1009, '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-16 06:47:49'),
(1010, '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-16 06:47:50'),
(1011, '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-16 06:48:23'),
(1012, '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-16 06:48:25'),
(1013, '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-16 06:48:26');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(1014, '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-16 06:48:28'),
(1015, '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-16 06:48:28'),
(1016, '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-16 06:48:29'),
(1017, '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-16 06:48:29'),
(1018, '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-16 06:48:29'),
(1019, '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-16 06:48:29'),
(1020, '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-16 06:48:30'),
(1021, '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-16 06:48:33'),
(1022, '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-16 06:48:34'),
(1023, '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-18\',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-18\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-18\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-18\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 06:48:37'),
(1024, '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-16 06:48:38'),
(1025, '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-16 06:48:39'),
(1026, '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-16 06:48:39'),
(1027, '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-16 06:48:40'),
(1028, '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-16 06:56:39'),
(1029, '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-18\',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-18\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-18\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-18\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 06:58:52'),
(1030, '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-16 06:58:53'),
(1031, '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-16 06:58:54'),
(1032, '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-16 06:58:54'),
(1033, '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-16 06:58:55'),
(1034, '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-16 06:59:31'),
(1035, '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-16 06:59:37'),
(1036, '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 = 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-16 06:59:41'),
(1037, '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-16 06:59:43'),
(1038, '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-16 06:59:54'),
(1039, '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-28\',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-28\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-28\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-28\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 06:59:58'),
(1040, '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-28\',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-28\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-28\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-28\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 06:59:58'),
(1041, '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-16 06:59:58');
