Adding database functions for admin panel