Add shopaccess.php and move all db code to it