<? global $lang;?>
<div>
  <?= \Tpl::view( 'globelus/firms/_partials/menu', [
    'active' => 'obserwowani-kandydaci'
  ] );?>
  <div class="mini-box fluid mb15">
    <div class="title">
      <?= ucfirst( $lang['obserwowani-kandydaci'] );?>
      <span class="pull-right text-danger small">
        Posiadasz <?= (int)\front\factory\GlobelusFirms::get_firm_points( $this -> user['id'] );?> pkt. <a href="/panel-pracodawcy/zakup-punktow">Doładuj konto.</a>
      </span>
    </div>
    <div class="subtitle mb0">
      <?= ucfirst( $lang['obserwowani-kandydaci-podtytul'] );?>
    </div>
  </div>
  <? if ( is_array( $this -> candidates ) and count( $this -> candidates ) ):?>
    <? foreach ( $this -> candidates as $candidate ):?>
      <div class="cv-entry">
        <div class="row">
          <div class="col-12 col-sm-2">
            <div class="img">
              <? if ( file_exists( \front\factory\GlobelusCandidates::avatar_url( $candidate['id'] ) ) ):?>
                <img src="/avatar/<?= $candidate['id'];?>/<?= \S::get_token();?>">
              <? else:?>
                <img src="/images/no-avatar.png">
              <? endif;?>
            </div>
          </div>
          <div class="col-12 col-sm-10">
            <div class="row">
              <div class="col-12 col-sm-9">
                <h2>
                  <a href="/kandydat/<?= $candidate['id'];?>/<?= \S::seo( $candidate['surname'] . ' ' . $candidate['name'], true );?>/" target="_blank" title="Kandydat: <?= addslashes( $candidate['surname'] . ' ' . $candidate['name'] );?>"><?= $candidate['surname'] . ' ' . $candidate['name'];?></a>
                </h2>
              </div>
              <div class="col-12 col-sm-3 sex-and-birth">
                <?= $lang['plec'];?>: <?= !$candidate['sex'] ? $lang['kobieta'] : $lang['mezczyzna'];?><br />
                <?= $lang['wiek'];?>: <?= $age = \S::date_diff( $candidate['date_of_birth'], date( 'Y-m-d H:i:s' ), 60 * 60 * 24 * 365.25 );?> <?= \front\factory\Globelus::age_word_translations( $age );?>
              </div>
            </div>
            <div class="info">
              <?= $lang['tel.'];?> <?= $candidate['phone'];?> | <?= $lang['email'];?>: <a href="mailto:<?= $candidate['email'];?>"><?= $candidate['email'];?></a>
            </div>
            <div class="short-text">
              <?= \S::clear_advert_text( $advert['short_text'] );?>
            </div>
            <a href="/kandydat/<?= $candidate['id'];?>/<?= \S::seo( $candidate['surname'] . ' ' . $candidate['name'], true );?>/" target="_blank" class="btn btn-success"><?= $lang['profil-kandydata'];?></a>
          </div>
        </div>
      </div>
    <? endforeach;?>
  <? else:?>
    <div class="alert alert-danger mt20"><?= $lang['panel-pracodawcy-brak-obserwowanych-kandydatow'];?></div>
  <? endif;?>
</div>
