<?php

 Yii::app()->setLanguage(isset(Yii::app()->session['lang']) ? Yii::app()->session['lang'] : 'ar'); 
 $lang=Yii::app()->getLanguage();
 

?>


<section class="section3 ltr-direction" class="pt20"> 
      <div class="container hidden-xs"> 
        <div class="row"> 
              
       </div> 
       <div class="owl-carousel">
	 <?php
		//get all article under barak-news
       
		$slug="albarakeh-bank-news";
		$category=Category::model()->findByAttributes(array('slug' => $slug ));
        $articles=Category::model()->getArticleByCategory_limit($slug);
        if($articles!=null)
		{
		//$articles=$category->articles;
		
		foreach($articles as $article){
	 ?>  
		 <div>
                     <div class="card">
						 <img src="<?php echo ($article->image!=null?(Yii::app()->request->baseUrl."/uploads/Article/".$article->image):(Yii::app()->request->baseUrl."/images/image_not_found.png"));?>" 
                         class="slider-img full-width" alt="<?php echo 'slider-img'.$article->id; ?>">
						 <div class="layer head-line">
						 <div class="text">
							<?php echo ($lang=='en'?$article->en_title:$article->title);?>
							 
							<button class="center-block btn read-more-btn" onclick="window.location.href='<?php echo Yii::app()->request->baseUrl.'/article/view/slug/'.$article->slug ?>'">
                            <?php //echo Yii::t('albarakaNews','readMore');?>
      <?php
                        if($lang=='ar')
                        { echo'
                         اقرأ المزيد
                        ';
                        }else{
                            echo'Read more';
                        }
                        ?>                            
                            </button> </div>
                         </div>	</div> 
			  </div> 
		<?php }?> 
     </div>
     <div class="row">
         <button class="btn btn-more-news center-block"  onclick="window.location.href='<?php echo Yii::app()->request->baseUrl.'/article/category/slug/'.$category->slug ?>'">
         <?php //echo Yii::t('albarakaNews','moreNews');?>
             <?php
                        if($lang=='ar')
                        { echo'
                                المزيد من الأخبار                            
                         ';
                        }else{
                            echo'More News';
                        }
                        ?> 
         
         </button>
     </div>
     </div>
     <div class="container hidden-md hidden-lg hidden-sm">
                <div class="row">
                    <div class="col-xs-12">
                        <img src="<?php echo ($article->image!=null?(Yii::app()->request->baseUrl."/uploads/Article/".$article->image):(Yii::app()->request->baseUrl."/images/image_not_found.png"));?>" 
                        class="slider-img center-block img-responsive" alt="<?php echo 'slider-img'.$article->id; ?>">
                    </div>
                    <div class="col-xs-12 text-center">
                        <div class="head-line">
                            <?php echo ($lang=='en'?$article->en_title:$article->title);?>                      
                        </div>
                    </div>
                    <div class="col-xs-12">
                        <button class="read-more center-bock" onclick="window.location.href='<?php echo Yii::app()->request->baseUrl.'/article/view/slug/'.$article->slug ?>'">
                        <?php //echo Yii::t('albarakaNews','readMore');?>
                        <?php
                        echo ($lang=='en'?'Read more':'اقرأ المزيد');
                      
                        ?>
                        </button>
                        <button class="more-news center-bock"  onclick="window.location.href='<?php echo Yii::app()->request->baseUrl.'/article/category/slug/'.$category->slug ?>'">
                        <?php //echo Yii::t('albarakaNews','moreNews');?>
                        <?php
                        echo ($lang=='en'?'More News':'المزيد من الأخبار');
                        ?>                      
                       
                        </button>
                    </div>
        <?php }?>
                </div>
            </div> 
 </section>