According to the Quran, Allah is all-knowing. But does it mean that He knows all the future as well? Does it mean than when He created everything He did so while already knowing everything that would have happened?
Yes, one of Allah's names is
Al Alim (العليم) The All Knowing, the Omniscient
Allah knows everything, everything that happened, happening, or will happen is already written in a book :
And the record [of deeds] will be placed [open], and you will see the criminals fearful of that within it, and they will say, "Oh, woe to us! What is this book that leaves nothing small or great except that it has enumerated it?" And they will find what they did present [before them]. And your Lord does injustice to no one.
You can read more about the question here : Does God know about future & what is the proof of it in Qur'an?