A former flight attendant conned his way onto hundreds of free flights by posing as a pilot, a court has heard.