If statement ignoring conditions?

Please use code tags . Your code’s really hard to read.