Done with ShowActivity.

Now it writes reference numbers and times to db.