<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 $resourceTypeName; ?> </div>
    <div id="partnerlevel_slider"> D-Link is pleased to offer a range of revenue-driving and margin-enhancing promotions.
      These special promotions are generally offered on a quarterly basis across our core
      networking products or around special channel sales initiatives. </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="100%" border="0" cellpadding="10" cellspacing="0">
              <tr> <span style="font-size:14px;">
                <td width="42%" align="left" valign="middle">Search by product model :</td>
                </span>
                <td width="16%" 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){
													$("#Resource_product_group_id").html(data)
													$("#Resource_product_category_id").html("<option value=\"\">Select category</option>")
													$("#Resource_product_id").html("<option value=\"\">Select product</option>")
													}'
            ))); ?> </td>
                <td width="16%" 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:$("#Resource_user_group_id :selected").val()',  
															  'product_group_id'=>'js:this.value'
															  ),  
												'success'=>'js:function(data){
													$("#Resource_product_category_id").html(data)
													$("#Resource_product_id").html("<option value=\"\">Select product</option>")
													}'
																		  ))); ?>  </td>
                <td width="15%" 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'=>'#Resource_product_id',
												'data'=>array(
															  'user_group_id'=>'js:$("#Resource_user_group_id :selected").val()',  
															  'product_group_id'=>'js:$("#Resource_product_group_id :selected").val()',  
															  'product_category_id'=>'js:this.value'
															  ),  
																		  ))); ?></td>
                <td width="11%" align="right" 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="100%" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#999999" class="bst_table">
                <?php
				if($resource==null && $productResource==null):
				?>
                <tr>
                  <td>No results found</td>
                </tr>
                <?php
				endif;
				foreach($resource as $eachResource):
				?>
                <tr>
                  <td width="22%" align="left" valign="top" bgcolor="#d9e6ef" ><p><?php echo $eachResource->resource_title; ?></p></td>
                  <td width="47%" align="left" valign="top" bgcolor="#d9e6ef" ><?php echo $eachResource->description; ?></td>
                  <td width="14%" align="left" valign="top" bgcolor="#d9e6ef" ><p><?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/resources/".$eachResource->source_file)/1000,2)." KB",Yii::app()->request->getBaseUrl(true).'/media/resources/'.$eachResource->source_file,array('target'=>'_balnk'));
							  ?></p></td>
                </tr>
                <?php
				  endforeach;
				  ?>
                <?php
				foreach($productResource as $eachResource):
				?>
                <tr>
                  <td align="left" valign="top"  ><?php echo $eachResource->resource_title; ?></td>
                  <td align="left" valign="top" ><?php echo $eachResource->description; ?></td>
                  <td align="left" valign="top" ><?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/resources/".$eachResource->source_file)/1000,2)." KB",Yii::app()->request->getBaseUrl(true).'/media/resources/'.$eachResource->source_file,array('target'=>'_balnk'));
							  ?>
                </tr>
                <?php
				  endforeach;
				  ?>
              </table>
            </div></td>
        </tr>
      </table>
      <?php $this->endWidget(); ?>
    </div>
  </div>
</div>