<div id="sub_menu"> 
<a href="<?php echo Yii::app()->createUrl('site/index'); ?>"> Home</a>
&nbsp;&nbsp;<img src="<?php echo Yii::app()->baseUrl; ?>/images/front/1/submenu_13.jpg" width="9" height="10" />&nbsp;&nbsp;&nbsp;Resources</div>
<div id="content">
  <div id="business_solution_leftcontent">
    <?php $this->renderPartial('productgroup_left_menu');  ?>
    <?php $this->renderPartial('pages/leftcontent'); ?>
  </div>
  <div id="overview_rightcontent">
    <div id="business_solution_subheadding"> <?php echo $title; ?> </div>
    <div id="partnerlevel_slider">
      <?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'resource-form',
	'enableAjaxValidation'=>false,
	'htmlOptions' => array(
        'enctype' => 'multipart/form-data',
    ),
)); ?>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="47"><table width="97%" border="0" cellpadding="0" cellspacing="0">
              <tr> <span style="font-size:14px;">
                <td width="26%" align="left" valign="middle">Search by product model :</td>
                </span>
                <td width="23%" align="left" valign="middle"><?php echo $form->dropDownList($model,'user_group_id',UserGroup::getGroups(),
											 array(
												'style'=>'width:150px',
												'prompt'=>'Select user group',
												'ajax' => array(
												'type'=>'POST',
												'url'=>CController::createUrl('site/updateProductGroup'), 
												//'update'=>'#Product_product_group_id',
												'data'=>array('user_group_id'=>'js:this.value'), 
												'success'=>'js:function(data){
													$("#Product_product_group_id").html(data)
													$("#Product_product_category_id").html("<option value=\"\">Select category</option>")
													$("#Product_product_id").html("<option value=\"\">Select product</option>")
													}'
            ))); ?> &nbsp; </td>
                <td width="23%" align="left" valign="middle"><?php echo $form->dropDownList($model,'product_group_id',ProductGroup::getProductGroup($model->user_group_id),array(
												'style'=>'width:150px',
												'prompt'=>'Select group',
												'ajax' => array(
												'type'=>'POST',
												'url'=>CController::createUrl('site/updateProductCategory'), 
												'data'=>array(
															  'user_group_id'=>'js:$("#Product_user_group_id :selected").val()',  
															  'product_group_id'=>'js:this.value'
															  ),  
												'success'=>'js:function(data){
													$("#Product_product_category_id").html(data)
													$("#Product_product_id").html("<option value=\"\">Select product</option>")
													}'
																		  ))); ?> &nbsp; </td>
                <td width="17%" align="left" valign="middle"><?php  echo $form->dropDownList($model,'product_category_id',ProductCategory::getProductCategory($model->user_group_id,$model->product_group_id),array(
												'style'=>'width:150px',
												'prompt'=>'Select category',
												'ajax' => array(
												'type'=>'POST',
												'url'=>CController::createUrl('site/updateProduct'), 
												'update'=>'#Product_product_id',
												'data'=>array(
															  'user_group_id'=>'js:$("#Product_user_group_id :selected").val()',  
															  'product_group_id'=>'js:$("#Product_product_group_id :selected").val()',  
															  'product_category_id'=>'js:this.value'
															  ),  
																		  ))); ?></td>
                <td width="11%" align="left" valign="top"><input type="submit" name="button" id="button" value="Go" /></td>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td height="60"><div style="border:1px #999 solid;">
          <style type="text/css">
.bst_table{
	font-family:arial;
	font-size:12px;
	color:#666;
} 
	.bst_table a{color:#666; text-decoration:none}
	.bst_table a:hover{color:#666; text-decoration:underline}


</style>
              <table width="745" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#999999" class="bst_table">
<?php
				if($modelProductDownloadables==null):
				?>
                <tr>
                  <td colspan="3">No results found</td>
                </tr>
                <?php
				endif;
				foreach($modelProductDownloadables as $eachProduct):
				?>
  <tr>
    <td width="172" bgcolor="#d9e6ef"><?php echo $eachProduct->product->product_name; ?></td>
    <td width="278" bgcolor="#d9e6ef"><?php echo $eachProduct->item_value; ?></td>
    <td width="257" bgcolor="#d9e6ef">&nbsp;<?php
							  echo CHtml::link(CHtml::image(Yii::app()->baseUrl."/images/front/1/downloadflash_03_03.png","",array("width"=>"20","height"=>"19")).round(@filesize(Yii::app()->basePath."/../media/product_item_downloadables/".$eachProduct->files_available)/1000,2)." KB",Yii::app()->request->getBaseUrl(true).'/media/product_item_downloadables/'.$eachProduct->files_available,array('target'=>'_balnk'));
							  ?></td>
  </tr>
  <?php
				  endforeach;
				  ?>
</table>
            </div></td>
        </tr>
      </table>
      <?php $this->endWidget(); ?>
    </div>
  </div>
</div>