Use the following code to get the type of a Magento product:
// configurable, simple, ...
$type = $product->getTypeId();
Getting the type of a product
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.