that's a big script for a small amount of problems. I'm sorry, but I don't have time to wade through it.
some issues
unless $user is a number you need to have quotes around it in the sql.
You shouldn't have maths in the sql that doesn't need to be there. Try the following
$moveAmt = $myaura-$amt;
$sql="UPDATE users SET aura = $moveAmt WHERE userid = '$user'";
however I didn't have time to go through it thoroughly so you need to debug and find the code that isn't working and post that.