First, "if" is not a loop - it tests a condition and branches.
Regarding your question, you may want to have a look at the variables. You do not set temp_mth (btw, do you have a reason for abbreviating the variable name?) but you compare with it. Thus, the evaluation will be false (if it doesn't even throw a syntax error due to the unset variable) and the execution goes to the "else" branch. Also, you are missing an "fi", so that the script would throw another syntax error there.