This is the Ulu Cami or Great Mosque, dating back to 1272, with 40 wooden pillars supporting a flat ceiling.
In 2008 I took many pictures of a mosque of the same type. Though you will see similarities with the Afyon one, the other pictures are far better, so take a look at Eşrefoğlu Mosque in Beyşehir.