You have written everything in one function ( main probably) but it is better split into its components. Essentially what you want to do is:
確定! 回上一頁