How to add DATETIME value for session user
I see two problems with

$query = "INSERT INTO log (user, timein) VALUES ($user , NOW())";


Problem #1 : You need quotes around $user

Problem #2 : You need use timein instead of NOW()

Now, you need to make a decision.

If you want to supply the time yourself, then the query should be 

$query = "INSERT INTO log (user, timein) VALUES ('$user','$tin')";


If you want the DB Server's clock time, then the query should be 

$query = "INSERT INTO log (user, timein) VALUES ('$user',NOW())";


thus eliminating the need for $tin= $_POST["timein"];