
  <!--content -->
  <?php $this->renderPartial('_top_banner'); ?>
  <div class="main_content">
  
    <div class="case-study">
    
     <h1> Case Studies </h1>
     
     <!--category-list-->
     <div class="category-list">
      <span class="filter-list">Product Category: </span>
      
      <div class="product-category">
       <?php   //echo CHtml::dropDownList('user_group_id','',UserGroup::userGroupFrontEnd(), array('prompt'=>'Select product category'));
               
               echo CHtml::dropDownList('user_group_id', '', UserGroup::userGroupFrontEnd(), array('prompt' => 'Select product category',
            'ajax' => array(
                'type' => 'POST',
                'dataType' => 'json',
                'url' => CController::createUrl('site/Casestudy'),
                'success' => 'function(data){         
                             if(data.status=="success2"){
                     
                      $(".case-study_content").hide(); 
                      // $(".reports_from_action").reset(); 
                        //$(".reports_from_action").show(); 
                   
                      
                                              $("#filter").html(data.info)
                                               
                       } }',
                 'data' => array('usergroup' => 'js:this.value'),
                ), ));
       ?>
          
          
      </div>
      
      <div class="product-category">
       <?php  echo CHtml::dropDownList('region_id','',Country::getCountry(),array('prompt'=>'Selecet country',
           'ajax' => array(
                'type' => 'POST',
                'dataType' => 'json',
                'url' => CController::createUrl('site/Casestudy'),
                'success' => 'function(data){         
                             if(data.status=="success2"){
                     
                      $(".case-study_content").hide(); 
                      // $(".reports_from_action").reset(); 
                        //$(".reports_from_action").show(); 
                   
                      
                                              $("#filter").html(data.info)
                                               
                       } }',
                 'data' => array('region' => 'js:this.value'),
                ), ));
       ?>
      </div>
      
      
      <div class="product-category">
       <?php for($i=date('Y');$i>=1990;$i--) $years[$i]=$i; ?>
        <?php echo CHtml::dropDownList('year','',$years,array(
		//'class'=>'selectyze2',
		'prompt'=>'Select year','ajax' => array(
                'type' => 'POST',
                'dataType' => 'json',
                'url' => CController::createUrl('site/Casestudy'),
                'success' => 'function(data){         
                             if(data.status=="success2"){
                     
                      $(".case-study_content").hide(); 
                      // $(".reports_from_action").reset(); 
                        //$(".reports_from_action").show(); 
                   
                      
                                              $("#filter").html(data.info)
                                               
                       } }',
                 'data' => array('year' => 'js:this.value'),
                ), ));
       ?>
      </div>
      
      <div class="product-category">
       <?php echo CHtml::dropDownList('industry_id','',Industry::getIndustry(),array('prompt'=>'Select industry',
           'ajax' => array(
                'type' => 'POST',
                'dataType' => 'json',
                'url' => CController::createUrl('site/Casestudy'),
                'success' => 'function(data){         
                             if(data.status=="success2"){
                     
                      $(".case-study_content").hide(); 
                      // $(".reports_from_action").reset(); 
                        //$(".reports_from_action").show(); 
                   
                      
                                              $("#filter").html(data.info)
                                               
                       } }',
                 'data' => array('industry' => 'js:this.value'),
                ), ));
       ?>
      </div>
      
      <span><a href="/partner/index.php/site/casestudy" class="filter-view-all">View all</a></span>
     </div><!--category-listend-->
     
     
     <div id="filter"></div>
     <!--case-study_content-->
     
     <div class="case-study_content"> 
     
     <!--filter-wrapper1 start-->
     
     <?php  echo ($caseStudies==null)?'No Results found':''; ?>
   <?php foreach($caseStudies as $eachModel): ?>
      <div class="filter-wrapper">
       <div class="img-outer">
        <img src="<?php echo Yii::app()->request->baseUrl.'/media/casestudy/thumb/'.$eachModel->image ?>"  alt="No Image""/>
       </div>
       <div class="title-outer">
        <h2><?php echo $eachModel->image_title; ?></h2>
        <span class="entryDate"><?php echo date('M d, Y', strtotime($eachModel->date_added)); ?></span>
       </div>
       <div class="content-outer">
           <h4><?php echo $eachModel->title_of_the_paper; ?></h4>
      <?php echo substr(strip_tags($eachModel->content),0,80); ?>
           <br><a class="case-download" href="<?php echo Yii::app()->request->getBaseUrl(true).'/media/paper/'.$eachModel->filename; ?>" target="_blank">Download pdf</a></br>
     
       </div>
      </div> 
       <!--filter-wrapper1 ends-->
        <?php endforeach; ?> 
     
       <?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 class="pagination">
                         <?php
                        $this->widget('CLinkPager', array(
                            'pages' => $pages,
                            'maxButtonCount'=>5,
                            'header' =>"",
                            'htmlOptions'=>array('class'=>'pagination classC page-C-01'),
                        ))
                        ?>
                    </div>
     </div>
     
     
    
     <!--case-study_content-->
     
    </div>	
    
    