<?php
/**
 * YAWIK
 *
 * @filesource
 * @copyright https://yawik.org/COPYRIGHT.php
 * @license   MIT
 */
/**
 * render a facebook profile
 */
 ?>
<div class="panel panel-default">
<div class="panel-heading"><?php echo $this->translate('personal information'); ?></div>
<div class="panel-body">
<div class="pull-left">
<img class="yk-portrait" src="https://graph.facebook.com/<?php echo $this->id?>/picture?type=normal"/>
</div>
<div>
<b><?php echo $this->name;?></b>
<br/><?php echo $this->location['name'];?>
<br/><?php echo $this->translate("Birthday");?>: <?php echo !is_null($this->birthday) ? $this->DateFormat($this->birthday,'short','null'):"";?>
<br/><i class="yk-icon yk-icon-envelope"></i> <?php echo $this->link($this->email); ?>
<br/><i class="yk-icon yk-icon-facebook"></i> <?php echo $this->link($this->link,'Facebook'); ?>
</div>
</div>
</div>

<?php if(isset($this->education)):?>
<div class="panel panel-default">
<div class="panel-heading"><?php echo $this->translate("education")?></div>
<table class="table table-bordered table-condensed">
<tr>
<th style="width:10%"><?php echo $this->translate("Date")?></th>
<th style="width:50%"><?php echo $this->translate("School or university")?></th>
<th style="width:40%"><?php echo $this->translate("Type")?></th>
</tr>
<?php foreach($this->education as $edu):?>
<tr>
 <td><?php echo isset($edu['year']['name'])?$edu['year']['name']:'';?></td>
 <td>
   <?php echo isset($edu['school']['name'])?$edu['school']['name']:'';?>
   <ul>
   <?php if(isset($edu['classes'])):?>
   <?php foreach($edu['classes'] as $classes):?>
     <li><?php echo $classes['name'];?></li>
   <?php endforeach;?>
   <?php endif;?>
   </ul>
 </td>
 <td>
   <?php echo isset($edu['type'])?$edu['type']:'';?>
 </td>
</tr>
<?php endforeach;?>
</table>
</div>
<?php endif;?>

<?php if(isset($this->work)):?>
<div class="panel panel-default">
<div class="panel-heading"><?php echo $this->translate("work experience");?></div>
<table class="table table-bordered table-condensed">
<tr>
<th style="width:10%"><?php echo $this->translate("Date")?></th>
<th style="width:25%"><?php echo $this->translate("Employer")?></th>
<th style="width:25%"><?php echo $this->translate("Position")?></th>
<th style="width:40%"><?php echo $this->translate("Description")?></th>
</tr>
<?php foreach($this->work as $work_experience):?>
<tr>
 <td>
   <?php echo isset($work_experience['start_date'])?$this->dateFormat($work_experience['start_date'],'medium', 'null'):'';?>
   <?php echo isset($work_experience['end_date'])?' - '.$this->dateFormat($work_experience['end_date'],'medium', 'null'):'';?>
 </td>
 <td>
   <?php echo isset($work_experience['employer']['name'])?$work_experience['employer']['name']:'';?>
   <?php echo isset($work_experience['location']['name'])?'<br/>'.$work_experience['location']['name']:'';?>
 </td>
 <td><?php echo isset($work_experience['position']['name'])?$work_experience['position']['name']:'';?></td>
 <td><?php echo isset($work_experience['description'])?$work_experience['description']:'';?></td>
</tr>
<?php endforeach;?>
</table>
</div>
<?php endif;?>

<?php if(isset($this->languages)):?>
<div class="panel panel-default">
<div class="panel-heading"><?php echo $this->translate("language skills"); ?></div>
<div class="panel-body">
<?php foreach($this->languages as $language_skills):?>
 <br/><?php echo isset($language_skills['name'])?$language_skills['name']:'';?>
</tr>
<?php endforeach;?>
</div>
</div>
<?php endif;?>
