I'm not sure how it is supposed to know to call the done function... Is this just regular javascript trying to use AJAX? I'm pretty sure your php page is good now. It is now a matter of debugging your app code.
Keep the echo statement outside of any IF statements and you will know the issue isn't with what form elements or values are being posted it is simply getting the result from the page.