Error 500

Undefined variable $max