<link href="<?php echo Yii::app()->baseUrl; ?>/css/bootstrap.css" rel="stylesheet">
<div class="main_content">
<div class="innercontent_outerbox">
  <h1><?php echo $title; ?></h1>
  <br />
  <table width="885" border="0" align="center" cellpadding="5" cellspacing="5">
    <tr>
      <td><h3>Search by Product model</h3></td>
    </tr>
    <tr>
      <td><?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'resource-form',
	'enableAjaxValidation'=>false,
	'htmlOptions' => array(
        'enctype' => 'multipart/form-data',
    ),
)); ?>
          <table width="100%" border="0" cellspacing="5" cellpadding="5">
            <tr>
              <td><input type="text" name="Product_name" class="input-xlarge" /></td>
              
              <td><input type="submit" value="Search" name="btValide" class="submit_button" /></td>
            </tr>
          </table>
        <?php $this->endWidget(); ?></td>
    </tr>
  </table>
  <br />
  <br />
  <table width="885" border="1" align="center" cellpadding="5" cellspacing="5" bordercolor="#999999">
  <?php
 
	if($modelProductDownloadables==null):
	?>
	<tr>
	  <td colspan="3">No results found</td>
	</tr>
	<?php
	endif;
	$bgcolor="";
	foreach($modelProductDownloadables as $eachProduct):
	$bgcolor	=	($bgcolor=="#CCCCCC")?"":"#CCCCCC";
	?>
    <tr>
      <td width="277" align="left" valign="middle" bgcolor="<?php echo $bgcolor; ?>" ><?php echo $eachProduct->product->product_name; ?></td>
      <td width="408" align="left" valign="middle" bgcolor="<?php echo $bgcolor; ?>"><?php echo $eachProduct->item_value; ?></td>
      <td width="142" align="left" valign="middle" bgcolor="<?php echo $bgcolor; ?>">
      <?php
							  /*echo CHtml::link(CHtml::image(Yii::app()->baseUrl."/images/download.png","",array("width"=>"25","height"=>"25")).round(@filesize(Yii::app()->basePath."/../media/product_item_downloadables/".$eachProduct->files_available)/1000000,2)." MB",Yii::app()->request->getBaseUrl(true).'/media/product_item_downloadables/'.$eachProduct->files_available,array('target'=>'_balnk'));*/
				if(round(@filesize(Yii::app()->basePath."/../media/product_item_downloadables/".$eachProduct->files_available)/1000000,2)==0)
                                      {
                                       echo CHtml::link(CHtml::image(Yii::app()->baseUrl."/images/download.png","",array("width"=>"25","height"=>"25")).round(@filesize(Yii::app()->basePath."/../../site/upload/downloadable/".$eachProduct->files_available)/1000000,2)." MB",Yii::app()->request->getBaseUrl(true).'/../site/upload/downloadable/'.$eachProduct->files_available,array('target'=>'_balnk'));
                                     
                                      }
                                      else {
                                      
                                       echo CHtml::link(CHtml::image(Yii::app()->baseUrl."/images/download.png","",array("width"=>"25","height"=>"25")).round(@filesize(Yii::app()->basePath."/../media/product_item_downloadables/".$eachProduct->files_available)/1000000,2)." MB",Yii::app()->request->getBaseUrl(true).'/media/product_item_downloadables/'.$eachProduct->files_available,array('target'=>'_balnk'));
                                      }
							  
							 
							  ?>
      
      </td>
    </tr>
    <?php endforeach; ?>
  </table>
  <br/>
  <?php 
        // the pagination widget with some options to mess
    $this->widget('CLinkPager', array(
            'currentPage'=>$pages->getCurrentPage(),
            'itemCount'=>$item_count,
            'pageSize'=>$page_size,
            'maxButtonCount'=>5,
            //'nextPageLabel'=>'My text >',
            'header'=>'',
        'htmlOptions'=>array('class'=>'pagination classC page-C-01'),
        ));
        ?>
</div>
<?php echo $this->renderPartial('_bottom_common_user_product_group'); ?> 