The error is related to the absence of the method “transfer” in the “admin” address.
Simply declare “admin” as “address payable”:
address payable admin;
Starting from compiler version 0.5.0, “address payable” type only has the method cited.
From Solidity documentation: