<div class="main_content">
<div class="innercontent_outerbox">
  <h1>Promotions</h1>
  <!--Featured Items List -->
  <div class="featured_items_boxouter">
    <ul class="promotion">
    <?php
    if(count($model)==0)
		echo "No Promotional products available";
	?>
    <?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);
				}
	?>
      <li >
        <div class="points">
          <div class="rewardspoints"> <?php echo $eachModel->rewardPoints; ?> </div>
        </div>
        <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))))); ?>" class="thumb"><span><img src="<?php echo Yii::app()->baseUrl; ?>/media/product_images/thumbs/220_137<?php echo $eachModel->product_image; ?>" alt="<?php echo $eachModel->product_name; ?>" /></span></a>
        <div class="name_box">
          <h2><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></h2>
          <?php echo $eachModel->product_name; ?></div>
      </li>
      <?php endforeach; ?>
     
    </ul>
  </div>
</div>
<?php echo $this->renderPartial('_bottom_common_user_product_group'); ?>