add sql to script
fix button ajax call
refactor login to use ajax partial