get magento customer group id and magento group name from admin side
You need to load the customer model by the customer id, e.g.:
$customer = Mage::getModel('customer/customer')->load($customerId);
Then based on the customer model you can get the group id with $customer->getGroupId()
Mage::helper('customer')->getGroups()
returns a list of groups excluding non-logged in one, based on it you can determine customer_group_code
which will be the customer assigned group name