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

<section class="annualrReports">
    <section class="annual-reports-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>
            <div class="row">
               <div class="col-sm-offset-1 col-sm-10 col-xs-offset-0 col-xs-12 card-container">
               <?php
                   //categories=Category::model()->getArticleByCategory('financial-statements' )
				   //findByAttributes(array('slug'=>'annual-reports'))
                    $categories=Category::model()->getArticleByCategory('annual-reports' );
                    if($categories!=null)
                    {
                        
                        foreach($categories as $report)
                        {
                ?>
                            <div class="  col-sm-4 col-xs-6 card"> 
                                <div  class="card-item" >
                                    <div class="col-xs-7 img-container">
                                        <div class="row">
                                        <?php
                                            echo '<img class="img-responsive img-report" src="'.Yii::app()->request->baseUrl.'/uploads/Article/'.$report->image.'" alt="report-2016">';
                                        ?>
                                    </div> 
                            </div>
                            <div class="col-xs-5 icon-container">
                                <div class="row row-icon ">
                                    <div class="col-xs-6">
                                        <div class="row">
                                        <?php  
                                            echo '
                                                <a href="'.Yii::app()->request->baseUrl.'/uploads/Article/files/'.$report->attachment_title.'" target="_blank">
                                                    <img class="img-responsive icon-view center-block" src="'.Yii::app()->request->baseUrl.'/images/view-icon.png" alt="view-icon"> 
                                                    <span class="icon-name center-block text-center">'.($lang=='ar'?'استعراض':'View').' </span>
                                                    </a>';
                                        ?>
                                    </div>
                                    </div>
                                    <div class="col-xs-6">
                                    <div class="row">
                                    <?php 
                                    echo '
                                        <a href="'.Yii::app()->request->baseUrl.'/uploads/Article/files/'.$report->attachment_title.'" download>
                                        ';?>
                                            <img class="img-responsive icon-download center-block" src="<?php echo Yii::app()->request->baseUrl?>/images/download-icon.png" alt="download-icon"> 
                                            <span class="icon-name center-block text-center">
                                            <?php //echo Yii::t('annualReports','download');?>
                                            <?php echo ($lang=='ar'?'تنزيل':'Download') ?>
                                            
                                            </span>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        </div>
                        <div class="col-xs-offset-2 col-xs-10 report-title">
                            <div class="report-title-text">

                            <?php echo ($lang=='ar'?$report->title:$report->en_title)?>

                            </div>
                            </div> 
                            <!--flash file-->
                            <?php if(!empty($report->flash_file)){ ?>
                            <div class="col-xs-offset-2 col-xs-10 flash-file">
                            <div class="report-flash-text">
                            <?php 
                                echo '<a href="'.Yii::app()->request->baseUrl.'/uploads/Article/files/'.$report->flash_file.'" target="_blank">'
                                .($lang=='ar'?'أضغط هنا لتصفح التقرير التفاعلي':'View interactive report').'</a>';
                                ?>
                            </div>
                            </div> 
                            <?php }else{ ?>
                                  <div class="col-xs-offset-2 col-xs-10 empty-flash-file">
                                    <div class="empty-report-flash-text">
                           
                                    </div>
                                    </div>
                            <?php } ?>
                            <!--End flash file-->
                    </div>
                <?php      }}  ?>
                    
                    
                        </div>
                    
                    </div>
                </div>
            </section>
        </section>
