INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(172, '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,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 06:01:31'),
(173, '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,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 06:02:15'),
(174, '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,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 06:03:05'),
(175, '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,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 06:03:26'),
(176, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:05:25'),
(177, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:05:25'),
(178, '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 06:05:39'),
(179, '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 06:05:39'),
(180, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:05:44'),
(181, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:05:44'),
(182, '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 06:06:47'),
(183, '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 06:06:51'),
(184, '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 06:06:53'),
(185, '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-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,10)  \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 06:06:57'),
(186, '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-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,10)  \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 06:06:58'),
(187, '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 06:06:58'),
(188, '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 06:06:58'),
(189, '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 06:06:58'),
(190, '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 06:06:58'),
(191, '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 06:06:59'),
(192, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:07:04'),
(193, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:07:04'),
(194, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:11:05'),
(195, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:11:05'),
(196, '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 06:11:16'),
(197, '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 06:11:16'),
(198, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:11:32'),
(199, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:11:32'),
(200, '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,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 06:13:39'),
(201, '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 06:14:12'),
(202, '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 06:14:15');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(203, '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 06:14:18'),
(204, '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 06:14:22'),
(205, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:14:41'),
(206, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:14:41'),
(207, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:14:48'),
(208, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:14:48'),
(209, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:14:57'),
(210, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:14:57'),
(211, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:15:39'),
(212, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:15:39'),
(213, '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 06:17:06'),
(214, '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 06:17:08'),
(215, '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-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 06:17:14'),
(216, '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 06:17:15'),
(217, '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 06:17:16'),
(218, '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 06:17:16'),
(219, '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 06:17:17'),
(220, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:17:25'),
(221, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:17:25'),
(222, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:17:48'),
(223, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:17:48'),
(224, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:17:56'),
(225, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:17:56'),
(226, '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 06:18:28'),
(227, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:18:30'),
(228, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:18:30'),
(229, '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 06:18:37'),
(230, '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 06:18:42'),
(231, '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,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 06:18:46'),
(232, '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 06:19:13'),
(233, '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 06:19:15'),
(234, '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 06:19:17'),
(235, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-22\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-22\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-22\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-22\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 06:19:19'),
(236, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:19:22'),
(237, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:19:22'),
(238, '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 06:19:38'),
(239, '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 06:19:40'),
(240, '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 06:19:41'),
(241, '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-30\',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-30\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-30\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-30\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 06:19:43');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(242, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:21:52'),
(243, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:21:52'),
(244, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:23:37'),
(245, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:23:37'),
(246, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:23:54'),
(247, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:23:54'),
(248, '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 06:27:20'),
(249, '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 06:27:24'),
(250, '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 06:27:25'),
(251, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:27:27'),
(252, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:27:27'),
(253, '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 06:27:28'),
(254, '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 06:27:28'),
(255, '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 06:27:28'),
(256, '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 06:27:29'),
(257, '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 06:27:29'),
(258, '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 06:27:29'),
(259, '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 06:27:30'),
(260, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:29:29'),
(261, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:29:29'),
(262, '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 06:29:34'),
(263, '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 06:29:46'),
(264, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:29:58'),
(265, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:29:58'),
(266, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:31:08'),
(267, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:31:08'),
(268, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:32:14'),
(269, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:32:14'),
(270, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:32:28'),
(271, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:32:28'),
(272, '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 06:32:36'),
(273, '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 06:32:36'),
(274, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:32:40'),
(275, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:32:40'),
(276, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:32:41'),
(277, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:32:41'),
(278, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:32:42'),
(279, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:32:42'),
(280, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:32:45'),
(281, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:32:45'),
(282, '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 06:38:51'),
(283, '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 06:38:54'),
(284, '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 06:38:55'),
(285, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:39:29'),
(286, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:39:29'),
(287, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:40:27'),
(288, '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=1) as company_name,\r\n(select total_amount from flight_bookings where user_id=1 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=1 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=1 order by createdAt DESC limit 0,1', '2021-07-15 06:40:27'),
(289, '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 06:42:27'),
(290, 'main_checkFareandTaxesShared', 'SELECT * from share_inventories where share_by_user_id=3 and share_to_user_id=3 ', '2021-07-15 06:42:50'),
(291, 'website_return_getSearchData', 'SELECT * from share_inventories where share_by_user_id=3 and share_to_user_id=3 ', '2021-07-15 06:42:50'),
(292, '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 06:45:46'),
(293, '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 06:45:54'),
(294, '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 06:47:49'),
(295, '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 06:47:55');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(296, '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 06:49:37'),
(297, '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 06:49:42'),
(298, '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 06:50:17'),
(299, '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 06:50:26'),
(300, '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 06:58:33'),
(301, '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 06:59:19'),
(302, '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 07:01:14'),
(303, '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 07:01:59'),
(304, '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 07:03:03'),
(305, '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 07:03:09'),
(306, '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 07:04:09'),
(307, '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 07:07:22'),
(308, '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 07:07:28'),
(309, '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 07:07:57'),
(310, '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 07:08:01'),
(311, '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 07:11:41'),
(312, '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 07:23:09'),
(313, '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 07:23:14'),
(314, '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 07:27:03'),
(315, '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 07:27:14'),
(316, '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 07:27:21'),
(317, '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 07:35:42'),
(318, '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 07:48:33'),
(319, '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 09:53:39'),
(320, '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 09:53:50'),
(321, '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 09:53:51'),
(322, '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 09:53:53'),
(323, '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 09:53:53'),
(324, '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 09:53:53'),
(325, '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 09:53:53'),
(326, '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 09:53:54'),
(327, '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 09:53:54'),
(328, '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 09:53:54'),
(329, '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-15 09:54:01'),
(330, '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 09:54:04');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(331, '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 09:54:07'),
(332, '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 09:54:08'),
(333, '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-24\',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-24\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-24\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-24\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 09:54:18'),
(334, '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 09:54:19'),
(335, '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 09:54:20'),
(336, '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 09:54:20'),
(337, '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 09:54:21'),
(338, '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 09:55:49'),
(339, '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 09:55:52'),
(340, '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 09:56:17'),
(341, '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 09:57:36'),
(342, '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 09:58:27'),
(343, '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 09:58:34'),
(344, '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 09:58:35'),
(345, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 09:58:38'),
(346, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 09:58:38'),
(347, '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 09:58:38'),
(348, '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 09:58:38'),
(349, '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 09:58:38'),
(350, '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 09:58:38'),
(351, '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 09:58:39'),
(352, '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 10:06:45'),
(353, '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 10:06:45'),
(354, '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 10:06:45'),
(355, '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 10:06:45'),
(356, '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 10:06:46'),
(357, '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 10:15:30'),
(358, '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 10:15:34'),
(359, '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 10:15:35'),
(360, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 10:15:38'),
(361, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 10:15:38');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(362, '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 10:15:38'),
(363, '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 10:15:38'),
(364, '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 10:15:39'),
(365, '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 10:15:39'),
(366, '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 10:15:39'),
(367, '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 10:17:55'),
(368, '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 10:23:06'),
(369, '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 10:37:51'),
(370, '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 10:50:17'),
(371, '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 10:50:23'),
(372, '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 10:50:26'),
(373, '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 10:50:32'),
(374, '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 10:50:34'),
(375, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 10:50:37'),
(376, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 10:50:37'),
(377, '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 10:50:37'),
(378, '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 10:50:37'),
(379, '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 10:50:37'),
(380, '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 10:50:37'),
(381, '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 10:50:38'),
(382, '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 10:50:40'),
(383, '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 10:50:41'),
(384, '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 = 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-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-15 10:50:45'),
(385, '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 10:50:45'),
(386, '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 10:50:46'),
(387, '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 10:50:47'),
(388, '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 10:50:47'),
(389, '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 10:51:01'),
(390, '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 10:51:03'),
(391, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 10:51:07'),
(392, '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 10:51:08'),
(393, '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 10:51:09'),
(394, '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 10:51:09'),
(395, '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 10:51:10');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(396, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 10:51:16'),
(397, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-17\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-17\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-17\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-17\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-15 10:51:17'),
(398, '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 10:51:17'),
(399, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-17\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-17\'\r\nand FARETAX.date =\'2021-07-17\' group by FGT.id', '2021-07-15 10:51:18'),
(400, '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 10:51:18'),
(401, '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 10:51:18'),
(402, '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 10:51:19'),
(403, '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 10:51:19'),
(404, '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 10:51:19'),
(405, '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 10:51:19'),
(406, '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 10:51:20'),
(407, '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 10:51:42'),
(408, '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 10:51:50'),
(409, '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 10:51:53'),
(410, '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 10:51:55'),
(411, '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 10:51:59'),
(412, '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 10:51:59'),
(413, '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 10:51:59'),
(414, '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 10:51:59'),
(415, '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 10:51:59'),
(416, '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 10:51:59'),
(417, '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 10:52:00'),
(418, '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 10:52:03'),
(419, '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 10:52:13'),
(420, '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 10:52:15'),
(421, '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 10:52:16'),
(422, '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 10:52:18');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(423, '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 10:52:18'),
(424, '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 10:52:19'),
(425, '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 10:52:19'),
(426, '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 10:52:19'),
(427, '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 10:52:19'),
(428, '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 10:52:20'),
(429, '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 10:52:22'),
(430, '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:02:19'),
(431, '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:02:22'),
(432, '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:02:23'),
(433, '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-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-15 11:02:25'),
(434, '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-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-15 11:02:25'),
(435, '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:02:26'),
(436, '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:02:26'),
(437, '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:02:26'),
(438, '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:02:26'),
(439, '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:02:27'),
(440, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-28\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-28\'\r\nand FARETAX.date =\'2021-07-28\' group by FGT.id', '2021-07-15 11:02:27'),
(441, '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:02:48'),
(442, '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:02:48'),
(443, '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:02:48'),
(444, '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:02:48'),
(445, '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:02:49'),
(446, '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-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-15 11:02:51'),
(447, '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:02:52'),
(448, '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:02:53'),
(449, '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:02:53'),
(450, '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:02:54'),
(451, 'website_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = USER.id \r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=2\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,12) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-28\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-28\'\r\nand FARETAX.date =\'2021-07-28\' group by FGT.id', '2021-07-15 11:03:55');
