Translation:Good night, Teacher Zhang!
Typically you use "晚上好(wǎnshànghǎo)" to mean "Good evening." and use "晚安" when ending a conversation or when going to bed.
I know some speakers in Taiwan use "晚安" as greeting, and I am not sure if this is the case in mainland China.
晚安 has the meaning of good night as well as good evening, so it works as well
Sounds like someone's having an inappropriate relationship with his/her teacher. :p
Well... sometimes college students or even high school might have to stay at school at night, so they might say goodnight to their teachers. My Dad and Mom used to stay at their college classes at night.
also, in America we don't go to our teacher and say teacher zhang, no we call the teacher mr.zhang
Wouldn't the context make it evening or night? It seems elsewhere 晚 can be used for both evening and night.