<div id="sub_menu"> 
<a href="<?php echo Yii::app()->createUrl('site/index'); ?>">Home&nbsp;&nbsp; </a>
<?php
if(@$_GET['user_group_id']!=null)
	echo '<img width="9" height="10" src="'.Yii::app()->baseUrl.'/images/front/1/submenu_13.jpg">&nbsp;&nbsp;&nbsp; <a href="#">'.UserGroup::model()->findByPK($_GET['user_group_id'])->group_name.'&nbsp;&nbsp;</a>';
if(@$_GET['id']!=null)
	echo '<img width="9" height="10" src="'.Yii::app()->baseUrl.'/images/front/1/submenu_13.jpg">&nbsp;&nbsp;&nbsp; <a href="'.Yii::app()->createUrl('site/productgroup',array(
	'user_group_id'=>$_GET['user_group_id'],
	'id'=>$_GET['id'],
	)).'"<img width="9" height="10" src="'.Yii::app()->baseUrl.'/images/front/1/submenu_13.jpg">&nbsp;&nbsp;&nbsp;'.ProductGroup::model()->findByPK($_GET['id'])->product_group_name.'&nbsp;&nbsp;</a>';
if(@$_GET['product_category_id']!=null)
	echo '<img width="9" height="10" src="'.Yii::app()->baseUrl.'/images/front/1/submenu_13.jpg">&nbsp;&nbsp;&nbsp; <a href="#">'.ProductCategory::model()->findByPK($_GET['product_category_id'])->category_name.'</a>';
	
?> 

</div>
<div id="content">
  <div id="business_solution_leftcontent">
        <?php $this->renderPartial('productgroup_left_menu',array('productCategories'=>$productCategories));  ?>
    	<?php $this->renderPartial('pages/leftcontent'); ?>
  </div>
  <div id="overview_rightcontent">
    <div id="business_solution_subheadding"> 
	<?php 
	if(count($model)==0):
		echo "No products available";
	else:
	if(isset($_GET['name']))
	{
		if(isset($_GET['product_category_id']))
		echo ucfirst(ProductCategory::model()->findByPK($_GET['product_category_id'])->category_name);
		else if(isset($_GET['user_group_id']))
		echo ucfirst(UserGroup::model()->findByPK($_GET['user_group_id'])->group_name);
	}
	else
		echo ucfirst(
		
		($ProductGroup!=null)?$ProductGroup->product_group_name:(
		($type!="New")?(($type=='isIntoPromotion')?'Promotional Items':'Featured Items'):'All Products'
		
		)); ?> 
    </div>
    <div id="product_promotion_box">
    <?php foreach($model as $eachModel): ?>
    <?php
				if (!file_exists('media/product_images/thumbs/220_137'.$eachModel->product_image)) 
				{
					$thumb=Yii::app()->phpThumb->create('media/product_images/'.$eachModel->product_image);
					$thumb->resize(200,130);
					$thumb->save('media/product_images/thumbs/220_137'.$eachModel->product_image);
				}
	?>
      <div class="product_promotions">
        <div class="product_promotion_imgbox"> 
            <a href="<?php echo Yii::app()->createUrl('site/productdetails',array('id'=>$eachModel->id,'name'=>
            preg_replace('/[^a-z0-9_]/','',strtolower( str_replace(" ", "_", $eachModel->product_name))))); ?>"> 
            <img src="<?php echo Yii::app()->baseUrl; ?>/media/product_images/thumbs/220_137<?php echo $eachModel->product_image; ?>" alt="<?php echo $eachModel->product_name; ?>" /> 
            </a> 
        </div>
        <div class="product_promotion_descriptions"> 
        <span style="font-size:14px; color:#333; font-weight:bold;"><a href="<?php echo Yii::app()->createUrl('site/productdetails',array('id'=>$eachModel->id,'name'=>
            preg_replace('/[^a-z0-9_]/','',strtolower( str_replace(" ", "_", $eachModel->product_name))))); ?>"><?php echo $eachModel->product_generic_name; ?></a></span>
  <br />
  <?php echo $eachModel->product_name; ?>
         
        </div>
        <?php if($type=='isIntoPromotion'): ?>
 		<div class="product_redeempoint_star">
            <div class="product_redeempoints_box">
			<?php echo $eachModel->rewardPoints.'<br />points'; ?> 
            </div>
         </div>
         <?php endif; ?>

      </div>
     <?php endforeach; endif;
	 ?>
    </div>
  </div>
</div>