<?php use_helper('I18N', 'ModalBox'); ?>
<?php
  $fullName = $linkName? $tbluser->getObject()->getHtmlName(): $tbluser->getUsFullname();
  $compareLink = ($us_id == $ccuid)? m_link_to('thêm điểm', '/user/buyscore'): link_to('So sánh với tôi', '/user/scorechart?id='.$ccuid.','.$us_id);
  $messageLink = mm_link_need_login('Nhắn tin cho người này', '/message/mailbox?type=compose&us_to='.$us_id);
?>
<table>
  <tr>
  <td style="vertical-align:top">
    <?php echo $tbluser->getObject()->getAvatar('photo'); ?>
  </td>
  <td style="vertical-align:top;padding-left:10px">
    <table>
      <?php foreach ($fields as $field): ?>
        <?php
          if ($field == 'Full name')    $info = $tblblogcheckinfo->getCiBadgeTitle().'<b>'.$fullName.'</b>';
          if ($field == 'Sex')          $info = $tbluser->getUsSex()==1? __('Male'): __('Female');
          if ($field == 'Ngày sinh')    $info = $tblblogcheckinfo->getCiBirthday('d-m-Y');
          if ($field == 'Số CMND')      $info = $tblblogcheckinfo->getCiNumberid();
          if ($field == 'Email')        $info = $tbluser->getUsEmail();
          if ($field == 'Điện thoại')   $info = $tbluser->getUsPhone();
          if ($field == 'Website')      $info = $tbluser->getUsHomepage()? link_to('', $tbluser->getUsHomepage(), array('target'=>'_blank')): '';
          if ($field == 'Chức vụ')      $info = $tbluser->getPositionTitle();
          if ($field == 'School')       $info = $tbluser->getSchoolName($getScName);
          if ($field == 'District')     $info = $tbluser->getDistrictName($getScName);
          if ($field == 'Province')     $info = $tbluser->getProvinceName($getScName);
          if ($field == 'Chuyên môn')   $info = $tblblogcheckinfo->getCiSubjectTitle();
          if ($field == 'Giới thiệu')   $info = $tblblogcheckinfo->getCiPr();
          if ($field == 'Xác thực bởi') $info = $tbluser->getObject()->getHtmlCheckers();
          if ($field == 'Đã đưa lên')   $info = $numUp.' tài liệu' . ($numUp>0? ' ('.link_to(__('view list'),'/user/listpost?user_id='.$us_id).')': '');
          if ($field == 'Đã tải về')    $info = $numDown.' tài liệu' . ($numDown>0? ' ('.link_to(__('view list'),'/user/listdown?user_id='.$us_id).')': '');
          if ($field == 'Score')        $info = $tbluser->getUsScore().' ('.link_to('Xem chi tiết', '/user/scorechart?id='.$us_id).')'.($ccuid? ' ('.$compareLink.')': '');
          if ($field == 'Bình luận')    $info = link_to('Các ý kiến đã gửi', '/user/comment?us_id='.$us_id.'&type=today');
          if ($field == 'Trao đổi')     $info = ($us_id == $ccuid)? link_to('Kiểm tra tin nhắn', '/message/mailbox'): $messageLink;
          if ($field == 'Tài khoản')    $info = ($us_id == $ccuid)? myUtility::formatCurrency($tbluser->getUsMoney()).' ('.m_link_to('nạp thêm', '/user/payment').')': '';
        ?>
        <?php if (!$info) continue ?>
        <tr>
          <td style="vertical-align:top; width:80px"><?php echo __($field)?></td>
          <td style="vertical-align:top"><?php echo $info ?></td>
        </tr>
      <?php endforeach ?>
    </table>
  </td>
  </tr>
</table>
