 <?php

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

<section class="acounts">
    <section class="acounts-section1">
        <div class="container">
            <div class="row">
                <div class="col-sm-offset-1 col-sm-10 col-xs-offset-0 col-xs-12">
                   
                </div>
            </div> 
			 <?php
             $articleId=0;
              //echo $artSlag;
                //$Categories=Category::model()->findByAttributes(array('slug'=>'acounts'));
				$articles=Category::model()->getArticleByCategory('acounts');
                if($articles!=null)
				{
					$images_div="";
					$title_div="";
					$text_div="";
					foreach($articles as $article)
					{
                        if($type!="" && $type==$article->slug)
                            $articleId=$article->id;
                       // $articleid=Article::model()->findByAttributes(array('slug'=>$artSlag));
                    //    if(!empty($article->image)){
						$images_div.=' <div class="tabcontent" id="pin'.$article->id.'">
                   <img   class="img-responsive myImg" src="'.Yii::app()->request->baseUrl.'/uploads/Article/'.$article->image.'">
               </div>';
            //    }else{
            //        echo $images_div.=($lang=='ar'?$article->title:$article->en_title);
            //    }
            //    foreach($Categories->articles as $article)
			// 		{
					$title_div.='<div class="button-menu">
                    
                 <button class="tabLink" href="#" onclick="openTap(event,\'pin'.$article->id.'\')">'.($lang=='ar'?$article->title:$article->en_title).'</button>   
               </div>';
                //}
					$text_div.=' <div class="tabcontent" id="pin'.$article->id.'-text">
                           '.($lang=='ar'?$article->content:$article->en_content).'
                        </div>';
                        
					 }
				}?>
              <div class="row">
              <div class="flex-content">
               <div class="col-sm-offset-1 col-sm-7 col-xs-offset-0 col-xs-12 card1">
			   <div class="row">
			    <?php echo $images_div;?>
			   </div>
              </div> 
               <div class="col-sm-3 pins-link hidden-xs">

             <div class="service-container">
               <div class="service-container-content">
                     <?php echo $title_div;?>
               </div> 
               </div>
              </div>
               </div>
                </div>
                <div class="row">
                    <div class="col-sm-offset-1 col-xs-offset-0 col-sm-10 col-xs-12 card2">
						 <?php echo $text_div;?>
					</div>
                </div>
            </div> 
    </section>
</section>
<script  type="application/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/site/scriptAccounts?articleId=<?= $articleId ?>"></script>