ParseError thrown

syntax error, unexpected 'endif' (T_ENDIF)