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

<section class="directors">
    <section class="directors-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">
                <div class="row flex-container">
                <?php 
                $persons=Person::model()->findAllByAttributes(array('type'=>'2')); 
                foreach($persons as $person){ 
                ?> 
                  <div class="img-col-2 col-xs-6">
                    <a href="#" data-toggle="modal" data-target="#myModal<?php echo $person->id ?>"> 
                   <div class="img-container-block">
                   <?php
                   echo '<img class="img-responsive personal-img center-block" src="'.Yii::app()->request->baseUrl."/uploads/Person/".$person->image.'" alt="'.$person->name_ar.'">';
                        ?>
                        </div>
                        <div class="full-name text-center"><?php echo ($lang=='en'?$person->name_en:$person->name_ar) ?></div>
                        <div class="position-name text-center"><?php echo ($lang=='en'?$person->job_title_en:$person->job_title_ar) ?></div>
                      </a>
                       <!-- Modal -->
                  <div class="modal fade" id="myModal<?php echo $person->id ?>" role="dialog">
                    <div class="modal-dialog">

                      <!-- Modal content-->
                      <div class="modal-content">
                        <div class="modal-header">
                          <button type="button" class="close" data-dismiss="modal">&times;      </button>
                          <h4 class="modal-title"><?php echo ($lang=='en'?$person->name_en:$person->name_ar) ?></h4>
                        </div>
                        <div class="modal-body row">
                         <div class="col-sm-4 col-xs-12">
                             <?php
                   echo '<img class="img-responsive personal-img center-block" src="'.Yii::app()->request->baseUrl."/uploads/Person/".$person->image.'" alt="'.$person->name_ar.'">';
                        ?>
                         </div>
                         <div class="col-sm-8 col-xs-12">
                            <p><?php echo ($lang=='en'?$person->job_title_en:$person->job_title_ar) ?> </p> 
                            <p></p>
                         </div> 
                        </div>
                        <div class="modal-footer">
                          <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo ($lang=='en'?'Close':'إغلاق') ?></button>
                        </div>
                      </div> 
                    </div>
                  </div>
                    </div>
                 <?php }?>  
                </div>
                   </div>
            </div>
        </div>
    </section>
</section>
